I have about 20 ESP32 boards and only a few ESP8266 boards which are mostly already in use somewhere. I just spent hours trying to get an SMD72D-M-2 energy meter to work with the ESP32. I failed. At some point i came across this post and thought I should maybe try using software UART. But according to this Github Issue Software UART only works on the ESP8266 and as soon as I tried using software UART on an ESP8266 it actually started working immediately. I’m really confused! In my mind hardware UART is “better” as it also supports higher baud rates (or at least works better with them). Why can’t I use hardware UART?! It’s also kind of annoying. I just used the exact same code for the esp8266 and esp32 in esphome, except the pins:
#rest of the code here
uart:
id: mod_uart
tx_pin: 4 # 1 for ESP32
rx_pin: 5 # 3 for ESP32
baud_rate: 9600
stop_bits: 1
modbus:
uart_id: mod_uart
id: modbus1
modbus_controller:
- id: controller
address: 1
modbus_id: modbus1
sensor:
- platform: modbus_controller
modbus_controller_id: controller
name: "Frequency"
id: "frequency"
register_type: read
value_type: FP32
address: 0x0046
accuracy_decimals: 2
I’d love to be able to just use on of my ESP32 and understand why this happening! Thank in advance!