The WIFI part of the example does not match current nodemcu API. use `wifi.eventmon.register()` instead of `wifi.sta.eventMonReg` remove `wifi.sta.eventMonStart()` (which was outside the station mode block anyway)