Also for some reasons I cannot read arduino output using "php_serial.class" code. SO, here is my alternative solution:
- I've created a deamon which redirects arduino serial output to a log file. This daemon can be started and stopped, on re-start it will re-write the logfile. I've done this for maintenance purposes - the intention is to clean the log file periodically, so that it doesn't grow to Gigabytes which ultimately could affect the performance of the overall solution(so, not because I don't have enough storage - I'm doing this on Netgear STORA after all :)). I've created a daemon script and an init script for this daemon. The code for the daemon script is easy "cat /dev/ttyUSB0 > /home/com_log.txt &" and that's it. Init script is more complex - you have to properly remove the log file and kill the cat process. You can download the code here
- Once I have a daemon - reading Arduino from any places without resetting it - is super easy. But you have to read last lines if you want latest output. I've created a script which sends to Arduino a command to print the updated information about temperature and humidity sensors, then the script reads new values from the log file and saves them into the MySQL database. Here is the code
- The script above is added to the crontab to collect temperature/humidity samples every 10 minutes
- Then I've created a page using Google's Charts JSAPI examples with chart for each counter. Code is here.

.jpg)
.jpg)
.jpg)
.jpg)
.jpg)
.jpg)






