emfcamp / TiDAL-badge-webserial

A web interface for badge.team-firmware badges using WebSerial
Other
3 stars 2 forks source link

Settings Wifi config #7

Open dpslwk opened 2 years ago

dpslwk commented 2 years ago

Needs and update to handle out new WPA-Ent support

dpslwk commented 2 years ago

Current View Code

https://github.com/emfcamp/TiDAL-badge-webserial/blob/3e4b432dde35b84a86c43faa807cedfac69a9fcc/src/components/Settings.vue#L10-L11

Current Save Code

https://github.com/emfcamp/TiDAL-badge-webserial/blob/3e4b432dde35b84a86c43faa807cedfac69a9fcc/src/components/Settings.vue#L99-L101

tomsci commented 2 years ago

There's a convenience API in wifi so you don't need to import settings yourself, might be easier to use that?

wifi.save_defaults(ssid, password, username)

username should be None for open or PSK SSIDs, and should be a string if the SSID is WPA2 Enterprise. password should be None for open SSIDs.

Alternatively, use settings.set("wifi_wpa2ent_username", ...)

We're currently using the username field for both the username and identity fields, and leaving esp-idf to figure out whether it's PEAP or TTLS or whatever, it looks like this should be ok for the EMF network (hopefully it also doesn't require a cert up front). Some googling looks like you might need to specify a different identity for eduroam networks, but I doubt we really care about connecting the badge to that.