Skip to main content

Wi-Fi Configuration

wifi/state

The current Wi-Fi state.

Example
# $HOST e.g. warp-AbCd

Read

curl http://$HOST/wifi/state
{
"connection_state": 3,
"connection_start": 10117,
"connection_end": 0,
"ap_state": 2,
"ap_bssid": "C4:5B:BE:C0:FF:EE",
"sta_ip": "10.1.2.3",
"sta_subnet": "255.255.255.0",
"sta_rssi": -38,
"sta_bssid": "71:21:CE:12:F0:12"
}
NameDescription
connection_state
int

State of the connection to the configured Wi-Fi. See wifi/sta_config

  • 0 - Not configured
  • 1 - Not connected
  • 2 - Connecting
  • 3 - Connected
ap_state
int

State of the Wi-Fi access point. See wifi/ap_config

  • 0 - Disabled
  • 1 - Enabled
  • 2 - Fallback inactive
  • 3 - Fallback active
ap_bssid
string

BSSID of the Wi-Fi access point.

ap_sta_count
int

Number of devices currently connected to the Wi-Fi access point.

sta_ip
string

Current IP of the device in the configured network. 0.0.0.0 if no connection exists.

sta_subnet
string

Current subnet mask of the device in the configured network. 0.0.0.0 if no connection exists.

sta_rssi
int

The current reception quality. 0 if no connection exists, otherwise negative. Values closer to 0 indicate better reception.

sta_bssid
string

The BSSID of the remote station to which the device is connected.

connection_start
int (ms)

Time in milliseconds when the last connection was established.

connection_end
int (ms)

Time in milliseconds when the last connection was disconnected.




wifi/scan

Triggers a scan for Wi-Fi networks. The scan results can currently only be queried via HTTP. Empty payload. One of the following values must be passed: null, "", false, 0, [] or {}

Example
# $HOST e.g. warp-AbCd

Write

curl http://$HOST/wifi/scan -d 'null'



wifi/sta_config

The Wi-Fi connection configuration.

Example
# $HOST e.g. warp-AbCd

Read

curl http://$HOST/wifi/sta_config
{
"enable_sta": true,
"ssid": "Mein WLAN",
"bssid": [12, 34, 56, 78, 90, 12],
"bssid_lock": true,
"passphrase": null,
"ip": "0.0.0.0",
"gateway": "0.0.0.0",
"subnet": "0.0.0.0",
"dns": "0.0.0.0",
"dns2": "0.0.0.0",
"wpa_eap_config": [0, null]
}

Write

curl http://$HOST/wifi/sta_config -d '{
"enable_sta": true,
"ssid": "Mein WLAN",
"bssid": [12, 34, 56, 78, 90, 12],
"bssid_lock": true,
"passphrase": null,
"ip": "0.0.0.0",
"gateway": "0.0.0.0",
"subnet": "0.0.0.0",
"dns": "0.0.0.0",
"dns2": "0.0.0.0",
"wpa_eap_config": [0, null]
}'
NameDescription
enable_sta
bool

Indicates whether a Wi-Fi connection to the configured network should be established.

  • true - If a Wi-Fi connection should be established.
  • false - If not.
ssid
string

SSID to which the device should connect.

bssid
int[6]

BSSID to which the device should connect. This entry is optional and can be left empty, but is required for bssid_lock.

bssid_lock
bool

Specifies whether to connect only to the Wi-Fi network with the specified BSSID. Leave disabled if repeaters or similar should be used.

  • true - Connects only to the access point with the specified BSSID.
  • false - Connects to any access point with the configured SSID, e.g., with repeaters.
enable_11b
bool

Specifies whether the outdated and slow 802.11b mode may be used. This also slows down other devices connected to the Wi-Fi, but can slightly improve reception quality and connection robustness.

  • true - Allow use of 802.11b mode
  • false - Forbid use of 802.11b mode
passphrase
string

The Wi-Fi passphrase. Maximum 63 bytes. This entry is optional and can be left empty if connecting to an unencrypted Wi-Fi network.

ip
string

IP address the device should use in the configured network. This entry and the following are optional and can be passed as "0.0.0.0" if automatic IP address assignment (DHCP) should be used.

gateway
string

Gateway address the device should use in the configured network.

subnet
string

Subnet mask the device should use in the configured network.

dns
string

DNS server address the device should use in the configured network.

dns2
string

Alternative DNS server address the device should use in the configured network.

wpa_eap_config
Union

WPA Enterprise configuration

null: WPA Personal




wifi/ap_config

The Wi-Fi access point configuration. Warning! If the access point is disabled and the Wi-Fi connection or LAN connection cannot be established or was not configured, the ESP can only be reached via a factory reset! We recommend always leaving the access point in fallback mode.

Example
# $HOST e.g. warp-AbCd

Read

curl http://$HOST/wifi/ap_config
{
"enable_ap": true,
"ap_fallback_only": true,
"ssid": "warp-AbCd",
"hide_ssid": false,
"passphrase": null,
"channel": 0,
"ip": "10.0.0.1",
"gateway": "10.0.0.1",
"subnet": "255.255.255.0"
}

Write

curl http://$HOST/wifi/ap_config -d '{
"enable_ap": true,
"ap_fallback_only": true,
"ssid": "wallbox_garage",
"hide_ssid": false,
"passphrase": null,
"channel": 0,
"ip": "10.0.0.1",
"gateway": "10.0.0.1",
"subnet": "255.255.255.0"
}'
NameDescription
enable_ap
bool

Indicates whether the access point should be enabled.

  • true - The AP should be enabled. Possibly only as fallback (see ap_fallback_only)
  • false - The AP should always remain disabled.
ap_fallback_only
bool

Indicates whether the access point should only be enabled if Wi-Fi and LAN connections cannot be established. Ignored if enable_ap is false.

  • true - The AP should only be enabled if Wi-Fi and LAN connections cannot be established.
  • false - The AP should always remain enabled.
ssid
string

SSID to which devices should connect.

hide_ssid
bool

true if the SSID should be hidden, otherwise false.

passphrase
string

The Wi-Fi passphrase. Maximum 63 bytes.

channel
int

Channel on which the access point should be accessible. Valid values are 1 to 13, or 0 if an unoccupied channel should be selected at startup.

ip
string

IP address the device should use in the configured network. This entry and the following are optional and can be passed as "0.0.0.0" if automatic IP address assignment (DHCP) should be used.

gateway
string

Gateway address the device should use in the configured network.

subnet
string

Subnet mask the device should use in the configured network.




wifi/scan_results

The Wi-Fi networks found as a result of a search triggered by wifi/scan.

Example
# $HOST e.g. warp-AbCd
curl http://$HOST/wifi/scan_results
[
{
"ssid": "Mein WLAN",
"bssid": "0C:22:38:4E:5A:0C",
"rssi": -43,
"channel": 9,
"encryption": 3
},
{
"ssid": "Mein WLAN",
"bssid": "0C:22:38:4E:5A:0D",
"rssi": -43,
"channel": 13,
"encryption": 3
},
{
"ssid": "Anderes WLAN",
"bssid": "C0:FF:EE:4E:5A:0C",
"rssi": -75,
"channel": 1,
"encryption": 3
}
]

Zwei Repeater des selben WLANs haben die gleiche SSID, aber unterschiedliche BSSIDs. Durch das bssid_lock in wifi/sta_config kann eine Verbindung zu einem spezifischen Repeater erzwungen werden.

IndexDescription
[..]
object
NameDescription
ssid
string

SSID of the found Wi-Fi network. Empty for hidden access points.

bssid
string

BSSID of the found Wi-Fi network.

rssi
int

The reception quality of the found Wi-Fi network. Always a negative value, where values close to 0 indicate better reception quality. See here for details

channel
int

Channel of the found Wi-Fi network.

encryption
int

Encryption standard of the found Wi-Fi network

  • 0 - Unencrypted
  • 1 - WEP
  • 2 - WPA-PSK
  • 3 - WPA2-PSK
  • 4 - WPA/WPA2-PSK
  • 5 - WPA2-Enterprise
  • 6 - Unknown