eclipse / paho.mqtt.javascript

paho.mqtt.javascript
Other
1.15k stars 467 forks source link

Device randomly dropping connection #129

Open tizme opened 6 years ago

tizme commented 6 years ago

I am building an app with Cordova/Ionic and am experiencing randomly timed connection drops from my client. my tablet is directly connected to the device it is communicating with over wifi that the device is broadcasting. The devices will be sending messages back and forth and then out of nowhere I get:

WebSocket connection to 'ws://192.168.1.1/mqtt' failed: Error in connection establishment: net::ERR_ADDRESS_UNREACHABLE

At this time the tablet is now disconnected from wifi (I am currently testing it with auto reconnect disabled, it will reconnect otherwise), and the device with the broker has the LED indicator installed on it flashing that it is broadcasting it's network. I have not been able to figure out what is causing my tablet to drop the network.

jpwsutton commented 6 years ago

It sounds like the issue is with the tablet / network if your tablet is disconnected from wifi, not the paho client. ERR_ADDRESS_UNREACHABLE means that chrome can no longer access the IP address of the broker (192.168.1.1) so you'll need to re-establish the WiFi connection before it can connect again.