TL;DR: Attempting to connect UART2 on ESP32-WROOM to a physical PC RS232 results in odd behavior and ESP32 crashes or errors. Suspect electrical design problems. Wondering if I need special consideration for voltages or diodes to avoid feedback to GPIO connectors on ESP side.

Hello! I'm relatively new to the community. I'm attempting to build a tool that will interact with a video conference bridge on its serial port to do room automation (mute/unmute/answer/raise_blinds/dim_lights/etc). Since the bridge interface is serial, I want to have two usable RS232 ports. One to interact with the bridge and the other to act as a console for troubleshooting and configuration.

I've purchased several ESP32-WROOM kits and have a good portion of the rest of the tool built, but I'm now struggling with getting UART2 to talk to my physical serial port on my PC so I can troubleshoot the actual bridge interactions. I've built a test sketch that just sends "Hello!" every second or so to UART2 and echoes anything it receives on UART2 back to UART0. UART0 is set for 115200 and UART2 is set to 9600. I have changed this to match and it made no difference.


  • UART0 is 115200,8N1 on standard USB console.
  • UART2 is 9600,8N1 on default GPIO 17/18 (TX2/RX2).
  • Pin17/18 and ground are wired to an 8 port single row header which is then plugged into a Teansic RJ45 breakout board.
  • Using Arduino IDE serial monitor to observe. Shows as COM3 on my PC.
  • UART2 is connected to a StarTech USB to RJ45 adapter made specifically for Cisco consoles (ICUSBROLLOVR) it shows as COM7 and I'm just using Putty to observe.


#include <HardwareSerial.h>

#define RXD2 16
#define TXD2 17
#define Serial0 Serial
#define Serial2 SerialPort

HardwareSerial Serial2(2);

void setup() {
  Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2);

void loop() {
  while (Serial2.available()) {
    Serial0.printf("[%012d]      In: ", esp_timer_get_time());
  while (Serial0.available()) {
    Serial2.printf("\n[%012d]  Insert: ", esp_timer_get_time());
  Serial0.printf("[%012d]     Out: ", esp_timer_get_time());



When I connect my PC up, it receive characters but they are (consistent) garbage of about the right number of characters. It looks like:


I sometimes receive phantom characters in from the PC even though I'm not sending anything.

If I loop UART2 back on itself (connect TX to RX at my serial header) I get a perfect response back out UART0 as though the input was coming from the PC.

If I send data from the PC to UART2, it results in crashes/errors similar to the following. The error implies it is rebooting, but it is not:

rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
mode:DIO, clock div:1
entry 0x400805f0
[000000011533]     Out: Hello!
[000001111758]      In: 
[000002111056]     Out: Hello!

I've observed the electrical output with an oscilloscope and it casually looked like a good RS232 signal. I went so far as to convert my character string to little endian binary and add the start and stop bits and it looks exactly like it should to me except that I am expecting that 0 and 1 should be in the range of -3 to -10 and +3 to +10 and instead the pattern appears to be about +400mV for 1 and markbits and just above zero for a 0 (relative to ground).

enter image description here

enter image description here

I have found very little to reference for RS232 to an actual PC. Almost everything appears to be logic level connections ESP32 to ESP32 or peripheral board to ESP32.

I suspect that this is a case of needing circuitry to convert the logic level voltages to external RS232 +10/-10v ranges and perhaps diodes or something to prevent phantom feedback since TX/RX have a shared ground, but I'm flying blind. I'm hoping someone here has experience with this and can point me to an answer or better reference materials.


1 Answer 1


I think I found the answer to my own question by Googling around for widgets.

There are a bunch of kits out there that do just this but Sparkfun was kind enough to provide me with a diagram on exactly how to build it.

SparkFun tutorial

I'll leave this out here for others and I'm still looking for feedback, but I think I have my answer.

It wasn't obvious to me (but should have been) that the board is only going to deal with low voltage positive (TTL) signals and the onboard UART doesn't magically make it inverted, higher voltage signals.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.