-
Notifications
You must be signed in to change notification settings - Fork 1
Boot sequence, init, captive portal, and recovery
Igor edited this page Jul 29, 2017
·
1 revision
- Make RasPi calling your own startup script. In /etc/rc.local:
nohup /home/pi/Orchids/init.sh &
- In /home/pi/Orchids/init.sh:
- Detect WiFi SSID set or got already an IP by DHCP.
- If no SSID and no IP then activate Captive portal => Call captive script and exit.
- From here normal boot continues:
- Kill all uncontrolled ssh sessions if any, including remaining of recovery script.
- Call reverse HTTP and reverse SSH recovery script.
Configure RasPi with SSID and password of your WiFi. Advanced purpose: set static IP for WLAN or for LAN interface.
- Switch the RasPi into AP mode with known SSID (OrchidCareAP, for instance) and with no password (for simplicity).
- Optional: Run HTTP server and Captive portal page with SSID and passphrase fields (at least).
- Accept SSH (or optional HTTP) connections in order to configure your WiFi SSID + passphrase.
- Once configured, propose user to reboot the RasPi. Automatic reboot may cause problems and recommended to be supervised by user.
Make sure the connection from VPS to RasPi works. If not then recover it. RasPI <--ReverseSSH/HTTP--> VPS <--SSH/HTTP--> User
- Access VPS from RasPi to VPS.
- Try to get relevant info from RasPi: curl or SSH to appropriate reversed port (10080 or 10022).
- Count failures.
- If exceeded count limit then kill all reverse tunnel processes and try to establish new ones and reset the counter.