Short answer

How do I talk to a meter on RS-485 from ESP32 UART?

  • UART echo only proves TX/RX and baud. RS-485 is a transceiver and a DE/RE pin, not a different UART peripheral.
  • Match 8N1 vs the meter, and the 120Ω termination on a long bus. Wrong polarity on A/B looks like noise.
  • 3.3V UART into a 5V-only transceiver needs a level plan. Do not guess with series resistors on a noisy bus.
  • If the host already speaks Modbus, use that framing. A custom binary on RS-485 is extra work for the customer’s PLC.

中文

短答

ESP32 串口怎么接到电表的 RS-485?

  • UART 回显只证明 TX/RX 和波特率。RS-485 是收发器和 DE/RE 脚,不是另一种 UART 外设。
  • 校验位要和表计一致,长总线要 120Ω 端接。A/B 接反看起来像噪声。
  • 3.3V 串口进纯 5V 收发器要有电平方案,不要在噪声总线上用串电阻碰运气。
  • 对方已经说 Modbus,就用那套帧。在 RS-485 上自造二进制,会给客户的 PLC 加工作量。