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

Neuerdings Fehlermeldung #70

Open
rucksman opened this issue Mar 16, 2022 · 6 comments · May be fixed by #77
Open

Neuerdings Fehlermeldung #70

rucksman opened this issue Mar 16, 2022 · 6 comments · May be fixed by #77

Comments

@rucksman
Copy link

Ich benutze SMA-EM schon eine ganze Zeit (in einem Docker Container). Neuerdings bekomme ich eine Fehlermeldung, auch nach einer kompletter Neuinstallation, wenn ich /opt/smaemd/sma-em-measurement.py mache:

unknown datatype: measurement 9217 datatype unknown raw_type 43
unknown datatype: measurement 0 datatype unknown raw_type 0
unknown datatype: measurement 65023 datatype unknown raw_type 7
unknown datatype: measurement 0 datatype unknown raw_type 93
unknown datatype: measurement 0 datatype unknown raw_type 0


SMA-EM Serial:2013313958
----sum----
Traceback (most recent call last):
  File "./sma-em-measurement.py", line 84, in <module>
    print ('P: consume:{}W {}kWh supply:{}W {}kWh'.format(emparts['pconsume'],emparts['pconsumecounter'],emparts['psupply'],emparts['psupplycounter']))
KeyError: 'pconsume'

Die Serial ist nicht die, die ich in der config eingetragen habe. Ich habe die config komplett aus dem Repository übernommen und nur die korrekte Serial eingefügt.

Eine ähnliche Fehlermeldung kommt nach /opt/smaemd/sma-em-capture-package.py:

unknown datatype: measurement 9217 datatype unknown raw_type 43
unknown datatype: measurement 0 datatype unknown raw_type 0
unknown datatype: measurement 65023 datatype unknown raw_type 7
unknown datatype: measurement 0 datatype unknown raw_type 209
unknown datatype: measurement 0 datatype unknown raw_type 0
----raw-output---
b'SMA\x00\x00\x04\x02\xa0\x00\x00\x00\x01\x00.\x00\x10`e\x0b\xd0x\x00\xbb\xa6\xa8\xc0\x00\x01$\x01+\xe03r\x00\x01\x00\x00\x00\x00\xdc\x80\r\x04\xfd\xff\x07\x00\x00\x00\x84\x03\x00\x00\xd162b\x00\x00\x00\x00\x00\x00\x00\x00'
----asci-output---
b'534d4100000402a000000001002e001060650bd07800bba6a8c0000124012be03372000100000000dc800d04fdff0700000084030000d13632620000000000000000'
----all-found-values---
serial: value:2013313958

@datenschuft
Copy link
Owner

Hallo rucksman; hast du vielleicht noch andere SMA-Geräte in deinem Netz hängen (mit der Seriennummer 2013313958)
#66
vermutlich ist das Problem hiermit behoben.
Dein Datenstrom beginnt auch mit 534d4100000402a000000001002; Das dürften auch Speedwire device discovery Pakete sein

@rucksman
Copy link
Author

Ich habe ja die aktuelle Version von SMA-EM verwendet, da ist der PR ja schon integriert. Ich habe zwar noch andere SMA Geräte (Wechselrichter, Home Manager 1.0), aber die haben alle nicht diese Seriennummer.

@rucksman
Copy link
Author

Neues Problem: Es kommen nur in großen Abständen Daten. Dazwischen werden keine Daten gesendet. Der EM ist aber per
ping erreichbar, auch die Web-Oberfläche lässt sich aufrufen. Der Wechselrichter ist auch pingbar. Mache ich in der Zeit ein sma-em-capture-package.py, dann passsiert erst einmal minutenlang gar nichts, irgendwann kommt dann eine Ausgabe, dann erhalte ich auch über MQTT wieder Daten. Das geht dann ganz kurze Zeit gut, bis wieder minutenlang keine Daten mehr kommen. Gibt es da einen Trick, wie ich dem Problem auf die Schliche kommen kann? Die Pakete kommen ja an, aber eben nicht zuverlässig und immer nur ganz kurz, ehe es wieder viele Minuten keine Daten gibt.

@ano302
Copy link

ano302 commented Apr 6, 2022

I tried to set this up on my new PV installation with HM2 and an SMA Tripower 15.
I got a similar behavior like rucksman. It seems 2 different devices are broadcasting.
HM2 Serial: 3011XXXXXX
unk Serials: 2013XXXXXX
STP 15 Serials: 19XXXXXXXX
With a try: except: block, I get a 50/50 chance to hit the correct device.
BTW, what is the correct value for "ipbind". If I enter the HM2 ip address, I get:
"could not connect to mulicast group or bind to given interface"

@ano302
Copy link

ano302 commented Apr 6, 2022

Okay, found a "fix".
I got datalength of 54, 74 and 606. So in decode_speedwire() I use:
if datalength > 74:
instead of
if datalength >= 54:

I also added a while not in sma-em-measurement.py

  emparts = {}
  while not emparts:
    emparts=decode_speedwire(sock.recv(608))

Lets see what will come out of that.

@uclara
Copy link

uclara commented Oct 1, 2022

Tanks @ano302 for the hint.

I got also this kind of crash, regularly in less than a minute:

Traceback (most recent call last):
  File "/opt/smaemd/SMA-EM/sma-em-measurement.py", line 82, in <module>
    print ('SMA-EM Serial:{}'.format(emparts['serial']))
KeyError: 'serial'

After adding the line "while not emparts:" the capturing works without crashing :-)

I'm using Sunny Home Manager 2.0 with the Firmware version "2.9.2.R|020902"

Ulli

@mslacken mslacken linked a pull request Oct 24, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

4 participants