anthill / 6brain

0 stars 3 forks source link

mqtt doesn't reconnect #55

Closed vallettea closed 8 years ago

vallettea commented 8 years ago

after the 3g was cut by the operator, 6brain was still working (normal), I switched the wifi back to normal to have te connection with:

sudo iw dev wlan0mon  del
sudo iw phy phy0 interface add wlan0 type managed

and i ping google to be sure we are connencted. However 6 brain doesn't reconnect to pheromon

Dec 01 08:05:00 ant1 6brain[412]: bluetooth measurements received
Dec 01 08:05:01 ant1 6brain[412]: wifi measurements received
Dec 01 08:05:07 ant1 6brain[412]: offline
Dec 01 08:05:20 ant1 6brain[412]: offline
Dec 01 08:05:33 ant1 6brain[412]: offline
Dec 01 08:05:46 ant1 6brain[412]: offline
Dec 01 08:05:59 ant1 6brain[412]: offline
Dec 01 08:06:12 ant1 6brain[412]: offline
Dec 01 08:06:25 ant1 6brain[412]: offline
Dec 01 08:06:38 ant1 6brain[412]: offline
Dec 01 08:06:51 ant1 6brain[412]: offline

in index:

    client = mqtt.connect('mqtt://' + PRIVATE.host + ':' + PRIVATE.port,
        {
            username: simId,
            password: PRIVATE.mqttToken,
            clientId: simId,
            keepalive: 60*60,
            clean: false,
            // Do not set to a value > 29 until this bug is fixed : https://github.com/mqttjs/MQTT.js/issues/346
            reconnectPeriod: 1000 * 10
        }
    );

so why 13 s between reconnections and wy no reconnection ?

vallettea commented 8 years ago

@4rzael had changed the PRIVATE.json