esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
294 stars 37 forks source link

SDM120M - CRC Errors on 22.12.1 #3939

Closed Ralphy140 closed 1 month ago

Ralphy140 commented 1 year ago

The problem

Connecting to SDM120M using RS485 to UART adaptor is generating CRC errors and not populating sensors. single Modbus quey works fine so know i can comminicate with the modbus on the device correctly. Device works IF logger verbose is enabled. It seems that the code is processing the modbus data stream before all data has been received. Attached debug logs attached logs_modbus-power_upload.txt

message (1).txt

Which version of ESPHome has the issue?

2022.12.1

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

No response

What platform are you using?

ESP32

Board

No response

Component causing the issue

No response

Example YAML snippet

uart:
  rx_pin: GPIO016
  tx_pin: GPIO017
  baud_rate: 9600 #if your energy meter is SDM230M or SDM120M than change the baud_rate: 2400
  stop_bits: 1
  debug:

sensor:
  - platform: sdm_meter
    phase_a:
      current:
        name: "SDM120M Current"
      voltage:
        name: "SDM120M Voltage"
      active_power:
        name: "SDM120M Power"
      power_factor:
        name: "SDM120M Power Factor"
      apparent_power:
        name: "SDM120M Apparent Power"
      reactive_power:
        name: "SDM120M Reactive Power"
      phase_angle:
        name: "SDM120M Phase Angle"
    frequency:
      name: "SDM120M Frequency"
    total_power:
      name: "SDM120M Total Power"
    import_active_energy:
      name: "SDM120M Import Active Energy"
    export_active_energy:
      name: "SDM120M Export Active Energy"
    import_reactive_energy:
      name: "SDM120M Import Reactive Energy"
    export_reactive_energy:
      name: "SDM120M Export Reactive Energy"
    update_interval: 10s

Anything in the logs that might be useful for us?

No response

Additional information

No response

probot-esphome[bot] commented 1 year ago

Hey there @jesserockz, @polyfaces, mind taking a look at this issue as it has been labeled with an integration (sdm_meter) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

karllinder commented 1 year ago

Same issue with SDM630, downgrade to 22.10.2 solved the issue temporarily.

janneman001 commented 1 year ago

Possibly duplicate of: https://github.com/esphome/issues/issues/3912

janneman001 commented 1 year ago

btw about the yaml snippet above. The sdm120m has to operate with 2400 baud.

saschaludwig commented 1 year ago

Looks like a timing related issue. I also have the same problems.

Maybe related to this: https://github.com/esphome/issues/issues/3909

Ralphy140 commented 1 year ago

btw about the yaml snippet above. The sdm120m has to operate with 2400 baud.

I have set the SDM120 to 9600 as well and it works just fine with a workaround of running verbose on the logger so its 100% no that casing this issue

karllinder commented 1 year ago

see my post at https://github.com/esphome/issues/issues/3912#issuecomment-1434480862 for the latest test with 2023.2

karllinder commented 1 year ago

@jesserockz Sorry to ping you. Still the same issue with 2023.4.2 14:32:36][W][modbus:108]: Modbus CRC Check failed! C071!=C100 [14:32:36][W][modbus:108]: Modbus CRC Check failed! D213!=433B