logo elektroda
logo elektroda
X
logo elektroda

ESP8266 D1 mini fails to execute code after exiting deepsleep

sen_soltysa 1845 17
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18015895
    sen_soltysa
    Level 10  
    Hi.
    I have a problem with the ESP8266 D1 mini (specifically this board: https://www.aliexpress.com/item/D1-mini-Mini-...ment-board-based-ESP8266-by/32651747570.html).

    The problem is that after exiting deepsleep (which can be seen on the port monitor in the Arduino IDE), the board no longer executes code. Only something like this appears on the console:

    ets Jan 8 2013,rst cause:5, boot mode:( 3,6)

    ets_main.c

    Nothing happens after that. If I press reset again I get this:

    ets Jan 8 2013,rst cause:2, boot mode:( 3,6)

    And the program still does not stratify.
    I press reset again and then only the program starts.

    I've tried some more with shorting D0 and RST (although apparently on this board you don't need to), but the end result is similar, only cause is "2".

    ets Jan 8 2013,rst cause:2, boot mode:( 3,6)

    What is wrong. A broken board? If I am not using deepsleep then the tile is working correctly.
    Deepsleep is fired by the command:
    ESP.deepSleep(10 * 1000000);
    I have tried even the simplest application which does nothing but send a teskt to the serial - it does not help.
    Do you have a problem with Arduino? Ask question. Visit our forum Arduino.
  • ADVERTISEMENT
  • #2 18015954
    kaczakat
    Level 34  
    If you do something before sleep then add some delay, I guess you should decide what to do with the radio after waking up:
    Code: C / C++
    Log in, to see the code
    .
    You have possible options in your comment.
    I understand you have an IO16 connected to the RST?
    SLEEP_TIME2 simply is the number defined at the beginning of the sketch.
    Edit:
    GPIO16 is just D0 on the Wemos, but always check the pinout of the board, those Dcos markings can sometimes be confusing on different boards. And in my case I have it connected to RESET with a cable to make it work. When it's connected I have trouble programming, so it's not likely to be done permanently on any board. I remove this connection for the duration of programming.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 18015962
    khoam
    Level 42  
    Check that in this Wemos you actually have D4 (GPIO2) and D3 (GPIO0) connected via resistors to the 3V3 supply. It is also safe to insert additional such resistors of 10k for testing.
  • #4 18015986
    sen_soltysa
    Level 10  
    This is what the board looks like up close - can anyone take a peek: https://photos.app.goo.gl/tBWyDVT9Ks8JPHi86
    As for this WAKE_RFCAL I have taken it to a lower level ie it also doesn't wake up in an app where there is no wifi. As far as programming goes, obviously there is no D0/RST jumper when uploading the app,
  • #5 18016046
    kaczakat
    Level 34  
    I recently had some crappy Wemos board, powered from USB it worked with varying degrees of efficiency, the problem was solved when I powered it directly to the 5V pin. Maybe you have one from the same series? I actually used it for a server with WIFI and after a random time it stopped working.
    Helpful post? Buy me a coffee.
  • #6 18016295
    khoam
    Level 42  
    What type of ESP8266 board do you have set up in the Arduino IDE?
  • #7 18016750
    sen_soltysa
    Level 10  
    I checked the external power supply (PIN G and PIN 5V) - the board works, but the effect is the same i.e. after connecting the power supply the application connects to the wifi, then I give the application deepsleep for 10 seconds, after this time you can see that the board wakes up (short LED flashing), but the connection to the wifi does not happen. So exactly the same as when powering up via USB.

    As for what is selected in the Arduino IDE, I have it set to: LOLIN(WEMOS) D1 R2 & mini.
    PS. I've tried refalsh - in both the factory firmware and Ai-Thinker exactly the same thing happens.
  • ADVERTISEMENT
  • #9 18016801
    khoam
    Level 42  
    sen_soltysa wrote:
    When it comes to what is selected in the Arduino IDE, I have set: LOLIN(WEMOS) D1 R2 & mini.
    .
    Try compiling and loading the code with the board set to "Wemos D1 R1".
  • #10 18016923
    kaczakat
    Level 34  
    You can't see much from your photo, but from what I've found out it's a hardware problem, take a peek if your ESP8266 looks like this:
    ESP8266 D1 mini fails to execute code after exiting deepsleep .
    well one of mine looks like this and there is the same problem with it. The reset signal from GPIO16 (D0) is too short and ineffective. Quite a few people have this problem, you will have to be careful when buying, https://github.com/esp8266/Arduino/issues/6007.
    Several people have replaced the Wemos mini board with the ESP module described DOIT - as in the photo above.
    Helpful post? Buy me a coffee.
  • #11 18017046
    sen_soltysa
    Level 10  
    This is exactly the chip - DOIT.AM. I read the thread you provided and the same behaviour is described there.
    I can already see that I have to advertise this board to the dealer and look for another one.
    Thank you for providing this link!
  • #12 18017137
    khoam
    Level 42  
    sen_soltysa wrote:
    I have read the thread you provided and the same behaviour is described there.
    .
    This does not refer directly to the "DOIT.AM chip", but to the ESP-12S version that may have been used in your module. The ESP-12S is such an "economical" clone, coming in different variants: without or with an extra row of pins.
    https://www.esp8266.com/viewtopic.php?f=6&t=17975
    The ESP-12S should simply be avoided. There may also be an AI-Thinker logo on such modules, but AI-Thinker no longer produces these modules for 3 years.

    ESP8266 D1 mini fails to execute code after exiting deepsleep .
  • #13 18017361
    sen_soltysa
    Level 10  
    I think mine is "EX" - This is what the Arduino IDE displays to me:

    esptool.py v2.6
    Serial port COM5
    Connecting....
    Chip is ESP8266EX
    Features: WiFi

    So the problem is probably wider than that.

    ESP8266 D1 mini fails to execute code after exiting deepsleep .
  • ADVERTISEMENT
  • #15 18017407
    kaczakat
    Level 34  
    It's not likely to apply only to the ESP-12S since people are reporting problems with the ESP-12F there (that's where the thread started). It's also hard to tell from the logo on the tin how the chip will behave, as you can probably order with your design ( and necessarily with FCC lettering). It's half bad as I ordered one Wemos module at all in the last year, but some people bought 100 chips there and don't know what to do with them. The ESP-12S module is immediately recognisable from the casing, the flash pins are not routed to the bottom edge. I still have a soldered module on an ESP-12 board and that didn't wake up either, but it was the first one I bought and I just figured that type had it that way.
    Helpful post? Buy me a coffee.
  • #16 18017413
    khoam
    Level 42  
    kaczakat wrote:
    The ESP-12S module is immediately recognisable by its housing, the flash pins are not routed to the bottom edge.
    .
    khoam wrote:
    ESP-12S is such an 'economical' clone, appearing in different variants : without or with an extra row of pins.
    .

    Added after 16 [minutes]:

    kaczakat wrote:
    because you can probably order with your pattern
    .
    Available in Poland, at least in one of the shops:

    ESP8266 D1 mini fails to execute code after exiting deepsleep
    ESP8266 D1 mini fails to execute code after exiting deepsleep
    .
  • #17 18017548
    kaczakat
    Level 34  
    I don't know, do you mean that you can recognise it by its appearance in the shop window? I also have a Wemos like the one in photo #16 and the wake-up works OK. There are ESP-12S modules sold on Ali and they are more expensive than ESP-12E or ESP-12F, maybe the economic value is noticed on a larger scale....
    ESP8266 D1 mini fails to execute code after exiting deepsleep .
    How do you know the one on the right won't work? The shape of the laminate because they saved will also not contribute anything, because I have one without cut corners and it also wake-up works.
    In addition, even if you look at it before you buy it, you still don't know what the module will actually look like. Also, he doesn't test the module immediately after unpacking, as with him with sleeping. But you will have to start.
    Helpful post? Buy me a coffee.
  • #18 18017570
    khoam
    Level 42  
    kaczakat wrote:
    How do you know if the one on the right won't work?

    Neither of these two I would buy or recommend. Both modules have ESP12 clones on board. Unfortunately, it looks like it's getting harder and harder to get the original ESP-07 or ESP-12. This may be related to the fact that Espressif has switched to the newer ESP-WROOM-02 series modules:
    https://www.espressif.com/sites/default/files/documentation/0c-esp-wroom-02_datasheet_en.pdf
  • Topic summary

    The discussion revolves around issues faced with the ESP8266 D1 mini board after exiting deep sleep mode. The user reports that the board fails to execute code post-deep sleep, displaying error messages related to reset causes. Various suggestions are provided, including adding delays before entering deep sleep, ensuring proper connections of GPIO pins to the power supply, and checking the board's power source. Users also discuss potential hardware issues, particularly with the ESP-12S module, which is known for unreliable performance. Recommendations include using different board settings in the Arduino IDE and considering alternative modules like the DOIT board for better reliability.
    Summary generated by the language model.
    ADVERTISEMENT