I had the idea to use a neopixel to visualize the state of the ESP.
Something like
* green: connected to wifi
* blinking: try to connect to wifi
* cyan: AP-Mode active
I've done it with a rule:
Code: Select all
// Enable AP Mode on Flash-Button press
on FlashBtn#State=1 do
WifiAPMode
endon
// Blink blue while trying to connect to wifi
On System#Boot do
NeoPixel,1,0,0,200
TaskValueSet 12,1,0 // Init LED on
TaskValueSet 12,2,0 // Init AP Mode on
timerSet,1,1
endon
On Rules#Timer=1 do
if [dummy#on]=0
NeoPixel,1,0,0,150
TaskValueSet 12,1,1
else
NeoPixel,1,0,0,0
TaskValueSet 12,1,0
endif
timerSet,1,1
endon
// End blink after connected
On WiFi#Connected do
if [dummy#ap]!=1
NeoPixel,1,0,0,200
timerSet,1,0
endif
endon
On WiFi#Disconnected do
if [dummy#ap]!=1
timerSet,1,1
endif
endon
// cyan on AP Mode
On WiFi#APmodeEnabled do
TaskValueSet 12,2,1
NeoPixel,1,200,200,0
endon
On Wifi#APmodeDisabled do
Reboot
endon
Greets