Black Lives Matter - Action and Equality.
0

Connecting to IO without fixed WiFi Access Point
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.

Connecting to IO without fixed WiFi Access Point

by mapavetic on Mon Apr 27, 2020 8:16 am

Hello, I was wondering if it's possible to connect to Adafruit IO with my Huzzah ESP32 while using some sort of Connection Manager, meaning I do not want to pre-code SSID and password of some fixed WiFi Access Point, but instead I want to be able to choose desired Access Points from Connection Manager, and afterwards publish data to IO.

Basically, what is bothering is me is that every example from "Adafruit IO Arduino" library is asking me to write in SSID and password of some fixed network in the config.h file. Since I am using Connection Manager which allows me to choose any WiFi AP and is keeping my WiFi connection live, I just need the IO subscription and publishing part of the code.

Project I am working on is basically a weather station, which I would like to occassionaly move to different places and connect to different WiFi Access Points, but without the need of pre-coding WiFi credentials every time I want to use it somewhere else.

mapavetic
 
Posts: 3
Joined: Fri Apr 13, 2018 2:43 am

Re: Connecting to IO without fixed WiFi Access Point

by mapavetic on Fri May 01, 2020 5:20 am

After reading through all AdafruitIO documentation and related web pages, I finally found solution on this link:

https://learn.adafruit.com/mqtt-adafrui ... u?view=all

I just followed the instructions and adapted given examples to work with ESP32. For instance, I swapped #include <ESP8266WiFi.h> with #include <WiFi.h>. Then I removed the connecting to WiFi access point part of the code and let my Connection Manager code do that. I then wrote a piece of code which connects to AdafruitIO after Connection Manager sucesfully connects to choosen Access Point (by connecting to my EPS32 with my phone and scanning nearby networks).

If someone needs further details, just let me know. Anyway, I would like to suggest to Adafruit team to consider making example sketches based on this problem, because this would make easier for users to swap WiFi Access Points, since there would be no need to constant rewritting of two lines of code every time user wanted to choose different Access Point.

mapavetic
 
Posts: 3
Joined: Fri Apr 13, 2018 2:43 am

Please be positive and constructive with your questions and comments.