There are three serial ports on the ESP known as U0UXD, U1UXD and U2UXD.
U0UXD is used to communicate with the ESP32 for programming and during reset/boot.
U1UXD is unused and can be used for your projects. Some boards use this port for SPI Flash access though
U2UXD is unused and can be used for your projects.
*/
#define RXD2 16
#define TXD2 17
#define ADDR 0
#include <ArduinoJson.h>
#include <HardwareSerial.h>
longTIME_OUT=45L;
Stringin;
voidsetup()
{
Serial.begin(115200);
pinMode(13,OUTPUT);
Serial.println("wait 30s to open pin 13");
delay(1000*5);
digitalWrite(13,1);
// Serial1.begin(9600, SERIAL_8N1, RXD2, TXD2);
Serial2.begin(115200,SERIAL_8N1,RXD2,TXD2);// Note the format for setting a serial port is as follows: Serial2.begin(baud-rate, protocol, RX pin, TX pin);
// Serial.println("Serial Txd is on pin: "+String(TX));
// Serial.println("Serial Rxd is on pin: "+String(RX));
while(!Serial)
;
Serial.println();
Serial.println("Input an str (waiting for 0.5 seconds");