esp32ModbusRTU icon indicating copy to clipboard operation
esp32ModbusRTU copied to clipboard

MAX485 connection to ESP WROOM 32

Open salvq opened this issue 6 years ago • 1 comments

Hello, trying to understand MAX485 connection to ESP32 from your schema and sketch, please help me to understand.

I have ESP WROOM 32 pinnout image

Your setup for SDM630 is "The ESP is connected to a max3485 with pins 17 (RX), 4 (TX) and 16 as RTS.".

Based on my pinnout, is it correct to be sketch changed to ?

  • PIN U2_RXD (GPIO16) to RO (receiver output)
  • U2_TXD (GPIO17) to DI (driver input)
  • D4 (GPIO4) to DE/RE (driver enable/receiver enable)

So your sentence for my setup would become "The ESP is connected to a max3485 with pins 16 (RX), 17 (TX) and 4 as RTS."

Thanks

salvq avatar Oct 10 '19 09:10 salvq

I have no experience with your module. But you can see in the example you have to 'begin' the serial interface yourself. Here you can assign the pins yourself.

The RTS pin should be provided in the modbus object's constructor. This again can be any gpio pin.

bertmelis avatar Oct 10 '19 13:10 bertmelis