Update Library to work with WifiManager
With the current library the WiFi SSID and password need to defined. It would be nice if Adafruit IO would work with WifiManager to fix this issue. Thanks
This issue is being actively developed in feature branch: https://github.com/adafruit/Adafruit_IO_Arduino/tree/dev-wifi-ap
Good news, thanks.
This issue is getting old, but I managed to use the two libraries at the same time by passing nullptr to both the ssid and pass arguments of AdafruitIO_WiFi / AdafruitIO_ESP8266.
Hi, any opportunity to change SSID and Password on the fly instead of using constants?
Hi, any opportunity to change SSID and Password on the fly instead of using constants?
Maybe not ideal, but I think there’s a version of WiFimanager where you can put it in AP mode by pushing a button , then you could enter your new credentials . For Adafruit_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS) , change WIFI_SSID and WIFI_PASS to nullptr
Did anyone get this to work? When I set WIFI_SSID AND WIFI_PASS to nullptr my esp32 reboots and sets WifiManager back into AP mode.
00:30:22.959 -> Connecting to Adafruit IOGuru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
00:30:22.959 -> Core 1 register dump:
00:30:22.959 -> PC : 0x400e1d12 PS : 0x00060a30 A0 : 0x800e17d9 A1 : 0x3ffb1d20
00:30:22.959 -> A2 : 0x3ffc1930 A3 : 0x3f40016f A4 : 0xfffffc7f A5 : 0x00002100
00:30:22.959 -> A6 : 0x00002000 A7 : 0x3ffc1e60 A8 : 0x00000000 A9 : 0x3ffb1d00
00:30:23.006 -> A10 : 0x00000019 A11 : 0x3f40016f A12 : 0x00000019 A13 : 0x0000ff00
00:30:23.006 -> A14 : 0x00ff0000 A15 : 0xff000000 SAR : 0x0000001c EXCCAUSE: 0x0000001c
00:30:23.006 -> EXCVADDR: 0x00000000 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xfffffff9
00:30:23.006 ->
00:30:23.006 -> ELF file SHA256: 0000000000000000
00:30:23.006 ->
00:30:23.006 -> Backtrace: 0x400e1d12:0x3ffb1d20 0x400e17d6:0x3ffb1d40 0x400d14ed:0x3ffb1d60 0x400e53c6:0x3ffb1fb0 0x40089e26:0x3ffb1fd0
00:30:23.006 ->
00:30:23.006 -> Rebooting...
This really needs to be fixed in the official library. Hard coding the SSID and KEY are fine for simple example and demo projects but not something you might want to share with others. I hacked around this as follows...
To allow wifimanager to handle the network connection and prevent Adafruit IO from conflicting the following lines were removed from the AdafruitIO_Wifi.cpp file...
also the class defintion was changed to remove the SSID and KEY and only use the IO_USERNAME and IO_KEY in the .h and .cpp files for wifi/AdafruitIO_ESP8266....
public: AdafruitIO_ESP8266(const char *user, const char *key); ~AdafruitIO_ESP8266();
Serial.println("here in Adafruit IO Code\n"); /* delay(100); commenting this out since we are already connected via wifimanager WiFi.begin(_ssid, _pass); delay(100); _status = AIO_NET_DISCONNECTED; */
I found a better way to fix this. The hack I mention above removes the existing functionality which is not good. So instead, I overloaded the AdafruitIO_WiFi function so that it supports usage with SSSD+password and without. For example in AdafruitIO_ESP8266.h the prototypes look like this...
public: AdafruitIO_ESP8266(const char *user, const char *key, const char *ssid, const char *pass); AdafruitIO_ESP8266(const char *user, const char *key);
In the implementation for the 2nd version, I set _ssid and _pass to NULL so that those can be checked to exclude the "connect" code.
@brentru - what are your suggestions on how we can get this concept included so that we can create projects without hard-coded wifi details?
Thanks!
@bradrblack If you want to checkout a PR with your changes to the existing, I'll gladly look it over.
@bradrblack If you want to checkout a PR with your changes to the existing, I'll gladly look it over.
PR #160 submitted.
Closing via https://github.com/adafruit/Adafruit_IO_Arduino/pull/161