1-wire DS1820 - OpenWRT - dualUSB bifferboard

1,648 views
Skip to first unread message

Petr Kracik

unread,
Jan 22, 2012, 9:56:48 AM1/22/12
to biffe...@googlegroups.com
Hi,

I've tried Dallas's 1-wire DS1820 temperature sensor by this tutorial

But I have problem with modules in OpenWRT

when I load w1-gpio one it will Write "Killed" and in dmesg i have this http://pastebin.com/JjJK4KEm

I used GPIO 8  by insmod w1-gpio-custom bus0=0,8,0 command...

but I can see on that GPIO pin some activity,, about each 10sec there I can measure some data (I don't have oscilloscope so I can just measure by voltmeter).


Any idea what I can do bad...

I've tried also "normal" powering of that DS1820 also parasite one.. without success,, but if I will use Serial 1-wire cable (interface) over USB->Serial then I can see it (by digitemp), so I know that DS is not burned...

also
root@OpenWrt:/sys/bus/w1# uname -a
Linux OpenWrt 2.6.37.6 #10 Sun Oct 23 11:53:18 BST 2011 i486 GNU/Linux


Maybe I missing something.... Thanks for reply

Petr Kracik
email: pet...@gmail.com
ICQ: 136530439

nicolas le falher

unread,
Jan 23, 2012, 5:15:56 AM1/23/12
to biffe...@googlegroups.com

Hi,

It's not your ds1820 who don't work, it's module who crash.
I've got some ds1820 at home, I'll test module after work.

Nicolas

nicolas le falher

unread,
Jan 23, 2012, 6:42:25 PM1/23/12
to biffe...@googlegroups.com
Try with this patch :
https://dev.openwrt.org/attachment/ticket/8952/w1-gpio-custom.patch

With i can load w1-gpio after w1-gpio-custom without warning (and sysfs is populated)

Nicolas

Petr Kracik

unread,
Jan 24, 2012, 5:23:44 AM1/24/12
to biffe...@googlegroups.com
Hi
Thanks for patch

that w1-gpio really was loaded without error / warning, but still I can't  see that DS1820 in that bus/w1 tree,, I will check cables at Friday or Saturday since I have it at home and have just SSH access to it now...

root@OpenWrt:/sys/bus/w1# find
.
./uevent
./devices
./devices/w1 bus master
./drivers
./drivers/w1_master_driver
./drivers/w1_master_driver/uevent
./drivers/w1_master_driver/unbind
./drivers/w1_master_driver/bind
./drivers/w1_master_driver/w1 bus master
./drivers/w1_slave_driver
./drivers/w1_slave_driver/uevent
./drivers/w1_slave_driver/unbind
./drivers/w1_slave_driver/bind
./drivers_probe
./drivers_autoprobe


root@OpenWrt:/sys/bus/w1# lsmod |grep w1
w1_therm                1320  0 
w1_gpio                  472  0 
w1_gpio_custom           668  0 
wire                    9132  2 w1_therm,w1_gpio
root@OpenWrt:/sys/bus/w1# 



Regards Petr



Petr Kracik
email: pet...@gmail.com
ICQ: 136530439


2012/1/24 nicolas le falher <n.lef...@gmail.com>


Nicolas

--
To unsubscribe send email to bifferboard...@googlegroups.com

Petr Kracik

unread,
Jan 27, 2012, 2:30:31 PM1/27/12
to biffe...@googlegroups.com
Hi,


So I've done little research I found this...


Each about 10 sec there is some communication (voltage goes lower), but nothing in "/sys/devices/w1 bus master" was not populated. 

If I use add "by hand" by
root@OpenWrt:/sys/devices/w1 bus master# cat w1_master_add
write device id xx-xxxxxxxxxxxx to add slave

then it's populated but of course I don't know right ID... but when I doing 

cat w1_slave

I can see some communication at that bus (each tam when I cat it that voltage goes lower).

also output is for example this:
root@OpenWrt:/sys/devices/w1 bus master/22-c10a01080032# time cat w1_slave 
ff ff ff ff ff ff ff ff ff : crc=c9 NO
00 00 00 00 00 00 00 00 00 t=-62
real    0m 0.80s
user    0m 0.00s
sys     0m 0.02s



if I will disconnect that DS1820 from interface then I've got different output
root@OpenWrt:/sys/devices/w1 bus master/22-c10a01080032# time cat w1_slave 
00 00 00 00 00 00 00 00 00 : crc=00 YES
00 00 00 00 00 00 00 00 00 t=0
real    0m 0.10s
user    0m 0.00s
sys     0m 0.01s

also in 1st output (with -t62) that took longer (as you can see at time output) so some communication there must be (I hope that w1-gpio works)...


I just wonder why auto search will not find it.

Also when I try Serial interface then I can see it (at server, not bifferboard)

Turning off all DS2409 Couplers
.
Searching the 1-Wire LAN
10DFC10A01080032 : DS1820/DS18S20/DS1920 Temperature Sensor
ROM #0 : 10DFC10A01080032

It looks like some problem with DS1820 version like DS18S20 and DS18B20 etc..

Any ideas ?


Regards Petr



Petr Kracik
email: pet...@gmail.com
ICQ: 136530439


2012/1/24 Petr Kracik <pet...@gmail.com>

nicolas le falher

unread,
Jan 27, 2012, 4:37:10 PM1/27/12
to biffe...@googlegroups.com
>Each about 10 sec there is some communication (voltage goes lower)

For my part there are reset on the bus :/. (http://www.imagup.com/data/1142365590.html)
I did not manage to have something else for the moment.

Nicolas

nicolas le falher

unread,
Jan 28, 2012, 6:02:37 AM1/28/12
to biffe...@googlegroups.com
Damn, by reading documentation it works better.

In "make menuconfig" add :
Kernel modules --->
W1 support --->
<*> kmod-w1
<*> kmod-w1-gpio-custom
<*> kmod-w1-slave-therm

Extract of w1-gpio-custom.c :
* <id> ID to used as device_id for the corresponding bus (required)
* <sda> GPIO pin ID of data pin (required)
* <od> Pin is configured as open drain.

So, here we go with open-drain :
# echo "w1-gpio-custom bus0=0,11,1" > /etc/modules.d/55-gpio-custom
# reboot

On reboot you will have
w1_master_driver w1 bus master: Family 28 for 28.0000034bc0b7.2e is
not registered.

# cat /sys/bus/w1/devices/28-0000034bc0b7/w1_slave
60 01 4b 46 7f ff 10 10 b5 : crc=b5 YES
60 01 4b 46 7f ff 10 10 b5 t=22000

On different boot, I've got different states with non-parasite mode :
- w1 slave not detected
- w1 slavec detected, but can't read temperature ( 18S20 doesn't
respond to CONVERT_TEMP )
- all works :)

With parasite mode, all works :)

Nicolas

Petr Kracik

unread,
Jan 28, 2012, 6:52:36 AM1/28/12
to biffe...@googlegroups.com
Ok,, there is no diff if i will use ,0 or ,1

still slave is not detected and I i will add it by hand it can't convert temp

I attached scheme if I'm right at hardware base (as long I understood that from text how-to on wiki)

I meanwhile got format of that ID so I've got different output (-1250 instead -62)

Petr Kracik
email: pet...@gmail.com
ICQ: 136530439


2012/1/28 nicolas le falher <n.lef...@gmail.com>

Nicolas

ds-biff.jpeg

nicolas le falher

unread,
Jan 28, 2012, 8:59:44 AM1/28/12
to biffe...@googlegroups.com
I use 5v from Biff power supply with a 4.7k pull up.
With 3.3v (from jtag port) and 1.5k no problem for detection too.

But, with ds18b20 pin vdd not connected, I've got different value
between two refresh :
# cat /sys/bus/w1/devices/28-0000034bc0b7/w1_slave
ff 07 4b 46 7f ff 01 10 2f : crc=2f YES
ff 07 4b 46 7f ff 01 10 2f t=127937
# cat /sys/bus/w1/devices/28-0000034bc0b7/w1_slave
50 05 4b 46 7f ff 0c 10 1c : crc=1c YES
50 05 4b 46 7f ff 0c 10 1c t=85000
# cat /sys/bus/w1/devices/28-0000034bc0b7/w1_slave
ff 07 4b 46 7f ff 01 10 2f : crc=2f YES
ff 07 4b 46 7f ff 01 10 2f t=127937
# cat /sys/bus/w1/devices/28-0000034bc0b7/w1_slave
50 05 4b 46 7f ff 0c 10 1c : crc=1c YES
50 05 4b 46 7f ff 0c 10 1c t=85000

With vdd wired to gnd, value is stable :
# cat /sys/bus/w1/devices/28-0000034bc0b7/w1_slave
55 01 4b 46 7f ff 0b 10 d0 : crc=d0 YES
55 01 4b 46 7f ff 0b 10 d0 t=21312

But for me values are no correct.
I've got another ds18b20 wired to an usb9097 (usb<>w1) and I get ~17C.
Same with a multimeter :/

Nicolas

Reply all
Reply to author
Forward
0 new messages