Save data locally while connection to wifi is lost

Hello!

I'm making da Data Acquisition System with an ESP32 and Google Firebase. Right now, I'm able do read data from sensors and write it to Firebase over Wi-fi.
But, I didn't find any resources or tools to, save data in the ESP32 if the connection to internet is lost for any reason.
There is any way to creat any kind of buffer to write the data to firebase when the connection to wifi goes back?

With this tutorial https://randomnerdtutorials.com/solved-reconnect-esp32-to-wifi/ I've manage to restabilish the wifi connection, at least.

Thanks in advance

It's called "memory". A "buffer" is normally just an array of data, not any special magic. In your case it would be a FIFO structure (queue).

Memory is limited, so you need to decide how long to tolerate a "lost connection", and how much data you might need to save during that period.

Before worrying about lost data right now, work on 1, know when the link is lost, and 2. work on how to reestablish the link and 3. how to send the stored data while new data is being stored so eventually you can begin to send the data in real time.
Not for beginners! But a good learning experience.

Hello @vinifrancioni,

You did post this in the Arduino WiFi Rev2 section of the forum but you're using a ESP32. Hence your topic was moved to a more suitable location on the forum.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.