Debug Error in NODE RED

Hello. I am getting the following error while using NODE RED.
image

Could someone please help me fix this error? Thank you. I do not know what this error means or it refers to.

Without sharing more information, nobody will be able to help you. Can you share your flow?

Just above the "msg: string" is normally a timestamp and the name of the node where it's coming from.
You can click on it, and it will highlight the node.

I cannot share my flow. I am trying to understand what possible situations could lead to that error.

Is this another sparkplug related question in the sequence of posts you have started recently?

These are all different. Why are you keeping tabs on my posts? I am allowed to make my posts. I do not want this scrutiny unless you have a solution to help me. Please stop discouraging me.

Should I not get help when in doubt? No I cannot share my flows with you.

Hi @sn19

The error message by itself is not enough for us to help you. It isn't a message I recognise from any core Node-RED node, so must be coming from an extra node you have installed.

@Hopperpop gave same great advice on how to identify which node is logging that error. If you can do that, and tell us which node is logging it, that will provide the missing context for your question.

I think the reason for @Colin's question was not to discourage you, but to try to piece together missing information from your question.

Your previous thread was a decoding error related to sparkplug.

Here you have started a new thread with another 'decode error' but no information about what nodes you are using. So is this also related to sparkplug?

If you want to keep each thread limited to its own issue, you need to provide enough information for us to understand what you are trying to do and not rely on us having read your other threads to get the fuller picture.

1 Like

Thank you @knolleary. Let me start again. I am trying to use a publisher a subscriber and a broker. I am trying to publish the following using mosquitto broker as a publisher and I expect to see the payload on the NODE RED sparkplug plus block as a subscriber.

The payload I am trying to send is

mosquitto_pub -h localhost -t spBv1.0/group1/DDATA/edge1/device1114 -p 1884 -m "{"value1":21,"value2":41}" -d

The flow I am using is simple. It only has a subscriber and a debug.

[
    {
        "id": "4685033d02e41bc7",
        "type": "debug",
        "z": "a26f2daa396eeb3a",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 850,
        "y": 780,
        "wires": []
    },
    {
        "id": "07eed719079e4a7d",
        "type": "mqtt sparkplug in",
        "z": "a26f2daa396eeb3a",
        "name": "spBv1.0/group1/DDATA/edge1/device1114",
        "topic": "spBv1.0/group1/DDATA/edge1/device1114",
        "qos": "2",
        "broker": "0918b46c7512b67a",
        "x": 490,
        "y": 780,
        "wires": [
            [
                "4685033d02e41bc7"
            ]
        ]
    },
    {
        "id": "0918b46c7512b67a",
        "type": "mqtt-sparkplug-broker",
        "name": "",
        "deviceGroup": "test11",
        "eonName": "test11",
        "broker": "192.168.2.115",
        "port": "1883",
        "tls": "3ea4da78.8b7bb6",
        "clientid": "Test1",
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "enableStoreForward": false,
        "primaryScada": ""
    },
    {
        "id": "3ea4da78.8b7bb6",
        "type": "tls-config",
        "name": "",
        "cert": "",
        "key": "",
        "ca": "",
        "certname": "server.crt",
        "keyname": "server.key",
        "caname": "ca.crt",
        "servername": "192.168.2.101",
        "verifyservercert": false,
        "alpnprotocol": ""
    }
]

The error message as shown on the debug pane is here
image

you would need to escape all the quotes inside the -m outer quotes.
e.g.

mosquitto_pub -h localhost -t spBv1.0/group1/DDATA/edge1/device1114 -p 1884 -m "{\"value1\":21,\"value2\":41}" -d
1 Like

This is the kind of info needed up front to avoid all this.

Anyhow, I suspect you need to escape the quotes ...

mosquitto_pub -h localhost -t test -m "{\"value1\":20,\"value2\":40}"
1 Like

From the node documentation:

mqtt sparkplug in:
The mqtt sparkplug in node makes it possible to subscribe to sparkplug b mqtt topics. The node is almost identical to the default node-red mqtt in node, but it will decode the sparkplug/protobuf messages and deliver them in json.

If you play around with the examples shipped with the sparkplug node (Menu>Import>Examples), you quickly see that the nodes expects encoded data and not a json object.

If you want to know how to encode messages yourself, you can find the specifications here: https://www.eclipse.org/tahu/spec/Sparkplug%20Topic%20Namespace%20and%20State%20ManagementV2.2-with%20appendix%20B%20format%20-%20Eclipse.pdf

If you only want to test if your flow works, use the mqtt-sparkplug-out node to send encoded messages to your input node.

Edit:
Additional you can use a normal mqtt-in node on the same topic to see the encoded messages that the sparkplug node is expecting.

2 Likes

That is not the same error you showed at the start, and is, in fact, the error that you posted in one of your other threads. This is even though you posted earlier that the reason you had started this thread was because you have a new, unrelated, problem.

@Colin if you're confused about my posts, do not reply. Please stop scamming my posts with unwanted unsolicited replies. Keep the replies limited to the post. You've never really provided a solution for any of my post other than recollecting my previous posts and these posts are defeating the purpose of this forum. I am here to learn. I am a beginner. If I got a doubt , I will make a post. I repeat, do not reply unless it is a solution. With the explanation I've provided in my own terms based on my three weeks of experience with NODE RED, I've got others helping me as seen above.

@sn19, fyi @Colin is a moderator on this forum & it is a moderator job to moderate posts. One of the tasks moderators do is keep the forum tidy & so discourage users from creating multiple posts as it causes confusion. Please don't take offence.

I just do not know on what's happening with the NODE RED. Like I've said I am only three weeks in with NODE RED and I honestly do not know things but I want to learn. He could be a moderator and I respect that but "Is this another sparkplug related question in the sequence of posts you have started recently?" This does not sound professional. @knolleary made a post in much better terms. It made me understand certain things around here. This is very helpful rather than just referring my previous posts and keeping a count of them. This forum is all the help I could get regarding NODE RED and I am trying my best. I do not know what the errors refer to or how they got in there. But yes, thank you @Steve-Mcl

I'm fairly certain the answer provided by @Hopperpop is the issue.

In an attempt to clarify...

A protobuf is a binary format created by Google to serialize data between different services.

In other words, sending JSON via MQTT from mosquito_pub is likely the problem.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.