Intended for integration into scripts or home automation systems, like Domoticz, where it's often easier to perform GET calls than it is to post JSON data.
The following query parameters are supported:
| Parameter name | Description |
| -------------- | - |
| value | Brightness value from 0 to 255. Applied to all steps. |
| percent | Percentage value from 0 to 100. Same behaviour as value. |
| time | Optional. Transition time in milliseconds. |
| from | Optional. Where to start the fade. Can be either 'top' or 'bottom'. If omitted or any other value, all steps change brightness at the same time. |
The value of the 'status' element corresponds to the ```wl_status_t``` enum as defined in [wl_definitions.h](https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/include/wl_definitions.h).
*Example response:*
```json
{
"ap": {
"enabled": true,
"ip": "192.168.4.1"
},
"station": {
"enabled": true,
"status": 3,
"ip": "10.138.1.10"
}
}
```
## GET /api/connection
Returns the settings of the WiFi connections.
*Example response:*
```json
{
"hostname": "stairs",
"accesspoint": true,
"station": true,
"ssid": "MyWiFi",
"password": "12345678",
"dhcp": true,
"ip": "",
"subnetmask": "",
"gateway": ""
}
```
## POST /api/connection
Updates the settings of the WiFi connections. The module will apply the new settings immediately and will break existing connections.
Returns the current brightness value for each step. The number of items in the array is equal to the number of configured steps. Each value has a range of 0 to 255.
Changes the brightness value for each step. If the number of values in the array is less than the number of configured steps, each subsequent step is considered to be off.
An optional element 'transitionTime' can be included which specifies how long the transition from the current value of each step to it's new value should take, the module will then smoothly fade between the values. The transition time must be specified in milliseconds. Assume a maximum of 30 seconds, because I did not test with higher values. Ain't nobody got time for that! If no transition time or 0 is specified, the new values will be applied immediately.
An optional array 'startTime' can be included which specifies the delay, for each step individually, before the transition will start. The example request uses this to create a sweeping effect. If no or not enough values are provided, they are assumed to be 0.
Uploads new firmware. The bin file should be posted as a multipart/form-data file attachment. Name is not relevant.
## GET /api/stacktrace/get
If an exception occurs and the stack trace was recorded before the device reset, this will return the stack trace as a file named "stacktrace.txt".
## GET /api/stacktrace/delete
Removes any recorded stack trace.
# Debug API
These APIs are hopefully never enabled unless you've changed the config.h for the purpose of testing the exception handler. Don't forget to turn it back off afterwards.
## GET /api/crash/exception
Causes a crash due to an unhandled exception. Should provide a stack trace afterwards.
## GET /api/crash/softwdt
Causes the software watchdog to reset.
## GET /api/crash/wdt
Disables the software watchdog and causes the hardware watchdog.