From 45aaa579d00bb03c88eb475a1c0cf133e69c1372 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sun, 10 Sep 2023 05:04:38 +0200 Subject: init.lua: print MAC only once --- src/init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/init.lua b/src/init.lua index 3aebe29..d2e8cef 100644 --- a/src/init.lua +++ b/src/init.lua @@ -43,7 +43,6 @@ function get_battery_percent(bat_mv) end function connect_wifi() - print("WiFi MAC: " .. wifi.sta.getmac()) print("Connecting to ESSID " .. station_cfgs[wifi_index].ssid) wifi.eventmon.register(wifi.eventmon.STA_GOT_IP, wifi_connected) wifi.eventmon.register(wifi.eventmon.STA_DHCP_TIMEOUT, wifi_err) @@ -124,6 +123,7 @@ init_t:register(1 * 1000, tmr.ALARM_SINGLE, scd4x_start) init_t:start() function wifi_connected() + print("Connected") have_wifi = true no_wifi_count = 0 end @@ -132,4 +132,5 @@ function wifi_err() have_wifi = false end +print("WiFi MAC: " .. wifi.sta.getmac()) connect_wifi() -- cgit v1.2.3