Recently, we have been conducting a GPRS remote monitoring experiment. Basic functions are easy to implement. The problem of Real-Time Detection of device status on the web page has not been solved. I did not think of a solution until I learned Ajax myself today. I have recorded several methods used here.
Target Board: initi6410
Web server: Boa
Browser: chorme
1. Method 1: Write the webpage showing the device status as CGI and use CGI to read the status of each device. Then, add <meta http-equiv =/"Refresh/" content =/"1; url = system_state.cgi/"> at the end of the program to set the refresh mode, in this way, the program can reload the webpage once every one banknote. In this case, it takes a lot of time. If the status is large, it will crash.
2. Method 2: Write the webpage showing the device status as CGI, and write a main program to read the status of all devices. The status information is then transmitted through the message queue. Then, use the CGI program to read the status. In this case, it is better than the first one, but if the status is too large, it will crash.
3. Method 3: Use ajax to update content locally.