Anyone using RS485/Modus with Waveshare ESP32-S3-LCD-7 or 7B?

I wrote some yaml to suck data out of Renogy batteries & charge controller. First for the Lilygo ESP32-CAN-RS485 board, then ported to Waveshare ESP32-S3-8RO-8DI relay board. Works great. Then I moved the code to the Waveshare LCD to have a visual display w/o having to spin up a browser, but it doesn’t work. I have tried two different boards and will try the “7” variant once it arrives, with no success. The log shows the request going out, but no response.

So, the ask: has anyone successfully used MODBUS at 9600baud with either of those two boards?

TIA

Are you using ESPHome?

Maybe if you shared some code someone would be able to help a bit.

Here are the relevant bits of yaml. Identical between the three devices I have tried it on, other than the rx_ and tx_ pins. Works on the CAN board, the Relay board, but does not work on either the ESP-S3 or ESP-P4 LCD boards.

My question has to do with the hardware and suitability for what I am doing. Both LCD boards have a wonky RS485 lash-up that I have not seen anywhere else. I am pretty certain that the yaml is correct - it is very simple and works on half of my devices without errors.

# RS485 / Modbus
uart:
  - id: modbus_uart
    tx_pin: GPIO15
    rx_pin: GPIO16
    baud_rate: 9600
    stop_bits: 1  # default to 8E1
    data_bits: 8  # default to 8E1
    parity: NONE  # default to 8E1
    rx_timeout: 2 # default

modbus:
  uart_id: modbus_uart
  send_wait_time: 50ms
#  flow_control_pin: ??

# Include file detailing registers we are interested in from the Renogy DCC50S charge controller
# see ESPHome "van-electrical" project for usage
modbus_controller:
  - id: ${modbus_id}
    address: ${device_adx}
    setup_priority: -10
    update_interval: ${interval}
    max_cmd_retries: 0
    offline_skip_updates: 3

BTW just tried this on an Mstack Tab5 and RS485/modbus works fine. This problem appears limited to the waveshare LCD products (S3-7, S3-7b and P4-7b). Very disappointing.

I don’t own your board, but check if there are jumpers for Uart and RS485 termination.
Also, most of rs485 devices nowadays don’t respect the standard for A/B polarity, so try to swap them as well.

All my boards appear to have the termination resistor attached, by default. And yes, I have swapped A/B.

Of the three products that work, two have a direction pin which AFAICT is just set to receive. None of the waveshare products (including the relay board which works) have a direction pin exposed.

The waveshare products that don’t work all have a funky logic attached to the RS485 interface chips to automate directions. The Lilygo product uses the MAX13487 driver with automatic direction control. The waveshare relay board is not saying what they have.

Foo.

It has automatic direction control, you see it on schematic.

Mea Culpa: the problem is that RS485 TX pin, really means the UART RX pin. Swapping pins in the UART definition and now I am getting RS485 data.

Jeeze. And I had to drag out my oscilloscope to figure that one out, although a carefull examination of the schematic would have illuminated the issue.

I take back all the bad things I have said about Waveshare.

Hi!
I have a similar problem with Waveshare ESP32S3 touch LCD 5B, but sending data over RS485 works with the default pins configuration. Receiving data from the sensor is a problem. I’ve tried connecting with USB to RS485, and the PC Serial Monitor receives data, but the ESP doesn’t. Any ideas?