JarvyJ / pislide-os

An OS for easily displaying images on a Raspberry Pi
GNU Affero General Public License v3.0
10 stars 0 forks source link

WiFi configuration #4

Open JarvyJ opened 1 month ago

JarvyJ commented 1 month ago

I was thinking on first boot, we could have an application that prompts for the users wifi credentials (or asks if they just want to use it entirely offline).

Easy enough to just type in, likely connected to a screen already. Would need a keyboard. We could also look into how the rpi imager loads up the wifi credentials on first boot and try and utilize that.

JarvyJ commented 1 month ago

Looks like the rpi imager just puts a file called network-.con in the boot partition. It would be pretty easy to just read the file and then call nmcli with the right values:

version: 2
wifis:
  renderer: networkd
  wlan0:
    dhcp4: true
    optional: true
    access-points:
      "[WIFI_SSID]":
        password: "[WIFI_PASSWORD]"

and then call: nmcli device wifi connect [WIFI_SSID] password [WIFI_PASSWORD]

Using it could be a simple option that could be kept around as needed.