rpi-wifi icon indicating copy to clipboard operation
rpi-wifi copied to clipboard

A Few Changes for the Script to Work with Pi Zero 2W and Bullseye

Open pmi123 opened this issue 1 year ago • 0 comments

I made a couple of changes to get the code to work on a Pi Zero 2 W running Debian Bullseye.

  1. Populate /etc/wpa_supplicant/wpa_supplicant.conf section I added in the configuration for the AP network and named it AP1, since according to the original article that has to start first (just easier for me to keep the labels organized in my mind). The client is now AP2:
network={
    ssid="${AP_SSID}"
    $([ $AP_PASSPHRASE ] && echo "psk=\"${AP_PASSPHRASE}\"")
    scan_ssid=1
    key_mgmt=WPA-PSK
    id_str="AP1"
}
  1. Populate /etc/network/interfaces section Add the line iface AP2 inet dhcp right before the EOF to take into account the change above.

  2. Populate /bin/start_wifi.sh section. I was having issues with /var/run/wpa_supplicant/wlan0 hanging around from previous invocations of wpa_supplicant as the Pi booted up, so I added the line sudo rm /var/run/wpa_supplicant/wlan0 right after the sleep(30) line.

  3. I changed line 191 to read sudo crontab -l 2>/dev/null | { cat; echo "@reboot /bin/rpi-wifi.sh"; } | sudo crontab - so the contab reboot entry would run at every reboot as root as suggested in the original article.

I hope these changes saves others some time in getting everything set up.

pmi123 avatar Nov 16 '23 06:11 pmi123