0

AdafruitIO_WiFi io() call
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

AdafruitIO_WiFi io() call

by borghuisb on Mon Feb 22, 2021 1:06 am

I want to connect my ESP8266 to Adafruit.io using wifi credentials, username and key stored in eeprom. In the tutorial, config.h file, these parameters are set using '#define '. How do I set them using string variables obtained inside setup()?

Specifically, if I initialize the AdafruitIO_WiFi object by calling

AdafruitIO_WiFi io(AfIO_username.c_str(), AfIO_key.c_str(), ssid.c_str(), password.c_str());

inside setup(), I successfully connect to Adafruit.io, but the io object appears to remain local to setup(): io.run() inside loop() does not handle its inputs and no dashboard input is received.
How do I resolve? Thanks!

borghuisb
 
Posts: 2
Joined: Mon Dec 14, 2020 1:04 pm

Re: AdafruitIO_WiFi io() call

by brubell on Mon Feb 22, 2021 10:47 am

I've answered something similar to this before, it might not be possible using Adafruit IO Arduino:
viewtopic.php?f=56&t=158391&p=781336&hilit=eeprom#p781336

brubell
 
Posts: 1381
Joined: Fri Jul 17, 2015 10:33 pm

Please be positive and constructive with your questions and comments.