Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ESPHome modbus not functional
#1
Hello, we recently bought and set up the KC868-A8S with a Midea heat pump. ESPHome was used to set up the switches, binary sensors and modbus. The first two work as intended, while the modbus seemingly not being able to read or send requests properly.

Here is the chunk of the code that relates to and might influence the modbus and one of the sensors:
Code:
esphome:
  name: centralina-freddo
  friendly_name: Centralina freddo

esp32:
  variant: ESP32
  flash_size: 4MB
  board: esp32dev

logger:

api:
  encryption:
    key: [cencored for privacy]

ota:
  - platform: esphome
    password: [cencored for privacy]

i2c:
  - id: bus_a
    sda: GPIO4
    scl: GPIO5
    scan: true

ethernet:
  type: LAN8720
  clk:
    pin: GPIO17
    mode: CLK_OUT
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  phy_addr: 0

uart:
  - id: uart_1
    tx_pin: GPIO33
    rx_pin: GPIO32
    baud_rate: 9600
    stop_bits: 1
    parity: NONE
    data_bits: 8
    rx_full_threshold: 8B
    debug:
      direction: BOTH

modbus:
  - id: modbus_1
    uart_id: uart_1
    role: client

modbus_controller:
  - id: modbus_controller_1
    address: 0x01
    modbus_id: modbus_1
    setup_priority: -10
    update_interval: 15s
   

sensor:
  - platform: modbus_controller
    name: "Temp. Esterna (PdC)"
    id: pdc_esterna_TP
    modbus_controller_id: modbus_controller_1
    address: 107
    register_type: holding
    unit_of_measurement: °C
    device_class: temperature
    state_class: measurement
    value_type: S_WORD
    accuracy_decimals: 1

Attempted fixes (that did not work):
  • phisically inverting the A and B connections
  • changing the modbus controller adress
  • changing the sensor adress to hexadecimal
  • changing the register type
  • changing the value type
  • adding accuracy decimals
  • changing th esp variant from inf to dev
  • changing the api to be more generic
  • inverting the tx and rx pins
  • changing the parity to even and odd
  • changing the amount of data bits
  • changing the amount of rx_full_threshold
  • removing the client role
  • removing the uart id
  • changing the update interval
  • decreasing the turnaround time to 50ms

At the moment, with this code, the log output repeats these lines:
Quote:[19:49:26.943][W][modbus:1214]: Clearing buffer of 21 bytes - timeout after partial response 1188899ms after last send
[19:49:26.954][D][uart_debug:113]: <<< 7E:66:66:00:66:F8:FE:18:E6:FE:E6:F8:FE:FE:E6:06:FE:E6:F8:FE:FE
Quote:[19:50:11.845][D][modbus:1118]: Frame already active for 1 with 2 requests pending, refused
[19:50:11.847][D][modbus_controller:204]: Poll refused by hub for range 0x68


We are unsure of what to do, and I am out of ideas on how to fix this.
All the GPIOs are correct. They have been checked.

Any help would be appreciated,
Thank you
Reply
#2
just config esphome yaml according to sensor's protocol.
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)