From 4cf5f6d151c3528d90432def2d3c4258f82abbe1 Mon Sep 17 00:00:00 2001 From: Empire Date: Fri, 27 Mar 2026 20:45:24 +0100 Subject: [PATCH] fix: correctly retrieve and display IP address for both IPv4 and IPv6 configurations --- Software/MainBoard/rust/src/main.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Software/MainBoard/rust/src/main.rs b/Software/MainBoard/rust/src/main.rs index 01f0031..0f65180 100644 --- a/Software/MainBoard/rust/src/main.rs +++ b/Software/MainBoard/rust/src/main.rs @@ -904,10 +904,22 @@ async fn try_connect_wifi_sntp_mqtt( } else { false }; + + let ip = match stack.config_v4() { + Some(config) => config.address.address().to_string(), + None => { + match stack.config_v6() { + Some(config) => config.address.address().to_string(), + None => { + String::from("No IP") + } + } + }, + }; NetworkMode::Wifi { sntp: sntp_mode, mqtt: mqtt_connected, - ip_address: stack.hardware_address().to_string(), + ip_address: ip, } } Err(err) => {