Dallas 1-Wire Support
#21
(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!
  Reply
#22
You need to decompile the DTS, apply the following patch to it, and recompile the DTS.

https://github.com/longsleep/build-pine6...l/23/files

(This is mainly due to the fact that longsleep didn't merged that PR yet)
  Reply
#23
Uh shame on me Smile
  Reply
#24
no worries  Tongue
  Reply
#25
(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-pine6...l/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-pine6...l/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.
  Reply
#26
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.
  Reply
#27
(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?
  Reply
#28
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 ?
  Reply
#29
(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
  Reply
#30
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.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question RGB LED Matrix support? foxnox 1 4,250 12-29-2017, 06:52 PM
Last Post: psychedup
  RaZberry Module (z-wave) need support to get it working! Luxus 13 18,728 11-03-2016, 02:04 AM
Last Post: Luxus
  USB WIFI Dongle Support InCognito 3 6,517 01-20-2016, 11:27 AM
Last Post: tllim

Forum Jump:


Users browsing this thread: 1 Guest(s)