Why does RS-232 Communication fail between these 3 ESP32's?

What's the Goal?

Trying to get two esp32's to communicate over their UART lines using RS-232.

Devices / Setups

I have two ESP 32 devices and I have connected them over their UARTs with basic dupont jumpers. Successful communication - I can send 'hello X' from one to the other - no problem!

I have next taken the same esp32 devices and then instead I have inserted RS-422 to TTL adapters and communication continues to flow perfectly!

I've then done the same with RS-485 to TTL adapters and all is well also with communication flowing in both directions!

The Challenge

I have the same ESP32's but am now using rs232 adapters. There's no communication going whatsoever apart from what 'appears' to be line noise...garbled chars like "0xFE', etc.

Steps

I have validated and verified that the TTL to RS232 adapters actually work by connecting them with DB9 serial cables to a PC (instead of using a USB cable) and seeing the REPL on both of them with my IDE, Thonny.

Now, I then use one of the same good cables to connect the RS-232/TTL adapters and the esp32s (on GPIO 13 and 14) and connect them back to USB power. But there's still no communication.

In terms of the physical setup it looks like this:

Each esp32 connects to the RS-232 with TX->TX, RX->RX and shares GND w/the module. Each module is powered independently (also tried sharing the same rail) with 5V rails. I put 14 millamps of current to the modules - I thought maybe there was not enough current to them so I tried various values.

I believe I have enough power going to each of the max 3232 modules as it appears the data sheet says it needs somewhere between 3 to 5 volts and seems like up to 20 mA should be fine. Not really sure what to try next. Any thoughts?

Oops! RS232 is point to point it does not like additional connections. Also it is picky and Rx only listens to a TX. Cross them and it should work with two but not 3.

3 Likes

I moved your topic to a more appropriate forum category @qqchachoo.

The Nano ESP32 category you chose is only used for discussions directly related to the Arduino Nano ESP32 board.

In the future, please take the time to pick the forum category that best suits the subject of your question. There is an "About the _____ category" topic at the top of each category that explains its purpose.

Thanks in advance for your cooperation.

If you must, you can connect three devices in RS232, but it will be noise-sensitive and only good for short distances. To do so, connect a 10kOhm resistor in series with each TX output. That effectively creates a mickey-mouse OR-ing connection. At least, I think that was how we accomplished it in 1988 or thereabouts.

But yeah, as others have said, RS232 is point-to-point, one RX to one TX each way.

Oh, and make darn sure of your GND connection between each module. There's no cheating with no GND, like you can in many circumstances with RS485.

1 Like

Many thanks for the reply @gilshultz and @camsysca !

I am sure you are both correct. With 'bare naked' UARTS, I did RX-->TX. Here, I was following this post, which appears to be incorrect, apparently. In my mind I thought that the cable from esp32 to the RS-232 module was like 'an extension' cord, so it sort of made sense :).

To share an update, I set RX->RX and TX-TX from each esp32 to the RS-232 modules. That did not correct the problem. I then also removed the cable and just have a gender changer. That did not correct the problem.

I feel like I maybe should try different esp32s. One thing I may not have mentioned. The reason I am using separate power supplies is the I measured only 1.2 V from the 5V/GND on each esp32. I thought it should give 5V? but everything else worked perfectly -- and honestly speaking -- there seems to be lots of different opinions on what the 5V pin is capable of.

Anyway, thanks so much for your thoughts! Updated pic:


p

If 5V isn't 5V -- that's a problem.
It's not a matter of debate.
Maybe it's your probesmanship.

1 Like

It's a cheapy little meter. It seems to work if I test a USB cable and get 5V. But yes, you could very well be correct, I could be gaffing the w/the probes!

  • Initial thoughts are we need a good schematic.

  • If you are connecting RS232 ± signals to ESP 3V3 pins, not going to work.

  • If you are connecting TTL 5v signal levels to ESP 3V3 pins, not going to work.

1 Like

I'd appreciate any documentation you have for the 5V pin of the esp32. Every site I go to contradicts the next site. Thanks

It is whatever the USB voltage is (which is "in the neighborhood of" 5V) - assuming that's plugged in.

Meaning - what is the purpose of it and how does it work

I.E why so many questions on what -- in theory -- is supposed to be a simple question :stuck_out_tongue:

Best of luck, old horse.

The Final solution:

A null modem cable was required. I thought the cable I had was that.

And to recap:

  • Esp32 TX to TX of each module .
  • Connect each module to it's own USB 5V power supply.
  • Each module shares ground with attached esp32 only.

Life is grand now.

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