Fix SoftAP boot abort: stop DHCP before setting static AP IP; drop RC522 SPI clock to 1 MHz; order RFID before display init
This commit is contained in:
@@ -266,14 +266,23 @@ esp_err_t web_server_start(void)
|
||||
.netmask = { .addr = ESP_IP4TOADDR(255, 255, 255, 0) },
|
||||
.gw = { .addr = ESP_IP4TOADDR(192, 168, 4, 1) },
|
||||
};
|
||||
ESP_ERROR_CHECK(esp_netif_set_ip_info(ap, &ip_info));
|
||||
/* The AP netif has DHCP running by default; stop it before assigning a
|
||||
* static IP, otherwise esp_netif_set_ip_info fails with
|
||||
* ESP_ERR_ESP_NETIF_DHCP_NOT_STOPPED. */
|
||||
esp_netif_dhcps_stop(ap);
|
||||
ret = esp_netif_set_ip_info(ap, &ip_info);
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGE(TAG, "set AP IP failed: %s", esp_err_to_name(ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = esp_wifi_start();
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGE(TAG, "wifi start (APSTA) failed: %s", esp_err_to_name(ret));
|
||||
return ret;
|
||||
}
|
||||
ESP_ERROR_CHECK(esp_netif_dhcps_start(ap));
|
||||
|
||||
(void)esp_netif_dhcps_start(ap); /* harmless if someone else started it */
|
||||
|
||||
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
|
||||
config.stack_size = 6 * 1024;
|
||||
|
||||
Reference in New Issue
Block a user