Blank Client ID - Auto ID? [message #1834040] |
Fri, 30 October 2020 17:25 |
Kyle Stokes 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?
|
|
|
|
Powered by
FUDForum. Page generated in 0.03212 seconds