From 65d26b5e3dd6196d26223676e7d20877cb17b978 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Tue, 27 Dec 2022 18:16:49 +0100 Subject: [PATCH] change hostname --- src/abfall.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/abfall.cpp b/src/abfall.cpp index 49509a2..0511394 100644 --- a/src/abfall.cpp +++ b/src/abfall.cpp @@ -14,6 +14,8 @@ int wifi_setup(uint32_t country, const string &ssid, const string &pw) { cyw43_arch_enable_sta_mode(); + netif_set_hostname(netif_default, "AbfallPicoW"); + if (cyw43_arch_wifi_connect_async(ssid.c_str(), pw.c_str(), CYW43_AUTH_WPA2_MIXED_PSK)) { return 2; } @@ -39,9 +41,11 @@ int wifi_setup(uint32_t country, const string &ssid, const string &pw) { cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 0); } else { cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 1); + + printf("IP: %s\n", ip4addr_ntoa(netif_ip_addr4(netif_default))); } - return 0; + return status; } int main() {