Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Esphome 12.2022 & HA - MBUS: Start bytes do not match & Frame too big for received data #19

Open
flo-dl opened this issue Dec 14, 2022 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@flo-dl
Copy link

flo-dl commented Dec 14, 2022

Hey all,
the code and hardware was working great for me the last few months (thanks for that btw!) but the recent 12.2022 Esphome upgrade, which I run as a Home Assistant add-on, seems to have broken something. I have the Kaifa MA110M smart meter (IKB).

As others, I'm using a m-bus-slave-click for the connection to the smart meter. I have a DFRobot FireBeetle 2 ESP32-E IoT Microcontroller board (this one: https://www.dfrobot.com/product-2231.html) because of it's low energy consumption in deep sleep as all parts are powered by a battery.

So, I updated the Esphome add-on to 12.2022 today and also pushed the available update to the devices. After those updates were done, I now get the following two error messages in the Esphome log of my board:

[15:05:16][E][espdm:048]: MBUS: Start bytes do not match
[15:05:16][E][espdm:064]: MBUS: Frame too big for received data

My uart configuration is:

uart:
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 2400
  rx_buffer_size: 1024 # Needed to receive the large packets send by the smart meter
  id: mbus

I've tried adjusting the rx_buffer_size to 2048 and also tried other things that were mentioned in other issues (i.e. adding parity, data and stop bits) but that didn't do the trick.

So, does anybody have an idea what might have changed or how I go about debugging it?
Thanks in advance, and I hope I've provided enough information.

@DomiStyle
Copy link
Owner

I can reproduce this on 2022.12 but I'm gonna have to check what changed.

For now, 2022.11.5 works fine.

@DomiStyle DomiStyle added bug Something isn't working help wanted Extra attention is needed labels Dec 14, 2022
@theexit
Copy link
Contributor

theexit commented Dec 22, 2022

#21 added fix... is working for me!

@flo-dl
Copy link
Author

flo-dl commented Dec 22, 2022

#21 added fix... is working for me!

Thanks a lot to the both of you. It wouldn't work for me (IKB) with just adding the delay. While the "Frame too big for received data" didn't show up in the log anymore, the "Start bytes do not match" was still there. I had to change my uart config from:

uart:
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 2400
  rx_buffer_size: 1024 # Needed to receive the large packets send by the smart meter
  id: mbus

to

uart:
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 2400
  parity: EVEN
  data_bits: 8
  stop_bits: 1
  rx_buffer_size: 2048
  id: mbus

I haven't checked what actually made the difference, but the above-mentioned fix and this config change worked in my case.

@theexit
Copy link
Contributor

theexit commented Dec 23, 2022

#21 added fix... is working for me!

Thanks a lot to the both of you. It wouldn't work for me (IKB) with just adding the delay. While the "Frame too big for received data" didn't show up in the log anymore, the "Start bytes do not match" was still there. I had to change my uart config from:

uart:
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 2400
  rx_buffer_size: 1024 # Needed to receive the large packets send by the smart meter
  id: mbus

to

uart:
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 2400
  parity: EVEN
  data_bits: 8
  stop_bits: 1
  rx_buffer_size: 2048
  id: mbus

I haven't checked what actually made the difference, but the above-mentioned fix and this config change worked in my case.

That's true. You must change the rx_buffer_size to 2048.
But you can leave data_bits and stop_bits because these are the default values.
I also have no parity settings.

@hvg1 hvg1 mentioned this issue Dec 25, 2022
@flo-dl
Copy link
Author

flo-dl commented Jan 29, 2023

#21 added fix... is working for me!

Thanks a lot to the both of you. It wouldn't work for me (IKB) with just adding the delay. While the "Frame too big for received data" didn't show up in the log anymore, the "Start bytes do not match" was still there. I had to change my uart config from:

uart:
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 2400
  rx_buffer_size: 1024 # Needed to receive the large packets send by the smart meter
  id: mbus

to

uart:
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 2400
  parity: EVEN
  data_bits: 8
  stop_bits: 1
  rx_buffer_size: 2048
  id: mbus

I haven't checked what actually made the difference, but the above-mentioned fix and this config change worked in my case.

That's true. You must change the rx_buffer_size to 2048. But you can leave data_bits and stop_bits because these are the default values. I also have no parity settings.

Thanks! I've tried removing them one by one but it wouldn't work without the parity: EVEN setting enabled, at least in my case. It would still error out with Start bytes do not match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants