[SOLVED] Wifi Gateway problem ESP8266



  • I cant get Wifi gateway to work

    Im using arduino 1.6.8

    I tried with Esp8266 board 2.0.0 and 2.1.0, with master and dev versions of mysensors but it didnt work.

    I get constant reset or exception on conection:

    Exception (28):
    epc1=0x4000bf80 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000


  • Admin

    Downgrade to Arduino-ESP 2.0.0.

    Not sure why 2.1 crashes. If someone has a tip, let me know.



  • Hi! I've your problem too!
    hek, what do you mean for "Downgrade to Arduino-ESP 2.0.0" and how can I do that?
    Thanx


  • Admin

    Arduino IDE -> Tools -> Board -> Board Manager



  • Yes, sorry!

    Works with Arduino-ESP 2.0.0 and mysensors dev

    Thank you very much.



  • @hek
    Great! It works. Thanx!



  • I wouldn't call downgrading a solution, but it is a useful workaround πŸ™‚

    Since this isn't actually solved and because I want to not downgrade the sdk I did some tracing.
    I added printf's to MySensorCore.cpp to see how far we get before the exception occurs. The ledsInit() at line 113 returns , but we crash somewhere during the hwReadConfigBlock() call to get the isMetric parameter. If I comment that out execution continues but fails after calling presentation().
    This seems to implicate the EEPROM library calls from MyHwESP8266.cpp and indeed when I add printf's there (oh how I hate debugging this way!!!), it fails on the call to EEPROM.init(length).


  • Admin

    Ok, great find. And yeah, print-debugging isn't the greatest..

    Did you search any further why the EEPROM.begin would fail? Any issues over at ESP/Arduino project?



  • I ran out of time last night.....
    There are at least 4 Issues open at ESP8266/Arduino on this topic. Most of the exception dumps seem to fail inside a timer interrupt????
    I reverted the EEPROM library to 2.0.0, no change.

    Adding a 1 second delay (wait(1000)) just before the EEPROM read (after leds_init) avoids the exception but results in a wdt event and restart.

    There are 80 files changed in cores/esp8266 since 2.0.0. I might do some diffs to see if there is anything that hints at being relevant. No telling what the cause is so binary search might be the only way without a hardware debug facility.

    Bottom line, for me I might have to live with using 2.0.0 until the esp8266 Arduino lib team figure this one out. 😞



  • Being Dutch I am very stubborn, a bit like a leach with lockjaw when it comes to defects.
    @hek
    Some more searching today turned up issues with esp8266/Arduino and the yield() function. That led to me looking through the MySensors site again and it turns out that a month ago in this set of comments that http://www.mysensors.org/build/esp8266_gateway user sl118 solved the problem by commenting out a line in MyGatewayTransportEthernet.cpp. I should have twigged on that earlier as someone elsewhere commented the using UDP solved the problem as well.

    The setnodelay(true) enables the Nagle algorithm inside the tcp stack, this combines small packets into a larger one. So perhaps a bit of a performance hit on a busy network but at least I can use esp8266/Arduino 2.1 now and avoid using Arduino IDE for gw, and use VS2015CE for all my development again.


  • Admin

    Sweet!

    Could you prepare a pull request so you'll get proper credit for finding it?



  • The credit should really go to @sle118 but I will create a pull request later today.

    And now that we know exactly what to look for, I found this: https://github.com/esp8266/Arduino/issues/1695 where they library fix is being implemented as well as a description of the problem.


Log in to reply
 

Suggested Topics

1
Online

11.4k
Users

11.1k
Topics

112.7k
Posts