-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
Data must be manually cleared between parse runs #17
Comments
Can you post your sketch? I suspect you're putting the parsed message in a global variable perhaps, so its contents are not cleared between runs (I'm not actually sure if there's a way to clear a parsed message right now, haven't checked the code). |
Thanks for your reply. The sketch is esp8266_p1_thingspeak.ino from my arduino repository. The "MyData data" object/structure(?) is indeed global, which I could change. It would be nice if your dsmr library would have a method to clear it, but feel free to close this issue if you are not planning to implement it. |
I had a closer look at the code now, and I think the default constructors are available. I believe this means you should be able to write:
to construct a new data object and assign it. You might even do:
to call the default constructor without having to name the type, but I'm not sure if that's valid syntax. That would probably solve your problem for now. I do wonder if this should perhaps happen automatically whenever |
…an#17) * Addition OBIS values used in Lithuania smart meeters. * Fixed error's * Add more fealds for active-apparent-reactive eneergy import/export
My ISKRA AM550 sends messages like this according to Serial.println(reader.raw())
The first telegram is parsed correctly like this
The subsequent telegrams result in "Duplicate field" parse errors pointing to the very first ISK5\2M550E-1012 line. To work around this problem I commended out line 114 and 115 in parser.h. After that the parsing works (most of the times, sometimes there is some obvious junk in the message). However, I see that the identification field is growing in subsequent telegrams like this:
The same happens for
I suspect that this is might be the underlying cause of the "Duplicate field" parse errors, since it seems that the previous values are not cleared.
My C++ template skills are not good enough to figure out why this would happen. Right now my workaround is to ignore the parse errors by keeping line 114 and 155 commented out and by not including identification and electricity_failure_log in the ParsedData template.
The text was updated successfully, but these errors were encountered: