Created
June 1, 2025 10:30
-
-
Save ColGren/15e04973005a61c16234b6132000ebb9 to your computer and use it in GitHub Desktop.
Hazomatic set up
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| echo "π§ Hazomatic WiFi Provisioning Setup" | |
| # Detect architecture | |
| ARCH=$(uname -m) | |
| echo "Detected architecture: $ARCH" | |
| if [[ "$ARCH" == "aarch64" ]]; then | |
| WIFI_CONNECT_VERSION="v4.9.1" | |
| WIFI_CONNECT_FILE="wifi-connect-${WIFI_CONNECT_VERSION}-linux-aarch64.zip" | |
| elif [[ "$ARCH" == "armv7l" ]]; then | |
| WIFI_CONNECT_VERSION="v4.11.3" | |
| WIFI_CONNECT_FILE="wifi-connect-${WIFI_CONNECT_VERSION}-linux-rpi.zip" | |
| else | |
| echo "β Unsupported architecture: $ARCH" | |
| exit 1 | |
| fi | |
| # Download | |
| DOWNLOAD_URL="https://github.com/balena-os/wifi-connect/releases/download/${WIFI_CONNECT_VERSION}/${WIFI_CONNECT_FILE}" | |
| echo "Downloading wifi-connect ${WIFI_CONNECT_VERSION} for ${ARCH}..." | |
| wget "$DOWNLOAD_URL" | |
| echo "Unzipping..." | |
| unzip "$WIFI_CONNECT_FILE" | |
| echo "Installing to /usr/local/bin..." | |
| sudo mv wifi-connect /usr/local/bin/ | |
| sudo chmod +x /usr/local/bin/wifi-connect | |
| echo "β Wifi-Connect installed:" | |
| wifi-connect --version | |
| # Clean up | |
| rm "$WIFI_CONNECT_FILE" | |
| rm -f LICENSE README.md | |
| # Install avahi (for mDNS) | |
| echo "Installing Avahi (mDNS support)..." | |
| sudo apt update | |
| sudo apt install -y avahi-daemon | |
| sudo systemctl enable avahi-daemon | |
| sudo systemctl start avahi-daemon | |
| # Create systemd service | |
| echo "Creating systemd service..." | |
| SERVICE_FILE=/etc/systemd/system/wifi-connect.service | |
| sudo bash -c "cat > $SERVICE_FILE" <<EOL | |
| [Unit] | |
| Description=WiFi Connect | |
| After=network.target | |
| [Service] | |
| ExecStart=/usr/local/bin/wifi-connect | |
| Restart=always | |
| RestartSec=5 | |
| [Install] | |
| WantedBy=multi-user.target | |
| EOL | |
| sudo systemctl enable wifi-connect | |
| sudo systemctl start wifi-connect | |
| echo "β Wifi-Connect service installed and running." | |
| # Done | |
| echo "π Hazomatic WiFi provisioning complete!" | |
| echo "π’ On first boot, connect to device AP to configure Wi-Fi." | |
| echo "π’ Device will advertise as: $(hostname).local on your LAN" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment