logo elektroda
logo elektroda
X
logo elektroda

ESP32 does not connect to WiFi - USB power, interference, faulty board?

Przybyłek 2085 12
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17998325
    Przybyłek
    Level 13  
    I have an interesting case, the circuit is soldered so it is difficult to swap ESP.


    It sees the network and does not want to connect to it, ESP not on the board works without a problem. Is it something interference from outside(other chips)? - I supply power from USB
    Is it a faulty board?
    Or any other idea?
    Scanning the wifi networks it shows me both but doesn't connect. Sometimes after a day of idling it will connect 3-8 times and then it won't connect anymore. The program only connects to the wifi with a static IP.
  • ADVERTISEMENT
  • #2 17998359
    piterek-23
    Level 33  
    It would be best if you showed a diagram of your board.
  • #3 17998613
    khoam
    Level 42  
    Przybyłek wrote:
    Scanning the wifi networks it shows me both but doesn't connect. Sometimes after a day's downtime it connects 3-8 times and then no longer wants to connect. The program only connects to the wifi with a static IP.
    .
    Show the piece of code where these kinds of problems occur.
  • ADVERTISEMENT
  • #4 17998656
    Przybyłek
    Level 13  
    Code: C / C++
    Log in, to see the code
    .
  • ADVERTISEMENT
  • #5 17998673
    khoam
    Level 42  
    You wrote that you have this ESP32 soldered into the board. Is this the cube itself or the module with the ESP32? It would be good if you posted a picture of both sides of the board where this ESP32 is soldered. For testing though, it's better to power it from a more stable 5V source than a USB port.

    Przybyłek wrote:
    The software only connects to wifi with a static IP.
    .
    Then show how you initialise WiFi.config().
  • ADVERTISEMENT
  • #6 17998731
    Przybyłek
    Level 13  
    I don't even initiate anymore, I just upload an example i.e. download after DHCP. I think I have 2 damaged ESP modules, I mean the processor. The one as written connects once in 10 times. Always the first one when it is cold. The other one does not program itself, it sees it but does not respond :/ The other two work. These are modules, some kind of WEMOS clones. Only that I have to change them to see if it is the influence of some periphery.
    As a curiosity, the device will control the greenhouse (watering, irrigation, lighting, ventilation) and the watering of the vegetable garden.
  • #7 17998747
    khoam
    Level 42  
    You can still check how the antenna works in these ESPs. Fire up some sample program that runs the ESP in AP mode. Then use the WiFi scanner on your tablet/phone to check the signal strength from the ESP.
  • #8 17998944
    kaczakat
    Level 34  
    Problems with WIFI operation are usually power supply related, sometimes replacing the cable with a shorter one, adding a capacitor at the power pin helps. The boards are made some better, some worse, sometimes you have to run a soldering iron over the pins. Admittedly I associate Wemos mainly with ESP8266, but I actually found something similar on Aliexpress with ESP32, only the capacitors on this module look very poor compared to e.g. DOIT Devkit V1.
    Helpful post? Buy me a coffee.
  • #9 17998956
    khoam
    Level 42  
    Przybyłek wrote:
    These are modules, some WEMOS clones.

    They have ESP-32S on board, or ESP-WROOM-32?
  • #12 18002847
    Anonymous
    Level 1  
  • #13 18003054
    khoam
    Level 42  
    Jarzabek666 wrote:
    since I flipped this function from setup to loop I have got the problem over with
    .
    Whether it is in setup() or in loop() it will automatically be found in one FreeRTOS task (loopTask - code below), which is assigned to the CONFIG_ARDUINO_RUNNING_CORE core (default value 1). I don't know if flipping the WiFi connection check from setup() to loop() will help, but from the FreeRTOS point of view it is still the same "loopTask".
    However, the RTOS-SDK functions related to the WiFi stack execute on core 0 by default.
    Code: C / C++
    Log in, to see the code
    .

    P.S. The author is already using FreeRTOS, as the Arduino HAL in ESP32 is based entirely on RTOS-SDK.

Topic summary

The discussion revolves around an ESP32 module that intermittently fails to connect to WiFi despite detecting the network. The user suspects potential issues such as interference from other components, power supply instability from USB, or a faulty board. Responses suggest checking the board's wiring and power source, using a more stable 5V supply, and examining the antenna's performance. The user mentions using WEMOS clones of the ESP32, which may have quality variations. Suggestions include implementing a retry mechanism in the code for WiFi connection attempts and considering the differences between various ESP32 modules. The conversation highlights the importance of proper initialization and configuration in resolving connectivity issues.
Summary generated by the language model.
ADVERTISEMENT