OpenEnergyMonitor Community

EmonESP missing first parts of data

Hi all,

I’m running emonESP flashed to a generic Expressif ESP8266, ESP-12F module.

I send it data in the normal key:value format it likes. I send data every four seconds for it to then post to EmonCMS.


It routinely misses the first few characters.

For instance, I send

“CT1_Rp:100.00, CT2_Rp:99.99, CT3_Rp:98.98”

However, it receives

“T1_Rp:100.00, CT2_Rp:99.99, CT3_Rp:98.98”


“_Rp:100.00, CT2_Rp:99.99, CT3_Rp:98.98”

Is this just me? Am I sending data too fast? It only ever misses the first few characters in a seemingly random way. Is the ESP just too busy or missing a serial interrupt (not sure if the ESP even has that…) As a workaround I could add a dummy value as the first in the string.

Interesting, I have seen garbled data at times from an EmonESP device but dont think I noticed a pattern with the first few characters. How often does it miss these characters? Is it every time or once every few hours?

It might be the Baud rate speed, or one of the other Serial Communications Parameters.

If it were a Baud rate mismatch, all of the characters would be affected, not just the first few.

I wouldn’t have thought so. There are ~40 characters, 320 bits at 115200 bits/second? Every 4 seconds? You can easily prove it by sending less frequently (it gets better) or even more frequently (it gets worse).

I think it’s more likely that you have not left a big enough delay to allow something else to complete before you send the serial data to the ESP, and it is that which is messing up the timing of the serial data. Try adding a small delay just before the Serial.print("CT1…

I concur.

Right, I don’t believe any mismatch of serial settings, as it works reliably beyond the first few characters I send.

It seems to be fairly frequent, like to the point where my first CT’s data isn’t reliably logged to a feed. Last time I got a good value for CT1_Rp was 8 hours ago per my EmonCMS inputs… my EmonCMS inputs fills with junk inputs because of this…

I’m going to try a couple of things, based on feedback here.

  1. I’ll try and add a delay of sorts before sending my data to the EmonESP from my device (I’m using a Teensy 3.2).

  2. I’m also going to try and re-flash the EmonESP firmware to the ESP-12F to see if that helps (not at the same time as the above change of course).

Thanks for the input! For those curious what my hardware looks like, see here.

So I re-flashed my ESP-12F with the latest & greatest EmonESP. So far it’s missed a couple of those first characters in the past few minutes… I’ll keep an eye on it, and if it’s still bad I’ll make those above mentioned ‘delay’ modifications to my firmware that runs on the Teensy 3.2.

What’s curious is that this setup has been running like this for over a year with no issues, then in the past few weeks this issue started to occur.

It would have been helpful to know that from the beginning. So what has been updated/updated itself recently?