Connecting to Mosquitto Broker on raspberry pi

Hello.

I'm trying to connect the single phase meter to Node Red via the Mosquitto MQTT broker on a raspberry pi  all on the same local network. Firmware is updated to latest and data set to send every 12 seconds (N=1) I've tried all the permutations of TCP and http that i can think of but it doesn't appear to be getting through. I am subscribing to device/<serial no>/realtime i have lots of other info going via the broker without problem and it is on the standard 1883 port which I am appending to all the variations I try in the unit's settings. Can anyone help me? 

Thank you for reading 

edit: it seems it connects and then disconnects with a socket error?  

1638276432: New connection from 192.168.0.153 on port 1883.

1638276432: Socket error on client <unknown>, disconnecting.

Thread Status
5
723
2
0
0

Sort replies by:

Hi, sorry,

I am not familiar with Mosquitto.
According to your problem, I recommend you use an MQTT client to publish some data and subscribe it from another MQTT client.

This is to prove that Mosquitto can route the topic message correctly.

As I say I have many clients publishing and subscribing without problems. Mosquitto is a fairly common raspberry pi broker  for MQTT. As you can see it is connecting and then getting disconnected. I can get data from the meter on node red using http nodes but, due to the nature of where this will be deployed I can’t guarantee a fixed IP address and so MQTT is the obvious solution. I bought several of these believing that they should be able to do the job and I suspect they can but there must be some configuration issue and it’s that that I need help with. 

Oh I forgot to mention that I have read all the instructions on how to do it but they haven’t helped. 

As I say I have many clients publishing and subscribing without problems. Mosquitto is a fairly common raspberry pi broker  for MQTT. As you can see it is connecting and then getting disconnected. I can get data from the meter on node red using http nodes but, due to the nature of where this will be deployed I can’t guarantee a fixed IP address and so MQTT is the obvious solution. I bought several of these believing that they should be able to do the job and I suspect they can but there mus

Most of the MQTT brokers have an authentification module, it will reject the connection if the client(meter) does not have the corresponding authority.

This is the logic of my previous replies.

1 I am not familiar with "Mosquitto ", so I can not give you a suggestion about how to do the troubleshooting in "Mosquitto ".
But I think if you use an MQTT software to publish the same formate data to the same topic(device/sn/realtime),this is at least prove that the "Mosquitto " can be published such topic and be subscribed to successfully (I do not know whether there is some setting that will affect this, so I give you a simple method to confirm it ).

Compared to other evidence, this proves is more strong. 


2 I give you a URL link that we use another MQTT software to build the mqtt server and illustrate how to use our energy meter to publish data to it.
It is also a third-party MQTT software that can be used as MQTT broker.
You can try this software, if it works, it proves the mqtt function of the device is OK.
Then what you need to do is compare what is the different setting in these two MQTT software.


Generally speaking, the above two suggestions have done the same thing, thathelp you to verify the mqtt process and do not need to worry about the device problem.
You can choose  one .

Looks like you are new here. Register for free, learn and contribute.