How to use DS18B20?

1,767 views
Skip to first unread message

André Fiúza

unread,
Apr 4, 2013, 8:17:15 PM4/4/13
to web...@googlegroups.com
Hi,
I have WebiOPi 0.6, and i liked to use this chip to show temperature in webpage.
But i don't know make this.
Someone help me? 

trouch

unread,
Apr 5, 2013, 7:29:01 AM4/5/13
to web...@googlegroups.com
this is very simple
in /etc/webiopi/config you have a [DEVICES] section
add your sensor here
for example :
[DEVICES]
mysensor = DS18B20

save, stop and restart webiopi, then open your browser to webiopi on your pi and select the devices monitor.



--
You received this message because you are subscribed to the Google Groups "WebIOPi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webiopi+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

André Fiúza

unread,
Apr 13, 2013, 10:06:27 AM4/13/13
to web...@googlegroups.com
I tryed, but when i define tempx = DS18B20 in config file, i go  webpage and not open, show me error.

Robert More

unread,
Apr 14, 2013, 8:36:12 PM4/14/13
to web...@googlegroups.com

André Fiúza

unread,
Apr 15, 2013, 4:51:26 PM4/15/13
to web...@googlegroups.com
Yes but when i define temp2 = DS18B20 in config file and try access to webiopi page show me error. Like this:
But when i define temp3 = DS18B20 slave:28-0000049bc218, i can access to webiopi page but not show me temperature, and put DS18B20 correctly.
Any solution?

André Fiúza

unread,
Apr 15, 2013, 5:21:09 PM4/15/13
to web...@googlegroups.com
And when i define in python script, show me this in terminal:

My script:
from webiopi.devices.sensor import DS18B20
tmp = DS18B20()

trouch

unread,
Apr 15, 2013, 5:29:23 PM4/15/13
to web...@googlegroups.com
what the result of
sudo cat /sys/bus/w1/devices/w1_bus_master1/w1_master_slaves
it should give you 1-Wire devices detected


--

trouch

unread,
Apr 15, 2013, 5:32:41 PM4/15/13
to web...@googlegroups.com
the slave address you used is the unique address of one my sensor.
your sensors will have different addresses.

but when you don't set any slave, webiopi take the first slave found depending on the class.
may be your sensor is not a DS18B20 ?

André Fiúza

unread,
Apr 15, 2013, 7:54:56 PM4/15/13
to web...@googlegroups.com
Thanks for information trouch.
I check and i have in really DS1820 and address is 10-00080289a21e.
when webiopi has defined the DS18B20 device, but is not exist, when i access the page gives error?
It seems that is what is wrong with me!
but just gives error if no device in reality?
Sorry i am new at this.

Robert More

unread,
Apr 16, 2013, 1:35:42 AM4/16/13
to web...@googlegroups.com
10-00080289a21e Is not a DS18B20 probably a different Dallas temp sensor number.  DS1820, DS1822 etc.

trouch

unread,
Apr 16, 2013, 2:11:32 AM4/16/13
to web...@googlegroups.com
Use DS18S20


--
Reply all
Reply to author
Forward
0 new messages