ESP8266 WiFi gateway port for MySensors


  • Admin

    You can set static ip in the dev-branch.


  • Mod

    @hek said:

    You can set static ip in the dev-branch.

    Even better :+1:



  • @Yveaux no buddy I used the last update of your repository, my question is , are you aware that your esp8266 sample sketch call library that wont work with esp architecture? I've compare last update with previous library and I've find the for couple of header file following code has been added
    #ifdef AVR
    #include <avr/interrupt.h>
    #else
    #error MsTimer2 library only works on AVR architecture
    #endif

    and I was wondering why your sample sketch call such file into the compiling



  • Hi @Yveaux

    could you please assist in the error.

    ESP8266 MySensors Gateway
    Connecting to HoUsEoFcLoWnS
    scandone
    f 0, scandone
    .add 0
    aid 5
    pm open phy_2,type:2 0 0
    cnt 
    
    connected with HoUsEoFcLoWnS, channel 11
    dhcp client start...
    .ip:192.168.0.23,mask:255.255.255.0,gw:192.168.0.1
    .Connected!
    IP: 192.168.0.23
    
     ets Jan  8 2013,rst cause:4, boot mode:(3,7)
    
    wdt reset
    load 0x4010f000, len 1264, room 16 
    tail 0
    chksum 0x42
    csum 0x42
    ~ld
    
    

    The gateway just keeps looping and connecting.
    I'm using a NodeMCU with a NRF ( both from ebay),
    Using the Regular library, and default sketch with SSID/pass updated.

    i tried checking the error "rst cause:4, boot mode:(3,7)" but wasn't able to find something.

    I even tried to power it using a USB cellphone charger, but i was unable to telnet so that rules out the power issue

    Thanks in advance



  • update,
    the error changed to "rst cause:4, boot mode:(3,6)" once i added a capacitor.


  • Mod

    @D_dude said:

    These ESP's seem to walk in mysterious ways...
    A lot of people have them, running without any issues (including myself and hek) and some people can't seem to get them to run stable.
    On the net, a lot of stability/reset issues are are claimed to have a relation to power supply.

    I even tried to power it using a USB cellphone charger, but i was unable to telnet so that rules out the power issue

    There are a lot of assumptions in this sentence ;-)
    What current rating is the cellphone charger? I'd advise one with at least 1amps, and a stable output.
    Not being able to telnet to the gateway can have more issues then just the ESP crashing...



  • @Yveaux
    Thank you for the response.

    As for the cell phone charger, I'm using a tablet charger Specifically original HP stream 7 charger, and it is able to provide more that 1amp. I Will try to use other charger/power supply to see if that helps.

    PS: I reloaded the gateway sketch and the error went back to boot mode (3,7) even with cap present.


  • Mod

    @D_dude I searched the net for a description of reset causes and boot modes but failed to find one.
    I have no clue of what they mean.



  • @Yveaux
    thank you for your assistance. I will try adding some debug in the code on the weekend to see what exactly is not running and possibly causing crash.


  • Mod

    I got a suggestion here to erase the flash before flashing. Haven't tried it yet, but it might help you @D_dude



  • @mfalkvidd
    Thank you, i will try this and post results.



  • @mfalkvidd
    tried erasing the flash using the method suggested but doesn't seem to be working for me. same result.
    Thanks for the tip though.


  • Mod

    Too bad. Thanks for posting your results.



  • here is my ESP8266 wifi gateway installed in wifi repeater box, taking the advantage that its has a 5 volts power supply.
    ESP8266WIFIgateway2.jpg ESP8266WIFIgateway1.jpg


  • Mod

    @luisgcu Nice housing!
    Thanks for the pics!



  • I'd been using the ESP gateway for several weeks, but recently was having trouble adding a new sensor I am developing.

    Since the copy of dev I built it with was now out of date, I went ahead and updated... still wasn't working right so while I had the serial link to it I checked and noticed it was crashing and cycling. It would work for hours, until I fired up my new node, then crash about immediately. A few dozen debug(PSTR())'s later, I found a cause.

    In core/MySensorsCore.cpp the result of _msg.getConfig() is dereferenced in a comparison, and it's possible it could return NULL ( like when it's a new node ). I put a check around that and it's not crashing anymore. Which is more than what I can say for my new sensor node....

    I have not tested this change with an AVR.

    I submitted PR 264.


  • Mod

    Great work @soward !



  • on some basic debugging, seems like my sketch is crashing in setupGateway.

    infact even adding a print statement, it only prints first 3 chars.

    My question is setupGateway takes output as an arg, which in turn is a function, should there be some parameters for this function?
    also "Serial.print(serialBuffer);" does not print anything i added prints above and before and they don't show up either.

      va_end (args);
      Serial.print("A1");
      Serial.print(serialBuffer);
      Serial.print("A2");
    

    any suggestions?


  • Mod

    @D_dude flush the serial output after each print.
    The ESP will output the serial data in the background while your programm continues and then it crashes.



  • Hi,
    I'm getting all the time this:

    ESP8266 MySensors Gateway
    Connecting to layla
    ......Connected!
    IP: 192.168.0.102
    0;0;3;0;9;gateway started, id=0, parent=0, distance=0

    Then it got stuck so I do reset and getting this in loop:

    ESP8266 MySensors Gateway
    Connecting to layla
    ..Connected!
    IP: 192.168.0.102
    0;0;3;0;9;radio init fail

    Soft WDT reset

    ctx: cont
    sp: 3ffefe70 end: 3fff00a0 offset: 01b0

    stack>>>
    3fff0020: 00000000 00000000 3ffeed74 40203665
    3fff0030: 0000007f 3ffef074 40205ba0 3ffef080
    3fff0040: 40202114 00000001 00000000 40205c10
    3fff0050: 6600a8c0 00ffffff 0100a8c0 3ffef074
    3fff0060: 3ffe84ac 3ffeee8c 3ffeefb0 4020256b
    3fff0070: 3ffe86b8 6600a8c0 00000000 00000000
    3fff0080: 3fffdc20 00000000 3ffef06d 40205bde
    3fff0090: 00000000 00000000 3ffef080 40100114
    <<<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


Log in to reply
 

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