Hi everyone , i am very new to this forum , i have a thermal store that i wish to monitor the temperature at the top and bottom of the store , i have a raspberry pi and standard expansion board to which i have connected 2 x cable ds18b20 sensors , i have a python script that queries the sensors and sends the data to google spreadsheet , this works ok
what i would like to know is just using the hardware i have can i send the data to emoncms so i can view the data in a nice format? , if so can someone point me to any guides on how to do this ? Many many thanks in advance ......
Re: Raspberry pi and ds18b20
Hi.
I did a software bridge in python, for send 1-wire temp data to emoncms , using the raspberry 1-wire bus managed by kernel on GPIO4.
This script use mysql db to store the unique 64bit (8 byte) address and for convert this value
in human readable format ( ex. 'room temperature' instead of '10-00080082fd88' )
The name of DB is homeaut where there is a table called 'sensors'.
create this table using s sql command :
-- Database: `homeaut`
CREATE TABLE IF NOT EXISTS `sensors` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`enabled` tinyint(1) unsigned NOT NULL,
`name` varchar(50) NOT NULL,
`address` varchar(15) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
Edit the script 1wireTempRead.py and :
-In line 51 set your correct emoncms url
-in line 54 set your user and pasword for mysql user
-in line 76 set the apikey of your emoncms installation
Save the script in this path and with this name :
/home/pi/python/1wireTempRead.py
Set the correct permission:
pi@raspberrypi ~ $ sudo chmod 755 /home/pi/python/1wireTempRead.py
This script must scheduled every minute by cron :
pi@raspberrypi ~ $ sudo crontab -e
insert this line :
* * * * * python /home/pi/python/1wireTempRead.py
after this you will see in emoncms input folder, a new line for each 1-wire device connected on raspberry gpio4.
If the unique 64bit (8 byte) address is not set in db, you will see the unique 64bit (8 byte) address as input name .
I suggest to insert in mysql db, the address and the uman readable format for each device.... in this mode in case of 1-wire device failure, you will change the reference of new device without changing anything in emoncms.
Sorry for my english
Fabrizio.
Re: Raspberry pi and ds18b20
Here's a python script I've been working on this morning. I'm a noob here but I managed to get this going my pi with emoncms running on another machine.
Very similar to the previous post.
Re: Raspberry pi and ds18b20
Here is some C code for the Raspberry PI if it helps. I borrowed this from the web somewhere and redid it to break it up into an Initialise function and a call to read the temperature. It supports both Celcius and Farenheit in the call to read the temp.
[code]
[/code]