lukicdarkoo / rpi-wifi

Configures simultaneous AP and Managed Mode Wifi on Raspberry Pi
GNU General Public License v3.0
535 stars 119 forks source link

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

Open pmi123 opened 8 months ago

pmi123 commented 8 months ago

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"
    }
  2. Populate /etc/network/interfaces section Add the line iface AP2 inet dhcp right before the EOF to take into account the change above.

  3. 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.

  4. 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.