Skip to content
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

Readings filling up filesystem #175

Closed
doug-burrell opened this issue Apr 29, 2023 · 4 comments
Closed

Readings filling up filesystem #175

doug-burrell opened this issue Apr 29, 2023 · 4 comments

Comments

@doug-burrell
Copy link

I've got an Enivro Indoor that I've been running since early February of 2023 and I'm finding that the readings are filling up the Pico's filesystem. Once it gets to the low storage limit it stops working until I manually remove all the readings files.

@MrDrem
Copy link

MrDrem commented Apr 29, 2023

Do you have it set to upload to somewhere? If not this is expected behaviour I believe. It might be better if it overwrote oldest readings maybe.

@doug-burrell
Copy link
Author

It's uploading to Adafruit successfully. I can see in main.py it's saving the readings but eventually it fills up because there's no file rotation for the readings. I've commented out this line of code for now but there should be some sort of file rotation going on to prevent the readings folder from filling up the filesystem.

@sjefferson99
Copy link
Contributor

File deletion is handled in upload_readings() in enviro/init.py on line 428 on the main branch. This calls function calls the appropriate destination code, so it should work the same for all valid destinations and it certainly works for my influxdb and wunderground configs.

It is designed to create log files only as a buffer and only store them as long as is needed until an upload is triggered AND successful. As a deliberate side effect, if you don't specify a destination, it will log locally, but I don't think there's any rotation for that scenario as yet, not a mode I have worked with though.

I would guess that you are not getting a 100% successful upload for it to skip this line, which should be evident in the log file where you see a log.info line in that segment that isn't " - uploaded ". If you can find the section of upload_readings() your code is hitting, you can hopefully correct the upload issue or fix the bug in that scenario, as you say it is uploading data to adafruit OK.

@doug-burrell
Copy link
Author

It looks like the problem has been fixed in the main branch, I'm using v0.0.2 which is the default release firmware that came on my unit and it does both upload and save readings locally, whereas main only saves readings locally if there's no upload configuration. I'll have to upgrade mine sometime soon. Thanks for the help!

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

3 participants