Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AIO connection rs485 modbus temperature humididty sensor
#1
Photo 
Hi! I have a problem with connect   CWT-TH03S Series RS485 temperature humidity sensor  to my   AIO board.    
This is my esphome code :

uart:
  id: mod_bus
  tx_pin: 33
  rx_pin: 32
  baud_rate: 9600
  stop_bits: 1
  parity: EVEN

 
modbus:
  id: modbus1
  uart_id: mod_bus
  send_wait_time: 200ms


modbus_controller:
  - id: temp_hum_meter
    modbus_id: modbus1
    address: 0x03
    update_interval: 5s


sensor:
  - platform: modbus_controller
    modbus_controller_id: temp_hum_meter
    name: "Temperature"
    id: modbus_temperature
    register_type: holding
    address: 0x00
    unit_of_measurement: "%rh"
    value_type: FP32
    accuracy_decimals: 1    
  - platform: modbus_controller
    modbus_controller_id: temp_hum_meter
    name: "Humifdity"
    id: modbus_humidity
    register_type: holding
    address: 0x01
    unit_of_measurement: "℃"
    value_type: FP32
    accuracy_decimals: 1


And in log file i have this errors

[W][modbus_controller:136]: Duplicate modbus command found: type=0x3 address=1 count=2
[20:30:21][D][modbus_controller:043]: Modbus command to device=3 register=0x01 countdown=0 no response received - removed from send queue

What i doing wrong? Please help.  

RS485 comunication parameters

20:2


Attached Files Image(s)
   
Reply
#2
do you want AIO work as "MASTER", your sensor work as "SLAVE"?
Reply
#3
(02-14-2024, 01:12 AM)admin Wrote: do you want AIO work as "MASTER", your sensor work as "SLAVE"?

Yes AIO board - MASTER   Sensor - SLAVE

Previously, I changed the baud rate, which was by default 4800, to 9600. I also changed the default SLAVE address , which was by default 1 to 3. Therefore, I wrote these parameters in the code.
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)