MQTT Connection is lost when another system connects

I am using MQTT to send data from an LS300 to the Airvantage server. My application was written and debugged, and finally I deployed it onto two units.

Suddenly, my MQTT session was being interrupted with “Connection Lost” messages in the timeline, on both units. After a lot of headscratching, I discovered that as soon as one unit connects, the other is forced to disconnect. Needless to say, this was not what I expected.

What could be causing this problem, and what can I do about it? I suppose if I created a completely new Airvantage account for each unit the problem would disappear, but I’d rather not do that.

Thanks for you help :smiley: !

-Philip Douglass

Hi Philip,

I post my answer here in order to share it to everyone:
This seems all your devices are communicating using the same device Id. Which device Id do you use for your devices? Is it a hard coded one?

For example, if you are using Paho, the device id is defined here:
MqttClient sampleClient = new MqttClient(broker, clientId, persistence);

Solution: serial number must be used to be unique.

Thanks for the quick response, that was it :smiley: .

I thought having different usernames would be enough, but now I see that the device Id should also be unique.