Configure wi-fi credentials on site with some kind of app or SoftAP?

Hi,

I have helped a friend develop an IoT device and set up my home wifi credentials through the cloud. Now I would like to take the device to his place and have it connected to his network, without setting up the new credentials through the cloud, is this possible?

If not, I could use USB and update the secrets that way, but in that case I will have his credentials on record and I'm not sure he would like that.

If it is possible to use some kind of app (SmartConfig?) or SoftAP to set the credentials on site, does OTA updates mess up the credentials if my home wifi is in the secret tab and not his?

Best regards, L

Hi @lonitech. The "Secret" tab is a convenient way to store the network credentials in a more private manner, but under the hood this is only setting some macros. Something like this:

#define SECRET_OPTIONAL_PASS "my-wifi-password"
#define SECRET_SSID "my-ssid"

Which are then used in the thingProperties.h code:

const char SSID[]     = SECRET_SSID;    // Network SSID (name)
const char PASS[]     = SECRET_OPTIONAL_PASS;    // Network password (use for WPA, or use as key for WEP)

WiFiConnectionHandler ArduinoIoTPreferredConnection(SSID, PASS);

You are welcome to set the SSID and password any way you like as long as they are passed to the ArduinoIoTPreferredConnection instantiation before that object is passed to ArduinoCloud.begin:

ArduinoCloud.begin(ArduinoIoTPreferredConnection);

A more simple (though less elegant) approach would be for them to set up a "guest" network in their Wi-Fi router. This is a feature accessible through the router's administrative interface. They could give you the credentials for that "guest" network and then use the administrative interface to change them or disable the network later to revoke the credentials, without any impact on the devices using the router's primary SSID.

Another option might be to set up your phone as a Wi-Fi hotspot, then configure your Thing sketch to access the Internet through the phone instead of relying on your friend's Wi-Fi. The Thing won't use very much data.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.