I have used your excellent web server projects now on a number of applications. In my latest the app runs on Windows successfully monitoring a number of sensors, but now I would like to also save the readings as they arrive to a disc file on the same laptop. I know the obvious security problems and that javascript is effectively sandboxed against this, but do you know of a way this could be done with security?
Regards,
Ron
Hi.
Can you provide more details?
Are you using a web server?
Where do you want to save the readings exactly?
On a file on your computer? On a database?
Regards,
Sara,
Hi Sara
Thanks for the reply.
So we are both on the same page, let us say I am using example 3.1 Web Server: Display Sensor Readings (SSE) from your Build Web Servers book. I am using an ESP32 at the measurement point and using a laptop as the client to display the values. From your code new readings are received by the laptop as a JSON string in the EventListener function, so the laptop has access to the numbers. Somewhere about that point I would like to append those values to a file on the laptop’s hard disc that is collecting those values for later analysis.
It would be nice if a path and name could be entered to which the data would go, but I would be happy if it was a fixed path/name that could be later changed outside the client app.
Let me know if you need additional details.
Regards, Ron
Hi.
That’s not as straightforward as it seems.
But, I recommend taking a look at Project 3.4.
It saves sensor readings on a file on the ESP32 filesystem. Then, you can check the raw data using the button “View Raw Data” on the web server. Then, you can then download/copy the data directly from your browser.
Even though this will probably work, I don’t think this is the best procedure if you’re looking for a datalogging project.
Let me know if you need further help.
Regards,
Sara