Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

HardwareSerial not returning any read data if UART_BREAK_ERROR triggered #6849

Copy link
Copy link
Closed
@AcuarioCat

Description

@AcuarioCat
Issue body actions

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

Type

No type

Projects

Status

Done
Show more project fields

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.