DWQA QuestionsCategory: ProgramExpress gets the updated JSON data in real time
pinocchio asked 1 month ago

1. What I am doing is to obtain the data of the temperature sensor through the URL. I save the obtained temperature, humidity and other data to the JSON format file, and then display the latest JSON data to the page
Problem: the biggest problem is that the data cannot be updated in real time. When rendering the page, the latest JSON data is assigned to the variable, but the variable is dead and cannot be displayed with the timer.
2. Screenshot
3. Supplement
View data: localhost: 8080/
Transfer data: localhost: 8080 / a? Arduino = yes & wet =& temp=?
The original intention is to get the last list array in JSON data, but it cannot be updated automatically from other localhost: 8080 / a? Arduino = yes & wet =& temp=? Requested data,Front end Ajax timing

1 Answers
Breezy_ 5806d6aacebb9 answered 1 month ago

Front end Ajax timing

pinocchio replied 1 month ago

Thank you. Could you elaborate

Breezy_ 5806d6aacebb9 replied 1 month ago

The real-time updated data is used as a separate interface, and the front end regularly fetches the data of this interface through Ajax