I’m working with the EC200U-CN module and facing an issue when receiving MQTT subscribed data via UART. The UART on this module uses a 2KB FIFO buffer.
What I’m trying to do:
I’m subscribing to an MQTT topic and reading the incoming data through UART. For messages less than or equal to 20KB, I’m able to read the full payload successfully by performing 10 consecutive reads of 2KB each (10 × 2KB = 20KB).
The issue:
When the MQTT payload size exceeds 20KB, the data received through UART seems to be incomplete. It looks like the module doesn’t load the full MQTT data into the 2KB FIFO buffer, or perhaps some data is lost or overwritten if not read fast enough.
Questions:
Is this the expected behavior of the EC200U-CN when handling larger MQTT payloads via UART?
Is there any alternate approach to ensure complete data reception for payloads larger than 20KB?
Any insights, workarounds, or suggestions from those who’ve dealt with similar situations would be appreciated!
I recommend using the USB AT port on the EC200U-CN. This provides higher bandwidth and more secure flow control. This eliminates the UART 2KB FIFO limit and the problem of very long URCs.
AT+CMEE=2
AT+QSCLK=0 // Sleep disabled, no streaming interruption
AT+QURCCFG="urcport","usb" // (if supported) Secure URC to USB AT port
AT&W
If you don’t have a USB option, use UART in “safe mode”.
DMA + dual buffer (e.g., 2x4–8KB) RX; copy only during interrupt, parse in task.
Ring buffer and flow control: When RX reaches 80% capacity, set RTS to HIGH; when exhausted, set it back to low.
Switch to manual receive (if available) to prevent the URC from continuously flowing:
Hi @AnnaLiu ,
The command ‘AT+QGMR’ could not be found. If you’re referring to checking the firmware version, the appropriate command might be ‘AT+GMR’.
The configuration number information for the command AT+QGMR is:
AT+GMR: EC200UCNAAR03A03M08
Your current version is quite outdated.
Our latest version has fixes for MQTT issues. You can upgrade and test it to see.
I have sent you the latest version privately.
Hi @AnnaLiu
Despite updating the firmware to the latest version you provided (EC200UCNAAR03A14M08), the issue still persists. The only noticeable change after the update is a reduction in MQTT connection and disconnection time.
I tried to increase the UART baud rate from 115200 to 1,000,000, but the issue remains unchanged.
Also configured AT+QURCCFG=“urcport”,“uart1”.