Ok, I didn't get as far as the NaN bit...... But I'm a bit confused that it worked as is, but I don't have MQTT installed on the machine it is running.
Not sure if lcoal-host means it just cheats or not.
Ok, I'm not fully up to speed with exactly what is happening.
Reading the whole thread again this is what I get:
1 - if you use your local machine as the MQTT broker, it (the MQTT part) sends two messages back in reply to you sending a message.
2 - if you use an external MQTT broker, it works.
Really going out on a limb:
Open the CLI (Terminal) on the Ras pi.
Actually two.....
The topic (channel?) of MQTT you are using is: vessels/self/navigation/NewPositionTest
In the CLI send a message to yourself.
In one type: mosquitto_sub -h local-host -t vessels/self/navigation/NewPositionTest
Then in the other CLI type: mosquitto_pub -h local-host -t vessels/self/navigation/NewPositionTest -m "This is a test"
See if you get two replies.
If not, expand on this and copy/paste the message payload and see what happens from the CLI.
I'm only throwing ideas in an attempt to find out where the problem is happening and why.
Another thing to try:
IF you get back two replies.......
cd .node-red node-red-stop
and try again.
I am only saying this to eliminate things one at a time and piece by piece.
Otherwise there is not going to be much happening to rule things out as good or bad.
The results from post 13 confirms that when you publish to that topic you are getting two results back. I can only think of two possibilities for how that could happen.
As you have suggested, a serious bug in the mqtt broker that somehow makes that happen. The reason I am resistant to that suggestion is that it would be a very odd bug. It could be that however.
That something else is also subscribed to that topic (or a wildcard version of it) and that when it sees the message from your publish it then publishes the NaN. To fit the fact that when you switch to a different broker it fixes the problem requires that this second client (or flow) does not publish to the different broker. Is that conceivable?
One way to test that would be to change the topic in your test flow to "something/completely/different" for the publish and the subscribe and see what happens.
Andrew,
I think that Mosquitto is not my MQTT server on my installation.
The MQTT Server that I have comes with Openplotter image, so I cannot follow your instruction.
Ok, that's no problem in that sense of things, but it (therefore) is a possible problem.
I have to agree with the line of thinking that:
If you remove all known things that what ever is left - despite what it is - has to be the problem.
(Or words to that end)
I would seriously dig into what it is doing.
Can you understand why I am saying this?
I have no bias to any part of the system. I am simply trying to find the cause by testing parts.
That if you change the topic and it doesn't give the two replies per message is also indicative that there is something going on behind the scenes which could be causing this to happen.
So what happens in the CLI when you type mqtt_sub......? command not found is probably what I am guessing with your reply.
That too is worrying as there should be some mechanism for MQTT to send messages.
The bare bones is (I'm guessing) that.
If it isn't that means (implies - probably better) that the whole thing (MQTT) has been changed.
Andrew,
I understand your point of view so if I can help you, here I am.
I tried to type some mqqt command, but the answer is: "Commando non trovato" (command not found in Italian)
Let me know how can I help you.
I can try to write in the forum of OpenMarine, who develop OpenPlotter, but I don't know exactly what ask them, or may be you can enter in contact directly at https://forum.openmarine.net/index.php or again I can do it for you if you write me what I have to ask.
I think you need to show them what is happening and get them to explain why you are getting two replies to one message.
Ideally MQTT is only a message handling system. You send a message in and you get it out.
That you send one message in and you get two is alarm bells - for me.
This anomaly needs to be resolved - by them.
Then you can see what happens from there.
Good luck.
But at this point you (we) have established that other than that is working.
If you change the topic to something else it doesn't send back this NaN error.
So when it is set to that topic you get the error.
What is happening really needs to be explained - by them.
Colin,
No, I've market solved because you found a solution changing the topic, but later Andrew wrote again.
I remove the flag.
Tomorrow morning I will write to the openplotter team.
Hi,
Unfortunately it is not Mosquitto server on my raspberry. I'm using an version call Openplotter that has his mqqt server already installed and it seem that is impossible to send any publish.
If I publish to the topic "vessels/xxxx" everything works well.
So it seems that only under "xxx/self/" I have a problem, that is the place where all the messages come from SignalK.