PINE64
Dallas 1-Wire Support - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4)
+--- Forum: Pine A64 Hardware, Accessories and POT (https://forum.pine64.org/forumdisplay.php?fid=32)
+---- Forum: POT modules (https://forum.pine64.org/forumdisplay.php?fid=8)
+---- Thread: Dallas 1-Wire Support (/showthread.php?tid=1004)

Pages: 1 2 3 4


RE: Dallas 1-Wire Support - joey - 08-12-2016

(07-11-2016, 12:25 PM)ItsDave Wrote: Confirmed that with a lot of patience (Thanks a lot martinayotte!!) This is now working on my Pine Smile

Dave,

Would you be willing to explain the steps on how you got it working? I have been logging temperatures with my RPi for a few years now, and last night my Pi died on me. I already had my Pine64 lying around, so I figured I'd have it take over temperature probe duty. I've not really got into the kernel modification scene, so I am having trouble following this thread. I just want to get my DS18B20 probes working again, but I need to figure out how to get the w1-gpio module loaded on the Pine.

Thanks!


RE: Dallas 1-Wire Support - martinayotte - 08-12-2016

You need to decompile the DTS, apply the following patch to it, and recompile the DTS.

https://github.com/longsleep/build-pine64-image/pull/23/files

(This is mainly due to the fact that longsleep didn't merged that PR yet)


RE: Dallas 1-Wire Support - longsleep - 08-12-2016

Uh shame on me Smile


RE: Dallas 1-Wire Support - martinayotte - 08-12-2016

no worries  Tongue


RE: Dallas 1-Wire Support - joey - 08-12-2016

(08-12-2016, 11:33 AM)martinayotte Wrote: You need to decompile the DTS, apply the following patch to it, and recompile the DTS.

https://github.com/longsleep/build-pine64-image/pull/23/files

(This is mainly due to the fact that longsleep didn't merged that PR yet)

Will you please point me at a thread that might explain what that means and how I would go about doing it? I have no problem following instructions if they are available, but I can't find any good results on this forum when searching for "decompile DTS."

Thanks!

Nevermind, I think I figured it out based on something I read in a thread called "Is SPI Working?" One of your responses to be precise Smile. I just had to figure out that I needed to install device-tree-compiler to get the dtc binary.

(08-12-2016, 11:05 PM)joey Wrote:
(08-12-2016, 11:33 AM)martinayotte Wrote: You need to decompile the DTS, apply the following patch to it, and recompile the DTS.

https://github.com/longsleep/build-pine64-image/pull/23/files

(This is mainly due to the fact that longsleep didn't merged that PR yet)

Will you please point me at a thread that might explain what that means and how I would go about doing it? I have no problem following instructions if they are available, but I can't find any good results on this forum when searching for "decompile DTS."

Thanks!

Nevermind, I think I figured it out based on something I read in a thread called "Is SPI Working?" One of your responses to be precise Smile. I just had to figure out that I needed to install device-tree-compiler to get the dtc binary.

So I de- and re-compiled the device tree with that patch included, but I still don't understand where to get the w1-gpio and w1-therm kernel modules. Are those Pi specific modules that I'm going to need to pull over? Or do I need to rebuild my kernel somehow with those included?

Thanks, and sorry I'm being such a newb. Kernel hacking just isn't my thing.


RE: Dallas 1-Wire Support - martinayotte - 08-13-2016

First, check if you have the w1-gpio.ko and w1_therm.ko modules in your kernel /lib/modules tree.
If not, you would have to compile a new kernel with the following flag :

CONFIG_W1=m
CONFIG_W1_MASTER_GPIO=m
CONFIG_W1_SLAVE_THERM=m

Maybe longsleep should enable them by default in his builds.


RE: Dallas 1-Wire Support - ed_mann - 11-26-2016

(05-29-2016, 03:49 PM)martinayotte Wrote: Just to let people know that I've finally got the "w1-gpio" working on Pin64 with a DS18B20.
The issue that I was facing is a discrepancy in DTS that I've not seen in other ARM boards but only on Pine64, but after doing kernel debugging, I've found a simple workaround in DTS.
Mainly, here it is :
Code:
               onewire_device@0 {
                       compatible = "w1-gpio";
                       gpio = <0x30 0x2 0x8 0x0>;
//                      gpios = <0x30 0x2 0x8 0x0 0x0 0x0 0x0>;
                       pinctrl-names = "default";
                       pinctrl-0 = <0xba>;
                       status = "okay";
               };

The issue is when using "gpios = <0x30 0x2 0x8 0x0>;", the DT parser give out this error : "arguments longer than property", it seems that plural "gpios" means you need to provide multiple gpios, not only one. Removing the "s" seems to do identical job with a single gpio.

I am trying to get my DS18B20 to work with my pine.
I have the following
Kernel : 3.10.104-1-pine64-longsleep
lsmod: w1_gpio                12739  0
           wire                   23744  1 w1_gpio

I see w1_master_driver in /sys/bus/w1/devices

I have power on pin 1, Data on pin 7 and ground on pin 6. From the chart here -> http://joey.hazlett.us/pine64/pine64_pins.html

I have tested this temp sensor on two different Raspberry pi boards, pi 2 and a pi 3. And it works on both using the same pin numbers. I have read over this thread and i don't know what i am missing.

Any pointers on how i can get this to work?


RE: Dallas 1-Wire Support - martinayotte - 11-27-2016

You should also see w1_therm while doing lsusb.
You should not only see w1_master_driver in /sys/bus/w1/devices, but also devices such 28-000005a2fac5
Do you have a 4K7 Pull-Up on the data line ?


RE: Dallas 1-Wire Support - ed_mann - 11-28-2016

(11-27-2016, 03:39 PM)martinayotte Wrote: You should also see w1_therm while doing lsusb.
You should not only see w1_master_driver in /sys/bus/w1/devices, but also devices such 28-000005a2fac5
Do you have a 4K7 Pull-Up on the data line ?

ok i did a modprobe w1_therm and now have that in lsmod

wire            23744    2 w1_gpio,w1_therm

i don't see any more entries like 28-000005a2fac5 under /sys/bus/w1/devices/. (i know it should be a unique device id for the sensor)  I do have a 4k Pull-Up as this is how i got it to work with the Raspberry pi. Do i need something else besides the kernel? Are there other things that need to be executed while booting?

I'm using a fedora beta release i found here on the forum with the longsleep kernel. What version are you using? I can give that a try.

Thanks


RE: Dallas 1-Wire Support - martinayotte - 11-30-2016

You don't need to do modprobe, it should comes automatically.
Check you DTS again, use "gpios = <0x30 0x2 0x8 0x0 0x0 0x0 0x0>;", recompile the DTB, reboot, and recheck.
Otherwise, it must be a wiring problem.