Skip to content

Instantly share code, notes, and snippets.

@hoon
hoon / esp32-example.c
Created December 23, 2017 07:55
Correct place to call tcpip_adapter_set_hostname() to set Wi-Fi client host name in ESP-IDF
ESP_ERROR_CHECK( esp_wifi_set_config(WIFI_IF_STA, &sta_config) );
ESP_ERROR_CHECK( esp_wifi_start() );
ESP_ERROR_CHECK(
tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_STA, "custom-hostname") );
ESP_ERROR_CHECK( esp_wifi_connect() );