-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
MQTT-Explorer 0.4.0-beta4 SparkplugB decode some strings as "{}" #792
Comments
5-character strings starting with "5" are what I noticed. So "50000" or "50.00" but not "5000" |
True, did some more tests and all the strings that you mentioned turned into {} in MQTT-Explorer. I can't count 😞 |
@thomasnordquist this is a release stopper i guess, sparkplugb decoding "detection" seems to be flaky.. The decoder choice logic is pretty naive at the moment it seems, it simply tries to decode the payload as sparkplug and if the result is MQTT-Explorer/backend/src/index.ts Line 52 in 65b86ac
A naive solution might be, to add a check to see if
|
Tried to run some more tests, here's what i found: |
Thank you, I consider this rather critical. I believe currently we run a decoder chain which is kind of broken tryToDecodeAsJson |
Would be awesome to prepare for image support to while we are at it. |
As someone that has knowledge about Sparkplug but not about JS/TS, I would suggest to inspect the topic structure to detemine if the message is sparkplugb. In my opinion, relying only on the message payload is a bad idea. The sparkplug specifikation can be found here: https://www.eclipse.org/tahu/spec/sparkplug_spec.pdf. The chapter 4.1 is describing the topic structure:
The namespace element must be |
I think @jst-mbs has a pretty good point. |
You are right: The state messages of the 'Host application' is JSON encoded, see chapter '4.2 Sparkplug Host Application'. |
Sidenote, there is a package sparkplug-payload that can do decoding/encoding. Might be worth looking into instead of rolling own protobuf decoding. |
@tobehn @jst-mbs have a look at #793, Will |
Just for the record, in our application we use custom protobuf messages and the wrongly decoded messages we are seeing are not empty but with random invalid data, as shown below. Hope @jst-mbs proposal and @bj00rn implementation fixes this issue, thanks! Payload 26 bytes Payload 36 bytes |
Thanks, there is clearly a bug with sparkplug decoding. Hopefully we'll get a new beta sorted soon that you can try. |
In the latest release of MQTT-Explorer, some payloads seem to be decoded by SparkplugB when they're not meant to be.
This results in some topics to display "{}" instead of the actual payload.
@kc2zgu mentionned here that some strings (like
5000
) are detected as SparkplugB payloads. I can't reproduce this in my application, but the string "empty" gets decoded by SparkplugB, and rendered as {} in MQTT-Explorer. Turns out that strings of length 5 starting with "e" are decoded wrongly, based on a few manual tests.The text was updated successfully, but these errors were encountered: