2

I have followed a couple of posts on here to turn off power management, but every morning I wake up after rebooting my pi the night before, my wifi has stopped working.

By stopped working I mean I can't ssh onto it, nmap no longer sees the ip on the network, and on the actual machine pinging or curl/wget don't work (I can't remember the error off the top of my head)

Can anyone help with either

a) the logs I should be checking INCLUDING what to grep for, in order to tell if the wifi is being powered down b) any outputs I can add to this that will help narrow down the issue

Thanks

UPDATE 2 :

When I came to try my pi today, the USB bluetooth keyboard wasn't registering anything. As I have a usb wifi dongle is it possible the USB ports are failing/powering down?

UPDATE 1 :

So last night I removed all my networking stuff in etc/network/interfaces and moved it to etc/dhcpcd.conf and etc/wpa_supplicant/wpa_supplicant.conf

After a couple of hours the wifi stopped again. Below is the output from syslog from when I turned on the pi, till this morning, grepped to wlan0. I rebooted it around 10pm, I think, to change the static IP to .8 instead of .12 . To me I can't see anything that would mean it was dropped.

Mar  8 19:50:28 raspberrypi wpa_supplicant[353]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 20:00:28 raspberrypi wpa_supplicant[353]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 20:10:28 raspberrypi wpa_supplicant[353]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 20:14:45 raspberrypi systemd[1]: Starting ifup for wlan0...
Mar  8 20:14:45 raspberrypi systemd[1]: Started ifup for wlan0.
Mar  8 20:14:46 raspberrypi kernel: [   16.605253] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Mar  8 20:14:45 raspberrypi dhcpcd[373]: wlan0: adding address fe80::8060:b514:6489:ee8d
Mar  8 20:14:46 raspberrypi avahi-daemon[370]: Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::8060:b514:6489:ee8d.
Mar  8 20:14:46 raspberrypi avahi-daemon[370]: New relevant interface wlan0.IPv6 for mDNS.
Mar  8 20:14:46 raspberrypi avahi-daemon[370]: Registering new address record for fe80::8060:b514:6489:ee8d on wlan0.*.
Mar  8 20:14:47 raspberrypi wpa_supplicant[450]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=GB
Mar  8 20:14:49 raspberrypi dhcpcd[373]: wlan0: waiting for carrier
Mar  8 20:14:50 raspberrypi wpa_supplicant[450]: wlan0: Trying to associate with c0:ff:d4:1d:88:f0 (SSID='VM507327-2G' freq=2422 MHz)
Mar  8 20:14:50 raspberrypi wpa_supplicant[450]: wlan0: Associated with c0:ff:d4:1d:88:f0
Mar  8 20:14:50 raspberrypi kernel: [   22.179269] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Mar  8 20:14:50 raspberrypi wpa_supplicant[450]: wlan0: WPA: Key negotiation completed with c0:ff:d4:1d:88:f0 [PTK=CCMP GTK=CCMP]
Mar  8 20:14:50 raspberrypi wpa_supplicant[450]: wlan0: CTRL-EVENT-CONNECTED - Connection to c0:ff:d4:1d:88:f0 completed [id=0 id_str=]
Mar  8 20:14:50 raspberrypi dhcpcd[373]: wlan0: carrier acquired
Mar  8 20:14:50 raspberrypi wpa_supplicant[450]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=COUNTRY_IE type=COUNTRY alpha2=GB
Mar  8 20:14:50 raspberrypi dhcpcd[373]: wlan0: IAID 02:d3:35:1a
Mar  8 20:14:51 raspberrypi dhcpcd[373]: wlan0: using static address 192.168.0.12/24
Mar  8 20:14:51 raspberrypi dhcpcd[373]: wlan0: adding route to 192.168.0.0/24
Mar  8 20:14:51 raspberrypi dhcpcd[373]: wlan0: adding default route via 192.168.0.1
Mar  8 20:14:51 raspberrypi avahi-daemon[370]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.12.
Mar  8 20:14:51 raspberrypi avahi-daemon[370]: New relevant interface wlan0.IPv4 for mDNS.
Mar  8 20:14:51 raspberrypi avahi-daemon[370]: Registering new address record for 192.168.0.12 on wlan0.IPv4.
Mar  8 20:14:52 raspberrypi dhcpcd[633]: wlan0: soliciting an IPv6 router
Mar  8 20:14:53 raspberrypi ntpd[656]: Listen normally on 3 wlan0 192.168.0.12 UDP 123
Mar  8 20:14:53 raspberrypi ntpd[656]: Listen normally on 5 wlan0 fe80::8060:b514:6489:ee8d UDP 123
Mar  8 20:15:17 raspberrypi dhcpcd[633]: wlan0: no IPv6 Routers available
Mar  8 20:20:28 raspberrypi wpa_supplicant[450]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 20:30:28 raspberrypi wpa_supplicant[450]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 20:40:28 raspberrypi wpa_supplicant[450]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 20:50:28 raspberrypi wpa_supplicant[450]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 21:00:28 raspberrypi wpa_supplicant[450]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 21:10:28 raspberrypi wpa_supplicant[450]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 21:20:28 raspberrypi wpa_supplicant[450]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 21:30:28 raspberrypi wpa_supplicant[450]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 21:40:28 raspberrypi wpa_supplicant[450]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 21:50:28 raspberrypi wpa_supplicant[450]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 22:00:28 raspberrypi wpa_supplicant[450]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 22:10:28 raspberrypi wpa_supplicant[450]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 22:10:46 raspberrypi kernel: [   14.354888] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Mar  8 22:10:46 raspberrypi systemd[1]: Starting ifup for wlan0...
Mar  8 22:10:46 raspberrypi systemd[1]: Started ifup for wlan0.
Mar  8 22:10:46 raspberrypi dhcpcd[371]: wlan0: adding address fe80::8060:b514:6489:ee8d
Mar  8 22:10:46 raspberrypi avahi-daemon[370]: Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::8060:b514:6489:ee8d.
Mar  8 22:10:46 raspberrypi avahi-daemon[370]: New relevant interface wlan0.IPv6 for mDNS.
Mar  8 22:10:46 raspberrypi avahi-daemon[370]: Registering new address record for fe80::8060:b514:6489:ee8d on wlan0.*.
Mar  8 22:10:47 raspberrypi wpa_supplicant[451]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=GB
Mar  8 22:10:49 raspberrypi dhcpcd[371]: wlan0: waiting for carrier
Mar  8 22:10:50 raspberrypi wpa_supplicant[451]: wlan0: Trying to associate with c0:ff:d4:1d:88:f0 (SSID='VM507327-2G' freq=2422 MHz)
Mar  8 22:10:50 raspberrypi kernel: [   19.398861] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Mar  8 22:10:50 raspberrypi wpa_supplicant[451]: wlan0: Associated with c0:ff:d4:1d:88:f0
Mar  8 22:10:50 raspberrypi wpa_supplicant[451]: wlan0: WPA: Key negotiation completed with c0:ff:d4:1d:88:f0 [PTK=CCMP GTK=CCMP]
Mar  8 22:10:50 raspberrypi wpa_supplicant[451]: wlan0: CTRL-EVENT-CONNECTED - Connection to c0:ff:d4:1d:88:f0 completed [id=0 id_str=]
Mar  8 22:10:50 raspberrypi dhcpcd[371]: wlan0: carrier acquired
Mar  8 22:10:50 raspberrypi wpa_supplicant[451]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=COUNTRY_IE type=COUNTRY alpha2=GB
Mar  8 22:10:50 raspberrypi dhcpcd[371]: wlan0: IAID 02:d3:35:1a
Mar  8 22:10:50 raspberrypi dhcpcd[371]: wlan0: soliciting an IPv6 router
Mar  8 22:10:51 raspberrypi dhcpcd[371]: wlan0: using static address 192.168.0.8/24
Mar  8 22:10:51 raspberrypi dhcpcd[371]: wlan0: adding route to 192.168.0.0/24
Mar  8 22:10:51 raspberrypi dhcpcd[371]: wlan0: adding default route via 192.168.0.1
Mar  8 22:10:51 raspberrypi avahi-daemon[370]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.8.
Mar  8 22:10:51 raspberrypi avahi-daemon[370]: New relevant interface wlan0.IPv4 for mDNS.
Mar  8 22:10:51 raspberrypi avahi-daemon[370]: Registering new address record for 192.168.0.8 on wlan0.IPv4.
Mar  8 22:10:53 raspberrypi ntpd[656]: Listen normally on 3 wlan0 192.168.0.8 UDP 123
Mar  8 22:10:53 raspberrypi ntpd[656]: Listen normally on 5 wlan0 fe80::8060:b514:6489:ee8d UDP 123
Mar  8 22:11:15 raspberrypi dhcpcd[633]: wlan0: no IPv6 Routers available
Mar  8 22:20:28 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 22:30:28 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 22:40:28 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 22:50:28 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 23:00:28 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 23:10:28 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 23:20:28 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 23:30:28 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 23:40:28 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  8 23:50:28 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 00:00:29 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 00:10:29 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 00:20:29 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 00:30:29 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 00:40:29 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 00:50:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 01:00:29 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 01:10:29 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 01:20:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 01:30:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 01:40:29 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 01:50:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 02:00:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 02:10:29 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 02:20:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 02:30:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 02:40:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 02:50:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 03:00:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 03:10:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 03:20:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 03:30:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 03:40:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 03:50:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 04:00:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 04:10:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 04:20:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 04:30:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 04:40:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 04:50:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 05:00:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 05:10:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 05:20:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 05:30:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 05:40:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 05:50:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 06:00:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 06:10:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
Mar  9 06:20:30 raspberrypi wpa_supplicant[451]: wlan0: WPA: Group rekeying completed with c0:ff:d4:1d:88:f0 [GTK=CCMP]
  • Thanks, I'll do all this when I get home tonight (I'm at work at the moment so can't do it now) – Russ Wheeler Mar 8 '18 at 12:52
1

the logs I should be checking INCLUDING what to grep for, in order to tell if the wifi is being powered down

Powering down is not necessarily the cause of lost wifi. However, you could try journalctl --since=yesterday to view all the logs since 12 AM yesterday (i.e., 24 hrs + the current time). This will appear in less (or perhaps whatever $VIEWER is set to; this is the same app used for man pages) by default, which is sort of nice since it also includes a bit of color. Less has regular expression searching (use 'h' for help), but if you prefer grep you can redirect that, including to a file (the complete system log does not appear in a plain text file anywhere unless you configure journalctl and rsyslog appropriately).

I would just search for the name of the interface (e.g. wlan0) at first. There's probably at most a thousand lines in there for since=yesterday, which is not that hard to eyeball scan either.

But it may well be that there is no error logged despite the fact the system is offline, except for by things that expect it to be, which is not much help in diagnosing the problem.

I don't use the normal high level network configuration/interface on linux, so I am not sure to what extent it can be expected that it will reconnect when there is a problem (I suspect it is either "not at all" or "depends on the issue"). However, you can still adapt my solution to work with the conventional system.

I run a background script that configures and maintains a connection. I've done this for years and it is fairly bulletproof (e.g., I have a few devices, including a Pi 3, that have been on wifi for months and months without me having to reset them). The part of the script that keeps things online pings the router at intervals using a "back off" style algorithm; after making a connection it does it fairly frequently (every 30-60 seconds), then doubles it until it reaches a predetermined maximum (3-5 minutes). The actual check is just:

ping -c 1 $ROUTER_IP &> /dev/null
if [ $? -ne 0 ]; then
    ...failure...

If you don't do any shell scripting, $? is the exit status of the last foreground process. Non-zero indicates ping failed. When this happens, I reset the frequency to 30 or 60 seconds and if it fails twice in a row, the script restarts.

The initial part of the script checks for other running instances, kills them, and shuts down anything else found running related to the connection, then starts it all a fresh. If you are using normal networking, you could just stop and start (or restart) that using whatever commands.

All this is logged to a dedicated file, including redirecting the output of whatever commands.

The one issue I do notice with this involves DHCP leases on my home LAN. I haven't looked into it, so it may be some annoying quirk of the Big Corp provided black box router. I only notice it with computers I actually work at, which implies when it happens to one of the afforementioned devices it eventually works itself out. I don't know how long that takes but I've sat waiting for fifteen minutes before, and nothing I do manually works -- DHCP fails because the router will not offer a lease. However: I use dhclient, and if I shut it down, then go into /var/lib/dhclient and erase everything (this is where the leases are kept) then restart, presto, no problem.

Some systems have required some tinkering to solve particular problems -- e.g., I had a laptop where I had to use rfkill to get the wifi to restart effectively. If you think your problem has to do with the interface powering down, then you should use whatever command to force it to power up.

  • Wow, thanks for the indepth answer, I'll be sure to try this when I get home. One thing I will add, is that I recently made some updates to the OS, via apt-get, in order to get some other libs on there working (namely newer versions of gradle and java). It started losing connection after that. So I don't consider it to be hardware or anything like that as an issue, so I'm a bit loathed to run a script constantly pinging etc. Not that it won't work, but I feel the issue is going to be a very simple one to fix, just some new config somewhere. – Russ Wheeler Mar 8 '18 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.