-
Notifications
You must be signed in to change notification settings - Fork 2
websocket usb config
Jim edited this page Feb 8, 2017
·
16 revisions
- Location
ws://localhost:8080/ws/usb-config
- ➥
list
- ⇠
{"status": "ok", "ports": ["PORT 1", "PORT 2" ... ]}
- ➥
key -----BEGIN RSA PRIVATE KEY-----\n.......\n-----END RSA PRIVATE KEY-----
- ⇠
{"status": "ok"}
注意,如果未設定金鑰將會發生錯誤
- ➥
connect [PORT]
- ⇠
- Success:
{"status": "ok", "serial": "XXX", "version": "[VER]", "name": "[name]", "model": "[model]", "password": [true|false], "uuid": "[32碼hex字串]"}
- Error:
{"status": "error", "error": "[ERROR_SYMBOL]"}
- ➥
auth
或auth [password]
- ⇠
- Success:
{"status": "ok"}
- Error:
{"status": "error", "error": "[ERROR_SYMBOL]"}
- ➥
set_nickname 1234
(use this) - ➥
set general {"name": "[printer name]"}
(old version, this is for reference) - ⇠
- Success:
{"status": "ok"}
- Error:
{"status": "error", "error": "[ERROR_SYMBOL]"}
- ➥
reset_password [PASSWORD]
- ⇠
- Success:
{"status": "ok", "password": true}
- Error:
{"status": "error", "error": "[ERROR_SYMBOL]"}
- ➥
scan_wifi_access_points
(use this) - ➥
scan_wifi
(old version, this is for reference) - ⇠
- Success:
{"status": "ok", "wifi": [{security: 'WPA2-PSK’, ssid: 'FLUX-2.4’, rssi: [-100~0]}, … ]}
- Error:
{"status": "error", "error": "[ERROR_SYMBOL]"}
{
"access_points": [
{
"bssid": "6C:19:8F:F2:1D:0D",
"ssid": "FLUX-Software",
"security": "WPA2-PSK",
"encrypt": true,
"rssi": -66
},
{
"bssid": "EC:22:80:F9:6D:66",
"ssid": "FLUX_LAB",
"security": "WPA2-PSK",
"encrypt": true,
"rssi": -76
}
],
"cmd": "scan",
"status": "ok"
}
- ➥
set network {"wifi_mode": "client", "ssid": "[SSID]", "security": "", "method": "dhcp"}
- ⇠
- Success:
{"status": "ok", "wifi": true}
- Error:
{"status": "error", "error": "[ERROR_SYMBOL]"}
- ➥
set network {"wifi_mode": "client", "ssid": "[SSID]", "security": "WEP", "wepkey": "[PASSWORD]", "method": "dhcp"}
- ⇠
- Success:
{"status": "ok", "wifi": true}
- Error:
{"status": "error", "error": "[ERROR_SYMBOL]"}
- ➥
set network {"wifi_mode": "client", "ssid": "[SSID]", "security": "WPA-PSK"|"WPA2-PSK", "psk": "[PASSWORD]", "method": "dhcp"}
- ⇠
- Success:
{"status": "ok", "wifi": true}
- Error:
{"status": "error", "error": "[ERROR_SYMBOL]"}
{"ip": "x.x.x.x", "mask": 24, "route": "y.y.y.y", "nameservers": ["z.z.z.z"]}
並且將 "method"="dhcp"
改為 "method"="static"
將 "wifi_mode": "client"
改為 "wifi_mode": "host"
- ➥
get_wifi_ssid
(use this) -
- ➥
get network
(old version, for reference)
- ➥
- ⇠ success:
// connecting
{
"status": "ok",
"ssid": ""
}
// connected
{
"status": "ok",
"ssid": "FLUX-2.4"
}
- Success:
{"status": "ok", "ssid": "[SSID]", "ip": ["ip 1", "ip 2", ..., "ip N"]}
# ip 有可能是 ipv4 或 ipv6 - Error:
{"status": "error", "error": "[ERROR_SYMBOL]"}