Skip to content

03 Wifi Onboarding

Resinchem edited this page Feb 11, 2023 · 1 revision

Wifi Onboarding the Amp

This applies only to the Arylic Amp Board. The ESP32 will join your wifi based on information entered in the Credentials.h file.

The UART firmware does not offer a way to onboard the amp to your wifi network, so this needs to be done independently of this project. The easiest way to do this is to use the mobile app for the amp. However, if you do not want to install the mobile app, you can use the following process to onboard your amp to wifi.

Note: If you plan on only using an Ethernet connection, wifi onboarding is optional.

Using the Arylic Amp HTTP API

There are a number of different commands that can be issued to the amp via a browser window. You can see the full commmand set here: Ayrlic Developers HTTP API. However, the specific commands for wifi onboarding are also covered here.

You must first connect the amp to an Ethernet connection and get the IP address assigned by your router

Next, the API requires that your wifi SSID and password be entered in text. So you can easily use an online text-to-hex converter, such as this one, to get the hex values for your SSID and password:

text_to_hex

Repeat the above for your wifi password and copy off the hex values for both the SSID and password, as they will be needed shortly.

Once you have the IP address and the hex values for your SSID and password, open a browser window and issue the following command, substituting Your actual IP address:

http:\\your_ip_address\httpapi.asp?command=wlanGetApListEX

This will return a JSON package of all the wireless networks seen by the amp (this may also pick up wifi signals from other nearby households if the signal is strong enough):

api_get_ssids_blurred

From the list, find your SSID by its hex value. In the example shown above, it is the first SSID in the list. Note or copy the listed values:

  • channel: 1
  • auth: WPA2PSK
  • encry: AES
  • excht: 0

At this point, you should have all the following values recorded (example for SSID of MyWifiSSD and password of 'SecretPassword'):

http_example_values_small

With this information, again in the browser, enter the following command (all on one line, no spaces), substituting your values as appropriate:

http://amp_ip_addr/httpapi.asp?command=wlanConnectApEx:ssid=hex_ssid_value:ch=ch_num:auth=auth_type:encry=encry_typ:pwd=hex_password:chext=num_chext

Use the above values as an example, the full command after the IP address would look like:

/httpapi.asp?command=wlanConnectApEx:ssid=4d795769666953534944:ch=1:auth=WPA2PSK:encry=AES:pwd=53656372657450617373776f7264:chext=0

If the command is accepted, the browser window will just return an 'OK'. This only means the command was accepted. To verify that the amp was able to join your wifi, issue the following command in the browser:

http://amp_ip_address/httpapi.asp?command=wlanGetConnectState

This will return one of four possible values:

Returned Value Description
PROCESS The amp is still in the process of connecting. Wait a few moments and try refreshing the page
FAILPAIR Either the SSID or password was incorrect. Be sure you are using the hexed values and have included proper capitilization. "A" and "a" have different hex values.
FAIL The connection failed for some other reason. Check your command carefully and assure you haven't made any typos, included spaces or entered a wrong value
OK The wifi connection was successful

Once you have received an "OK" from the GetConnectState command, you can unplug the Ethernet connection as the amp is now on your wifi. Your router should have issued a new IP address for the wifi connection. You might want to verify this and note the new IP address.

This step only needs to be completed once, unless you later issue a reset command to the amp, which clears all settings. At this point, you'd need to reconnect to Ethernet and repeat the above steps.