Closed
Description
Board
ESP32 WROOM-32E
Device Description
Plain module on pcb
Hardware Configuration
GPIO21,22 connected to I2C
Version
v2.0.3
IDE Name
Visual Micro
Operating System
Windows 11
Flash frequency
80MHz
PSRAM enabled
no
Upload speed
921600
Description
I'm trying to read from an SDM120M modbus energy meter. The meter is returning data. The last byte is 00 but after the last bit the data line stays low causing a framing error. This triggers an RX break in the uartEventTask.
No data is then available (serialX.available() returns 0)
Finally after a few calls the UART FIFO fills up and the uart then returns 120 from serialX.available() and provides provides the 120 bytes (presumably as UART_FULL_THRESH_DEFAULT is triggered).
Sketch
Sketch is the sdm_live_page_esp32_hwserial.ino example from the SDM library :
https://github.com/reaper7/SDM_Energy_Meter
I added an onReceiveError callback to the SDM.cpp to trap the error.
void rxerr(int err) {
Serial.printf("Receive error:%d\n", err);
}
Debug Message
[1232656][W][HardwareSerial.cpp:256] _uartEventTask(): UART1 RX break.
Receive error:0
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.
Metadata
Metadata
Assignees
Labels
Relates to peripheral's APIs.Relates to peripheral's APIs.Common questions & problemsCommon questions & problems
Type
Projects
Status
Done