micw / tibber-pulse-reader

A tool to read data directly from tibber pulse and publish it locally
43 stars 7 forks source link

Unable to parse SML from response #22

Closed windaishi closed 10 months ago

windaishi commented 10 months ago

Hello,

i get the following error:

2023-10-26 22:29:58.250  INFO 1 --- [           main] de.wyraz.tibberpulse.TibberPulseReader   : Starting TibberPulseReader v1.0.0-SNAPSHOT using Java 17.0.2 on 7a8e40dfcc58 with PID 1 (/tibber-pulse-reader.jar started by root in /)
2023-10-26 22:29:58.251 DEBUG 1 --- [           main] de.wyraz.tibberpulse.TibberPulseReader   : Running with Spring Boot v2.5.14, Spring v5.3.20
2023-10-26 22:29:58.251  INFO 1 --- [           main] de.wyraz.tibberpulse.TibberPulseReader   : No active profile set, falling back to 1 default profile: "default"
2023-10-26 22:29:58.688  INFO 1 --- [           main] de.wyraz.tibberpulse.TibberPulseReader   : Started TibberPulseReader in 0.674 seconds (JVM running for 0.894)
2023-10-26 22:29:58.834 DEBUG 1 --- [           main] de.wyraz.tibberpulse.sml.SMLDecoder      : Parsing SML: 1b1b1b1b01010101760484788603620062007263010176010102310b0a01445a470002b3c4747262006501467252620242cfa500760585788703420062007263070177010a0a01445a470003b3c474070100620affff72420165014772527477070100603200010172420162006200520004445a470077060100400100ff017262014200620052000a0a01445a470003b2c4740077070000010800ff641c01047262016200621e52ff440121f6a00176070100100700ff017262016200621b52fe5400a4b8000101633e140076058678870342006200726302017101630ae3001b1b1b1b1a005952
2023-10-26 22:29:58.836  WARN 1 --- [           main] d.w.t.source.TibberPulseHttpReader       : Unable to parse SML from response

java.io.IOException: Invalid SML payload: wrong crc
    at de.wyraz.tibberpulse.sml.SMLDecoder.extractMessage(SMLDecoder.java:281) ~[classes!/:1.0.0-SNAPSHOT]
    at de.wyraz.tibberpulse.sml.SMLDecoder.decode(SMLDecoder.java:51) ~[classes!/:1.0.0-SNAPSHOT]
    at de.wyraz.tibberpulse.source.TibberPulseHttpReader.fetch(TibberPulseHttpReader.java:92) ~[classes!/:1.0.0-SNAPSHOT]
    at de.wyraz.tibberpulse.source.TibberPulseHttpReader.run(TibberPulseHttpReader.java:51) ~[classes!/:1.0.0-SNAPSHOT]
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:817) ~[spring-boot-2.5.14.jar!/:2.5.14]
    at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:801) ~[spring-boot-2.5.14.jar!/:2.5.14]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:350) ~[spring-boot-2.5.14.jar!/:2.5.14]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1370) ~[spring-boot-2.5.14.jar!/:2.5.14]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1359) ~[spring-boot-2.5.14.jar!/:2.5.14]
    at de.wyraz.tibberpulse.TibberPulseReader.main(TibberPulseReader.java:18) ~[classes!/:1.0.0-SNAPSHOT]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[tibber-pulse-reader.jar:1.0.0-SNAPSHOT]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[tibber-pulse-reader.jar:1.0.0-SNAPSHOT]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[tibber-pulse-reader.jar:1.0.0-SNAPSHOT]
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[tibber-pulse-reader.jar:1.0.0-SNAPSHOT]

I already disabled CRC checks via IGNORE_SML_CRC_ERRORS: true

Can you tell me whats wrong?

micw commented 10 months ago

Just saw that IGNORE_SML_CRC_ERRORS has no effect anymore since I have re-implemented the SML parser. Anyway, the CRC is in the envelope (1b1b1b1...1b1b1b1). This is still the old code and the CRC there had never been an issue and was never affected by IGNORE_SML_CRC_ERRORS.

Do you always get this error or only for some messages?

windaishi commented 10 months ago

Thank you for your reply.

Do you always get this error or only for some messages?

I get this error for every message.

micw commented 10 months ago

And does you data properly show up on tibber?

windaishi commented 10 months ago

And does you data properly show up on tibber?

Actually this is what I try to debug with your tool. They don't. But they used to work properly until some days ago.

micw commented 10 months ago

Seems there are reading issues from your meter. What happens when you re-position the reading head?

micw commented 10 months ago

BTW we can switch to german if you like ^^

windaishi commented 10 months ago

BTW we can switch to german if you like ^^

Thank you for your offer. I would prefer to continue our discussion in English so that more individuals facing the same issue can benefit from the conversation.

Anyway, moving the meter actually helped this time. I tried this like a hundred times before, I even did reset the bridge. It appears that the app is currently experiencing issues with displaying real-time consumption data, which is why I've been unable fix the issue with moving the meter. With your tool I got an instant response after moving the meter and could find the optimal position for the meter. This helped a lot. Thank you.

I still get CRC errors from time to time but this does not impact the functionality. Only if the first reading is a CRC error the app crashes. Other CRC errors are just skipped.

I close here as my problem has been solved.