11

Just flashed a card with Raspbian Buster Lite on a Raspberry Pi 2, and ssh'd into it using an ethernet cable. raspi-config/wpa_cli can't communicate with wpa_supplicant (there's no /var/run/wpa_supplicant control interface).

At the end of the post I explain a workaround, but it's not permanent.

Here's some debugging information,

pi@raspberrypi:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:    10
Codename:   buster
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.19.97-v7+ #1294 SMP Thu Jan 30 13:15:58 GMT 2020 armv7l GNU/Linux
pi@raspberrypi:~ $ ps aux | grep wpa
root       289  0.0  0.4  10740  3976 ?        Ss   may02   0:00 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant
pi         915  0.0  0.0   7356   496 pts/0    S+   00:00   0:00 grep --color=auto wpa
pi@raspberrypi:~ $ sudo systemctl status wpa_supplicant.service 
● wpa_supplicant.service - WPA supplicant
   Loaded: loaded (/lib/systemd/system/wpa_supplicant.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2020-05-04 02:04:51 -03; 2min 50s ago
 Main PID: 602 (wpa_supplicant)
    Tasks: 1 (limit: 2200)
   Memory: 496.0K
   CGroup: /system.slice/wpa_supplicant.service
           └─602 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant

may 04 02:04:51 raspberrypi systemd[1]: Starting WPA supplicant...
may 04 02:04:51 raspberrypi systemd[1]: Started WPA supplicant.
may 04 02:04:51 raspberrypi wpa_supplicant[602]: Successfully initialized wpa_supplicant

pi@raspberrypi:~ $ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
    ssid="****"
    psk="****"
}

As you can see, I've only edited the config with network's ssid/psk after failing at raspi-config.

Here's my usb wifi adapter / driver,

pi@raspberrypi:~ $ sudo lsusb -v

Bus 001 Device 004: ID 0bda:8179 Realtek Semiconductor Corp. RTL8188EUS 802.11n Wireless Network Adapter
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0x8179 RTL8188EUS 802.11n Wireless Network Adapter
  bcdDevice            0.00
  iManufacturer           1 Realtek
  iProduct                2 802.11n NIC
  iSerial                 3 00E04C0001
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0027
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0002
  (Bus Powered)
  Remote Wakeup Enabled
pi@raspberrypi:~ $ ip addr show wlan0
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 18:a6:f7:1d:36:90 brd ff:ff:ff:ff:ff:ff
pi@raspberrypi:~ $ cat /var/log/syslog
...
May  3 00:04:04 raspberrypi kernel: [    8.225728] r8188eu: module is from the staging directory, the quality is unknown, you have been warned.
May  3 00:04:04 raspberrypi kernel: [    8.324223] Chip Version Info: CHIP_8188E_Normal_Chip_TSMC_D_CUT_1T1R_RomVer(0)
May  3 00:04:04 raspberrypi kernel: [    8.362213] usbcore: registered new interface driver r8188eu
May  3 00:04:04 raspberrypi kernel: [   10.939312] random: crng init done
May  3 00:04:04 raspberrypi kernel: [   10.939336] random: 7 urandom warning(s) missed due to ratelimiting
May  3 00:04:04 raspberrypi kernel: [   11.394678] 8021q: 802.1Q VLAN Support v1.8
May  3 00:04:04 raspberrypi systemd[1]: Started triggerhappy global hotkey daemon.
May  3 00:04:04 raspberrypi systemd[1]: Started System Logging Service.
May  3 00:04:05 raspberrypi avahi-daemon[288]: Successfully called chroot().
May  3 00:04:05 raspberrypi avahi-daemon[288]: Successfully dropped remaining capabilities.
May  3 00:04:05 raspberrypi avahi-daemon[288]: No service file found in /etc/avahi/services.
May  3 00:04:05 raspberrypi avahi-daemon[288]: Network interface enumeration completed.
May  3 00:04:05 raspberrypi avahi-daemon[288]: Server startup complete. Host name is raspberrypi.local. Local service cookie is 2935413426.
May  3 00:04:05 raspberrypi wpa_supplicant[307]: Successfully initialized wpa_supplicant
May  3 00:04:05 raspberrypi systemd[1]: Started Login Service.
May  3 00:04:05 raspberrypi systemd[1]: Started Avahi mDNS/DNS-SD Stack.
May  3 00:04:05 raspberrypi systemd[1]: Started WPA supplicant.
May  3 00:04:05 raspberrypi raspi-config[313]: Checking if shift key is held down:Error opening '/dev/input/event*': No such file or directory
May  3 00:04:05 raspberrypi raspi-config[313]:  No. Switching to ondemand scaling governor.
May  3 00:04:05 raspberrypi systemd[1]: Started LSB: Switch to ondemand cpu governor (unless shift key is pressed).
May  3 00:04:05 raspberrypi kernel: [   11.661234] Adding 102396k swap on /var/swap.  Priority:-2 extents:1 across:102396k SSFS
May  3 00:04:05 raspberrypi systemd[1]: Started dphys-swapfile - set up, mount/unmount, and delete a swap file.
May  3 00:04:05 raspberrypi dhcpcd[306]: eth0: waiting for carrier
May  3 00:04:05 raspberrypi kernel: [   11.679881] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May  3 00:04:05 raspberrypi dhcpcd[306]: wlan0: waiting for carrier
May  3 00:04:05 raspberrypi dhcpcd[306]: eth0: carrier acquired
May  3 00:04:05 raspberrypi kernel: [   12.338131] MAC Address = 18:a6:f7:1d:36:90
May  3 00:04:05 raspberrypi kernel: [   12.341657] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
...

After reading some posts, people seems to have issues with the driver, so tried with wext,

pi@raspberrypi:~ $ sudo pkill wpa_supplicant
pi@raspberrypi:~ $ sudo wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -D wext
Successfully initialized wpa_supplicant
rfkill: Cannot get wiphy information
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument

pi@raspberrypi:~ $ ps aux | grep wpa
root       496  0.2  0.2  10996  2760 ?        Ss   01:58   0:00 wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -D wext

That worked, and wlan0 went up, but I'm not sure how to keep it permanent for reboot, because it's not clear who is responsable for starting wpa_supplicant, dhcpcd hooks (10-wpa_supplicant.conf)? systemd's wpa_supplicant dbus service?

According to ps aux output, it's using the DBus service, and tried adding -Dwext parameter on ExecStart and rebooted but didn't work. It's like the default DBus version doesn't work. Is it expecting NetworkManager to be installed or something?

pi@raspberrypi:~ $ ps aux | grep wpa
root       321  0.2  0.4  10740  3972 ?        Ss   01:56   0:00 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant -Dwext

When running wpa_supplicant using the default nl80211 I get this output,

pi@raspberrypi:~ $ sudo /sbin/wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -i wlan0
Successfully initialized wpa_supplicant
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
wlan0: Failed to initialize driver interface
soundblaster
  • 119
  • 1
  • 1
  • 4
  • 3
    I am not sure that what you have listed is significant and fiddling with wpa_supplicant is unnecessary, but one thing is clear - you do not appear to have setup the Pi fully. Depending on what your network supports and the whether the WiFi chip supports it but you have NOT set country code See How to set up networking/WiFi – Milliways May 04 '20 at 06:05
  • For example, you can set up country code using raspi-config, right? I can't even do that because it fails communicating with wpa_supplicant control interface (there's no /var/run/wpa_supplicant created at boot). I had already set country code and rebooted and it doesn't matter, at least for my interface. dhcpcd doesn't seem to start wlan0, whereas starting wpa_supplicant setting wext driver manually does work. – soundblaster May 04 '20 at 13:53
  • 1
    I can't say why raspi-config is not changing the file - I don't use it but put a file called wpa_supplicant.conf in the boot directory and reboot. ls /sys/class/net will show if there is a wireless interface - if not fiddling with other files is futile. – Milliways May 05 '20 at 00:45
  • I can confirm the same issue: Raspberry Pi OS Buster Lite 2021-03-04 on a Raspberry Pi 3. I used a fully-complete wpa_supplicant.conf file and made no other changes. – Daniele Procida May 08 '21 at 09:16
  • Not just Lite either; Desktop too. – Daniele Procida May 08 '21 at 10:16
  • In my case, NetworkManager was trying to manage the wifi connection, and wpa_supplicant was not able to do its thing freely. I anyway wanted to use nmcli, once I switched, it worked. – Milind R Jul 18 '22 at 14:24

3 Answers3

7

The approach described here worked for me. I had the same symptoms, albeit with a different RTL chip (RTL8192S / Edimax EW-7622UMn):

the wlan0 interface does not sense the carrier and dhcpcd refuses to configure it. It seems that dhcpcd does not acknowledge that it is a WiFi adapter, so we have to force it. Just add an interface section into /etc/dhcpcd.conf:

interface wlan0
env ifwireless=1
env wpa_supplicant_driver=nl80211,wext

Then reload with:

sudo systemctl daemon-reload
sudo systemctl restart dhcpcd

This was on a Raspberry Pi Model B+ v1.2 running bullseye.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

$ uname -an Linux raspberrypi 5.10.63+ #1459 Wed Oct 6 16:40:27 BST 2021 armv6l GNU/Linux

$ lsusb Bus 001 Device 005: ID 7392:7622 Edimax Technology Co., Ltd RTL8192S WLAN Adapter ...

It has survived at least one reboot so far!

jdleesmiller
  • 171
  • 1
  • 1
4

There are some settings that you always need for a proper configuration. First set option

country=??

outside a network={..} block in /etc/wpa_supplicant/wpa_supplicant.conf and ?? with your country code. If you cannot use raspi-config for doing that, then edit wpa_supplicant.conf.

Then enable WiFi with

rpi ~$ rfkill unblock 0

It is not a good idea to use old background driver wext, even if it seems to work. You may encounter other problems with connections. In /usr/share/doc/wpasupplicant/examples/wpa_supplicant.conf you can find a hint, that background driver nl80211 is the default Linux interface:

Note: ap_scan=2 should not be used with the nl80211 driver interface (the current Linux interface). ap_scan=1 is optimized work working with nl80211. For finding networks using hidden SSID, scan_ssid=1 in the network block can be used with nl80211.

After setting this and your WiFi still doesn't work then you should not touch these settings. Instead look at other issues because these settings are always needed.

Update:
After some more digging I was able to reproduce your situation. It seems you do not have dhcpcd running. By default wpa_supplicant is running two times. One time from its package configuration on installation and one time called by dhcpcd. You can check this with:

rpi ~$ systemctl status wpa_supplicant.service
● wpa_supplicant.service - WPA supplicant
   Loaded: loaded (/lib/systemd/system/wpa_supplicant.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2020-05-05 22:46:15 BST; 18min ago
 Main PID: 511 (wpa_supplicant)
    Tasks: 1 (limit: 4915)
   Memory: 2.7M
   CGroup: /system.slice/wpa_supplicant.service
           └─511 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant

May 05 22:46:15 raspberrypi systemd[1]: Starting WPA supplicant...
May 05 22:46:15 raspberrypi wpa_supplicant[511]: Successfully initialized wpa_supplicant
May 05 22:46:15 raspberrypi systemd[1]: Started WPA supplicant.

This is what you see from the package installation but that does not provide interfaces for management (only option -O for dbus interface). This service is not needed for special Raspbian dhcpcd networking and can be disabled. It only confuses people.

What you do not see is the second wpa_supplicant daemon started by dhcpcd.

rpi ~$ ps aux | grep wpa
root       511  0.0  0.1  10740  4028 ?        Ss   22:46   0:00 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant
root       986  0.0  0.0  10984  1972 ?        Ss   23:14   0:00 wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0 -Dnl80211,wext
pi        1029  0.0  0.0   7348   584 ttyS0    S+   23:15   0:00 grep --color=auto wpa

Have a look at the CGroup:

rpi ~$ systemctl status dhcpcd.service
● dhcpcd.service - dhcpcd on all interfaces
   Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/dhcpcd.service.d
           └─wait.conf
   Active: active (running) since Tue 2020-05-05 23:14:14 BST; 3min 48s ago
  Process: 970 ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -w (code=exited, status=0/SUCCESS)
 Main PID: 1006 (dhcpcd)
    Tasks: 2 (limit: 4915)
   Memory: 1.9M
   CGroup: /system.slice/dhcpcd.service
           ├─ 986 wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0 -Dnl80211,wext
           └─1006 /sbin/dhcpcd -q -w

May 05 23:14:13 raspberrypi dhcpcd[970]: eth0: IAID 32:7f:38:91
May 05 23:14:13 raspberrypi dhcpcd[970]: wlan0: waiting for carrier
May 05 23:14:14 raspberrypi dhcpcd[970]: eth0: soliciting an IPv6 router
May 05 23:14:14 raspberrypi dhcpcd[970]: eth0: rebinding lease of 192.168.50.6
May 05 23:14:14 raspberrypi dhcpcd[970]: eth0: leased 192.168.50.6 for 3600 seconds
May 05 23:14:14 raspberrypi dhcpcd[970]: eth0: adding route to 192.168.50.0/24
May 05 23:14:14 raspberrypi dhcpcd[970]: eth0: adding default route via 192.168.50.1
May 05 23:14:14 raspberrypi dhcpcd[970]: forked to background, child pid 1006
May 05 23:14:14 raspberrypi systemd[1]: Started dhcpcd on all interfaces.
May 05 23:14:26 raspberrypi dhcpcd[1006]: eth0: no IPv6 Routers available

So you have to check why your dhcpcd is not running. Maybe you have just to enable and start it with:

rpi ~$ sudo systemctl enable --now dhcpcd.service
Ingo
  • 42,107
  • 20
  • 85
  • 197
  • already tried adding country. I've edited my post with output when using nl80211. wlan0: Failed to initialize driver interface – soundblaster May 05 '20 at 02:13
  • @soundblaster I have updated the answer. – Ingo May 05 '20 at 22:29
  • dhcpcd is running, in fact dhcpcd logs show: control command: dhcpcd --denyinterfaces wlan0. dhcpcd starts, but can't start wlan0, it's not in its CGroups. There's an issue either with the r8188eu driver and my TP-Link wireless adapter, or the ctrl_interface not being found. Neither wpa_cli or raspi-config can't access the ctrl_interface. – soundblaster May 24 '20 at 16:01
  • did a fresh install without modifying any file, I just want to configure WIFI using raspi-config – soundblaster May 24 '20 at 16:03
  • @soundblaster Seems you are mixing up things, very confusing. wlan0 is an interface and has nothing to do with CGroups. /sbin/wpa_supplicant must be shown under CGroups from the output of systemctl status dhcpcd.service. That means that wpa_supplicant is started with a hook script of dhcpcd. Have you checked this? – Ingo May 24 '20 at 16:28
  • when I said "it's not in its CGroups", I meant that /sbin/wpa_supplicant is not in dhcp.service CGroups. dhcpcd starts but doesn't start wpa_supplicant. When trying to start wpa_supplicant manually, I get nl80211: driver does not support authentication/association or connect command. Whereas using -Dwext it starts – soundblaster May 24 '20 at 17:29
1

I had this exact same problem, and I diagnosed it.

In short, the problem is your choice of WiFi adapter. The RTL8188EUS / r8188eu does not work properly with out of the box software configurations. This is evident in your log messages:

May  3 00:04:05 raspberrypi dhcpcd[306]: eth0: waiting for carrier
May  3 00:04:05 raspberrypi kernel: [   11.679881] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May  3 00:04:05 raspberrypi dhcpcd[306]: wlan0: waiting for carrier
May  3 00:04:05 raspberrypi dhcpcd[306]: eth0: carrier acquired

Dhcpcd is waiting for carrier on both eth0 and wlan0, and does not find a carrier on wlan0, so it does not continue to configure the interface. Under normal circumstances, dhcpcd will see carrier immediately on the wlan0 interface, and start another instance of wpa_supplicant with interface-specific arguments, which can then be configured through raspi-config and wpa_cli.

At boot time, systemd starts /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant. I think this listens on DBUS for commands, but I don't know how to drive it from the command line.

If you plug in an RTL8188, this is what is logged:

Sep  5 16:47:55 pi-3-test kernel: [  340.758606] usb 1-1.2: new high-speed USB device number 6 using dwc_otg
Sep  5 16:47:56 pi-3-test kernel: [  340.889394] usb 1-1.2: New USB device found, idVendor=0bda, idProduct=8179, bcdDevice= 0.00
Sep  5 16:47:56 pi-3-test kernel: [  340.889421] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Sep  5 16:47:56 pi-3-test kernel: [  340.889439] usb 1-1.2: Product: 802.11n NIC
Sep  5 16:47:56 pi-3-test kernel: [  340.889457] usb 1-1.2: Manufacturer: Realtek
Sep  5 16:47:56 pi-3-test kernel: [  340.889474] usb 1-1.2: SerialNumber: 000B81A264C8
Sep  5 16:47:56 pi-3-test mtp-probe: checking bus 1, device 6: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2"
Sep  5 16:47:56 pi-3-test mtp-probe: bus: 1, device: 6 was not an MTP device
Sep  5 16:47:56 pi-3-test kernel: [  340.981586] lib80211: common routines for IEEE802.11 drivers
Sep  5 16:47:56 pi-3-test kernel: [  340.981613] lib80211_crypt: registered algorithm 'NULL'
Sep  5 16:47:56 pi-3-test kernel: [  341.034610] r8188eu: module is from the staging directory, the quality is unknown, you have been warned.
Sep  5 16:47:56 pi-3-test kernel: [  341.064199] Chip Version Info: CHIP_8188E_Normal_Chip_TSMC_D_CUT_1T1R_RomVer(0)
Sep  5 16:47:56 pi-3-test kernel: [  341.093994] usbcore: registered new interface driver r8188eu
Sep  5 16:47:56 pi-3-test mtp-probe: checking bus 1, device 6: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2"
Sep  5 16:47:56 pi-3-test mtp-probe: bus: 1, device: 6 was not an MTP device
Sep  5 16:47:56 pi-3-test systemd-udevd[433]: Using default interface naming scheme 'v240'.
Sep  5 16:47:57 pi-3-test dhcpcd[357]: wlan0: waiting for carrier

There is no further message until the device is unplugged.

If you then plug in a working WiFi adapter, say MT7601, dhcpcd notices the new wlan0 interface, waits for a carrier, logs wlan0: carrier acquired and starts a new instance of wpa_supplicant:

Sep  5 16:50:54 pi-3-test kernel: [  519.698607] usb 1-1.2: new high-speed USB device number 7 using dwc_otg
Sep  5 16:50:54 pi-3-test kernel: [  519.839852] usb 1-1.2: New USB device found, idVendor=148f, idProduct=7601, bcdDevice= 0.00
Sep  5 16:50:54 pi-3-test kernel: [  519.839879] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Sep  5 16:50:54 pi-3-test kernel: [  519.839897] usb 1-1.2: Product: 802.11 n WLAN
Sep  5 16:50:54 pi-3-test kernel: [  519.839914] usb 1-1.2: Manufacturer: MediaTek
Sep  5 16:50:54 pi-3-test kernel: [  519.839932] usb 1-1.2: SerialNumber: 1.0
Sep  5 16:50:55 pi-3-test mtp-probe: checking bus 1, device 7: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2"
Sep  5 16:50:55 pi-3-test mtp-probe: bus: 1, device: 7 was not an MTP device
Sep  5 16:50:55 pi-3-test kernel: [  520.188591] usb 1-1.2: reset high-speed USB device number 7 using dwc_otg
Sep  5 16:50:55 pi-3-test kernel: [  520.321273] mt7601u 1-1.2:1.0: ASIC revision: 76010001 MAC revision: 76010500
Sep  5 16:50:55 pi-3-test kernel: [  520.328011] mt7601u 1-1.2:1.0: Firmware Version: 0.1.00 Build: 7640 Build time: 201302052146____
Sep  5 16:50:55 pi-3-test kernel: [  520.791567] mt7601u 1-1.2:1.0: EEPROM ver:0d fae:00
Sep  5 16:50:56 pi-3-test kernel: [  521.029278] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
Sep  5 16:50:56 pi-3-test kernel: [  521.042449] usbcore: registered new interface driver mt7601u
Sep  5 16:50:56 pi-3-test systemd[1]: Starting Load/Save RF Kill Switch Status...
Sep  5 16:50:56 pi-3-test mtp-probe: checking bus 1, device 7: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2"
Sep  5 16:50:56 pi-3-test mtp-probe: bus: 1, device: 7 was not an MTP device
Sep  5 16:50:56 pi-3-test systemd-udevd[471]: Using default interface naming scheme 'v240'.
Sep  5 16:50:56 pi-3-test systemd[1]: Started Load/Save RF Kill Switch Status.
Sep  5 16:50:56 pi-3-test dhcpcd-run-hooks[491]: wlan0: starting wpa_supplicant
Sep  5 16:50:56 pi-3-test dhcpcd[357]: wlan0: connected to Access Point `'
Sep  5 16:50:56 pi-3-test dhcpcd[357]: wlan0: waiting for carrier
Sep  5 16:50:56 pi-3-test dhcpcd[357]: wlan0: carrier acquired
Sep  5 16:50:56 pi-3-test dhcpcd[357]: DUID 00:01:00:01:26:d1:11:c3:b8:27:eb:80:3f:4b
Sep  5 16:50:56 pi-3-test dhcpcd[357]: wlan0: IAID 76:b0:23:61
Sep  5 16:50:56 pi-3-test dhcpcd[357]: wlan0: adding address fe80::f412:3b9a:bf52:71ac
Sep  5 16:50:56 pi-3-test avahi-daemon[299]: Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::f412:3b9a:bf52:71ac.

etc etc. The new instance of wpa_supplicant looks like this:

root       494  0.0  0.2  10996  2436 ?        Ss   12:59   0:00 wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0 -Dnl80211,wext

You can tell dhcpcd to not wait for carrier by adding the -K flag, and then reloading systemd, but this did not work for me to make the RTL8188 device hotpluggable:

vim /etc/systemd/system/dhcpcd.service.d/wait.conf
systemctl daemon-reload
systemctl restart dhcpcd

The RTL8188 device can be brought up manually by running the appropriate wpa_supplicant command: wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0 -Dnl80211,wext but I think the better solution is to throw the RTL8188 back into the parts drawer and use something which works out of the box, such as the MT7601. Or buy a Raspberry Pi 3 or later, which has working inbuilt WiFi.

elronxenu
  • 11
  • 2