I'm having an issue with the MQTT node in Node-RED. I'm not getting all of the data that I'm getting in a MQTT client application, so the data I'm receiving is incomplete. I'm wondering if anyone else has experienced this issue and how they might have resolved it?
I'm using the same broker and credentials in both the MQTT client and the Node-RED MQTT node, so I'm not sure why I'm getting different amounts of data.
You will need to expand on that. How have you looked for it being incomplete? How big is the data and how is it structured? Do you mean that subscribed topics aren't being received or is it a large topic value?
Okay, so we have an end that is listening onqtt messages, formats it for an influx db, and pushes to it. There is a lot of data coming in, so we are using a switch node to differentiate the type of message before formating and sending to an influx db.
In the switch node (i also have an option othervise(as last one) which saves payload and topic in a local file (for debugging) . I also added a catch node to save all errors to file).
So there is absolutely no way thos error is on the node red part.
We used mqtt explorer and noticed topics that we don't have saved in the database, around 15, out of ~100
Add directly to the MQTT-IN output port, a debug with the count option set or install a counter node.
Do the same for all outputs of the SWITCH and anywhere else in your flow - do the counts match what you see in MQTT Explorer?
What is more likely is a bug in your flow or an issue with something like the Influx node where 1 or more messages are dropped or not processed due to content.
Also, what QoS level are you using to subscribe in Node-RED and in MQTT Explorer?
Figured out where is was wrong.
Had a system in place to delete any payload that wasn't containing any numbers, thanks @Steve-Mcl to supply a good debug tutorial