I'm using ESP8266 as WiFi cloud posting device for my sensor nodes.
Taking data from a sensor node via UART (Software UART) -> Get Timestamp from RTC -> Store that data into SD card -> On regular time interval Post collected data to Thingspeak using Bulk Data update API.
Issue I'm facing is while ESP8266 posting data to Thingspeak it remains busy to get back the response from thingspeak for successful posting. It takes 6 - 8 seconds normally and sometimes if internet is down it takes 25 - 30 seconds.
So during this time, ESP8266 not able to get data from Sensor node via UART.
Is there any way to get data via UART during the time of posting also???
I'm using
Arduino IDE
NodeMCU as ESP8266 board
Thingspeak REST API bulk update
UART communication between sensor node and ESP8266
Any other alternative way is also acceptable like instead of using UART, use SPI.
Post the code. If it can be modified so that it does not block while waiting for a network transaction to complete, then the sensor output can be added to a queue for the next data transmission.
Another option might be a breakout board for SC16IS750 which is a UART I2C-Bus/SPI adaptor and has a 64 byte buffer.
Do the sensor messages arrive at a regular interval? If so, you could calculate the approximate arrival time after you read a message from the chip's buffer.
PaulRB:
Another option might be a breakout board for SC16IS750 which is a UART I2C-Bus/SPI adaptor and has a 64 byte buffer.
SoftwareSerial on esp has a configurable buffer size and the buffer is filled with interrupt so the data should arrive.
The library for SC16IS750 is slow. Sends data over I2C or SPI byte by byte without buffering, with overhead of protocol bytes for every byte. I did write a fast I2C implementation, but only for the Uno WiFi on-board setup.
Juraj:
SoftwareSerial on esp has a configurable buffer size and the buffer is filled with interrupt so the data should arrive.
The library for SC16IS750 is slow. Sends data over I2C or SPI byte by byte without buffering, with overhead of protocol bytes for every byte. I did write a fast I2C implementation, but only for the Uno WiFi on-board setup.