I am a non-programmer feeling my way through Xively with a Raspberry Pi running python. I have successfully worked through the tutorial given on the xively site given here: https://xively.com/dev/tutorials/pi/
The next step in my project is to continuously take readings from one of the GPIO pins (simply whether it's high or low) do some calculations and once a minute supply a number to an Xively feed.
I have the GPIO portion working right in a separate program. But I'm running into problems when I try to incorporate this into the Xively tutorial example program I got running.
I am now thinking that I should have the GPIO program and the Xively programs running simultaneously with the GPIO program writing data to a file and the Xively program reading from that file and uploading the data to the feed. So my question is: Is this possible and reasonably easy to execute?
Alternatively, if someone could point me to an example where the Xively tutorial example was modified to accept GPIO inputs, that would also help.
And if there is a better/simpler way to accomplish what I'm after, I'm open to suggestions...
You need to :
Download and Install Xively Python Library first. Download and Install httplib2 module.
You can combine your "GPIO Sensor" script and your "Send Data to Xively" script.
Here's a sample code for you (it's for Raspberry Pi and DHT 11) :