Note: Open Wi-Fi networks that require you to interact with a web page (captive portal) before you can access the Internet cannot be used by IoT Cloud devices.
A network configuration in IoT Cloud cannot be saved unless network parameters for all fields are provided. Some networks may not have all parameters, such as:
- Open (unencrypted) Wi-Fi networks
- GSM connections not requiring SIM PIN, or account credentials (username and password).
To use a device with these networks, you can set the network parameters in the Web Editor instead.
Set network parameters in the Web Editor
-
Open your Thing in IoT Cloud.
-
Click the Sketch tab.
-
Click Open full editor to view the sketch in the Web Editor.
-
Open the
thingsProperties.h
tab. -
Find the rows where the
SECRET
variables are assigned, like:const char SSID[] = SECRET_SSID; // Network SSID (name) const char PASS[] = SECRET_PASS; // Network password (use for WPA, or use as key for WEP)
-
Assign an empty string (
""
) to the parameters you don’t want to use.const char SSID[] = SECRET_SSID; // Network SSID (name) const char PASS[] = ""; // Network password (use for WPA, or use as key for WEP)
-
Go to the
Secret
tab and verify that remaining secrets (such asSECRET_APN
orSECRET_SSID
) are correct. -
Click the
Upload button to upload directly from the Web Editor, or go back to IoT Cloud and upload from the sketch tab.
Note: Each time the sketch is updated from IoT Cloud (by adding or changing Variables), the changes made to
thingsProperties.h
in the Web Editor will be overwritten. To upload the sketch again, simply repeat the steps above.
Examples
Here are some example network configurations that can be declared in thingsProperties.h
.
Remember to set the remaining secrets in the Secret
tab.
Open Wi-Fi network
Note: Open Wi-Fi networks that require you to interact with a web page (captive portal) before you can access the Internet cannot be used by IoT Cloud devices.
const char SSID[] = SECRET_SSID; // Network SSID (name)
const char PASS[] = ""; // Network password (use for WPA, or use as key for WEP)
Open Wi-Fi network (ESP32)
Note: Open Wi-Fi networks that require you to interact with a web page (captive portal) before you can access the Internet cannot be used by IoT Cloud devices.
const char SSID[] = SECRET_SSID; // Network SSID (name)
const char PASS[] = ""; // Network password (use for WPA, or use as key for WEP)
const char DEVICE_KEY[] = SECRET_DEVICE_KEY; // Secret device password
Third-party GSM provider
const char GPRS_APN[] = SECRET_APN; // "APN"
const char PINNUMBER[] = ""; // "PIN"
const char GPRS_LOGIN[] = ""; // "Username"
const char GPRS_PASSWORD[] = ""; // "Password"
Save the modified lines in a tab for quick access
To make it easier to restore your configuration after updating your sketch, you can keep the modified lines in a different tab:
-
To the right of the tab row, click ▼.
-
Click Add Tab.
-
Give the new tab a name like “NetworkConfig”.
-
Copy and paste the modified lines from
thingsProperties.h
and paste them in this file. -
When you need to restore your network configuration, copy and paste the edited lines into the
thingsProperties.h
tab.