ESP32 Wroom - Serial Port

Hello

I am using Uart 2 on pins 16 and 17 of the ESP32 Wroom module

Setup consists of ......
Serial2.begin(115200, SERIAL_8N1, RXD2, TXD2);
Serial2.println("Hello World");

When the module is rebooted a 3 ramdon characters are printed prior to the string

Is there away to prevent this from happening ?

Any suggestions would be appreciated

Thank you

Start up glitches are common on serial ports. Why do you need to prevent it?

Where is serial2 printing to?

The ESP32 uses GPIO_1 and GPIO_3 to print to the serial monitor.

Serial1 is naturally assigned to GPIO_16 and GPIO_17. Mapping one Serial2 to Serial1 may not be the wisest use.

On an ESP32 I use serial this way

#include <HardwareSerial.h>

HardwareSerial SerialTFMini( 1 );
HardwareSerial SerialBrain( 2 );
////// serial(1) = pin27=RX green, pin26=TX white
////// serial(2) = pin16=RXgreen , pin17=TX white

voided setup()
{
  Serial.begin( SerialDataBits );
  SerialBrain.begin( SerialDataBits );
  SerialTFMini.begin(  SerialDataBits, SERIAL_8N1, 27, 26 );
}

There is a chance the connected device may do something strange if it receives bad sequence of characters....It would seem logical to eliminate if possible

What is the connected device? How does it interpret your, "Hello world"? :slight_smile:

Suppress Boot messages - ESP32 Forum

Under Arduino, I do not know if there is a solution.

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