We have about nearly 60 devices (about 30+ gateways) connected to losant at the moment using mosquitto as a local broker which forwards (bridge) everything to losants broker.
We are connected using TLS.
We are connecting via fairly unreliable network (3g) connections so do get a range of timeouts, connect errors etc
This is a connection log for a single gateway device since the 14th.
Device ID Date Sent Rec Details
591xxxxxxxxxxxxxxxxxxf7cd 09/22/2017 1:18:07 PM
591xxxxxxxxxxxxxxxxxxf7cd 09/22/2017 1:18:04 PM 403 0 Error: read ECONNRESET
591xxxxxxxxxxxxxxxxxxf7cd 09/22/2017 12:10:52 PM
591xxxxxxxxxxxxxxxxxxf7cd 09/22/2017 12:10:52 PM 161 0 Device establishing new connection, closing previous connection
591xxxxxxxxxxxxxxxxxxf7cd 09/22/2017 11:44:05 AM
591xxxxxxxxxxxxxxxxxxf7cd 09/22/2017 11:44:05 AM 233 0 Device establishing new connection, closing previous connection
591xxxxxxxxxxxxxxxxxxf7cd 09/22/2017 11:04:55 AM
591xxxxxxxxxxxxxxxxxxf7cd 09/22/2017 11:04:55 AM 358 0 Device establishing new connection, closing previous connection
591xxxxxxxxxxxxxxxxxxf7cd 09/22/2017 10:04:53 AM
591xxxxxxxxxxxxxxxxxxf7cd 09/22/2017 10:04:45 AM 2793 0 Publish Error - Error: connect ECONNREFUSED 188.8.131.52:443
591xxxxxxxxxxxxxxxxxxf7cd 09/15/2017 1:03:56 PM 4967 0 Keepalive Timeout
591xxxxxxxxxxxxxxxxxxf7cd 09/14/2017 11:14:22 PM
591xxxxxxxxxxxxxxxxxxf7cd 09/14/2017 11:14:19 PM 4318 0 Error: read ECONNRESET
591xxxxxxxxxxxxxxxxxxf7cd 09/14/2017 11:14:22 AM
591xxxxxxxxxxxxxxxxxxf7cd 09/14/2017 11:14:18 AM 360 0 Error: read ECONNRESET
591xxxxxxxxxxxxxxxxxxf7cd 09/14/2017 10:14:21 AM
591xxxxxxxxxxxxxxxxxxf7cd 09/14/2017 10:14:19 AM 1513 0 Error: read ECONNRESET
591xxxxxxxxxxxxxxxxxxf7cd 09/14/2017 6:02:03 AM
591xxxxxxxxxxxxxxxxxxf7cd 09/14/2017 6:02:02 AM 39 0 The server-side MQTT broker has been restarted for maintenance or upgrades
591xxxxxxxxxxxxxxxxxxf7cd 09/14/2017 5:55:42 AM
This is a particularly bad network at times. (there is a big gas plant being constructed 5km off shore and the network can get hammered at times. All those tradies watch youtube during smoko
Mosquitto will automatically retry the connection, and we are using QOS 1 for publishing so this is pretty self healing.
I was originally publishing directly via a python application but I found I had to deal with so many different network failure scenarios that I have up and now use that same python code to publish to the local broker acting as a bridge.
Everthing has been significantly more reliable since adopting that approach, and it keeps my code much simpler.