From 1543642dc2721f1804504ffe2a9024ef990917c2 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 9 Oct 2024 14:22:16 -0700 Subject: [PATCH] Fix mac address formatting and disable aesio for ESP --- ports/espressif/common-hal/wifi/__init__.c | 3 ++- ports/espressif/mpconfigport.mk | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/espressif/common-hal/wifi/__init__.c b/ports/espressif/common-hal/wifi/__init__.c index 710688b9d31c..1a4c014bfbc5 100644 --- a/ports/espressif/common-hal/wifi/__init__.c +++ b/ports/espressif/common-hal/wifi/__init__.c @@ -212,7 +212,8 @@ void common_hal_wifi_init(bool user_initiated) { char cpy_default_hostname[board_len + (MAC_ADDRESS_LENGTH * 2) + 6]; uint8_t mac[MAC_ADDRESS_LENGTH]; esp_wifi_get_mac(ESP_IF_WIFI_STA, mac); - snprintf(cpy_default_hostname, sizeof(cpy_default_hostname), "cpy-%s-%x", CIRCUITPY_BOARD_ID + board_trim, (unsigned int)mac); + snprintf(cpy_default_hostname, sizeof(cpy_default_hostname), "cpy-%s-%02x%02x%02x%02x%02x%02x", CIRCUITPY_BOARD_ID + board_trim, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); + const char *default_lwip_local_hostname = cpy_default_hostname; ESP_ERROR_CHECK(esp_netif_set_hostname(self->netif, default_lwip_local_hostname)); // set station mode to avoid the default SoftAP diff --git a/ports/espressif/mpconfigport.mk b/ports/espressif/mpconfigport.mk index e80c9654040b..ffca0a057436 100644 --- a/ports/espressif/mpconfigport.mk +++ b/ports/espressif/mpconfigport.mk @@ -58,6 +58,9 @@ CIRCUITPY_WATCHDOG ?= 1 CIRCUITPY_WIFI ?= 1 CIRCUITPY_SOCKETPOOL_IPV6 ?= 1 +# Turn off aesio. It is a custom API that no one uses. +CIRCUITPY_AESIO = 0 + # Enable _eve module CIRCUITPY__EVE ?= 1