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

SlimmeLezer+ with HDLC stops working #76

Open
morotsgurka opened this issue Jul 5, 2023 · 1 comment
Open

SlimmeLezer+ with HDLC stops working #76

morotsgurka opened this issue Jul 5, 2023 · 1 comment

Comments

@morotsgurka
Copy link

morotsgurka commented Jul 5, 2023

Hi!

Recently purchased a SlimmeLezer+ v1.2 for my Aidon 6534 electricity meter.
Using the sample config for the slimmelezer works. But when changing the meter_sensor from P1Reader to P1ReaderHDLC it stops working. I cant open the web portal, upload ota or connect using Home Assistant. Re-flashing using ESPHome flasher without HDLC makes everything work again.

Compiled using latest ESPHome v2023.6.3, I've also tried to pin the container to the lastest working according to the readme (2022.12.1) but still the same issue.

When compiling with HDLC enabled i also get this warning:

In file included from src/main.cpp:65:
src/p1reader.h: In member function 'bool P1ReaderHDLC::readHDLCStruct(ParsedMessage*)':
src/p1reader.h:364:21: warning: '.' directive writing 1 byte into a region of size between 0 and 4 [-Wformat-overflow=]
  364 |       sprintf(obis, "%d.%d.%d", buffer[2], buffer[3], buffer[4]);
      |                     ^~~~~~~~~~
src/p1reader.h:364:21: note: directive argument in the range [0, 255]
src/p1reader.h:364:14: note: 'sprintf' output between 6 and 12 bytes into a destination of size 7
  364 |       sprintf(obis, "%d.%d.%d", buffer[2], buffer[3], buffer[4]);
      |       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

but it still compiles successfully. But after uploaded the sensor stops responding. My simple guess from some googling is that it might be causing some buffer overflow? Changing line 346 from char obis[8]; to char obis[12]; does remove the warning but the device still does not respond... so i might just caused other issues, or i am looking in the wrong spot.

@morotsgurka morotsgurka changed the title SlimmeLezer+ with HDLC stopps working SlimmeLezer+ with HDLC stops working Jul 5, 2023
@morotsgurka
Copy link
Author

UPDATE. It works... but with some modification.
I first found this post after posting my initial issue. He seemed to have the same issue as me:

It flashes OK but the SL+ never starts afterwards.

So i followed his steps using forsbers fork. I then used his yaml config that he posted in his thread.
The differences being that i did all of this in ESPHome docker container running v2023.6.3. This gave me compile issues from forsbers p1reader.h but after implementing the changes that MrGlad8 wrote in issue #44 everything works. Adopted into Home Assistant and i am getting readings from the meter now.

So. Something is not working correctly in the current main branch to support Aidon meters on Slimmelezer+ v1.2. But the changes that were suggested in issue #44 seems to be implemented in the current main branch from what i can see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant