Don't use Serial1 and Serial2! Use HardwareSerial to define your Uart and name it to different name.
HardwareSerial RS485Uart(1);
void setup() {
DongleUart.begin(19200, SERIAL_8N1, RXD,TXD);
}
Search found 3 matches
- Mon Jun 06, 2022 1:12 am
- Forum: ESP32 Arduino
- Topic: RS485 uart trouble (solved)
- Replies: 3
- Views: 2214
- Mon Jun 06, 2022 1:06 am
- Forum: ESP32 Arduino
- Topic: Cannot receive data from UART1 and UART2
- Replies: 1
- Views: 1269
Re: Cannot receive data from UART1 and UART2
I have fixed the problem.
UART0, UART1, UART2 is default name in HardwareSerial.h
it should be be used as a class name for UART. the name of UART was changed to DebugUart and everything works well.
Hardwareserial DebugUart(1);
UART0, UART1, UART2 is default name in HardwareSerial.h
it should be be used as a class name for UART. the name of UART was changed to DebugUart and everything works well.
Hardwareserial DebugUart(1);
- Sat Jun 04, 2022 7:13 am
- Forum: ESP32 Arduino
- Topic: Cannot receive data from UART1 and UART2
- Replies: 1
- Views: 1269
Cannot receive data from UART1 and UART2
Dear members, I am trying to test Hardware UART function on a ESP32 module base on Arduino. An USB -UART dongle was use to test the ESP32. below is the code. RX on UART0 can receive the data send from dongle. but the UART1 and UART2 can't receive data. however, trasnfer from TX works well. HardwareS...