chilipeppr / serial-port-json-server

Serial Port JSON Server is a websocket server for your serial devices. It compiles to a binary for Windows, Mac, Linux, Raspberry Pi, or BeagleBone Black that lets you communicate with your serial port from a web application. This enables web apps to be written that can communicate with your local serial device such as an Arduino, CNC controller, or any device that communicates over the serial port.
http://chilipeppr.com
GNU General Public License v2.0
322 stars 101 forks source link

Headless Wifi Setup of Pi #6

Open raykholo opened 8 years ago

raykholo commented 8 years ago

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.