radiodan / provision

A set of scripts and configs to take a vanilla pi to a radiodan.
6 stars 6 forks source link

Upgrades to resin-io/resin-wifi-connect v3 #18

Closed andrewn closed 6 years ago

andrewn commented 6 years ago

resin-wifi-connect v3 is based on NetworkManager and allows password-less access points so we don't need to maintain our patched fork of connman anymore. It also has an install script which simplifies our installation. Also, it's supposed to be more stable.

Usage

A systemd service called wifi-connect is enabled which runs on boot. It runs the start-wifi-connect script below.

Commands

The following command scripts are installed onto the Pi's path and so can be run in the shell.

start-wifi-connect is a new script that Systemd will run on start-up. This runs wifi-connect to see if any networks can be joined. After this if the device isn't connected to a network then it will run wifi-connect --clear=true to start the AP mode. Unfortunately this clears all existing wi-fi networks but this is the only way to enable AP mode using v3. When that completes it checks the network connection again. If it's still not connected then the whole process starts again.

forget-wifi-networks clears all previous connections and shuts down the Pi. This is because as soon as this runs it will disconnect the wifi network that's connected leaving the ssh connection hanging. There's also a bug where if you reboot the Pi then the AP network that's created is called "Wifi Connect" and not "radiodan-configuration". Shutting down forces a power cycle which solves this problem for now.