Also try sending the topic and string that you are trying to send, using mosquitto_sub and see if it works.
sending directly with Moquitto works fine. But as i get the inputs from Modbus in Node-Red, i want to publish from there.
as i understood, i have to have Mosquitto installed locally in any case ?
If thats true, how do i publish to Thingsboard via local Moquitto ?
@claib I understand you want to publish from Node-RED - that is why we're trying to help. You don't need to have mosquitto installed locally unless you want to use it.
To continue trying to debug this, can you share the contents of telemetry-data.json
so we can see exactly what format it is in?
Hello
so many thanks for all your help debugging me !
That's what mosquito sends ( with success ) ( telemetry-data.json )
{"temperature":27, "humidity":55.0, "active": false}
So the file contains:
{"temperature":27, "humidity":55.0, "active": false}
when it works.
You are trying to publish
[1403]
and it doesn't work.
the problem is, that the TB Broker waits super formed strings. otherwis he drops.
How can i transform / format my message that it fits the format ?
What does [1403]
represent?
In your flow you have a JSON node before the MQTT node. If you get rid of that, then you'll have msg.payload set to an array with a single value, 1403. You need to get that into an object, for example a Function node:
msg.payload = {
magic: msg.payload[0]
}
return msg;
I have no idea what 1403 represents so I have called it magic
- rename that to whatever you want.
ok : we are getting near
Red arrow is the output from my modbus
Blue arrow the working injector
Thx so much for your help !
actually i can submit single objects by mqtt.
My problem is, that i've got about 30 adresses on my usb modbus interface...
how can i read and submit multiple registers ?
best
Christoph
Hello got the same problem, is it possible you send me your flow?