Page 1 of 1

ESP32 AP not showing up

Posted: Tue Dec 13, 2016 4:58 pm
by arao23
I'm on Windows, and I finally got it to flash after following Rudi's post here:
http://esp32.com/viewtopic.php?f=13&p=1512#p1512

So, it looks like it flashed, but it's weird because I don't see "Erasing flash" anywhere, just multiple writes:

Code: Select all

$ make flash
Flashing binaries to serial port COM9 (app at offset 0x10000)...
esptool.py v2.0-dev
Connecting...
Uploading stub...
Running stub...
Stub running...
Attaching SPI flash...
Configuring flash size...
Wrote 16384 bytes at 0x00001000 in 1.4 seconds (91.4 kbit/s)...
Hash of data verified.
Wrote 491520 bytes at 0x00010000 in 43.4 seconds (90.7 kbit/s)...
Hash of data verified.
Wrote 16384 bytes at 0x00008000 in 1.4 seconds (91.6 kbit/s)...
Hash of data verified.

Leaving...
The AP does not show up on any other wifi device -- I feel like I am doing something wrong:

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 wifi_event_handler(void *ctx, system_event_t *event)
{
	switch(event->event_id)
	{
	//case SYSTEM_EVENT_STA_START:
	//	ESP_ERROR_CHECK(esp_wifi_connect());
	//	break;
	default:
		break;
	}

	return ESP_OK;
}

void app_main(void)
{
    nvs_flash_init();
    tcpip_adapter_init();

    ESP_ERROR_CHECK( esp_event_loop_init(wifi_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_AP) );

    wifi_config_t apConfig = {
    		.ap = {
    				.ssid="test12",
					.password="testttt",
					.ssid_len = 0,
					.channel = 0,
					.authmode = WIFI_AUTH_OPEN,
					.ssid_hidden = 0,
					.max_connection=4,
					.beacon_interval = 100
    		}
    };

    ESP_ERROR_CHECK( esp_wifi_set_config(WIFI_IF_AP, &apConfig) );
    ESP_ERROR_CHECK( esp_wifi_start() );
    ESP_ERROR_CHECK( esp_wifi_connect() );

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

Re: ESP32 AP not showing up

Posted: Tue Dec 13, 2016 9:39 pm
by ESP_Angus
Hi arao23,

esptool.py doesn't currently reset the ESP32 after flashing, you have to press the reset button (also labelled EN on some boards) to run the program.

If you connect a serial terminal program at 115200bps and press reset, what output do you see?

Angus

Re: ESP32 AP not showing up

Posted: Tue Dec 13, 2016 9:44 pm
by arao23
Thanks Angus, noticed in the serial terminal program that it was panicking at esp_wifi_connect() as it was only an AP, not a station, so there was nothing to connect to. After commenting out that line, it boots up properly.