dbannon
Posts: 5
Joined: Wed Mar 25, 2015 5:31 am

Kernel 3.18.8 breaks 1-wire

Wed Mar 25, 2015 5:50 am

Since I upgraded my Raspberry Pi to the 3.18.8 K my 1-wire system is broken. Just went to 3.18.9 and same problem.

I initially thought it was a DT problem but disabled DT from /boot/config.txt and its still there.

In dmesg I see

Code: Select all

[    8.487115] w1-gpio [email protected]: gpio pin 4, external pullup pin -1, parasitic power 0
[    8.533507] w1_add_master_device: set_pullup requires write_byte or touch_bit, disabling
I'm loading w1_gpio and w1_therm from a file in /etc/modules-load.d.

If I remove specific 1-wire directives from /boot/config.txt, no errors but interface is not functional at all, cannot see /sys/bus/w1/devices/w1_bus_master1. As you would expect.

With either one of the two 1-wire directives enabled, I see the above error in dmesg, I see /sys/bus/w1/devices/w1_bus_master1 and no temperature files in /sys/bus/w1/devices/. While I am using the 3 wire (vcc, data and gnd) version of one wire that seems unimportant.

While I have not tried, indications are that this stuff works fine on Raspian.

David

User avatar
DougieLawson
Posts: 36515
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Kernel 3.18.8 breaks 1-wire

Wed Mar 25, 2015 9:20 am

Have you added the device tree stuff in /boot/config.txt?

Add this

Code: Select all

dtoverlay=w1-gpio,gpiopin=x
If you require the external pullup

Code: Select all

dtoverlay=w1-gpio-pullup,gpiopin=x,pullup=y
otherwise

Code: Select all

dtoverlay=w1-gpio-pullup,gpiopin=x
(where x and y are gpios).
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

dbannon
Posts: 5
Joined: Wed Mar 25, 2015 5:31 am

Re: Kernel 3.18.8 breaks 1-wire

Wed Mar 25, 2015 9:27 am

Hi Dougie, config.txt now has the code in there, just needs to be uncommented. Thus -

Code: Select all

# Uncomment to enable the w1-gpio Onewire interface module
# Use this overlay if you *don't* need a pin to drive an external pullup.
# Params: gpiopin                  GPIO pin for I/O (default "4")
#         pullup                   Non-zero, "on", or "y" to enable the parasitic
#                                  power (2-wire, power-on-data) feature
# device_tree_overlay=w1-gpio
# device_tree_param=gpiopin=4
# device_tree_param=pullup=on
I have tried enabling just the "device_tree_overlay=w1-gpio" and, separately, the following parameters. Neither worked. There are two blocks, one for 3 wire and one for 2 wire. Again, each generate the error message I mentioned.

David

User avatar
DougieLawson
Posts: 36515
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Kernel 3.18.8 breaks 1-wire

Wed Mar 25, 2015 10:11 am

Does /boot/overlays exist and is it full of the overlay dtb files?
Are the w1-*.ko kernel modules in /lib/modules/3.18.8/... ?
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

dbannon
Posts: 5
Joined: Wed Mar 25, 2015 5:31 am

Re: Kernel 3.18.8 breaks 1-wire

Wed Mar 25, 2015 11:16 am

Yep.

Code: Select all

[[email protected] ~]# ls -l /boot/overlays/
total 66
.....
-rwxr-xr-x 1 root root 1124 Mar 12 12:42 w1-gpio-overlay.dtb
-rwxr-xr-x 1 root root 1291 Mar 12 12:42 w1-gpio-pullup-overlay.dtb

[[email protected] ~]# ls -l /lib/modules/3.18.9-2-ARCH/kernel/drivers/w1/masters/
total 20
....
-rw-r--r-- 1 root root 3654 Mar 12 12:57 w1-gpio.ko.gz

[[email protected] ~]# ls -l /lib/modules/3.18.9-2-ARCH/kernel/drivers/w1/slaves/ 
total 52
.....
-rw-r--r-- 1 root root 3341 Mar 12 12:57 w1_therm.ko.gz
David

User avatar
DougieLawson
Posts: 36515
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Kernel 3.18.8 breaks 1-wire

Wed Mar 25, 2015 11:28 am

Why is that module gzipped? Has the kernel loaded it?
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

dbannon
Posts: 5
Joined: Wed Mar 25, 2015 5:31 am

Re: Kernel 3.18.8 breaks 1-wire

Wed Mar 25, 2015 10:28 pm

> Why is that module gzipped? Has the kernel loaded it?

Good question, I did not spot that. Yes, they appear to be loaded -

Code: Select all

[[email protected] ~]# lsmod
Module                  Size  Used by
...
w1_therm                3065  0 
w1_gpio                 3990  0 
wire                   28140  2 w1_gpio,w1_therm
I unzipped them and rebooted, now they don't seem to load, looks like kernel expects gzipped files -

Code: Select all

[[email protected] masters]# modprobe -v w1_gpio
insmod /lib/modules/3.18.9-2-ARCH/kernel/drivers/w1/masters/w1-gpio.ko.gz 
modprobe: ERROR: could not insert 'w1_gpio': Unknown symbol in module, or unknown parameter (see dmesg)
But found something interesting. After re zipping the modules, I poked them back into the K. w1_gpio, fine. But w1_therm hangs the command line. I had been playing with w1_gpio so had not noticed. If I ctrl-C the "modprobe w1_therm" lsmod says its loaded but clearly something is wrong. I need to head out now but will play more latter today.

David

dbannon
Posts: 5
Joined: Wed Mar 25, 2015 5:31 am

Re: Kernel 3.18.8 breaks 1-wire

Mon Mar 30, 2015 1:19 am

Think this thread needs to be regarded as closed, mainly because the title is incomplete.

I have now determined that w1_gpio loads fine (as long as setup properly in /boot/config.txt) but w1_therm hangs during modprobe. I don't have the same problem on another RasPi also running an up to date release of Arch. So, I need to find out what the difference is. If it turns out to be something interesting I'll mention it here.

I'll be away for a couple of weeks so its not going to happen soon.

Thanks for your interest folks.

David

Return to “Arch”