I am working on adapting an electricity meter interface device sketch on GitHub to my use case. It will use an ESP-12 (actually on an Adafruit Huzzah board).
The data is sent by the electricity meter at intervals of about 5-10 seconds as a packet containing some 30 ASCII lines of 20+ characters each at 115200 baud.
This calculates to about 60-70 ms block transfer time or about 2 ms per line.
Each line is decoded separately in the sketch as it arrives and I think it is OK speed-wise to handle a line while the next is arriving into the serial buffer.
BTW: How big is the serial buffer in ESP8266?
But the sketch is set up to only read and process data for a complete block at some 60 s interval so when it is not reading data from the serial port arriving characters will obviously overflow the receive buffer...
And now I wonder what happens internally in system code when the sketch decides to start reading data from the serial port again?
Will the serial port have a problem with all the unhandled data or is it just stuffing incoming chars into the buffer, overwriting older data? Like a circular buffer.
If these data just disappear is not really a problem because it is looking for a specific packet start character before even beginning to analyze the data.
and a 128 byte FIFO i think, but that will discard data when the rx-buffer is full and is only relevant for high speed transfers.
the FIFO will transfer data to the RX buffer in the background, i do suggest you setup your sketch to start processing data in the background as well. You are planning to receive some 600 bytes, your buffer should be big enough to hold all, but why wait those 60 seconds before to start processing.
The sketch is using a 60 second pause between actually processing data even though the meter sends the packets at an interval of 5-10 seconds.
This is in order to limit the data being recorded since there is no need for a second by second reading of the meter...
So if the ESP8266 serial port handler is not stuck if data are not handled while they arrive but just discarded then all is fine. I will probably increase the delay to 10 minutes in order to have less growth in the final database store anyway.
That is what it does, check out core files to confirm how it does (hardwareSerial.h etc) Still if it is just because of the database, i would receive what needs to be received and discard what you don't want to use yourself. Or maybe even better, receive what you want to receive when you want to, and then disable reception. This is the most CPU efficient. Simply change the pinMode of the RX-pin. That way the data never reaches the UART. check here for pinMode per function table.