I am trying to make WiFi Wan connection available via device APIs. I am using /api/cmd.wifi.connect endpoint, when there is a saved security policy on that WAN, only providing the SSID and policy key is enough to make the connection, but for new SSIDs I get this error:
{"code":400,"message":"Wi-Fi profile does not exist","stat":"fail"}
Other endpoint /api/config.ssid.profile for SSID profiles only provides “update” action and I have no idea how I can create new profile for new network:
Sorry if the OP was not clear. I am not going to make a SSID or AP
I am going to scan available WiFi networks and connect to any of them by setting the SSID and its password. So far I managed to get list of available networks by query the /api/cmd.wifi.scan
According to the documentation when SSID profile is not defined (a new network) I should provide additional information. Here is my POST body for a wpa-psk network:
{"code":400,"message":"Wi-Fi profile does not exist","stat":"fail"}
It seems there is no direct way to create SSID profiles and they get created when WAN interface get connected to that network for the first time, but as well I don’t see how to connect to wpa-psk network just by sending the password.