I am working on a system that has a bunch of sensors communicating with a linux machine. I need to make a web interface for this to display status of sensors and automatically update them when the status of any of the sensors changes(or just automatically update them every few seconds).
The code for reading sensors is all in C code. What are the options for pushing the sensor data to the web browser automatically or even by continuously requesting the data?
I have considered the following scheme: Allocate shared memory in the C program for the sensor data, which can be read by a server side script like php. Then have some ajax or something requesting the data on a loop or timer event.
Is it possible to push the data to the client rather than pull?
I really do not have any experience with php/ajax, so any tips on how to implement this would be great.
Some key elements I do not know:
-How to do timing in javascript
-How to get some sort of structured data in javascript on the fly from a request to the server(eg php page reading the sensor data)