Skip to content

Buffer readings when internet connection drops out #286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nick-4711 opened this issue Feb 24, 2025 · 2 comments
Open

Buffer readings when internet connection drops out #286

nick-4711 opened this issue Feb 24, 2025 · 2 comments
Assignees

Comments

@nick-4711
Copy link
Collaborator

The goal is to buffer the readings in the ESP32 heap memory when transmission to the backend fails and then send the data once the connection recovers again.

Because the ONE and Open Air hardware doesn't support a battery-backed RTC, it is probably the easiest to use a backend provided timestamp as a base to tag the readings with a timestamp. This also means that we won't be able to buffer data upon power failure, but still it does improve the situation if only the internet drops out and then recovers within a few hours.

@samuelbles07
Copy link
Collaborator

Do you mean when transmission failed, buffer every failed transmission until it success send the first failed transmission? So basically send in a FIFO manner?
This approach can take a lot of heap if offline in a long time, do you have any recommendation to prevent this @nick-4711 ?

@nick-4711
Copy link
Collaborator Author

Yes, we have to limit the buffer size to avoid to run out of heap. I made an experiment once where I was able to keep 100 measurement cycles in RTC memory (which is only 8KB). So I expect that buffering data for a few hours is feasible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants