BTT-Pi icon indicating copy to clipboard operation
BTT-Pi copied to clipboard

Enable 1-wire

Open Puzzl88 opened this issue 1 year ago • 12 comments

How do enable 1-wire on the BTT-Pi, specifcally for the DS18B20 sensor?

Puzzl88 avatar Sep 27 '23 05:09 Puzzl88

Please see https://github.com/bigtreetech/CB1/issues/65#issuecomment-1740552051 for the answer.

mdvorak avatar Sep 29 '23 09:09 mdvorak

Please see bigtreetech/CB1#65 (comment) for the answer.

biqu@BTT-CB1:~/w1-gpio-cl$ sudo make install install -m644 w1-gpio-cl.ko /lib/modules/uname -r/kernel/drivers/w1/masters install: cannot stat 'w1-gpio-cl.ko': No such file or directory make: *** [Makefile:95: install] Error 1

Puzzl88 avatar Sep 30 '23 15:09 Puzzl88

Hmm, maybe I forgot a package, I'll take a look, thanks

mdvorak avatar Sep 30 '23 20:09 mdvorak

Hmm, maybe I forgot a package, I'll take a look, thanks

I understood what's the problem. After LN -s/Lib/Modules/Uname -r/Build/Include/Linux W1, you need to execute a command make.

Thanks for the help! image

Puzzl88 avatar Oct 01 '23 17:10 Puzzl88

ah, great, I'll update the guide, thanks!

mdvorak avatar Oct 01 '23 18:10 mdvorak

sorry, i'm a unix newbe - i get the following error:

biqu@voron:~/w1-gpio-cl$ sudo make NOTE: ./w1 symlink is already set and will not be updated. Remove it and restart the compilation process in case you want to re-run the kernel sources examination. NOTE: gen-mast.h was generated make -C /lib/modules/5.16.17-sun50iw9/build M= modules make[1]: Entering directory '/usr/src/linux-headers-5.16.17-sun50iw9' make[2]: *** No rule to make target 'arch/arm64/tools/gen-cpucaps.awk', needed by 'arch/arm64/include/generated/asm/cpucaps.h'. Stop. make[1]: *** [arch/arm64/Makefile:173: archprepare] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-5.16.17-sun50iw9' make: *** [Makefile:13: all] Error 2

wm-13 avatar Oct 03 '23 19:10 wm-13

Hmm, that is wierd error :-)

mdvorak avatar Oct 03 '23 19:10 mdvorak

I've managed to reproduce it with latest packages, maybe it was caused by some recent system update, I'll investigate it.

mdvorak avatar Oct 04 '23 06:10 mdvorak

@wmetnitz Found it. make needs to be run without sudo, for some reason, it messes up env vars and compilation fails to find some files. Also for the compilation itself, sudo should not be really needed. I was originally running it all directly as a root, so I did not encounter this problem.

Guide updated.

note: sudo -E make seems to work fine too.

mdvorak avatar Oct 04 '23 06:10 mdvorak

Hi, i don’t know, what goes wrong ☹

The installation seams ok, but:

==> sudo echo 'options w1-gpio-cl m1="gdt:71"' > /etc/modprobe.d/w1-gpio-cl.conf

got permisssion denied.

Now i created this file manually.

==> sudo modprobe w1-gpio-cl

-rw-r--r-- 1 root root 31 Oct 4 17:47 w1-gpio-cl.conf

@.***:/etc/modprobe.d$ sudo modprobe w1-gpio-cl

modprobe: ERROR: could not insert 'w1_gpio_cl': Exec format error

  • sudo modprobe 21-gpio-cl m1="gdt:71"

@.***:/etc/modprobe.d$ sudo modprobe w1-gpio-cl m1="gdt:71"

modprobe: ERROR: could not insert 'w1_gpio_cl': Exec format error

What goes wrong?

Many thanks,

Werner

@.***:~/w1-gpio-cl$ sudo -E make

NOTE: ./w1 symlink is already set and will not be updated. Remove it and restart the compilation process in case you want to re-run the kernel sources examination.

NOTE: gen-mast.h was generated

make -C /lib/modules/5.16.17-sun50iw9/build M=/home/biqu/w1-gpio-cl modules

make[1]: Entering directory '/usr/src/linux-headers-5.16.17-sun50iw9'

CC [M] /home/biqu/w1-gpio-cl/w1-gpio-cl.o

MODPOST /home/biqu/w1-gpio-cl/Module.symvers

LD [M] /home/biqu/w1-gpio-cl/w1-gpio-cl.ko

make[1]: Leaving directory '/usr/src/linux-headers-5.16.17-sun50iw9'

@.***:~/w1-gpio-cl$ NOTE: ./w1 symlink is already set and will not be updated. Remove it and restart the compilation process in case you want to re-run the kernel sources examination.

NOTE: gen-mast.h was generated

make -C /lib/modules/5.16.17-sun50iw9/build M=/home/biqu/w1-gpio-cl modules

make[1]: Entering directory '/usr/src/linux-headers-5.16.17-sun50iw9'

CC [M] /home/biqu/w1-gpio-cl/w1-gpio-cl.o

MODPOST /home/biqu/w1-gpio-cl/Module.symvers

LD [M] /home/biqu/w1-gpio-cl/w1-gpio-cl.ko

make[1]: Leaving directory '/usr/src/linux-headers-5.16.17-sun50iw9'

@.***:~/w1-gpio-cl$ sudo make install

install -m644 w1-gpio-cl.ko /lib/modules/uname -r/kernel/drivers/w1/masters

depmod

cd /etc/modprobe.d

Von: Michal Dvořák @.> Gesendet: Mittwoch, 4. Oktober 2023 08:45 An: bigtreetech/BTT-Pi @.> Cc: wm13 @.>; Mention @.> Betreff: Re: [bigtreetech/BTT-Pi] Enable 1-wire (Issue #20)

@wmetnitz https://github.com/wmetnitz Found it. make needs to be run without sudo, for some reason, it messes up env vars and compilation fails to find some files. Also for the compilation itself, sudo should not be really needed. Guide updated.

_note: sudo -E make seems to work file too.`

— Reply to this email directly, view it on GitHub https://github.com/bigtreetech/BTT-Pi/issues/20#issuecomment-1746236412 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BC7SATMH4ZVDML3YGKRRM2TX5UAVZAVCNFSM6AAAAAA5IXWFYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBWGIZTMNBRGI . You are receiving this because you were mentioned. https://github.com/notifications/beacon/BC7SATOAL4EXEG2CNV6ARTTX5UAVZA5CNFSM6AAAAAA5IXWFYGWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTICVZ7Y.gif Message ID: @.*** @.***> >

wm-13 avatar Oct 04 '23 15:10 wm-13

That was entirely mistake on my side, sorry!

echo 'options w1-gpio-cl m1="gdt:71"' | sudo tee /etc/modprobe.d/w1-gpio-cl.conf
echo 'w1-gpio-cl' | sudo tee /etc/modules-load.d/w1-gpio-cl.conf

I needed a tester, thanks

mdvorak avatar Oct 04 '23 19:10 mdvorak

Hi, thanks for your help, but it doesn’t work…

@.***:~/w1-gpio-cl$ echo 'options w1-gpio-cl m1="gdt:71"' | sudo tee /etc/modprobe.d/w1-gpio-cl.conf

options w1-gpio-cl m1="gdt:71"

@.***:~/w1-gpio-cl$ echo 'w1-gpio-cl' | sudo tee /etc/modules-load.d/w1-gpio-cl.conf

w1-gpio-cl

@.***:~/w1-gpio-cl$ sudo modprobe w1-gpio-cl

modprobe: ERROR: could not insert 'w1_gpio_cl': Exec format error

@.***:~/w1-gpio-cl$

Von: Michal Dvořák @.> Gesendet: Mittwoch, 4. Oktober 2023 21:26 An: bigtreetech/BTT-Pi @.> Cc: wm13 @.>; Mention @.> Betreff: Re: [bigtreetech/BTT-Pi] Enable 1-wire (Issue #20)

That was entirely mistake on my side, sorry!

echo 'options w1-gpio-cl m1="gdt:71"' | sudo tee /etc/modprobe.d/w1-gpio-cl.conf echo 'w1-gpio-cl' | sudo tee /etc/modules-load.d/w1-gpio-cl.conf

I needed a tester, thanks

— Reply to this email directly, view it on GitHub https://github.com/bigtreetech/BTT-Pi/issues/20#issuecomment-1747504818 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BC7SATNH6UGDKRY7SHYWDLTX5WZ37AVCNFSM6AAAAAA5IXWFYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBXGUYDIOBRHA . You are receiving this because you were mentioned. https://github.com/notifications/beacon/BC7SATJP3FEYMQJ6VHIZRRDX5WZ37A5CNFSM6AAAAAA5IXWFYGWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTIFDHLE.gif Message ID: @.*** @.***> >

wm-13 avatar Oct 04 '23 20:10 wm-13