Random disconnection of controller (2-15mn) on Wifi gateway (v2.0)


  • Hardware Contributor

    Hello,
    I am using the dev version of MySensors (downloaded and updated minutes ago) on a NodeMCU 0.9 board as a wifi gateway, but I have random disconnection of the controller in intervals between 2 and 15 minutes.

    I first made a gateway with NRF radio and a sensor with an RGB Led and Domoticz as the controller. Was perfect... but only for a few minutes.

    I now simplified things down to a gateway with no radio and put a temp/hum sensor sending data every 15 seconds and MySController (and I removed the MySensor gateway from Domoticz to avoid any interference).

    The script is based on the humidity example in the library to which I made the following changes :

    • add #define lines for gateway with static ip, comment the NRF24 radio define
    • replaced the "delay" commands with wait
    • changed delay between sendings to 15 seconds and forced sending of temperature even if there is no change to know when the controllers really stops receiving data

    In the serial output from the gateway everything seems to be fine until I see a : 0;255;3;0;9;Client 0 disconnected line. Then the log continues displaying the temperature/humidity values.

    On the controller side I see nothing, it just stops receiving the messages after the message appears in the serial output of the gateway but seem unaware of any disconnection. When I click disconnect then connect buttons it reconnects to the gateway and receives the messages again. No use to restart the gateway.

    I have tried to put the gateway at only a few meters from the router with no obstacle and the behaviour is the same.

    I'm open to any suggestion on how I could find out what is wrong...


  • Admin

    What version of esp8266 do you have in the IDE/Tools/Board/Board Manager?

    Could you try updating to 2.1.0-rc2 and see if things works better?

    Go to IDE/Settings and add "http://arduino.esp8266.com/staging/package_esp8266com_index.json" to Additional Board Manager URLs to get the rc:s in the list.


  • Hardware Contributor

    Thank you for your reply. I had the stable branch and installed the 2.1.0 RC2
    After 5mns the controller stopped receiving the messages, but this time I had no disconnect message in the serial output of the gateway just the log from the sensor reading.

    The "client disconnected" message appears immediately in the serial output when I disconnect from MYSController so the connexion seems to still be active.

    I restarted and waited for messages not to appear anymore in MYSController, then I sent some messages to the gateway: they appear in the serial output of the gateway, after some time and sending other messages I have a client disconnected message.

    T: 2949149.00
    H: 44.00
    0;255;3;0;9;Client 0: 0;11;3;1;0;
    T: 2949149.00
    H: 45.00
    T: 2949149.00
    0;255;3;0;9;Client 0: 0;11;3;1;2;
    T: 2883613.00
    H: 44.00
    0;255;3;0;9;Client 0 disconnected
    T: 2949149.00
    H: 45.00
    

  • Admin

    Ok, I've had a WiFi gw running here (with the latest) since I came home from work (>1h).

    No disconnects so far and data is rolling in.

    I just have had it powered from my macs USB port. It seems to provide a stable power source which is needed for the pretty sensitive ESP board..


  • Hardware Contributor

    🙂 I guess I will have to find another power supply then, I tried with everything I had and USB from my computer (both sides) and always have a similar result.

    Thank you for your time, I'll try again when I can find something more stable than phone/tablet chargers, or maybe try to use a capacitor between vcc and gnd....


  • Hardware Contributor

    I power the same board from the same USB port than before, but connected to the board I now have DHT11, BMP180 and a 16x2 LCD through an I2C backpack (and backlight always on).
    It's sending the temp, humidity and pressure data to domoticz every 30s, I programmed domoticz to restart connection to the gateway if no data is received after one minute, but ... no restart until now after a few hours.


  • Admin

    So.... what changed? Why is it more stable?


  • Hardware Contributor

    I have no idea except adding bmp and lcd...


Log in to reply
 

Suggested Topics

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts