Contents
describe
- Wifi related interface
Interface version
Version number | Maker | Date of formulation | Revision date |
---|---|---|---|
1.0 | alan | 2022-07-26 |
POST request address
http://192.168.1.1/api
API List
Name | Description |
---|---|
get | Get wif configuration |
set | Set wifi settings |
1、get
Get the wifi configuration request parameters
{ "version": "1.0", "sid": "d0ec44cfd0de6162c4bfe1d4362f03ef", "module": "wifi", "api": "get", "param": {}}
Request parameter description
Parameter name | type | description |
---|---|---|
ver | string | API version |
sid | string | session id returned after logging |
module | string | requested module |
api | string | requested api interface |
Return to the example
{ "module": "wifi", "version": "1.0", "api": "get", "errcode": 0, "result": { "guest": { "disabled": 1, "ssid": "zZzzz+guest", "encryption": "none" }, "master": { "ssid": "zZzzz", "encryption": "mixed-psk", "key": "123456789", "hidden": 0, "disabled": 0 }, "radio0": { "current_channel": 11, "chanlist": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0 ], "bw": "auto", "channel": 0 }, "radio1": { "current_channel": 149, "chanlist": [ 36, 40, 44, 48, 149, 153, 157, 161, 165, 0 ], "bw": "auto", "channel": 0 } }, "sid": "9faedbbd29f344990d3a5301381a41d4"}
Return to parameter description
Parameter name | type | description |
---|---|---|
module | string | requested module |
version | string | api version |
api | string | requested api interface |
errcode | string | Returned error code |
sid | string | requested sid |
result.master | string | wifi main network configuration information |
result.master.ssid | string | ssid of wifi main network |
result.master.encryption | string | encryption method of wifi main network, mixed-psk means encryption, none means unencrypted |
result.master.key | string | wifi connection password for the wifi main network when setting mixed-psk |
result.master.disabled | number | Whether the main wifi network is turned on, 0 means on, 1 means off |
result.master.hidden | number | 1 means hidden ssid, 0 means not hidden |
result.guest | string | wifi guest network configuration information |
result.guest.ssid | string | ssid for wifi guest network |
result.guest.encryption | string | wifi guest network encryption method, mixed-psk means encryption, none means unencrypted |
result.guest.key | string | wifi connection key for wifi guest network when setting mixed-psk |
result.guest.disabled | number | Whether the wifi guest network is turned on, 0 means on, 1 means off |
result.radio0 | string | wifi 2.4G network advanced configuration |
result.radio0.bw | string | wifi 2.4G network bandwidth mode, HT20, HT40 or auto (auto) |
result.radio0.channel | string | wifi channel of 2.4G network, 0 means using automatic channel |
result.radio0.current_channel | string | wifi 2.4G current working channel |
result.radio0.chanlist | array | wifi 2.4G supports channel list, 0 is automatic channel |
result.radio1 | string | wifi Advanced configuration of 5G network |
result.radio1.bw | string | wifi Bandwidth mode of 5G network, HT20, HT40, HT80 or auto (auto) |
result.radio1.channel | string | wifi channel of 5G network, 0 means using automatic channel |
result.radio1.current_channel | string | wifi 5G current working channel |
result.radio1.chanlist | array | wifi 5G supports channel list, 0 is automatic channel |
2、set
Set wifi interface request parameters
{ "version": "1.0", "sid": "cdd2a5d9734c44df74745430dd7a149b", "module": "wifi", "api": "set", "param": { "guest": { "ssid": "zZZZ-guest", "encryption": "none", "disabled": 0 }, "master": { "ssid": "aaZzzz", "encryption": "mixed-psk", "key": "1234567890", "disabled": 0 }, "radio0": { "bw": "auto", "channel": 0 }, "radio1": { "bw": "auto", "channel": 0 } }}
Request parameter description
Parameter name | type | description |
---|---|---|
version | string | API version |
sid | string | session id returned after logging |
module | string | requested module |
api | string | requested api interface |
param.master | string | wifi main network configuration information |
param.master.ssid | string | ssid of wifi main network |
param.master.encryption | string | encryption method of wifi main network, mixed-psk means encryption, none means unencrypted |
param.master.key | string | wifi connection password for the wifi main network when setting mixed-psk |
param.master.disabled | number | Whether the main wifi network is turned on, 0 means on, 1 means off |
param.guest | string | wifi guest network configuration information |
param.guest.ssid | string | ssid for wifi guest network |
param.guest.encryption | string | wifi guest network encryption method, mixed-psk means encryption, none means unencrypted |
param.guest.key | string | wifi connection key for wifi guest network when setting mixed-psk |
param.guest.disabled | number | Whether the wifi guest network is turned on, 0 means on, 1 means off |
param.radio0 | string | wifi 2.4G network advanced configuration |
param.radio0.bw | string | wifi 2.4G network bandwidth mode, HT20, HT40 or auto (auto) |
param.radio0.channel | string | wifi channel of 2.4G network, 0 means using automatic channel |
param.radio1 | string | wifi Advanced configuration of 5G network |
param.radio1.bw | string | wifi Bandwidth mode of 5G network, HT20, HT40, HT80 or auto (auto) |
param.radio1.channel | string | wifi channel of 5G network, 0 means using automatic channel |
Return to the example
{ "module": "wifi", "version": "1.0", "api": "set", "errcode": 0, "result": { }, "sid": "cdd2a5d9734c44df74745430dd7a149b"}
Return to parameter description
Parameter name | type | description |
---|---|---|
module | string | requested module |
version | string | api version |
api | string | requested api interface |
errcode | string | Returned error code |
sid | string | requested sid |
result.restart_wifi | bool | Will wifi restart after modifying wifi configuration |