Reputation: 4767
I am facing issue of disconnect on specific client_id. When i am trying to connect,it will suddenly disconnected and shows me error
1450599983: New connection from 192.168.2.245 on port 1883.
1450599983: Client 46144 disconnected.
1450599983: New client connected from 192.168.2.245 as 46144 (c0, k60).
1450599984: Socket error on client 46144, disconnecting.
And my conf.d file is
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
cleansession true
And sometimes it happens after sending message. Why it is happing,how we can reslove this ?
Thanks
Upvotes: 0
Views: 3455
Reputation: 11608
It sounds like you have multiple clients connecting with the same clientid. The clientid must be unique per client, if a client with the same id as an existing client then the broker disconnects the older client. If you enable full logging on mosquitto it will tell you when this is happening.
Upvotes: 5