ESP32 serial never becomes available

Hi!

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

#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. Serial and Serial2 never even becomes available.
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?

/Mads

What characters are you sending via Serial, and how?

As seen on the code above, it’s just .’s and -‘s and writing between the two serial ports. I have added a jumper between RX2 and TX2.

The wiring is understood.

Where do the characters come from? Are you trying to send them using the serial monitor?

If so, you will have an easier time using a terminal program like TeraTerm or PuTTY.

And this is of course the crux of the problem. I assume that the Serial.println in the setup would be enough to cause Serial.available() to be truthy. I don’t send other characters then what is seen in the code. Tried connecting via the terminal and was able write to Serial and get the expected feedback.

Thanks!

No, the TX and RX channels are completely independent.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.