Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement WiFi setup for the Raspberry Pi device #478

Open
jbmorley opened this issue Apr 21, 2023 · 1 comment
Open

Implement WiFi setup for the Raspberry Pi device #478

jbmorley opened this issue Apr 21, 2023 · 1 comment
Labels
device-python Impacts the Python device implementation enhancement New feature or request

Comments

@jbmorley
Copy link
Collaborator

Right now the Python / Raspberry Pi device implementation doesn't support the WiFi setup workflow, requiring devices to be manually connected. This won't be too bad once we have a dedicated Raspberry Pi image, but it would still be better if devices could be re-paired.

@jbmorley
Copy link
Collaborator Author

I was experimenting with the access point configuration when setting up pi-gen builds. Could be a useful starting point:

function configure_access_point {

    echo "Configuring network..."
    # Based on the instructions provided at https://github.com/schollz/raspberry-pi-turnkey and
    # https://thepi.io/how-to-use-your-raspberry-pi-as-a-wireless-access-point/.

    cat <<EOF>> "${ROOTFS_DIR}/etc/dhcpcd.conf"
interface wlan0
static ip_address=192.168.4.1/24
EOF

    cat <<EOF>> "${ROOTFS_DIR}/etc/dnsmasq.conf"
interface=wlan0
dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h
EOF

    cat <<EOF>> "${ROOTFS_DIR}/etc/hostapd/hostapd.conf"
interface=wlan0
driver=nl80211
ssid=StatusPanel
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=StatusPanel
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
EOF

    cat <<EOF>> "${ROOTFS_DIR}/etc/default/hostapd"
DAEMON_CONF="/etc/hostapd/hostapd.conf"
EOF

}

@jbmorley jbmorley added enhancement New feature or request device-python Impacts the Python device implementation labels Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
device-python Impacts the Python device implementation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant