simap / pixelblaze

Files related to Pixelblaze
https://www.bhencke.com/pixelblaze
233 stars 29 forks source link

Having wifi default to client mode but revert to wifi AP if network is not available #23

Open marcmerlin opened 1 week ago

marcmerlin commented 1 week ago

Gateway'ed from https://forum.electromage.com/t/having-wifi-default-to-client-mode-but-revert-to-wifi-ap-if-network-is-not-available/3835

For my LED wearable, I have my ESP32 do similar things as pixelblaze, and there is one feature I would much like to have pixelblaze offer too if I want to be able to switch to it from my own older solution: My code is setup to a be wifi client and when at home, will connect to my wifi. However if I’m not home, it fails to connect to wifi, detects that, and then switched to access point mode on its own so my phone can connect to it. After next reboot, it tries client mode again first. Pixelblaze seems to force me to pick one or the other (client or AP) and the way to switch between them is a bit cumbersome. Yes, I could have my phone act as a wifi access point, but that’s not very palatable because of the extra battery draw that causes.

If that helps, that’s the coe I use to do wifi client first and then switch to AP https://github.com/marcmerlin/NeoMatrix-FastLED-IR/blob/da6fcead6c110d1a48c1fe5a1e0618da658d03f1/NeoMatrix-FastLED-IR.ino#L4876

Related to this,