1

I have a Pi Zero W running software that constantly retrieves internet information (there is no reason for the WiFi to "sleep" although I think I've already turned off all the power-save stuff). Every few days, the WiFi connection just STOPS. My router security is "WPA2 Personal" it's an Apple router and I don't have many more options.

I was still able to access the Pi via USB/RNDIS/Ethernet Gadget mode so I could at least retrieve some information while it's off-WiFi:

ifconfig - WHILE WIFI IS DOWN

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:371953 errors:0 dropped:0 overruns:0 frame:0
          TX packets:371953 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:117420716 (111.9 MiB)  TX bytes:117420716 (111.9 MiB)

usb0      Link encap:Ethernet  HWaddr 12:61:9d:58:71:e7  
          inet addr:192.168.2.20  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::b4f1:b5d:5f46:2804/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:30346 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25046 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:21326729 (20.3 MiB)  TX bytes:11436261 (10.9 MiB)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:fd:8e:43  
          inet6 addr: fe80::55e6:6635:aa91:21c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2677376 errors:0 dropped:251 overruns:0 frame:0
          TX packets:1905430 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1769016413 (1.6 GiB)  TX bytes:335795383 (320.2 MiB)

ip addr show - WHILE WIFI IS DOWN

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 12:61:9d:58:71:e7 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.20/24 brd 192.168.2.255 scope global usb0
       valid_lft forever preferred_lft forever
    inet6 fe80::b4f1:b5d:5f46:2804/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether b8:27:eb:fd:8e:43 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::ba27:ebff:fefd:8e43/64 scope link 
       valid_lft forever preferred_lft forever

iwconfig - WHILE WIFI IS DOWN

usb0      no wireless extensions.

wlan0     IEEE 802.11  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off

lo        no wireless extensions.

ifconfig - WHEN WIFI IS BACK UP

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:371977 errors:0 dropped:0 overruns:0 frame:0
          TX packets:371977 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:117502451 (112.0 MiB)  TX bytes:117502451 (112.0 MiB)

usb0      Link encap:Ethernet  HWaddr 12:61:9d:58:71:e7  
          inet addr:192.168.2.20  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::b4f1:b5d:5f46:2804/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:30586 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25274 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:21361874 (20.3 MiB)  TX bytes:11479732 (10.9 MiB)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:fd:8e:43  
          inet addr:10.0.1.169  Bcast:10.0.1.255  Mask:255.255.255.0
          inet6 addr: fe80::55e6:6635:aa91:21c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2677377 errors:0 dropped:251 overruns:0 frame:0
          TX packets:1905461 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1769016749 (1.6 GiB)  TX bytes:335802150 (320.2 MiB)

ip addr show - WHEN WIFI IS BACK UP

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether a6:30:3f:a5:9e:a3 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.21/24 brd 192.168.2.255 scope global usb0
       valid_lft forever preferred_lft forever
    inet6 fe80::a430:3fff:fea5:9ea3/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:fd:8e:43 brd ff:ff:ff:ff:ff:ff
    inet 10.0.1.169/24 brd 10.0.1.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::ba27:ebff:fefd:8e43/64 scope link 
       valid_lft forever preferred_lft forever

iwconfig - WHEN WIFI IS BACK UP

usb0      no wireless extensions.

wlan0     IEEE 802.11  ESSID:"outerspace"  
          Mode:Managed  Frequency:2.437 GHz  Access Point: 3C:15:C2:F2:61:18   
          Bit Rate=57.7 Mb/s   Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=70/70  Signal level=-17 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:1  Invalid misc:0   Missed beacon:0

lo        no wireless extensions.

/etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto wlan0

auto lo usb0
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
    wireless-power off
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
    post-up iw wlan0 set power_save off

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug usb0
iface usb0 inet manual
pinhead
  • 447
  • 1
  • 6
  • 17
  • Is there any traces in the log's? Example /var/log/messages and what does the "software that retreive..." log say? – MatsK Sep 14 '17 at 02:40
  • 1
    @MatsK log is huge should I grep something? And what do you mean about the software that retrieves? – pinhead Sep 14 '17 at 02:57
  • Start by pinpointing the time when it happens, and then you have to read the log and look for suspicious log entries. And from your Q, "I have a Pi Zero W running software that constantly retrieves internet information". That is the software. – MatsK Sep 14 '17 at 03:01
  • 1
    @MatsK Thanks. It's running Bitcoin with pretty verbose log so I know exactly when the connection dropped :-) Here's a taste of the system log around that time: https://pastebin.com/raw/xsywtuSp (looks like some SD card trouble) and then about an hour after that, this: https://pastebin.com/raw/sHzsdtFS which looks like out-of-memory errors. – pinhead Sep 14 '17 at 20:38
  • Have a look at "Log To RAM" https://raspberrypi.stackexchange.com/questions/62533/how-can-i-reduce-the-writing-to-log-files and replace the SD card. – MatsK Sep 14 '17 at 22:24

0 Answers0