serial-port-json-server icon indicating copy to clipboard operation
serial-port-json-server copied to clipboard

Headless Wifi Setup of Pi

Open raykholo opened this issue 8 years ago • 0 comments

Just throwing the initial idea out there about a more user friendly way to set up wifi on a Raspberry Pi after the SPJS image has been flashed, without having to hook up a KVM, SSH in, or modify text on the SD card (which isn't horrible, but has room for improvement).

The methodology:

(If first boot) Pi Broadcasts ad hoc network that user can connect to with their computer and go to pi webserver config page where they can see all available wifi networks and put in passcode + connect to the one they want. Pi restarts.

  1. Pi boots. Wait 5 seconds for it to connect to any potential wifi networks it knows.
  2. If connected to wifi, great. Continue as usual. If not connected, turn on ad hoc network such that config page is accessible.

Astroprint does this in Python: https://github.com/AstroPrint/AstroBox/blob/master/src/astroprint/network/manager.py https://github.com/AstroPrint/AstroBox/blob/master/src/astroprint/network/debian.py and I also found it interesting that they do random hostname assignment as does SPJS: https://github.com/AstroPrint/AstroBox/blob/master/set-initial-hostname

PrintToPeer also has some nice shell scripts that can be used: https://github.com/PrintToPeer/PrintToPi/tree/master/wifi

We can go about this either by invoking the scripts using SPJS exec command, or by sending terminal wifi config commands one line at a time via SPJS exec directly.

Having used Octoprint a lot, I think wifi configuration difficulties/ lack of seamless solution is one of the major pain points for a novice friendly plug and play solution.

raykholo avatar Apr 06 '16 20:04 raykholo