logo elektroda
logo elektroda
X
logo elektroda

[Solved] ESP8266MOD: No WiFi connection - program code issues

dasej 1941 11
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19425195
    dasej
    Level 32  
    Welcome.

    The topic is about this version of the mod
    ESP8266MOD: No WiFi connection - program code issues .

    Code: C / C++
    Log in, to see the code
    .


    There is practically nothing in the program and it constantly resets itself.
    As I do not attach the WiFi support the module itself when blinking the diode works.

    Is the module defective or am I doing something wrong?

    ESP8266MOD: No WiFi connection - program code issues

    Code: Ini
    Log in, to see the code
    .
  • ADVERTISEMENT
  • #2 19425235
    sylweksylwina
    Moderator of Computers service
    Power supply all correct? I.e. you're probably powering from USB anyway, but you could check that the voltages are correct after the stabiliser etc.

    Exception indicates a problem with program execution, if it is caused by WiFi code then maybe try clearing memory and uploading new firmware.

    rst cause 2 it looks like the reset button was pressed.

    Don't do so many delays because if you start to complicate the code, it will start to watchdog reset the board (rst cause 4).
    You can give yield() in the main program loop.
  • ADVERTISEMENT
  • #3 19425289
    dasej
    Level 32  
    I fed 3.3V from the power supply behind the stabiliser and still the same.
    The button is working, when I hold it down the ESP does not start.
    I added a delay so that ESP resets more slowly.
  • ADVERTISEMENT
  • #4 19425336
    Anonymous
    Level 1  
  • #5 19425405
    khoam
    Level 42  
    @dasej Install a plug-in for the Arduino IDE called ESP8266/ESP32 Exception Stack Trace Decoder . You will then know specifically where the program is crashing. Otherwise, it's a search in the dark. Link .

    Jarzabek666 wrote:
    Delay in esp does not exist
    .
    Really? :) Code from Arduino Core for ESP8266 below. It is certainly less blocky than what you presented in your post.
    Code: C / C++
    Log in, to see the code


    Added after 4 [minutes]:

    sylweksylwina wrote:
    Don't do so many delays because if you start complicating the code it will start your watchdog resetting the board
    .
    Nonsense. The delay() function in the ESP8266 does not block the execution of other threads or the operation of the WTD.
  • #6 19425450
    Anonymous
    Level 1  
  • #7 19425463
    dasej
    Level 32  
    @khoam .
    I received something like this back.

    Code: Ini
    Log in, to see the code
    .

    Added after 1 [minute]:

    @Jarzabek666 .

    My dear reader, we are not writing here about DELAY.
  • Helpful post
    #8 19425469
    khoam
    Level 42  
    In the board settings, change "Erase Flash" to "All Flash Contents" and reload the programme.
  • #9 19425500
    dasej
    Level 32  
    @khoam Many thanks works.
    Two words of explanation.
  • #10 19425505
    khoam
    Level 42  
    You can go back to "Only Sketch". The whole process of loading the code will be faster.

    Added after 1 [minute]: .

    dasej wrote:
    Two words of explanation.

    There was rubbish in the flash area where the settings for the WiFi network are stored. Unfortunately the WiFi.begin() function doesn't clear this, it just sets those parameters you specified in the program.
  • ADVERTISEMENT
  • #11 19425519
    sylweksylwina
    Moderator of Computers service
    Okay I actually got something mixed up, although I try to avoid delays anyway, maybe that's what got me worked up. Although I'll admit honestly that I haven't figured out the basics like delay in the source files.

    Stack trace decoder would indeed help to track down the problem, although with this simple program it probably helps just to tick "erase all flash contents". Sometimes things can go wrong in the configuration and circuses happen.
  • #12 19425532
    dasej
    Level 32  
    Many thanks for your help @khoam

Topic summary

The discussion revolves around issues with establishing a WiFi connection using the ESP8266MOD module. The user provided a code snippet but encountered problems, including exceptions during execution. Responses suggested checking the power supply, clearing memory, and using the "Erase Flash" option in the Arduino IDE to resolve potential issues with residual settings. The importance of minimizing delays in the code to prevent watchdog timer resets was emphasized. Additionally, using the ESP8266/ESP32 Exception Stack Trace Decoder was recommended for debugging. Ultimately, the user found success by erasing all flash contents, which resolved the connection issue.
Summary generated by the language model.
ADVERTISEMENT