Wifi re-connect ?

My Volumio runs on an RPi 3 and connects via Wifi to my network. The problem is that if the Wifi goes down, Volumio never reconnects when the Wifi is available again, which means I can’t get it working without a power down (bad for linux) as I cannot even connect to do an orderly shutdown.

Is there any way to make it attempt to reconnect periodically after losing the connection, so that when Wifi is available again, it connects and is usable again.?

There have been a number of topics on this subject. For example

#! /bin/sh
ssid=$(/sbin/iwgetid --raw)
if [ -z "$ssid" ]
then
    echo "Wifi is down, reconnecting..."
    /sbin/ifconfig wlan0 down
    sleep 5
    systemctl restart wireless
    /volumio/app/plugins/system_controller/volumio_command_line_client/volumio.sh play
fi
echo "wifi-check done"

I wrote a python script (part of a bigger system) to periodically ping a host & perform the ifconfig wlan0 down/ systemctl restart wireless which seemed to work (similar to the above script).

Thanks. I have found a plugin someone made - haven’t test it yet. This really should be part of the standard setup though.

Do you have a link to the plugin? Agreed would be nicer if integrated with Volumio core.

Hi,
I also have the issue that my Raspberry 2 with Volume Version 2.368 looses the WLAN connection. The command:
“systemctl restart wireless” doesn’t work. When executing this command (as sudo and as not sudo) it takes a while and then fails with the message:
Job for wireless.service failed. See ‘systemctl status wireless.service’ and ‘journalctl -xn’ for details.

systemctl status wireless brings following up.
● wireless.service - Wireless Services
Loaded: loaded (/lib/systemd/system/wireless.service; enabled)
Active: failed (Result: timeout) since Tue 2018-02-27 22:04:21 UTC; 1min 43s ago
Process: 12021 ExecStart=/volumio/app/plugins/system_controller/network/wireless.js start (code=killed, signal=TERM)
Process: 12007 ExecStartPre=/bin/wifistart.sh (code=exited, status=0/SUCCESS)
Main PID: 928 (code=exited, status=0/SUCCESS)

Feb 27 22:05:54 volumio wpa_supplicant[12113]: * Auth Type 0
Feb 27 22:05:54 volumio wpa_supplicant[12113]: nl80211: MLME connect failed: ret=-114 (Operation already in progress)
Feb 27 22:05:54 volumio wpa_supplicant[12113]: wlan0: Association request to the driver failed
Feb 27 22:05:54 volumio wpa_supplicant[12113]: wlan0: Radio work ‘connect’@0xe012e8 done in 0.513207 seconds
Feb 27 22:05:54 volumio wpa_supplicant[12113]: Added BSSID 9c:3d:cf:21:72:04 into blacklist
Feb 27 22:05:54 volumio wpa_supplicant[12113]: wlan0: Blacklist count 8 --> request scan in 10000 ms
Feb 27 22:05:54 volumio wpa_supplicant[12113]: wlan0: Setting scan request: 10.000000 sec
Feb 27 22:05:54 volumio wpa_supplicant[12113]: wlan0: State: ASSOCIATING -> DISCONNECTED
Feb 27 22:05:54 volumio wpa_supplicant[12113]: nl80211: Set wlan0 operstate 0->0 (DORMANT)
Feb 27 22:05:54 volumio wpa_supplicant[12113]: netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT)

Any idea? BTW I found the plugin github.com/balbuze/volumio-plug … ireconnect from baluze, but this also works with the systemctl restart command…

Btw, what is the meaning of the entries:
Feb 27 22:05:54 volumio wpa_supplicant[12113]: Added BSSID 9c:3d:cf:21:72:04 into blacklist
Feb 27 22:05:54 volumio wpa_supplicant[12113]: wlan0: Blacklist count 8 --> request scan in 10000 ms
does that mean it blacklist the device with that address. It’s one of my mesh Accesspoints.

A reboot normally brings the clan back and sometimes also unplug and re-plug the USB-WLan adapter, bit in the later case the status of the wireless service is still failed…

Regards, Caunus

github.com/balbuze/volumio-plug … ireconnect

Latest Volumio version fixes this: when you loose connection to wireless, it will retry to reconnect until it does.
Just make sure you have hotspot fallback set to off, in network settings

I already have those settings. Certainly wifi reconnects as confirmed by ifconfig & can for example sudo ping google.com. But certainly Volumio doesn’t resume playing any webradio stream. I have to click the Pause then Play button. Is that expected?

Uses the latest version, so I’m still not sure why it doesn’t work…

I have also problem with newest volumio and rpi3 with wifi connection.
first I run it maybe too far away from wifi AP but I just bought Ubiquiti AP AC LR and moved it different place so its now closer and shouldnt be too poor signal. I mainly listen webradios.

Volumios iwconfig show now:

root@nettiradioth:/home/volumio# iwconfig 
wlan0     IEEE 802.11  ESSID:"myAP"  
          Mode:Managed  Frequency:2.462 GHz  Access Point: NN:NN:NN:NN:NN   
          Bit Rate=6.5 Mb/s   Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=44/70  Signal level=-66 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

so its not poor I think… but however I have pull the power plug 3-5 times / day because it stops play and I cannot even ssh to volumio.

@caunus, @pumo, did you have same problem with earlier 2.362 version?

It seems the Pi3/P0W wireless firmware issue is not fully over yet.
Though remaining issues should mostly be noticed in Hotspot (AP) mode, maybe there are some other corner cases?
Knowing if you had same issue with previous release, would help understanding this.

Yes this newest and couple version before that.
I have running this newest version only with new wifi placement.

I try to upgrade rpi firmware, I havent done it since I bought rpi in last year.

edit: that was bad idea :slight_smile: I broke whole volumio, reinstalling next…
edit2: I have also another rpi3 in wifi, with rasbian and domoticz in it. It works without breaking net… I have upgraded firmware in this year but I dont remember when.

Only current 2.368 release had “transitional” updated wifi firmware.
2.362 had original one (same as the reverted one made available by Pi Foundation recently).
So if you had problem with 2.362 we can not fully conclude: could be other thing.

Yes do NOT rpi-update on Volumio.
You may sudo apt-get install -y --only-upgrade firmware-brcm80211 to check with reverted firmware on 2.368.
(Be careful if you do Volumio OTA updates after that, as you’ll keep that firmware, whatever new OTA comes with…)

after volumio breaking rpi firmware upgrade, my wifi have been up all the time.
even that I have to reinstall whole volumio I am now satisfied :slight_smile:

good advice is to install rasbian lite to another sd card and upgrade firmware thru that…

Fine if you are satisfied with such Frankenstein setup, but it’s probably not a good advise for most: expect unexpected issues… :unamused:

Well I got with easy because I have 3 rpis allready two of them are with raspbian…

this is what works for me on volumio 2.575 (jessie)

fist save ifupdown in xxx.original then copy ifupdown.sh as described here
francisuniverse.wordpress.com/2 … i-to-wifi/
or
elektronik-kompendium.de/si … 101211.htm (…german)

(ethernet-port will not work then. you have to copy back for that with:
cd /etc/ifplugd/action.d/
sudo rm ifupdown
sudo cp ifupdown.original ifupdown
)

this is the script. i run it every 5 min in crontab:

#!/bin/bash

#router ip 192.168.0.1

Only send two pings

ping -c2 192.168.0.1 > /dev/null

if [ $? != 0 ]
then

#Restart network services
sudo systemctl reenable wpa_supplicant.service
sudo systemctl restart wpa_supplicant.service
sudo systemctl restart dhcpcd.service

now=$( date '+%F_%H:%M:%S' )
echo "checkwifi script. no wifi connection, reconnect at: $now" >> /usr/local/bin/cronlog.txt 2>&1

fi

sources:
wiki.debian.org/WiFi/HowToUse (search for “quick connect to the configured network”)
alexba.in/blog/2015/01/14/automa … spberrypi/ (didnt work for me but explains script and crontab)