tiny-pilot / tinypilot

Use your Raspberry Pi as a browser-based KVM.
https://tinypilotkvm.com
MIT License
3.02k stars 252 forks source link

Create a script for enabling WiFi access point #1711

Closed mtlynch closed 5 months ago

mtlynch commented 9 months ago

Related: https://github.com/tiny-pilot/tinypilot/issues/1710

Our FAQ for enabling TinyPilot's WiFi access point is mostly code snippets the user has to copy/paste. A lot of the code is irrelevant to them, but showing the entire snippet might confuse users into thinking they have to care about what's behind the snippets.

It would be less intimidating for customers to go through this process with simple scripts that simplify the semantics for them.

The only setting we should really force the user to choose is the WiFi password. Everything else, we can choose sensible defaults and offer command-line flags to let the user override them.

The original instructions allow the user to specify an IP range, but I think we can just hardcode that until we get a request otherwise. I can't think of a reason a user would care about what IP range TinyPilot uses since I don't think it should matter even if the user has another network with the same IP range.

$ sudo /opt/tinypilot-privileged/enable-wifi-ap \
  --password "${PASSWORD}"
TinyPilot is now running a WiFi access point with these details:
SSID: TinyPilotAP
Country: US
IP Address: 192.168.1.1
IP Range: 192.168.1.2 - 192.168.1.100
$ sudo /opt/tinypilot-privileged/enable-wifi-ap  \
  --ssid 'mytpwifi' \
  --country 'gb' \
  --password "${PASSWORD}"
TinyPilot is now running a WiFi access point with these details:
SSID: mytpwifi
Country: GB
IP Address: 192.168.1.1
IP Range: 192.168.1.2 - 192.168.1.100
$ /opt/tinypilot-privileged/disable-wifi-ap
TinyPilot has disabled its WiFi access point.

It's likely that we'd later reuse these scripts when we add Wi-Fi settings to the web UI.

jdeanwallace commented 5 months ago

Completed via https://github.com/tiny-pilot/tinypilot/pull/1778