Closed krylovsk closed 9 years ago
Otherwise the DGW goes into infinite loop trying to connect to a broker. Need to handle this in a clever way: allow several attempts and then sleep for some TTL, then try again (avoid discotheque in the terminal)
The problem is not in connecting to the server - it is that immediately after connecting it gets disconnected (the clientID problem). There is already a back-off on establishing a connection.
Good! But it does not help to avoid loop over:
[device-gateway] 10:26:24 MQTTPulbisher: lost connection to the broker: EOF [device-gateway] 10:26:24 MQTTPublisher: connecting to the broker tcp://127.0.0.1:1883, backOff: 0 sec [device-gateway] 10:26:24 MQTTPublisher: connected to the broker tcp://127.0.0.1:1883 [device-gateway] 10:26:24 MQTTPulbisher: lost connection to the broker: EOF [device-gateway] 10:26:24 MQTTPublisher: connecting to the broker tcp://127.0.0.1:1883, backOff: 0 sec
The mqtt library disconnects when a client with the same clientID connects to the broker