ESP8266 MySensors Gateway Crashes when Node Connects



  • Today I've build a ESP8266 MySensors Gateway.

    The gateway starts up and I can connect to it with my Domoticz Controller.

    2015-11-06 22:24:19.180 MySensors: connected to: 192.168.15.150:5003
    2015-11-06 22:24:19.181 MySensors: Gateway Ready...
    2015-11-06 22:24:20.181 MySensors: Gateway Version: 1.5
    
    ESP8266 MySensors Gateway
    Connecting to YVER
    ...........Connected!
    IP: 192.168.15.150
    0;0;3;0;9;gateway started, id=0, parent=0, distance=0
    Client 0 connected
    0;0;3;0;14;Gateway startup complete.
    Client 0: 0;0;3;0;2;Get Version
    0;0;3;0;2;1.5
    

    Next I've build a temperature sensor, but when the sensor try to connect to the gateway, the gateway crashes with the followinf output:

    0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
    255;255;3;0;3;
    Client 0: 255;255;3;0;4;1
    
    ctx: cont
    sp: 3ffeabd0 end: 3ffeaf10 offset: 01b0
    
    >>>stack>>>
    3ffead80:  3ffe97bf 000000ff 3ffe9850 40205288
    3ffead90:  3ffe97bf 00000030 3ffe9850 402052d4
    3ffeada0:  a8e1fcff 000000a8 3ffe9850 4020548b
    3ffeadb0:  3ffe97bf 00000008 3ffe9850 40204cdb
    3ffeadc0:  00000017 3ffe9850 00000011 000000ff
    3ffeadd0:  000000ff 3ffe97b8 3ffe97bf 40203b81
    3ffeade0:  0000000a 00000000 3ffeae4f 4020b73c
    3ffeadf0:  ffffffff 3ffeae50 3ffe9850 00000004
    3ffeae00:  00000000 00000000 3ffe97bf 4020101c
    3ffeae10:  3ffe98b9 3fffdc20 3ffeaf3c 3ffe97b8
    3ffeae20:  3ffe98ba 00000000 3ffeae4e 4020102c
    3ffeae30:  000000ff 00000003 3ffe97bf 00000000
    3ffeae40:  000000ff 00000000 3ffe97b8 40203262
    3ffeae50:  3ffeafff 0000000e 3ffe98ba 00000000
    3ffeae60:  000000ff 00000000 3ffe97b8 40203e78
    3ffeae70:  000000ff 3ffe97bf 3ffeaf70 4020ae11
    3ffeae80:  3ffe98ac 3ffe98ac 3ffeaf70 3ffeaf70
    3ffeae90:  000000ff 3ffe97b8 3ffe97bf 40202501
    3ffeaea0:  3ffe9ab0 3ffe98ac 00000000 40202784
    3ffeaeb0:  3ffe8e40 00000000 000003e8 3ffe9c44
    3ffeaec0:  00000000 3fff4c78 3fff4c08 3ffeaf3c
    3ffeaed0:  00000000 0000000a 00000000 00000000
    3ffeaee0:  40201c35 960fa8c0 00000000 3ffeaf3c
    3ffeaef0:  3fffdc20 00000000 3ffeaf34 40201c92
    3ffeaf00:  00000000 00000000 3ffe9ef0 40100378
    <<<stack<<<
    
     ets Jan  8 2013,rst cause:2, boot mode:(3,6)
    
    load 0x4010f000, len 1264, room 16
    tail 0
    chksum 0x42
    csum 0x42
    ~ld
    
    

    On the sensor side the serial output is:

    sensor started, id=255, parent=0, distance=1
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
    

    When the Domoticz Controller is not connected the output of the gateway is :

    ESP8266 MySensors Gateway
    Connecting to YVER
    .......Connected!
    IP: 192.168.15.150
    0;0;3;0;9;gateway started, id=0, parent=0, distance=0
    0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
    255;255;3;0;3;
    0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
    255;255;3;0;3;
    0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
    255;255;3;0;3;
    
    

    The output of the sensor is :

    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
    sensor started, id=255, parent=0, distance=1
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
    

    What I tried my self:

    • placed a decoupling capacitor on both radio's
    • mounting the PCB's on a protoboard to minimize the distance between the controller and the radio by nit using dupont cables.
      IMAG1005.jpg

    What am I missing and how can I get this setup to work ?
    Any help/suggestion is appreciated.


  • Mod

    Power supply seems to be a recurring problem with ESP8266.
    I assume you power the ESP board through the USB connector?
    Do you power it from your PC then?
    USB 2.0 can supply a maximum power of 500mA, which is on the edge for ESP.
    Try powering the board from a 1Amp minimum supply and see if things improve.



  • I did power it from my PC, so i tried your suggestion and powered it with an 'official' Raspberry Pi 2A power adapter. IMHO this is the most stable 2A power adapter.

    Unfortunately it still crashes and reboots.



  • I am using mysensor 1.5.1 ESP8266 mysensor gateway. But It is not starting up. I am using 2A power supply. Here is the log.

    ESP8266 MySensors Gateway
    Connecting to Ahmed
    ............Connected!
    IP: 192.168.0.31
    
    ctx: cont 
    sp: 3ffebcb0 end: 3ffec010 offset: 01b0
    
    >>>stack>>>
    3ffebe60:  3ffea8af 000000ff 3ffea940 40205384  
    3ffebe70:  3ffea8af 00000030 3ffea940 402053d0  
    3ffebe80:  a8e1fc0a 000000a8 3ffea940 40205587  
    3ffebe90:  3ffea8af 0000000a 3ffea940 40204dd7  
    3ffebea0:  3fff1e58 4024371c 3fff235c 0000000a  
    3ffebeb0:  000000ff 3ffea8a8 3ffea8af 40203c7d  
    3ffebec0:  3ffec070 00000001 3ffebf2f 4020c5a8  
    3ffebed0:  402421c0 00000001 00000001 3ffec070  
    3ffebee0:  00000033 0000000a 3ffec070 4020b6e1  
    3ffebef0:  3ffebf2e 40243cbc 3fff1e58 0000000a  
    3ffebf00:  000000ff 00000000 0000000d 4020335e  
    3ffebf10:  40217e00 3ffead34 3ffe9390 3ffe93a4  
    3ffebf20:  00000065 3ffea940 3ffebf65 40203379  
    3ffebf30:  00000000 3ffea940 3ffea94a 0000000a  
    3ffebf40:  000000ff 00000000 3ffea8a8 40203f38  
    3ffebf50:  0000001d 3ffea8af 3ffea940 402053bc  
    3ffebf60:  3ffe92f8 a8e1fc0a 3ffea940 00000001  
    3ffebf70:  00000001 00000000 3ffea8a8 402040b0  
    3ffebf80:  00000001 0000000a 3ffea8a8 4020422b  
    3ffebf90:  00000000 0000000a 3ffea8a8 40204381  
    3ffebfa0:  0000007f 3ffec03c 40201cac 3ffeaff0  
    3ffebfb0:  40202320 00000001 0000000a 40201d4f  
    3ffebfc0:  1f00a8c0 00ffffff 0100a8c0 3ffec03c  
    3ffebfd0:  3ffe9328 3ffead34 3ffec070 402026ef  
    3ffebfe0:  3ffe98a8 1f00a8c0 00000000 00000000  
    3ffebff0:  3fffdc20 00000000 3ffec034 40201d1f  
    3ffec000:  00000000 00000000 3ffeaff0 40100398  
    <<<stack<<<
    
     ets Jan  8 2013,rst cause:1, boot mode:(3,7)
    
    load 0x4010f000, len 1264, room 16 
    tail 0
    chksum 0x42
    csum 0x42
    ~ld
    

    May someone help me?



  • I also tried to use 1.5.1, but the ESP8266Gateway sketch won't even compile, so I'm stuck with no Gateway.



  • Yesterday I installed 1.5.1 Development.
    Today I installed 1.5.1 master

    Still having the same crash when a sensor connects to the gateway.

    To rule out if the problem is on the controller side, I installed a different controller (MajorDomo) to see how the gateway reacts.

    Unfortunately the gateway still crashes.



  • Well I'm sort of glad, I thought I was the only one with this issue. I have tried numerous power supplies, including one I am sure is very stable and can supply the required load.

    I am using 1.5.


  • Admin

    Sorry to hear about your troubles. Very strange. My ESP gateway seems very stable here, shuffling messages back and forth. I just feed in from my mac (but with vanilla NRF-radio on it).

    Yesterday I installed 1.5.1 Development.

    Guess you mean 1.6.0-beta? That is what I mainly run here now...

    What happens if you simply use netcat to send messages to the ESP?

    > nc 192.168.1.xx 5003
    (then send the serial messages..)
    42;1;1;47;0;Hello
    


  • When I use a telnet session from Putty, the crash does occur.
    result.JPG

    When i connect from linux with nc, the crash doesn't occur.
    result2.JPG

    What could be the problem ? I exactly followed the build instructions. I even bought the hardware from the ebay-links provided.


  • Admin

    Looks like you're sending some trash characters when connecting with telnet (just after "Client 0"-print).

    I have no idea what that crap is.

    But as it works with nc you must be doing something strange...


  • Mod

    telnet is more than just a TCP connection. Not much more, but it will always send some extra characters. Netcat is a pure TCP connection.



  • Thanks hek & mfalkvidd.
    Reading your replies made me think that maybe the problem isn't the gateway, but the sensor sending some crap.
    I will build a new sensor toninght and test it.



  • Hmmm, I've build the most basic actuator "BinarySwitchSensor" and again when it connects, the gateway crashes. I'm totaly lost here.


  • Admin

    So it crashes both when controller connects to gateway or when it receives a radio message?



  • When no controller is connected and a message is received it doesn't crash.

    It only crashes when a controller is connected and the gateway receives a radio message.
    (I used the tempsensor sketch and the binaryswitch sketch to test)
    (But the testmessage : 42;1;1;47;0;Hello didn't crash the gateway)

    Right now I just uploaded the SerialGateway sketch to 1 of my sensors and that is working correctly with my Domoticz Controller. But I still prefer a wifi gateway.



  • @Luppie Hi. Have you ever been able to solve this issue? I have the same here.

    Tronix



  • Nope, I never resolved it. So I've build a USB gateway, thats is working great for 4 months now.



  • @Luppie Ok, thanks. I also have the USB and LAN gateway running. But it would be very helpful having the WIFI version on other locations in the house. Thanks anyway.



  • I also experience a crash... I've tried using master and dev, I see the crash when Domoticz tries to connect to the gateway (Using the MySensors LAN option)... When running without Domoticz, it seems to run fine without issue (watching debug all appears a-okay).

    Spent almost the last day trying to work it out, no luck so far!


  • Admin


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.