Simple Wifi not working - rebooting

maxwell32
Posts: 5
Joined: Thu Apr 13, 2017 6:14 pm

Simple Wifi not working - rebooting

Postby maxwell32 » Thu Apr 13, 2017 6:22 pm

Hello,

I'm having serious issues getting the Wifi working. I want to create an access point and figured out that the esp_wifi_start() always leaded to a reboot of the ESP32. So I tried the esp-idf-template with the wifi-station-mode and commented the esp_wifi_connect()-line. But still an error occurs and the ESP32 keeps rebooting. Do you have any idea how I can fix this problem?

This is the serial output and below you can see the code.
Thank you in advance! :)

Code: Select all

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0008,len:8
load:0x3fff0010,len:3168
load:0x40078000,len:8568
load:0x40080000,len:252
entry 0x40080034
[0;32mI (805) cpu_start: Pro cpu up.[0m
[0;32mI (805) cpu_start: Single core mode[0m
[0;32mI (806) heap_alloc_caps: Initializing. RAM available for dynamic allocation:[0m
[0;32mI (818) heap_alloc_caps: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM[0m
[0;32mI (838) heap_alloc_caps: At 3FFB6860 len 000297A0 (165 KiB): DRAM[0m
[0;32mI (859) heap_alloc_caps: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM[0m
[0;32mI (880) heap_alloc_caps: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM[0m
[0;32mI (902) heap_alloc_caps: At 4009A1F4 len 00005E0C (23 KiB): IRAM[0m
[0;32mI (922) cpu_start: Pro cpu start user code[0m
[0;32mI (981) cpu_start: Starting scheduler on PRO CPU.[0m
I (1036) wifi: wifi firmware version: a8ef40a
I (1037) wifi: config NVS flash: enabled
I (1037) wifi: config nano formating: disabled
I (1042) wifi: Init dynamic tx buffer num: 32
I (1043) wifi: wifi driver task: 3ffbb0ec, prio:23, stack:3584
I (1048) wifi: Init static rx buffer num: 10
I (1052) wifi: Init dynamic rx buffer num: 0
I (1056) wifi: Init rx ampdu len mblock:7
I (1060) wifi: Init lldesc rx ampdu entry mblock:4
I (1064) wifi: wifi power manager task: 0x3ffc04a4 prio: 21 stack: 2560
I (1071) wifi: wifi timer task: 3ffc1534, prio:22, stack:3584
Guru Meditation Error of type InstrFetchProhibited occurred on core  0. Exception was unhandled.
Register dump:
PC      : 0xffffffff  PS      : 0x00060230  A0      : 0x8008c016  A1      : 0x3ffbaeb0  
A2      : 0x3f401040  A3      : 0x3ffb66e6  A4      : 0x00000009  A5      : 0xffffffe8  
A6      : 0xffffffce  A7      : 0x3ffb1d4c  A8      : 0xffffffff  A9      : 0x3ffbaec0  
A10     : 0x00000000  A11     : 0x00000002  A12     : 0x5fff0007  A13     : 0x00000000  
A14     : 0x00000000  A15     : 0x00000000  SAR     : 0x00000000  EXCCAUSE: 0x00000014  
EXCVADDR: 0xfffffffc  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0x00000000  

Backtrace: 0x7fffffff:0x3ffbaeb0 0x4008c016:0x3ffbaed0 0x40088fa1:0x3ffbaf10 0x40089f15:0x3ffbaf40 0x4008a6e3:0x3ffbaf60 0x40108ee8:0x3ffbaf80 0x4010907d:0x3ffbafa0 0x400d7aa3:0x3ffbafc0 0x400d7ae1:0x3ffbaff0 0x400d8082:0x3ffbb020 0x40093fe2:0x3ffbb040

Code: Select all

#include "freertos/FreeRTOS.h"
#include "esp_wifi.h"
#include "esp_system.h"
#include "esp_event.h"
#include "esp_event_loop.h"
#include "nvs_flash.h"
#include "driver/gpio.h"

esp_err_t event_handler(void *ctx, system_event_t *event)
{
    return ESP_OK;
}

void app_main(void)
{
    nvs_flash_init();
    tcpip_adapter_init();
    ESP_ERROR_CHECK( esp_event_loop_init(event_handler, NULL) );
    wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
    ESP_ERROR_CHECK( esp_wifi_init(&cfg) );
    ESP_ERROR_CHECK( esp_wifi_set_storage(WIFI_STORAGE_RAM) );
    ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_STA) );
    wifi_config_t sta_config = {
        .sta = {
            .ssid = "access_point_name",
            .password = "password",
            .bssid_set = false
        }
    };
    ESP_ERROR_CHECK( esp_wifi_set_config(WIFI_IF_STA, &sta_config) );
    ESP_ERROR_CHECK( esp_wifi_start() );
    //ESP_ERROR_CHECK( esp_wifi_connect() );

    gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT);
    int level = 0;
    while (true) {
        gpio_set_level(GPIO_NUM_17, level);
        level = !level;
        vTaskDelay(300 / portTICK_PERIOD_MS);
    }
}

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Simple Wifi not working - rebooting

Postby ESP_igrr » Fri Apr 14, 2017 4:32 am

Which ESP32 development board are you using, and how are you powering it?

Also, could you please post the output of "git describe" and "git status" in the ESP-IDF directory. Thanks.

ESP_Sprite
Posts: 9769
Joined: Thu Nov 26, 2015 4:08 am

Re: Simple Wifi not working - rebooting

Postby ESP_Sprite » Fri Apr 14, 2017 4:43 am

What do you use as a power supply? Can it provide at least 300mA and preferably 500mA of current? (3.3V outputs from USB-to-serial boards are known to be inadequate for this.)

maxwell32
Posts: 5
Joined: Thu Apr 13, 2017 6:14 pm

Re: Simple Wifi not working - rebooting

Postby maxwell32 » Sun Apr 16, 2017 1:57 pm

Thanks for your reply. I used my USB port to power it.
Now I built an external 3.3 power supply and it works without problems.

Thank you!

Who is online

Users browsing this forum: BipinDangwal, ESP_Roland, Google [Bot], ok-home and 67 guests