Serial loopback debugging

mads-k
Posts: 1
Joined: Fri Sep 16, 2022 11:50 am

Serial loopback debugging

Postby mads-k » Fri Sep 16, 2022 11:59 am

Hi!

This is my first ESP32!
I have an ESP-WROOM-32 chip where I have placed a jumper between RX2 and TX2 in the hopes of seeing data being transmitted from TX2 to RX2.

In order to test it, I have the following code

Code: Select all

#define RXD2 16
#define TXD2 17
void setup() {
 Serial.begin(115200);
 Serial2.begin(115200, SERIAL_8N1, RXD2, TXD2);
 delay(1000);
 Serial.println("Loopback program started");
}
void loop() {
 if(Serial.available()){
   Serial.write("-");
   Serial2.write(Serial.read());  
 }
 if(Serial2.available()){
   Serial.write(".");
   Serial.write(Serial2.read());  
 }
}
But looking at the output I get(see attachment), it doesn't look like anything is transmitted over the RX2 and TX2 pins.
I am connected to the device via USB and have selected FireBeetle-ESP32 in the Arduino IDE since that's what I've seen recommended in various places.

What am I missing?
screenshot.png
Arduino IDE with output and code
screenshot.png (527.9 KiB) Viewed 902 times
/Mads

Who is online

Users browsing this forum: Bing [Bot] and 107 guests