I’ve constructed a climate station based mostly on a Rasperry Pi. The climate information must be despatched to a WordPress web site in common intervals (about each 5 to 10 seconds). There the info must be displayed in a graphical interface. My plan was to create an additional web page the place solely the climate information is proven in JSON format:
{"timestamp": 1657989715, "windspeed": 10, "winddirection": 130, "temperature": 30, "strain": 1012.4}
The graphical person interface ought to then get its information from this separate web page utilizing AJAX and the getJSON
command.
My questions:
How do I create a web page in WordPress that shows solely the JSON information (e.g. like right here: https://api.myip.com/)?
And the way can I replace this JSON information usually?
Or is there perhaps a greater resolution to this drawback?
Thanks a lot!