On many ESP32 boards Serial2 uses GPIO 16 for RX and GPIO 17 for TX by default, and you can set other pins in begin().
What the message means
The ESP32 has three hardware UARTs. UART0 is the USB console, so use Serial2 for a GPS, a sensor or another board.
Fix it in this order
- Call Serial2.begin(baud, SERIAL_8N1, rxPin, txPin) with the pins you wired.
- Cross the lines: the device TX goes to your RX pin, and its RX goes to your TX pin.
- Join the grounds, and use 3.3 V levels. Level-shift a 5 V device TX line.
- Match the baud rate to the device datasheet.
- Do not use GPIO 6 to 11 or the strapping pins for this.
- Print what you receive on the USB Serial to check.
If you see this, do this
| You see | Do this |
|---|---|
| Nothing arrives | TX and RX not crossed, or baud mismatch. |
| Garbage characters | Baud rate. |
Related
Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.