Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ESPHome Modbus config for KC868-A6
#1
Is this the correct ESPHome configuration for RS-485 Modbus on KC-868 A6?

Code:
uart:
  id: mbus
  tx_pin: GPIO12
  rx_pin: GPIO13
  baud_rate: 9600

modbus:
  id: modbus1
  uart_id: mbus
  send_wait_time: 500ms

modbus_controller:
- id: wp3082adam1
  address: 1
  modbus_id: modbus1
  update_interval: 5s

I'm trying to use this with WellPro WP3082ADAM:

Code:
text_sensor:
- name: "analoginputs"
  platform: modbus_controller
  modbus_controller_id: wp3082adam1
  id: test
  # internal: true
  register_type: holding
  address: 0x0000
  register_count: 8
  raw_encode: HEXBYTES
  response_size: 10

This is sending correct command to the wp3082adam, but ESPHome it never receives a response:
Code:
Modbus command to device=1 register=0x00 no response received - removed from send queue

The frustrating this is I can see the holding register request from the A6 and the response from the WP3082ADAM when monitoring the wire, everything seems to be working perfectly, but A6 can't "hear" the modbus response.

sent from A6:
{01}{03}{00}{00}{00}{08}{44}{0C}
response from wp3082adam:
{01}{03}{10}{00}{00}{00}{00}{00}{00}{00}{00}{03}{34}{00}{00}{00}{00}{00}{00}{D1}{8F}

I would appreciate any suggestions
Reply
#2
sorry, i don't know the "WP3082ADAM". maybe you can use USB-RS485 adapter to test firstly. when you send command manually and check whether have feedback. if OK, then test with ESPHome.
Reply
#3
(10-05-2024, 12:45 AM)admin Wrote: sorry, i don't know the "WP3082ADAM". maybe you can use USB-RS485 adapter to test firstly. when you send command manually and check whether have feedback. if OK, then test with ESPHome.

Yes have already done this - sending the same command and seeing the same response:

[Image: 98O6odA.png]

Just having issues getting ESPHome to hear the response.  Can you confirm if I have the correct GPIO pin assignment for RS-485 on the KC868-A6?

uart:
  id: mbus
  tx_pin: GPIO12
  rx_pin: GPIO13
  baud_rate: 9600

I couldn't find this information for A6 anywhere and referred to the schematic.
Reply
#4
(10-05-2024, 12:45 AM)admin Wrote: sorry, i don't know the "WP3082ADAM". maybe you can use USB-RS485 adapter to test firstly. when you send command manually and check whether have feedback. if OK, then test with ESPHome.

Hey I just realised I was reading the schematic incorrectly.

The correct GPIO pins for RS485 on A6 are described here: 
https://devices.esphome.io/devices/KinCony-KC868-A6

In case this is helpful for anyone else, I now have RS485 working on A6 using following ESPHome config:

Code:
uart:
  - id: rs485
    tx_pin: GPIO27
    rx_pin: GPIO14
    baud_rate: 9600
  - id: rs232
    tx_pin: GPIO17
    rx_pin: GPIO16
    baud_rate: 9600

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

modbus_controller:
- id: wp3082adam1
  address: 1
  modbus_id: modbus1
  update_interval: 2s

Now receiving data correctly in ESPHome:
[14:15:20][D][text_sensor:064]: 'analoginputs': Sending state '00000000000000000334'
Reply
#5
ok, good.
Reply


Forum Jump:


Users browsing this thread: