APSTA is available in the WICED SDK as a sample application snippet. This means that the thermostat can host a webserver and allow other clients to connect to it; at the same time, as a client it can connect to the home access point for connection to the internet.
The WICED SDK makes it easy for the developer to host an http server on the thermostat to expose REST API calls to GET or POST the desired temperature. This powerful feature makes the thermostat accessible to other devices on the network.
For instance, a small peer application on a mobile device can be written to enable it to set the temperature using a sample POST request which would look something like this:
The app can also ask the thermostat to tell the mobile device which temperature it is currently set to, with a GET request such as:
There are two mechanisms for connecting the thermostat to a desired access point:
- feed the SSID and password of the access point into the configuration file;
- ask any client such as a mobile phone connected to the softAP hosted by the thermostat to allow the user to enter the password for the chosen access point. The thermostat subsequently reboots and stores the access point credentials in a device configuration table;
- The WICED SDK also provides for the option of WPS security for registering a new device to an access point.