Waveshare ESP32-S3-POE-ETH-8DI-8RO — modbus_controller against RTU relay expansion + second independent UART possible?

Hi all,

I’m setting up a Waveshare ESP32-S3-POE-ETH-8DI-8RO board (8 onboard relays + 8 digital inputs) for home irrigation control, and I want to extend it with Waveshare’s own Modbus RTU Relay expansion module over the board’s onboard RS485 bus (GPIO17/18 in the ESPHome config). I have two open questions:

  1. modbus_controller against RTU relays — Waveshare’s own wiki documents extending the 8 onboard relays with this Modbus RTU Relay module over RS485, using their Arduino firmware. Does the generic modbus_controller component in ESPHome work the same way against an RTU setup on this onboard RS485 UART, or does it expect something different (Modbus TCP, a specific relay profile, etc.)? Has anyone actually run modbus_controller against this specific Waveshare relay expansion, or an equivalent generic Modbus RTU relay board?

  2. independent UART — Alongside the RS485 bus to the relay module, I also need a second, fully independent UART (not RS485) for a separate sensor — a ScioSense UFM-01 flow meter, whose ESPHome component (ufm01) needs its own uart_id with dedicated tx_pin/rx_pin. Is there a free GPIO pair on this board broken out for a second UART, or are GPIO17/18 the only UART-capable pins exposed?

I asked the board’s ESPHome-integration maintainer (jacobstim) on GitHub and got a helpful but unconfirmed answer — he suspects both would work but hasn’t tried it himself, and suggested I check with the ESPHome project directly.
So: has anyone actually done this combination (RTU relay expansion + separate sensor UART) on this board or a similar ESP32-S3 board?

Thanks!

I don’t qualify for the last part but

  1. Modbus RTU is not hardware/software dependent, so it will work on esphome. Why you need RTU relay in the first place?
  2. S3 has multiple UARTs so you can use pair of free gpio pins for second UART.

Thanks Karosm, that’s helpful!

  1. Why the RTU relay module: the onboard board only has 8 relays, but my irrigation setup needs 12 channels in total (7 valves for the drip zones + 4 valves for a separate lawn zone + 1 master valve), so I need the extra 4+ channels from Waveshare’s own Modbus RTU Relay expansion over RS485 to make up the difference.
  2. Good to hear RTU itself isn’t a concern, and that the S3 can just use another free GPIO pair for the second UART — that’s reassuring.

One follow-up: do you happen to know, or have a source for, which GPIO pins are actually still free (not already used internally) on the Waveshare ESP32-S3-POE-ETH-8DI-8RO specifically? I want to pick a safe pair for the second UART before wiring it up on the bench.

Can you post link to your exact device. WS has often many versions like V1, V2…

Waveshare has complete documentation on all their boards on their web site. Did you check their wiki?

Waveshare ESP32-S3-POE-ETH-8DI-8RO

There are plenty of useful pins.
Gpio 1-3 are best choices for uart sensor.
Default uart0 pins 43/44 would likely work as well, but there might be some logging at early boot stage.
And if you don’t use SD-card, you have 4 usable pins more.

thanks Karosm, this is exactly what I needed!

Confirming the device: Waveshare ESP32-S3-POE-ETH-8DI-8RO (Mfr.PN/WS.PN as printed on the box: ESP32-S3-POE-ETH-8DI-8RO, no separate hardware revision marking on the unit itself).

I opened the enclosure and found the onboard pin header you can see on Waveshare’s own detail drawing — an unpopulated 2×14 through-hole header right next to the RTC battery holder. It matches your pinout table exactly: GPIO1 (pin 23) and GPIO2 (pin 25) are both free, right where you said. I’ll be wiring up tx_pin: GPIO1 / rx_pin: GPIO2 for a second UART to a flow sensor, alongside the existing RS485 bus (GPIO17/18) to the Modbus RTU relay expansion.

As a bonus, that same header also breaks out 5V and 3.3V right next to the GPIOs, so I don’t need to tap power from anywhere else on the board.

Haven’t flashed the actual config yet, but the hardware side is now fully confirmed. Will report back once it’s running. Thanks again for the help!

You are welcome.

Be aware that Esp32 operating voltage is 3.3V and you should not connect it to 5V sensor without level shifting.

Good catch, and already covered — I have a bidirectional logic level shifter (BSS138-based, 4-channel) between the UFM-01 (5V) and the ESP32’s GPIO1/GPIO2 (3.3V), exactly for that reason. Should have mentioned that in the first post. Thanks for double-checking though, better safe than sorry!

BSS138 shifter is good for I2C, not so for push-pull UART (TXB0104 would be better choice). I personally would just use voltage divider made of two resistors on sensor TX-line.