I am trying to connect a modbus PT1000 temperature sensor module to my esphome controlled esp32 (wt32-eth01).
I was successful, using the Modbus Poll windows software like described here: YouTube video “PTDNC04 4CH PT100/PT1000 RS485 temperature sensor”
According to the manual of the module, it should communicate like this:
send data…: 01 03 00 00 00 01 84 0A (read temperature on channel 0)
received data: 01 03 02 00 DB F8 1F
My current config looks like this:
uart:
- id: uart_modbus
tx_pin: GPIO15
rx_pin: GPIO36
baud_rate: 9600
stop_bits: 1
data_bits: 8
parity: NONE
debug:
direction: BOTH
modbus:
- uart_id: uart_modbus
id: modbus_bus
role: server
modbus_controller:
- id: modbus_temp
modbus_id: modbus_bus
address: 0x01
setup_priority: -10
update_interval: 2s
sensor:
# Modbus Sensoren
- platform: modbus_controller
modbus_controller_id: modbus_temp
id: pt1000temp
name: "PT1000 Temperature Ch1"
register_type: holding
address: 0x0000
unit_of_measurement: "°C"
value_type: U_WORD
The logs show these messages:
[19:51:24][D][modbus:147]: Modbus error function code: 0x83 exception: 3
[19:51:24][E][modbus_controller:094]: Modbus error function code: 0x3 exception: 3
[19:51:24][E][modbus_controller:098]: Modbus error - last command: function code=0x3 register address = 0x0 registers count=1 payload size=0
[19:51:24][D][uart_debug:114]: <<< 01:83:03:01:31
[19:51:26][D][uart_debug:114]: >>> 01:03:40:21
[19:51:26][D][modbus:147]: Modbus error function code: 0x83 exception: 3
[19:51:26][E][modbus_controller:094]: Modbus error function code: 0x3 exception: 3
[19:51:26][E][modbus_controller:098]: Modbus error - last command: function code=0x3 register address = 0x0 registers count=1 payload size=0
[19:51:26][D][uart_debug:114]: <<< 01:83:03:01:31
[19:51:28][D][uart_debug:114]: >>> 01:03:40:21
[19:51:28][D][modbus:147]: Modbus error function code: 0x83 exception: 3
[19:51:28][E][modbus_controller:094]: Modbus error function code: 0x3 exception: 3
If I decode the TTL UART signal with my oscilloscope, it sends 01 03 60 21 on the Tx line. This is completely not what it should look like.
So how should the esphome config look like to send the command like this:
RS485 address (1 Byte) Function Code (1 Byte) Register address (2 Byte) Read number (2 Byte) CRC16 (2 Byte)
Module Modbus Manual: https://downloads.primat.ch/manuals/PTDNC04%20PT1000%204CH%20Modbus%20Wide%20Range%20Temperature%20Sensor%20Collector%20RS485/PTDNC04%20Manual/PTDNC04%20Modbus%20Rtu%20Command.pdf
Thank you very much for any help to get this working.