HTTP server not responding

landre
Posts: 7
Joined: Fri Feb 11, 2022 10:46 am

HTTP server not responding

Postby landre » Sun Feb 13, 2022 2:10 pm

Hello all,

I'm trying to access esp-idf http server by wifi.

The problem:
I can access it only when the wifi is in AP mode, and the ESP32 create it's own AP.
When I try to access it in client mode, the server doesn't accept connection..

Background:
I use a ESP32-WROVER-E (16MB) module with ESP-IDF v4.4-beta1 with -O2.
I have an SPI screen, SD card, and a IR camera FLIR lepton 3.5 on a custom PCB.
The internal web server host a web-socket + boostrap + javascript html page to stream IR pictures.

To switch between wifi AP and STA at boot time, I use a file in SD-card with known network defined.
When there is no know wifi, the ESP32 start in AP mode.
So at boot, the ESP32 scan available network, if SD-Card's known wifi -> wifi STA mode, if no known networks -> wifi AP.

When mode is AP, I also start the DHCP server with a IP defined in the same file.
And I have no problem here .Client have a ip. Connection are fine .
I can access the web server and stream video via websocket to web client (firefox / chrome / android / safari)

In STA mode I use default dhcp client to get ip from the external router.
here the wifi works great too. I can get an IP without problem, and I can ping that ip with low latency.

But the http server doesn't respond... :x

What I have tried
Nmap see the http 80 port opened on the esp32...
I use Hercules (a simple TCP client app) to connect to the esp32 http server. I can connect, I can send data (like GET / HTTP/1.1\n\n), but I never received anything.. (in AP mode it works)
It's not related to my router, as I tried another one.
I'have tryied different initialization, with different delays (500ms between wifi scan and wifi ap or sta init, before starting http server and so on..)

I think I'll go crazy :D

Have you seen something similar? Do you have a suggestion?

Thanks for your help :)
Loïc



Wifi code :

Code: Select all

static const char* TAG = "wifi_task";

static void wifi_event_handler(void* arg, esp_event_base_t event_base,
                                int32_t event_id, void* event_data)
{
	static uint32_t s_retry_num =0;

	wifi_task_t * wt = (wifi_task_t*) arg;

    if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) {
    	wt->status = WIFIT_STA_DISCO;
        esp_wifi_connect();
    } else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) {
        ESP_LOGI(TAG,"Wifi disconnected");
    	wt->status = WIFIT_STA_DISCO;

        memset(&wt->wiSTA_IP, 255, sizeof(ip4_addr_t));
        memset(&wt->wiSTA_GW, 255, sizeof(ip4_addr_t));

		xTaskNotify(http_task_get_handle(), HT_NOTIFY_NET_GONE, eSetBits);

        if (s_retry_num < WIFI_MAXIMUM_RETRY) {
            esp_wifi_connect();
            s_retry_num++;
            ESP_LOGI(TAG, "retry to connect to the AP");
        }
    } else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) {
        ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data;
        ESP_LOGI(TAG, "got ip \"%s\"", ip4addr_ntoa((ip4_addr_t*)&event->ip_info.ip));

        memcpy(&wt->wiSTA_GW, &event->ip_info.gw, sizeof(ip4_addr_t));
        memcpy(&wt->wiSTA_IP, &event->ip_info.ip, sizeof(ip4_addr_t));


		xTaskNotify(http_task_get_handle(), HT_NOTIFY_GET_IP, eSetBits);
        s_retry_num = 0;
    	wt->status = WIFIT_STA;
    }


    if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_AP_STACONNECTED) {
        wifi_event_ap_staconnected_t* event = (wifi_event_ap_staconnected_t*) event_data;
        ESP_LOGI(TAG, "station "MACSTR" join, AID=%d",
                 MAC2STR(event->mac), event->aid);
    } else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_AP_STADISCONNECTED) {
        wifi_event_ap_stadisconnected_t* event = (wifi_event_ap_stadisconnected_t*) event_data;
        ESP_LOGI(TAG, "station "MACSTR" leave, AID=%d",
                 MAC2STR(event->mac), event->aid);
    }
}



void wifi_task_init(wifi_task_t *wt, data_man_t * dm)
{
	assert(wt != NULL);
	assert(dm != NULL);

	wt->status = WIFIT_INIT;
	wt->wiSTA_num =-1;
	wt->wiSTA_bitmask =0;

    memset(&wt->wiSTA_IP, 255, sizeof(ip4_addr_t));
    memset(&wt->wiSTA_GW, 255, sizeof(ip4_addr_t));

	esp_err_t ret = nvs_flash_init();
    if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
      ESP_ERROR_CHECK(nvs_flash_erase());
      ret = nvs_flash_init();
    }

    ESP_ERROR_CHECK(esp_netif_init());
    ESP_ERROR_CHECK(esp_event_loop_create_default());

    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_storage(WIFI_STORAGE_FLASH) );

    int8_t sta = wifi_check_known(wt,dm);
	vTaskDelay(80);
    if(sta >= 0)
    	wifi_mode_sta(wt,dm);
    else
    	wifi_mode_ap(wt,dm);

}


esp_err_t wifi_mode_sta(wifi_task_t *wt, data_man_t * dm)
{
	assert(wt != NULL);
	assert(dm != NULL);


	if(wt->status < WIFIT_INIT)
		return ESP_FAIL;
	if(wt->wiSTA_num <0)
		return ESP_FAIL;
	if(wt->wiSTA_num > WIFISTA_MAXNUM )
		return ESP_FAIL;

//	esp_netif_config_t netif_cfg = ESP_NETIF_DEFAULT_WIFI_STA();
//	wt->netif = esp_netif_new(&netif_cfg);
//	assert(wt->netif);
//
//	esp_netif_attach_wifi_station(wt->netif);
//	esp_wifi_set_default_wifi_sta_handlers();
//    esp_netif_set_hostname(wt->netif, HOSTNAME);

    esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta();
    assert(sta_netif);

	ESP_LOGI(TAG, "Wifi mode STA, try to connect to %s", dm->WifiSTA[wt->wiSTA_num].name);

    wifi_config_t sta_config = {
        .sta = {
            .ssid = "",
            .password = "",
            .bssid_set = false

        }
    };

	memcpy(sta_config.sta.ssid,      dm->WifiSTA[wt->wiSTA_num].name, CONF_STRING_LEN_MAX);
	memcpy(sta_config.sta.password,  dm->WifiSTA[wt->wiSTA_num].pass, CONF_STRING_LEN_MAX);

    ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_STA) );
    ESP_ERROR_CHECK( esp_wifi_set_config(WIFI_IF_STA, &sta_config) );
    ESP_ERROR_CHECK( esp_wifi_start() );
    ESP_ERROR_CHECK( esp_wifi_connect() );

    esp_event_handler_instance_t instance_any_id;
    esp_event_handler_instance_t instance_got_ip;
    ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT,
                                                        ESP_EVENT_ANY_ID,
														wifi_event_handler,
														(void *) wt,
                                                        &instance_any_id));
    ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT,
                                                        IP_EVENT_STA_GOT_IP,
														wifi_event_handler,
														(void *) wt,
                                                        &instance_got_ip));
    return ESP_OK;
}


esp_err_t wifi_mode_ap(wifi_task_t *wt, data_man_t * dm)
{
	assert(wt != NULL);
	assert(dm != NULL);

	if(wt->status < WIFIT_INIT)
		return ESP_FAIL;



	ESP_LOGI(TAG, "Set IP: %s", ip4addr_ntoa(&dm->WifiAP.ip));

	// Start DHCP SERVER
	esp_netif_config_t netif_cfg = ESP_NETIF_DEFAULT_WIFI_AP();
	wt->netif = esp_netif_new(&netif_cfg);
    assert(wt->netif);

	esp_netif_dhcps_stop(wt->netif);
    esp_netif_ip_info_t info;
    memcpy(&info.ip, &dm->WifiAP.ip, sizeof(ip4_addr_t));
    memcpy(&info.gw, &dm->WifiAP.ip, sizeof(ip4_addr_t)); // same as ip because esp is the gateway
    IP4_ADDR(&info.netmask, 255, 255, 255, 0);

    ESP_ERROR_CHECK(esp_netif_set_ip_info(wt->netif, &info));

    esp_netif_attach_wifi_ap(wt->netif);
    esp_wifi_set_default_wifi_ap_handlers();

	ESP_LOGI(TAG, "Start DHCP server");
    dhcps_lease_t lease;
    lease.enable = true;
    lease.start_ip.addr = dm->WifiAP.ip.addr + (1  << 24);
    lease.end_ip.addr   = dm->WifiAP.ip.addr + (10 << 24);
	ESP_LOGI(TAG, "DHCPs start ip : %s",ip4addr_ntoa(&lease.start_ip));
	ESP_LOGI(TAG, "DHCPs end   ip : %s",ip4addr_ntoa(&lease.end_ip));
//    ESP_ERROR_CHECK(tcpip_adapter_dhcps_option(
//                (tcpip_adapter_dhcp_option_mode_t)TCPIP_ADAPTER_OP_SET,
//                (tcpip_adapter_dhcp_option_id_t)TCPIP_ADAPTER_REQUESTED_IP_ADDRESS,
//                (void*)&lease, sizeof(dhcps_lease_t)));
    ESP_ERROR_CHECK(esp_netif_dhcps_start(wt->netif));
    esp_netif_set_hostname(wt->netif, HOSTNAME);

	ESP_ERROR_CHECK(esp_netif_dhcps_option(wt->netif, ESP_NETIF_OP_SET, ESP_NETIF_REQUESTED_IP_ADDRESS, &lease, sizeof(dhcps_lease_t)));

	ESP_LOGI(TAG, "Wifi mode AP");

	// Start AP
    wifi_config_t ap_config = {
        .ap = {
            .channel = 8,
            .max_connection = 5,
            .authmode = WIFI_AUTH_WPA_WPA2_PSK
        },
    };


	memcpy(ap_config.ap.ssid,      dm->WifiAP.name, CONF_STRING_LEN_MAX);
	memcpy(ap_config.ap.password,  dm->WifiAP.pass, CONF_STRING_LEN_MAX);

	ap_config.ap.ssid_len = strlen(dm->WifiAP.name);

    if (strlen(dm->WifiAP.pass) == 0) {
    	ap_config.ap.authmode = WIFI_AUTH_OPEN;
    }

    ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_AP));
    ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_AP, &ap_config));
    ESP_ERROR_CHECK(esp_wifi_start());


    ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT,
                                                        ESP_EVENT_ANY_ID,
                                                        &wifi_event_handler,
                                                        (void *) wt,
                                                        NULL));

    //start http server as we are connected
    xTaskNotify(http_task_get_handle(), HT_NOTIFY_GET_IP, eSetBits);

    return ESP_OK;
}


esp_err_t wifi_check_known(wifi_task_t *wt, data_man_t * dm)
{
	assert(wt != NULL);
	assert(dm != NULL);

	ESP_LOGI(TAG, "search for known wifi..");

	if(wt->status < WIFIT_INIT)
		return ESP_FAIL;

	wt->wiSTA_num = -1;

	uint16_t number = WIFI_MAX_AP_LIST;
	wifi_ap_record_t ap_info[WIFI_MAX_AP_LIST];
	uint16_t ap_count = 0;
	memset(ap_info, 0, sizeof(ap_info));

	for(uint8_t known =0; known < WIFISTA_MAXNUM; known++)
	{
		ESP_LOGI(TAG, "Known Wifi : %s",dm->WifiSTA[known].name);
	}

	ESP_LOGI(TAG, "start scan mode..");
	ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
	ESP_ERROR_CHECK(esp_wifi_start());
	esp_wifi_scan_start(NULL, true);
	ESP_ERROR_CHECK(esp_wifi_scan_get_ap_records(&number, ap_info));
	ESP_ERROR_CHECK(esp_wifi_scan_get_ap_num(&ap_count));
	ESP_LOGI(TAG, "Total APs scanned = %u", ap_count);

	for (uint8_t i = 0; (i < WIFI_MAX_AP_LIST) && (i < ap_count); i++)
	{
		ESP_LOGI(TAG, "Wifi : %s",ap_info[i].ssid);
		for(uint8_t known =0; known < WIFISTA_MAXNUM; known++)
		{
			if((strcmp((char*)ap_info[i].ssid, dm->WifiSTA[known].name) ==0) && (ap_info[i].rssi > -90)){
				ESP_LOGI(TAG, "  SSID %s", ap_info[i].ssid);
				ESP_LOGI(TAG, "  RSSI %d", ap_info[i].rssi);
				ESP_LOGI(TAG, "  CHAN %d", ap_info[i].primary);
				ESP_LOGI(TAG, "Found known Wifi : %s",dm->WifiSTA[known].name);
				wt->wiSTA_num = known;
				wt->wiSTA_bitmask = 1 << known;
				break;
			}
		}

		if(wt->wiSTA_num >=0 ){
			break;
		}
	}
	ESP_ERROR_CHECK(esp_wifi_scan_stop());
	ESP_ERROR_CHECK(esp_wifi_stop());
	if(wt->wiSTA_num <0)
		ESP_LOGI(TAG, "found no known wifi...");

	return wt->wiSTA_num;
}
HTTP init code :

Code: Select all

void http_task()
{

	uint32_t notification_value;
	uint8_t GetAsyncFlag =0;

	ESP_LOGI(TAG, "Start task");

	while (true)
	{
		if (xTaskNotifyWait(0x00, 0xFFFFFFFF, &notification_value, portMAX_DELAY ))
		{
			if(Notification(notification_value,HT_NOTIFY_NET_GONE)){
				ESP_LOGI(TAG, "Close HTTPs");
				if(ht->serverhdl != NULL)
					httpd_stop(ht->serverhdl);
			}
			if(Notification(notification_value,HT_NOTIFY_GET_IP)){
				vTaskDelay(100);
				httpd_config_t config = HTTPD_DEFAULT_CONFIG();
				//config.task_priority      = 8;
				config.core_id            = 0;

				config.lru_purge_enable = true;

				ESP_LOGI(TAG, "Starting server on port: '%d'", config.server_port);

				ht->serverhdl = NULL;
				if (httpd_start(&ht->serverhdl, &config) != ESP_OK) {
				    ESP_LOGI(TAG, "Error starting server!");
				}
				else{
					ESP_LOGI(TAG, "Registering URI handlers");
					ESP_ERROR_CHECK(httpd_register_uri_handler(ht->serverhdl, &ws));
					ESP_ERROR_CHECK(httpd_register_uri_handler(ht->serverhdl, &root));
					ESP_ERROR_CHECK(httpd_register_uri_handler(ht->serverhdl, &index_html));
					ESP_ERROR_CHECK(httpd_register_uri_handler(ht->serverhdl, &favicon_ico));
					ESP_ERROR_CHECK(httpd_register_uri_handler(ht->serverhdl, &bootstrap_css));
					ESP_ERROR_CHECK(httpd_register_uri_handler(ht->serverhdl, &bootstrap_js));

					ESP_LOGI(TAG, "Init OK");
				}
			}
	...... no relevent code.......
	
Main init :

Code: Select all

	// initialization of HTTP web server, need to be called before wifi
	http_task_init(&https,&lepton);
	xTaskCreatePinnedToCore(&http_task, "http_task",  8192, NULL, 9, &https.task_handle,  0);

	// initialization of wifi, need file_task and http_task started before
	ESP_LOGI(TAG, "initialize wifi...");
	wifi_task_init(&wifi,&dataman);
WIFI STA log

Code: Select all

I (30) boot: ESP-IDF v4.4-beta1 2nd stage bootloader
I (31) boot: compile time 10:35:02
I (31) boot: chip revision: 3
I (34) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (41) qio_mode: Enabling default flash chip QIO
I (46) boot.esp32: SPI Speed      : 80MHz
I (51) boot.esp32: SPI Mode       : QIO
I (55) boot.esp32: SPI Flash Size : 8MB
I (60) boot: Enabling RNG early entropy source...
I (65) boot: Partition Table:
I (69) boot: ## Label            Usage          Type ST Offset   Length
I (76) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (84) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (91) boot:  2 factory          factory app      00 00 00010000 00400000
I (99) boot:  3 storage          Unknown data     01 82 00410000 00300000
I (106) boot: End of partition table
I (110) boot_comm: chip revision: 3, min. application chip revision: 0
I (118) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=6f7d0h (456656) map
I (252) esp_image: segment 1: paddr=0007f7f8 vaddr=3ffb0000 size=00820h (  2080) load
I (253) esp_image: segment 2: paddr=00080020 vaddr=400d0020 size=90398h (590744) map
I (421) esp_image: segment 3: paddr=001103c0 vaddr=3ffb0820 size=036c4h ( 14020) load
I (425) esp_image: segment 4: paddr=00113a8c vaddr=40080000 size=1c788h (116616) load
I (464) esp_image: segment 5: paddr=0013021c vaddr=50000000 size=00010h (    16) load
I (478) boot: Loaded app from partition at offset 0x10000
I (478) boot: Disabling RNG early entropy source...
I (490) psram: This chip is ESP32-D0WD
I (490) spiram: Found 64MBit SPI RAM device
I (490) spiram: SPI RAM mode: flash 80m sram 40m
I (495) spiram: PSRAM initialized, cache is in low/high (2-core) mode.
I (503) cpu_start: Pro cpu up.
I (506) cpu_start: Starting app cpu, entry point is 0x4008172c
I (498) cpu_start: App cpu up.
I (1378) spiram: SPI SRAM memory test OK
I (1385) cpu_start: Pro cpu start user code
I (1385) cpu_start: cpu freq: 240000000
I (1385) cpu_start: Application information:
I (1388) cpu_start: Project name:     IRCAM_Test
I (1394) cpu_start: App version:      1
I (1398) cpu_start: Compile time:     Feb 13 2022 10:34:51
I (1404) cpu_start: ELF file SHA256:  f97bff5f372f9a1c...
I (1410) cpu_start: ESP-IDF:          v4.4-beta1
I (1416) heap_init: Initializing. RAM available for dynamic allocation:
I (1423) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (1429) heap_init: At 3FFC1648 len 0001E9B8 (122 KiB): DRAM
I (1436) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (1442) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1449) heap_init: At 4009C788 len 00003878 (14 KiB): IRAM
I (1455) spiram: Adding pool of 4095K of external SPI memory to heap allocator
I (1463) spi_flash: detected chip: gd
I (1467) spi_flash: flash io: qio
W (1471) spi_flash: Detected size(16384k) larger than the size in the binary image header(8192k). Using the size in the binary image header.
I (1485) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (1495) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations

IRCAM Init...
I (1505) System_init: GPIO Init
I (1835) System_init: SPI_init 1
I (1835) System_init: SPI_init 2
I (1835) System_init: I2c init
I (1835) System_init: adc init
I (1835) System_init: vbat=4.29
I (1835) data_manager: init...
I (1845) data_manager: init successful
I (1845) file_task: init
I (1845) SD: init SD card
I (1855) SD: Mounting filesystem
I (1855) gpio: GPIO[4]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1905) sdspi_transaction: cmd=5, R1 response: command not supported
Name: ACLCD
Type: SDHC/SDXC
Speed: 20 MHz
Size: 30436MB
I (2145) SD: Filesystem mounted
I (2145) file_task: /sdcard/settings.txt exists, load settings...
I (2155) file_task: file size = 273, read file...
I (2165) data_manager: wifiAP SSID :  "ESPAP"
I (2175) data_manager: wifiAP IP :  "192.168.10.1"
I (2185) data_manager: wifiSTA 0 SSID :  "Meuh"
I (2195) file_task: Settings successfully decoded
I (2205) file_task: init done
I (2205) main: initialize screen...
I (2205) screen_task: TFT IO init
I (2315) screen_task: TFT init
I (2605) screen_task: gui init
I (2605) GUI: gui init, screen : 240x240, gram_len*2=115200
I (2615) GUI: gui init, Done
I (2615) screen_task: lcd clear
I (2655) main: initialize button task...
I (2655) main: initialize lepton task
I (2655) main: Start critical tasks
I (2655) screen_task: Start task
I (2665) file_task: Start task
I (2665) main: Start remaining tasks
I (2665) lep_task: Start task
I (2675) http_task: Init
I (2675) lep_task: CCI interface init
I (2675) http_task: Start task
I (2675) main: initialize wifi...
I (2735) wifi:wifi driver task: 3ffd89e8, prio:23, stack:6656, core=0
I (2735) system_api: Base MAC address is not set
I (2735) system_api: read default base MAC address from EFUSE
I (2745) wifi:wifi firmware version: f84e709
I (2745) wifi:wifi certification version: v7.0
I (2745) wifi:config NVS flash: enabled
I (2745) wifi:config nano formating: disabled
I (2755) wifi:Init data frame dynamic rx buffer num: 32
I (2755) wifi:Init management frame dynamic rx buffer num: 32
I (2765) wifi:Init management short buffer num: 32
I (2765) wifi:Init static tx buffer num: 16
I (2775) wifi:Init tx cache buffer num: 32
I (2775) wifi:Init static rx buffer size: 1600
I (2775) wifi:Init static rx buffer num: 10
I (2785) wifi:Init dynamic rx buffer num: 32
I (2785) wifi_init: rx ba win: 6
I (2795) wifi_init: tcpip mbox: 32
I (2795) wifi_init: udp mbox: 6
I (2795) wifi_init: tcp mbox: 6
I (2805) wifi_init: tcp tx win: 5744
I (2805) wifi_init: tcp rx win: 5744
I (2815) wifi_init: tcp mss: 1440
I (2815) wifi_init: WiFi IRAM OP enabled
I (2825) wifi_init: WiFi RX IRAM OP enabled
I (2825) wifi_task: search for known wifi..
I (2835) wifi_task: Known Wifi : Plop
I (2835) wifi_task: Known Wifi : Meuh
I (2855) wifi_task: start scan mode..
I (2855) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
W (3005) phy_init: saving new calibration data because of checksum failure, mode(0)
I (3025) wifi:mode : sta (e0:e2:e6:33:9a:b0)
I (3025) wifi:enable tsf
I (5175) wifi_task: Total APs scanned = 3
I (5175) wifi_task: Wifi : Meuh
I (5175) wifi_task:   SSID Meuh
I (5185) wifi_task:   RSSI -49
I (5185) wifi_task:   CHAN 1
I (5185) wifi_task: Found known Wifi : Meuh
I (5195) wifi:flush txq
I (5195) wifi:stop sw txq
I (5195) wifi:lmac stop hw txq
I (6005) wifi_task: Wifi mode STA, try to connect to Meuh
I (6005) wifi:mode : sta (e0:e2:e6:33:9a:b0)
I (6005) wifi:enable tsf
I (6005) main: memory heap free size: 3901595
I (6005) main: memory heap minimum free size: 3901595
I (6005) wifi:new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1
I (6545) wifi:state: init -> auth (b0)
I (6545) main: memory heap largest free block: 2097152
I (6545) main: init done..
I (6555) main:  End main task
I (6555) wifi:state: auth -> assoc (0)
I (6565) wifi:state: assoc -> run (10)
I (6585) wifi:connected with Meuh, aid = 3, channel 1, BW20, bssid = 38:10:d5:e2:a2:aa
I (6585) wifi:security: WPA2-PSK, phy: bgn, rssi: -51
I (6595) wifi:pm start, type: 1

W (6595) wifi:<ba-add>idx:0 (ifx:0, 38:10:d5:e2:a2:aa), tid:0, ssn:0, winSize:64
I (6685) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (8225) esp_netif_handlers: sta ip: 192.168.2.107, mask: 255.255.255.0, gw: 192.168.2.1
I (8225) wifi_task: got ip "192.168.2.107"
I (9225) http_task: Starting server on port: '80'
I (9225) http_task: Registering URI handlers
I (9225) http_task: Init OK

ESP_Mahavir
Posts: 190
Joined: Wed Jan 24, 2018 6:51 am

Re: HTTP server not responding

Postby ESP_Mahavir » Thu Feb 17, 2022 3:54 pm

Does `simple` HTTP server example from ESP-IDF (https://github.com/espressif/esp-idf/tr ... ver/simple) work for you?

landre
Posts: 7
Joined: Fri Feb 11, 2022 10:46 am

Re: HTTP server not responding

Postby landre » Thu Feb 17, 2022 6:02 pm

I just tested it. It don't work too.

So I tested an third autonomous Wifi access point, and it work flawlessly.
I have a weird problem with my router.
It seems to block the packet... I don't know why, it's not supposed to.
I'm going to invest further.

I'll let you know.
Thank's

Loïc

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

Re: HTTP server not responding

Postby ESP_Sprite » Fri Feb 18, 2022 1:32 am

There's a common access point setting that disallows WiFi stations to communicate with eachother... maybe you need to look for that?

landre
Posts: 7
Joined: Fri Feb 11, 2022 10:46 am

Re: HTTP server not responding

Postby landre » Sat Feb 19, 2022 3:17 pm

Thank you Sprite, it was exactly that...

So I found a workaround :D

See you !

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 222 guests