Jump to content

So, anyone here used a Raspberri Pi and a temp humidity sensor to get a web server displaying his...


G+_Travis Hershberger
 Share

Recommended Posts

Taylor Graham Good memory.

 

Travis Hershberger Basicly, what you need to do is to find the driver for your sensor. That driver will basically create a file for you to read ( because linux is great! ). Then you need create a server program that will read the sensor and log it. Then create a php script that will connect to the server over tcp to grab the results ( I like the zeromq library but any should do). Then using Javascript, graph the results from the php script and display it. I know, it seems like a convoluted way of doing it, but thats the web for ya. :)

 

 If you want my source, just let me know and I'll pop it onto github or something. Just be warned, I may have forgotten to go back and comment it. :)

 

If your main goal is to plot out temp/humidity. You may want to give this website a look: https://plot.ly/ I belive they have an api for devices to update graphs.

Link to comment
Share on other sites

610bob I need to keep everything "in-house" as I possibly can, lawyers, uck.  I'm planning to use the sensor parsed to a simple csv file.  From that I'll take the information and do things like make graphs and such from it.  It's an i2c sensor, so hooking it up to the pi is easy.  Adafruit only has code for the Arduino on their web page, which should work with a little futzing about with it.

Link to comment
Share on other sites

Yes its C, but its not always standard. I find that the arduino api is deeply entrenched into arduino libraries. If it's fairly simple operation, then yea, just supplement your own functions that the library requires. But if it requires a ton of arduino functions, then it can turn into a migraine quick. You also have to take timing into consideration. I see a lot of libraries using NOP for super short, accurate delays. Which won't work in a linux, or any real time operating system environment. 

 

I usually find reverse engineering to be better in a situation like this rather than porting.

 

But keep in mind, I have only done something like this (using arduino code as a jumpstart) once or twice. So I might be missing something. I also havn't looked at the library in detail, so I could be totally overthinking this.

Link to comment
Share on other sites

 Share

×
×
  • Create New...