Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Mosquitto » Blank Client ID - Auto ID?(Several devices sent out with blank client id, kicking eachother off, how to fix on the server side?)
Blank Client ID - Auto ID? [message #1834040] Fri, 30 October 2020 17:25 Go to next message
Kyle Stokes is currently offline Kyle StokesFriend
Messages: 1
Registered: October 2020
Junior Member
Hello,

I have 6 MQTT Gateways that receive transmissions from sensors, compose an MQTT message and then send that MQTT message to a Mosquitto broker in the cloud that I control and administer.

Unfortunately when I sent these six out, I left the clientID blank. I am now seeing in the logss on the Mosquitto broker, that is seems like these gateways are connecting with a clientID of '' (blank) and kicking eachother off.

MQTT_01 will connect, and then MQTT_02 connects and kicks off 01.
Since there are six total they are kicking eachother off quite rapidly and I am losing some messages.

Is there anyway to fix this on the server side? To allow blank clientIds and give them some sort of automatic identifier?

I looked at 'allow_zero_length_clientid', and set that to true but it doesnt seem to have done anything.
I also set 'auto_id_prefix auto-' but that also doesnt appear to have done anything.

Here is what I am seeing in the log file:
New connection from 174.xxx.xxx.243 on port 1883.
2020-10-30T17:22:09: Client blank already connected, closing old connection.
2020-10-30T17:22:09: New client connected from 174.xxx.xxx.243 as blank (p2, c1, k15, u'mqtt_02').
2020-10-30T17:22:09: No will message specified.
2020-10-30T17:22:09: Sending CONNACK to blank (0, 0)
2020-10-30T17:22:09: Received SUBSCRIBE from blank
2020-10-30T17:22:09: endnodetransmit (QoS 0)
2020-10-30T17:22:09: blank 0 endnodetransmit
2020-10-30T17:22:09: Sending SUBACK to blank
2020-10-30T17:22:09: New connection from 174.xxx.xxx.185 on port 1883.
2020-10-30T17:22:09: Client blank already connected, closing old connection.
2020-10-30T17:22:09: New client connected from 174.xxx.xxx.185 as blank (p2, c1, k15, u'mqtt_06').
2020-10-30T17:22:09: No will message specified.
2020-10-30T17:22:09: Sending CONNACK to blank (0, 0)
2020-10-30T17:22:09: New connection from 174.xxx.xxx.120 on port 1883.
2020-10-30T17:22:09: Received SUBSCRIBE from blank
2020-10-30T17:22:09: endnodetransmit (QoS 0)
2020-10-30T17:22:09: blank 0 endnodetransmit
2020-10-30T17:22:09: Sending SUBACK to blank
2020-10-30T17:22:09: Client blank already connected, closing old connection.
2020-10-30T17:22:09: New client connected from 174.xxx.xxx.120 as blank (p2, c1, k15, u'mqtt_03').
2020-10-30T17:22:09: No will message specified.
2020-10-30T17:22:09: Sending CONNACK to blank (0, 0)
2020-10-30T17:22:09: Received SUBSCRIBE from blank
2020-10-30T17:22:09: endnodetransmit (QoS 0)
2020-10-30T17:22:09: blank 0 endnodetransmit
2020-10-30T17:22:09: Sending SUBACK to blank
2020-10-30T17:22:09: New connection from 174.xxx.xxx.243 on port 1883.

Here is what my conf looks like, at /etc/mosquitto/conf.d/mosquitto.conf
log_timestamp true
log_timestamp_format %Y-%m-%dT%H:%M:%S
log_type all
connection_messages true
log_dest file /var/log/mosquitto/mosquitto.log

allow_anonymous false
password_file /etc/mosquitto/pass.txt
allow_zero_length_clientid true
auto_id_prefix auto-


Any thoughts or advice?
Re: Blank Client ID - Auto ID? [message #1834064 is a reply to message #1834040] Sat, 31 October 2020 20:57 Go to previous message
Roger Light is currently offline Roger LightFriend
Messages: 90
Registered: September 2013
Member
2020-10-30T17:22:09: Client blank already connected, closing old connection.


This is telling you that the client id is the literal string "blank", it isn't an empty client id. So you have multiple clients using the same id. The only way to fix it is to use separate client ids I'm afraid.

Cheers,

Roger
Previous Topic:Publishing and Subscribing Using C Between 2 Computers
Next Topic:mosquitto status failed
Goto Forum:
  


Current Time: Thu May 02 23:57:12 GMT 2024

Powered by FUDForum. Page generated in 0.03212 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top