Board enviro weather storage fills up with readings -> auto cleanup?

Hello All,

I have the ‘Enviro Weather (Pico W Aboard) - Board Only’. After some time of operation the device storage fills up with readings content. That leads to boot failure. For ong term operation I would like to know about auto cleanup of the ‘readings’ area. How to do that?

Below screenshot showing full readings area. (I manually deleted some readings files to regain operation. But that it not feasible long term.

Cheers,
Gert

What do you mean by “After some time of operation the device storage fills up with readings content”, where are you writing the data to/how do you know the storage fills up? It would be helpful to see the code you’re using here. In theory MicroPython should manage the memory automatically, but if you’re appending all results to something like a list which is kept in memory and just gets bigger and bigger then eventually you’ll run out of it.

@Shoe,

I am using the device as it came from factory. All code is stock. When I ran the device connected to Thonny I saw an error message and I assumed it ran out of memory. I deleted manually some of the files under ‘readings’ (in Thonny) pressed boot button and the device started and performed normally.

Just wondering if I am failing to provide a required user setting, i.e. “delete oldest readings when space is 90% full”. I don’t understand why ‘readings’ is kept. Shouldn’t the data be sent to the host computer?

Cheers,
Gert

So it looks like if there is low disk space it should explicitly log this somewhere:

enviro.logging.error("! low disk space. Attempting to upload file(s)")

Is that the error you saw somewhere? Have you configured it at all to upload the data anywhere else over WiFi? There are guides for doing this at the bottom of the Pimoroni guide.

Hi,

I saw same message about a LED variable not set. But I did not copy it. And once I started deleting files in ‘readings’ and tried the launch again the run went smooth.

I have edited config to upload to mqtt broker which works fine. The observation was happening during a phase where I was changing code for the plotting software and the broker might not have been active for a time. Maybe during that time the readings piled up? It is a possible scenario that the broker will be down and this should not become a cause for storage space failure in the board.

Cheers,
Gert

At a glance at the code in the main.py there is a section which looks for a destination and if it can’t connect it “caches” it. I’m not sure exactly what that means, but cached data has to go somewhere and might cause the issue?

Hi,

That must be the answer. I am not a code developer, is there someone from support team available to improve the firmware of the board?

Cheers,
Gert

Hello All,

So I have observed this again for a few days, as I was concerned that there was an upload failure due to battery drained. But there was plenty of bright days and I could follow the measurements until they stopped. I am sure the mqtt broker (running on my RPI4) was stable as I could inject messages into it from the RPI command line. So the measurements that got taken were sent to the broker but as well stored into the ‘readings’. I saw that once I connected the board to Thonny and for all the days where there were meaasured data logged by the broker there were ‘readings’ entries.

Could someone please point to a config setting that will stop storing readings and fillup the storage? Maybe some setting that if at all only the last 5 days are kept and all older ones are auto deleted?

Thanks,
Gert