mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-08 13:10:52 +00:00
ESPNOW + WiFi
This commit is contained in:
@@ -141,7 +141,7 @@ void wifi_init()
|
|||||||
/*
|
/*
|
||||||
* STAND-ALONE
|
* STAND-ALONE
|
||||||
*/
|
*/
|
||||||
/*ESP_ERROR_CHECK(esp_netif_init());
|
ESP_ERROR_CHECK(esp_netif_init());
|
||||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||||
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
|
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
|
||||||
ESP_ERROR_CHECK( esp_wifi_init(&cfg) );
|
ESP_ERROR_CHECK( esp_wifi_init(&cfg) );
|
||||||
@@ -153,11 +153,12 @@ void wifi_init()
|
|||||||
#if CONFIG_ESPNOW_ENABLE_LONG_RANGE
|
#if CONFIG_ESPNOW_ENABLE_LONG_RANGE
|
||||||
ESP_ERROR_CHECK( esp_wifi_set_protocol(ESPNOW_WIFI_IF, WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_LR) );
|
ESP_ERROR_CHECK( esp_wifi_set_protocol(ESPNOW_WIFI_IF, WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_LR) );
|
||||||
#endif
|
#endif
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* WI-FI
|
* WI-FI
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
ESP_ERROR_CHECK(esp_netif_init());
|
ESP_ERROR_CHECK(esp_netif_init());
|
||||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||||
esp_netif_create_default_wifi_sta();
|
esp_netif_create_default_wifi_sta();
|
||||||
@@ -176,6 +177,7 @@ void wifi_init()
|
|||||||
ESP_ERROR_CHECK( esp_wifi_start());
|
ESP_ERROR_CHECK( esp_wifi_start());
|
||||||
//ESP_ERROR_CHECK( esp_wifi_set_channel(CONFIG_ESPNOW_CHANNEL, WIFI_SECOND_CHAN_NONE));
|
//ESP_ERROR_CHECK( esp_wifi_set_channel(CONFIG_ESPNOW_CHANNEL, WIFI_SECOND_CHAN_NONE));
|
||||||
ESP_ERROR_CHECK( esp_wifi_connect() );
|
ESP_ERROR_CHECK( esp_wifi_connect() );
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
// Task to periodically send ESPNOW remote control data
|
// Task to periodically send ESPNOW remote control data
|
||||||
|
Reference in New Issue
Block a user