Skip to content

Commit

Permalink
Fix mac address formatting and disable aesio for ESP
Browse files Browse the repository at this point in the history
  • Loading branch information
tannewt committed Oct 9, 2024
1 parent 390c280 commit 1543642
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ports/espressif/common-hal/wifi/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions ports/espressif/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1543642

Please sign in to comment.