Environment
- Raspberry Pi 3B
- Raspbian Stretch (have tried both 2018-11-13-full and 2018-06-27-raspbian-stretch)
- WiFi wpa_supplicant fully configured, and WiFi operational
- Raspbian boots to graphical desktop, everything works as expected.
- Then use raspi-config to reconfigure to boot to console, and reboot (no other changes)
- With no graphical desktop, WiFi bounces approximately every 6-10 minutes with 'carrier lost', and then comes back online.
Analysis
Graphical mode
- The directory /tmp/dhcpcd-pi exists, owned by pi/pi, with 2 sockets in it:libdhcpcd-wpa-<pid>.0 and libdhcpcd-wpa-<pid>.1. The pid is that of lxpanel. lsof indicates that gmain, gdbus, and menu-cached also access these sockets. lsof doesn't show dhcpcd or wpa_supplicant accessing these sockets, so I'm not yet clear how this is all wired up. I'm hoping that someone on the Raspbian team can shed some light on this!
- I found the following in the wpa_supplicant log when booted in graphical desktop.
Code: Select all
Feb 18 11:12:47: CTRL_IFACE monitor attached /tmp/dhcpcd-pi/libdhcpcd-wpa-963.3\x00 Feb 18 11:12:47: wlan0: Control interface command 'STATUS' Feb 18 11:12:47: EAPOL: EAP Session-Id not available Feb 18 11:12:47: wlan0: Control interface command 'BSS 0' Feb 18 11:12:47: wlan0: Control interface command 'BSS 1' Feb 18 11:12:47: wlan0: Control interface command 'BSS 2' Feb 18 11:12:47: wlan0: Control interface command 'BSS 3' Feb 18 11:12:47: wlan0: Control interface command 'BSS 4' Feb 18 11:12:47: wlan0: Control interface command 'BSS 5' Feb 18 11:12:47: wlan0: Control interface command 'BSS 6' Feb 18 11:12:47: wlan0: Control interface command 'BSS 7' Feb 18 11:12:47: wlan0: Control interface command 'BSS 8' Feb 18 11:12:47: wlan0: Control interface command 'BSS 9' Feb 18 11:12:47: wlan0: Control interface command 'BSS 10' Feb 18 11:12:47: wlan0: Control interface command 'BSS 11' Feb 18 11:12:47: wlan0: Control interface command 'STATUS'
Console mode
- the directory /tmp/dhcpcd-pi does not exist
- The wpa_supplicant log (at the same point in the log). Note that the CTRL_IFACE message from the graphical desktop scenario is nowhere to be found. Instead, it looks like the SSIDs are flushed from the wpa_supplicant cache, and then eventually followed by a WiFi disconnect event. See the end of this message for the corresponding journalctl log entries for this disconnect. The wpa_bss_flush_by_age messages appear about 3 minutes after wlan0 is put online, initially, and after each bounce.
Code: Select all
Feb 17 20:23:15: EAPOL: disable timer tick Feb 17 20:26:23: wlan0: BSS: Remove id 0 BSSID 4c:01:43:69:21:1f SSID 'OurFiNotYourFi' due to wpa_bss_flush_by_age Feb 17 20:26:23: wlan0: BSS: Remove id 2 BSSID 4c:01:43:65:49:f6 SSID 'BennLiz' due to wpa_bss_flush_by_age Feb 17 20:26:23: wlan0: BSS: Remove id 3 BSSID 4c:01:43:65:49:f3 SSID '91b55' due to wpa_bss_flush_by_age Feb 17 20:26:23: wlan0: BSS: Remove id 4 BSSID 4c:01:43:65:49:ff SSID 'OurFiNotYourFi' due to wpa_bss_flush_by_age Feb 17 20:26:23: wlan0: BSS: Remove id 5 BSSID 4c:01:43:64:5f:ff SSID 'OurFiNotYourFi' due to wpa_bss_flush_by_age Feb 17 20:26:23: wlan0: BSS: Remove id 6 BSSID 4c:01:43:64:5f:f6 SSID 'BennLiz' due to wpa_bss_flush_by_age Feb 17 20:26:23: wlan0: BSS: Remove id 7 BSSID a0:63:91:cc:43:3b SSID 'Chapman' due to wpa_bss_flush_by_age Feb 17 20:26:23: wlan0: BSS: Remove id 8 BSSID 44:1c:12:02:4c:01 SSID 'Comcast Box' due to wpa_bss_flush_by_age Feb 17 20:26:23: wlan0: BSS: Remove id 9 BSSID 00:1f:90:e4:cf:97 SSID '30CL0' due to wpa_bss_flush_by_age Feb 17 20:26:23: wlan0: BSS: Remove id 10 BSSID 4c:01:43:65:49:f9 SSID '' due to wpa_bss_flush_by_age Feb 17 20:26:23: wlan0: BSS: Remove id 11 BSSID 44:1c:12:02:4c:03 SSID 'xfinitywifi' due to wpa_bss_flush_by_age Feb 17 20:29:00: nl80211: Event message available Feb 17 20:29:00: nl80211: Ignored event (cmd=48) for foreign interface (ifindex 3 wdev 0x0) Feb 17 20:29:00: nl80211: Drv Event 48 (NL80211_CMD_DISCONNECT) received for wlan0 Feb 17 20:29:00: nl80211: Disconnect event Feb 17 20:29:00: wlan0: Event DEAUTH (12) received Feb 17 20:29:00: wlan0: Deauthentication notification Feb 17 20:29:00: wlan0: * reason 0 (locally generated) Feb 17 20:29:00: Deauthentication frame IE(s) - hexdump(len=0): [NULL] Feb 17 20:29:00: wlan0: CTRL-EVENT-DISCONNECTED bssid=4c:01:43:69:21:16 reason=0 locally_generated=1 Feb 17 20:29:00: wlan0: Auto connect enabled: try to reconnect (wps=0/0 wpa_state=9) Feb 17 20:29:00: wlan0: Setting scan request: 0.100000 sec Feb 17 20:29:00: Added BSSID 4c:01:43:69:21:16 into blacklist Feb 17 20:29:00: wlan0: Blacklist count 1 --> request scan in 100 ms Feb 17 20:29:00: wlan0: Ignore new scan request for 0.100000 sec since an earlier request is scheduled to trigger sooner Feb 17 20:29:00: TDLS: Remove peers on disassociation Feb 17 20:29:00: wlan0: WPA: Clear old PMK and PTK Feb 17 20:29:00: wlan0: Disconnect event - remove keys Feb 17 20:29:00: wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0 Feb 17 20:29:00: wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0 Feb 17 20:29:00: wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=0x194b978 key_idx=0 set_tx=0 seq_len=0 key_len=0 Feb 17 20:29:00: addr=4c:01:43:69:21:16 Feb 17 20:29:00: wlan0: State: COMPLETED -> DISCONNECTED
- In this scenario, as I mentioned, the Wifi bounces. A typical journalctl entry is shown at the end of this message.
I also tried Stretch 2018-06-27, which exhibited the same behavior: worked with graphical desktop, WiFi bounces regularly with console.
lxpanel, gmain, gdbus, and/or menu-cached are doing something that makes Wifi operate correctly, and whatever that is is not being done in console mode. This strikes me as problematic, since WiFi without the full graphical Raspbian interface should work reliably, shouldn't it?
This is what a typical bounce looks like in the systemd journal
Code: Select all
Feb 17 20:29:00 rpi31 dhcpcd[508]: wlan0: carrier lost
Feb 17 20:29:00 rpi31 dhcpcd[508]: wlan0: deleting address fe80::f574:788:2dd9:a9cd
Feb 17 20:29:00 rpi31 avahi-daemon[351]: Withdrawing address record for fe80::f574:788:2dd9:a9cd on wlan0.
Feb 17 20:29:00 rpi31 avahi-daemon[351]: Leaving mDNS multicast group on interface wlan0.IPv6 with address fe80::f574:788:2dd9:a9cd.
Feb 17 20:29:00 rpi31 avahi-daemon[351]: Interface wlan0.IPv6 no longer relevant for mDNS.
Feb 17 20:29:01 rpi31 dhcpcd[508]: wlan0: deleting default route via 192.168.92.1
Feb 17 20:29:01 rpi31 dhcpcd[508]: wlan0: deleting route to 192.168.92.0/24
Feb 17 20:29:01 rpi31 avahi-daemon[351]: Withdrawing address record for 192.168.92.198 on wlan0.
Feb 17 20:29:01 rpi31 avahi-daemon[351]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.92.198.
Feb 17 20:29:01 rpi31 avahi-daemon[351]: Interface wlan0.IPv4 no longer relevant for mDNS.
Feb 17 20:29:01 rpi31 dhcpcd[508]: wlan0: carrier acquired
Feb 17 20:29:01 rpi31 dhcpcd[508]: wlan0: IAID eb:b4:d3:c1
Feb 17 20:29:01 rpi31 dhcpcd[508]: wlan0: adding address fe80::f574:788:2dd9:a9cd
Feb 17 20:29:01 rpi31 dhcpcd[508]: wlan0: soliciting an IPv6 router
Feb 17 20:29:02 rpi31 dhcpcd[508]: wlan0: rebinding lease of 192.168.92.198
Feb 17 20:29:02 rpi31 dhcpcd[508]: wlan0: probing address 192.168.92.198/24
Feb 17 20:29:03 rpi31 avahi-daemon[351]: Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::f574:788:2dd9:a9cd.
Feb 17 20:29:03 rpi31 avahi-daemon[351]: New relevant interface wlan0.IPv6 for mDNS.
Feb 17 20:29:03 rpi31 avahi-daemon[351]: Registering new address record for fe80::f574:788:2dd9:a9cd on wlan0.*.
Feb 17 20:29:07 rpi31 dhcpcd[508]: wlan0: leased 192.168.92.198 for 86400 seconds
Feb 17 20:29:07 rpi31 avahi-daemon[351]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.92.198.
Feb 17 20:29:07 rpi31 avahi-daemon[351]: New relevant interface wlan0.IPv4 for mDNS.
Feb 17 20:29:07 rpi31 dhcpcd[508]: wlan0: adding route to 192.168.92.0/24
Feb 17 20:29:07 rpi31 avahi-daemon[351]: Registering new address record for 192.168.92.198 on wlan0.IPv4.
Feb 17 20:29:07 rpi31 dhcpcd[508]: wlan0: adding default route via 192.168.92.1
Feb 17 20:29:15 rpi31 dhcpcd[508]: wlan0: no IPv6 Routers available
Feb 17 20:34:59 rpi31 dhcpcd[508]: wlan0: carrier lost