Apologies for delay, kept missing a fi and couldn’t understand why it wouldn’t work.
It works now for me, but I only have 1 network specified, you’ll have to try both when set up.
Make sure and backup the sd card before starting, if it fails it won’t connect to wifi at all and you will need to rewrite the card - which I have done numerous times
Hope it works for you - good luck
Log in via SSH using root and musicbox
sudo nano /opt/musicbox/startup.sh
Scroll down to the line “if [ “$INI__network__wifi_network” != “” ]”
Delete or # everything between the first line and the #enable wifi line there is also a fi at the very end that I missed loads of times so make sure and delete that as well.
if [ “$INI__network__wifi_network” != “” ]
then
#put wifi settings for wpa roaming
#
# If wifi_country is set then include a country=XX line
if [ “$INI__network__wifi_country” != “” ]
then
WIFICOUNTRY=“country=$INI__network__wifi_country”
else
WIFICOUNTRY=""
fi
if [ “INI__network__wifi_password" != "" ]
then
password_length={#INI__network__wifi_password}
if [ $password_length -gt 63 ]
then
PSK=”$INI__network__wifi_password"
else
PSK=""$INI__network__wifi_password""
fi
cat >/etc/wpa.conf <<EOF
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
$WIFICOUNTRY
network={
ssid="$INI__network__wifi_network"
psk=$PSK
scan_ssid=1
}
EOF
else
#if no password is given, set key_mgmt to NONE
cat >/etc/wpa.conf <<EOF
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
$WIFICOUNTRY
network={
ssid="$INI__network__wifi_network"
key_mgmt=NONE
scan_ssid=1
}
EOF
fi
#enable wifi
ifdown wlan0 Remove # from this line
ifup wlan0
/etc/init.d/networking restart
fi Delete this line
ctrl x to save and exit.
Next
Open /etc/wpa.conf
sudo nano /etc/wpa.conf - it should show your network details.
Copy and paste underneath, then fill in correct names etc.
ctrl x to save and exit
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="myhomenetworks"
psk="myhomepassword"
scan_ssid=1
}
network={
ssid="myworknetworks"
psk="myworkpassword"
scan_ssid=1
}
Reboot and fingers crossed.
If you can hook up to hdmi to check progress as it reboots it’s easier to spot any errors.
Make sure and backup the sd card before starting, if it fails it won’t connect to wifi at all and you will need to rewrite the card