OpenEnergyMonitor Community

EmonESP data buffering

Tags: #<Tag:0x00007fc9ae170bb8>

Following on from emonESP firmware dev thread:

It’s occurred to me that the ESP possible with the addition of an SD card or extra flash could be used to buffer data before posting to emoncms. In the event of network failure, data could be buffered locally on the ESP then bulk uploaded with emoncms connection to restored.

What do you think of the feasibility of this feature? It would be really great not to have to relay on the quality of a network connection to obtain good quality monitoring data. There could even be potential for the ESP to operate in ‘offline’ mode logging to an SD card for later data upload.

Have you got any thoughts @jeremypoulter ?

Even without the SD card/flash this would be a useful feature, with the free memory I am typically seeing (at least 10Kb) you should be able to store data for around 40 minutes without even trying (10 data points, 4 bytes each = 40 bytes a sample, 10KB / 40B gives you storage for 256 samples, 2560 seconds or 42 mins).

I think from the conversations on Could emonESP also support CSV and post to a local emonHub? I think the larger issue was there is no way to bulk upload named values.

I say larger but it probably is not that bigger deal. A kind of hacky way of extending the current bulk upload may be to have some magic value for the time that indicates the values are names not values, eg ["names",0,"ct1","ct2","ct3","ct4","vrms","pulse","t0"]

I nicer solution would probably involve coming up with a new schema on a different endpoint.