• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Saving sensor readings

Q&A Forum › Category: Arduino › Saving sensor readings
0 Vote Up Vote Down
Ron Kreymborg asked 1 year ago

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
 

Question Tags: Saving data
3 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

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,

0 Vote Up Vote Down
Ron Kreymborg answered 1 year ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

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

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.