Connecting Wordpress to GPIO
Posted: Sat Jan 12, 2013 8:05 pm
Sometimes it's amazing what you can accomplish without really knowing what you're doing. And other times it's amazing how an old dog such as myself actually can learn a new trick or two.
So, long story short, I started with Raspbian "Pisces" image and installed lighttpd, MySQL, and PHP. Got the basic "Hello world", or... sorry "It works!" and then some basic php functions told me it was working OK. I installed Wordpress this morning and after just a couple false starts it actually works! That's kind of amazing.
Now, I want to integrate the Adafruit project to connect to a DHT series temperature and humidity sensor with Wordpress.
http://learn.adafruit.com/dht-humidity- ... g/overview
As written, this integrates with Google Docs and OK that's pretty cool. But I want to give this to my brother who's way less geeky than I am and allow him to use this thing in conjunction with his indoor exotic flower growing thing so that he can make observations in the Wordpress posts and automatically insert the temperature, or eventually a photo of the plant taken with a USB camera.
I think the sensor interface code is written in C. How do I get that info out of there and into Wordpress?
Without knowing any better, I can think of:
1) Have the C code write some OS environment variables which Wordpress can pick up somehow (PHP?).
2) Have the C code interface with MySQL and then WordPress can call PHP to get the stuff out of MySQL.
Any brilliant ideas or caveats?
Thanks!
DL
So, long story short, I started with Raspbian "Pisces" image and installed lighttpd, MySQL, and PHP. Got the basic "Hello world", or... sorry "It works!" and then some basic php functions told me it was working OK. I installed Wordpress this morning and after just a couple false starts it actually works! That's kind of amazing.
Now, I want to integrate the Adafruit project to connect to a DHT series temperature and humidity sensor with Wordpress.
http://learn.adafruit.com/dht-humidity- ... g/overview
As written, this integrates with Google Docs and OK that's pretty cool. But I want to give this to my brother who's way less geeky than I am and allow him to use this thing in conjunction with his indoor exotic flower growing thing so that he can make observations in the Wordpress posts and automatically insert the temperature, or eventually a photo of the plant taken with a USB camera.
I think the sensor interface code is written in C. How do I get that info out of there and into Wordpress?
Without knowing any better, I can think of:
1) Have the C code write some OS environment variables which Wordpress can pick up somehow (PHP?).
2) Have the C code interface with MySQL and then WordPress can call PHP to get the stuff out of MySQL.
Any brilliant ideas or caveats?
Thanks!
DL