In order to connect to a Wi-Fi access point, the ADI OtoSense™ Smart Motor Sensor needs to be provided with a network profile. Once the sensor has received a network profile, it will stop broadcasting its access point / SSID, and the mobile or desktop device should disconnect from it.
After the sensor stops broadcasting its access point, it will connect to the internet via the network specified in the network profile. At this point, the mobile or desktop device should also connect to the internet, typically via a Wi-Fi access point.
If the mobile device does not disconnect from the sensor after 30 seconds, then it can be assumed that an error has occurred.
Figure 4: An overview of the network configuration process
Deleting old network profiles on the sensor
Old network profiles need to be deleted before a new network profile can be added. This can be accomplished via an HTTP POST request.
Note: Even if an ADI OtoSense™ Smart Motor Sensor has not been previously commissioned, this step should still be performed.
Protocol: HTTP`
Host: 10.123.45.1
Method: POST
Path: /api/1/wlan/profile_del_all
There is no body required in this request.
Using the sensor to scan for Factory Wi-Fi access points (optional)
Have the SMS perform an AP scan. The results can be retrieved using the ‘Getting sensor scan results (optional)’ detailed below.
Protocol: HTTP
Host: 10.123.45.1
Method: POST
Path: /api/1/wlan/en_ap_scan
Request Content Type: application/x-www-form-urlencoded
Request Schema:
Parameter | Description |
__SL_P_SC1 | Time between scan cycles. Should be set to ‘0’. |
__SL_P_SC2 | The number of scan cycles. Should be set to ‘10’. |
Sample Request:
__SL_P_SC2=10&__SL_P_SC1=0
Getting sensor scan results (optional)
Should only be called after ‘Using the sensor to scan for Factory Wi-Fi access points (optional)’. The response will be a semi-colon ‘;’ separated list of APs, each prefixed with the AP security type (see table).
Security Type Prefix | Description |
0 | Open |
1 | WEP |
2 | WPA |
3 | WPA/WPA2 |
5 | WPA3 |
Protocol: HTTP
Host: 10.123.45.1
Method: GET
Path: /netlist.txt
Response Content Type: text/plain
Sample Response:
2MyAP;2CoffeeShop;3EntAP;X;X;X;X;X;X;X;X;X;X;X;X;X;X;X;X;X;X;X;X;X;X;X;X;X;X;X;
Setting the sensor’s network profile
In order to connect to a Wi-Fi network, the SMS device needs a network profile. Use this POST request to set the sensor profile.
Protocol: HTTP
Host: 10.123.45.1
Method: POST
Path: /api/1/wlan/profile_add
Request Content Type: application/x-www-form-urlencoded
Parameter | Description |
__SL_P_P.A | SSID. The name of the Factory Wi-Fi access point the sensor should connect to. No more than 32 characters are allowed. If the SSID includes special characters (e.g., ‘%’ or ‘+’), they must be URL encoded (also known as “percent encoded”). Semicolons (‘;’) cannot be used in the SSID. Warning: The encoding of the SSID is independent of the standard URL encoding of x-www-form-urlencoded payloads. Therefore, special characters will need to be double encoded before transmission – (ex. `%25` will need to be encoded again as `%2525`) |
__SL_P_P.B | Network security type. Security type options are as follows: 0-Open, 1-WEP, 2-WPA, 3-WPA2/WPA2+PMF, 5- WPA3, 6-WPS/Push-button, 7-WPS/Pin Keypad, 8-WPS/Pin Display |
__SL_P_P.C | Factory Wi-Fi password. Must not exceed 64 characters. If the router password includes special characters (e.g., ‘%’ or ‘+’), they must be URL encoded (also known as “percent encoded”). Semicolons (‘;’) cannot be used in the router password. Warning: The encoding of the password is independent of the standard URL encoding of x-www-form-urlencoded payloads. Therefore, special characters will need to be double encoded before transmission – (ex. `%25` will need to be encoded again as `%2525`) |
__SL_P_P.D | Profile priority. Should be set to ‘0’. |
Sample Request:
__SL_P_P.A=FactoryWiFiRouter& __SL_P_P.B=3& __SL_P_P.C=dEs%24%2F%5E%7ER0vDQ50o%22%3F%27UA& __SL_P_P.D=0
Confirming the network profile
After the sensor’s network profile has been set, it needs to be confirmed via an HTTP POST request. After this request is made, the sensor should stop broadcasting its AP and attempt to connect to the Factory Wi-Fi.
Protocol: HTTP
Host: 10.123.45.1
Method: POST
Path: /api/1/wlan/confirm_req
There is no body required in this request.
Getting sensor profile error
Once the profile is confirmed the sensor will attempt to obtain an IP address and connect to the internet. If this is unsuccessful, the sensor will return to AP mode. The provisioning application can connect to the sensor AP and call this request to gain some insight into why the profile did not work. Possible reasons include bad profile, bad profile password, or no internet connectivity.
Note: This request is only useful after a sensor is unable to use the profile to connect to the internet. No other error conditions are covered by this request.
Protocol: HTTP
Host: 10.123.45.1
Method: GET
Path: /api/1/host/info/1/error_info
Response Content Type: application/json
Response Schema:
Parameter | Description |
profileError | 0=no error, 1=error |
internetError | 0=no error, 1=error |
Sample Response:
{
"profileError": 0,
"internetError": 1
}