esp32 wroom custom board & wifi

Gaston1980
Posts: 41
Joined: Sun Oct 06, 2024 10:26 am

esp32 wroom custom board & wifi

Postby Gaston1980 » Fri Jun 06, 2025 11:49 am

Hi to all, I made my own board with the esp32 wroom 32E and I'm able to flash it and debug it with the esp-prog board without problems. But an strange problem is happening. I'm using the WiFi connection and when I tried to set the configs the program go to panic. This line:

Code: Select all

ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_configuration));
this is the output I got:

I already test and use this code with the esp32wroom dev board and works like a charm. But I don't understand why in this custom board I got problems with the WiFi settings. a couple of questions:
1) Do I need to enable something on menuconfig?
2) Could this be a hardware problem? But why am I able to program and debug the board?

P.S: I also test this code in a different custom board and still get this problem. Only work in the development board.
Thanks
Gastón
Attachments
error_wifi.png
error_wifi.png (107.54 KiB) Viewed 179 times
error_wifi.png
error_wifi.png (107.54 KiB) Viewed 179 times

ahsrabrifat
Posts: 201
Joined: Sat Jan 18, 2025 2:31 pm

Re: esp32 wroom custom board & wifi

Postby ahsrabrifat » Fri Jun 06, 2025 2:06 pm

Have you run a continuity test on your board?

Gaston1980
Posts: 41
Joined: Sun Oct 06, 2024 10:26 am

Re: esp32 wroom custom board & wifi

Postby Gaston1980 » Fri Jun 06, 2025 2:25 pm

thanks for reply, I guess is a link problem with router. But why? if I change

Code: Select all

ESP_IF_WIFI_STA
to

Code: Select all

ESP_IF_WIFI_AP
this is the wifi config i have in code:

Code: Select all

 ESP_ERROR_CHECK(esp_netif_init());                    // TCP/IP initiation 					s1.1
    ESP_ERROR_CHECK(esp_event_loop_create_default());     // event loop 			                s1.2
    my_staif = esp_netif_create_default_wifi_sta(); // WiFi station 	                    s1.3
    wifi_init_config_t wifi_initiation = WIFI_INIT_CONFIG_DEFAULT();
    ESP_ERROR_CHECK(esp_wifi_init(&wifi_initiation)); // 					                    s1.4
    // 2 - Wi-Fi Configuration Phase
    esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, wifi_event_handler, NULL);
    esp_event_handler_register(IP_EVENT, IP_EVENT_STA_GOT_IP, wifi_event_handler, NULL);
    wifi_config_t wifi_configuration = {
        .sta = {
            .ssid = "",
            .password ="",   
            .threshold.authmode = WIFI_AUTH_WPA2_PSK,       
            }
            };
    strcpy((char*)wifi_configuration.sta.ssid,SSID);
    strcpy((char*)wifi_configuration.sta.password,PASS);
    ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_configuration));//change STA to AP
    ESP_ERROR_CHECK(esp_wifi_start());
    ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));//change STA to AP
    ESP_ERROR_CHECK(esp_wifi_connect());
    esp_wifi_get_ps(0);
where SSID and PASS are in different file, but this code works in the dedvelopment board esp32 wroom. Now in the custom board with the esp32E just jump to panic.

Could thi be a problem with the router? I enabled the wifi debugging but can't see anything. The esp32E module somehow is not able to link with the router.

MicroController
Posts: 2672
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: esp32 wroom custom board & wifi

Postby MicroController » Fri Jun 06, 2025 7:17 pm

Any log output (-> IDF monitor) would be more helpful than the debugger screenshot.

Notice that ESP_ERROR_CHECK(...) calls abort() upon a non-OK result. So the abort() you get could stem from any ESP_ERROR_CHECK() in your code, not just the esp_wifi_set_config(...) call itself.
Could this be a problem with the router?
Sure, it could (MAC address restriction?). Or with the antenna or connection on your board. Or with the power supply. Or...

Gaston1980
Posts: 41
Joined: Sun Oct 06, 2024 10:26 am

Re: esp32 wroom custom board & wifi

Postby Gaston1980 » Sat Jun 07, 2025 3:10 am

Hi Microcontroller thanks for the reply. At first I thought it was a hardware or router problem. But I was able to debug the development board with the esp-prog and the code works great in the esp32 dev board. I have the latest esp-idf installed on linux ubuntu 64. I have the project in a different folder (no the esp folder) and debugging step by step the custom board I found that most of the source code is not recognized in the custom board ( i got the "not defnition found for.." like the image below with the ESP_OK).
I was able to link the WiFi with the network, but need to add headers files manually to the proj folder, which seems wierd because using the esp32E development board the code works great as it is.
This is my first custom board with the esp32E module and got some question:
1)why the code works great in the dev board but not in the custom board?
2)I add all the files need for this proj in the CMakeList.txt, but now some data is not recognized, why?
this code was working OK and now most of it is not recognized, but some how works in the dev board.
Thanks
Attachments
CMakeLists.txt
(908 Bytes) Downloaded 5 times
Captura desde 2025-06-06 23-22-45.png
Captura desde 2025-06-06 23-22-45.png (29.94 KiB) Viewed 157 times

Who is online

Users browsing this forum: Bytespider, ChatGPT-User, Qwantbot and 3 guests