I made a couple of changes to get the code to work on a Pi Zero 2 W running Debian Bullseye.
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:
Populate /etc/network/interfaces section
Add the line iface AP2 inet dhcp right before the EOF to take into account the change above.
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.
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.
I made a couple of changes to get the code to work on a Pi Zero 2 W running Debian Bullseye.
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:Populate
/etc/network/interfaces
section Add the lineiface AP2 inet dhcp
right before the EOF to take into account the change above.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 linesudo rm /var/run/wpa_supplicant/wlan0
right after thesleep(30)
line.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.