doc:appunti:hardware:raspberrypi_wpa_supplicant_problem
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
doc:appunti:hardware:raspberrypi_wpa_supplicant_problem [2018/02/17 10:17] – [Alternative: wpa_supplicant started by systemd] niccolo | doc:appunti:hardware:raspberrypi_wpa_supplicant_problem [2024/11/17 16:55] (current) – [dhcpcd process dies without configuring wlan0] niccolo | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
I got a problem with a **Realtek RTL8188EUS** UBS WiFi dongle, into a **Raspberry Pi Model A+**, running **Rasbpian 2017-11-29 Stretch Lite** (based on Debian 9.1). | I got a problem with a **Realtek RTL8188EUS** UBS WiFi dongle, into a **Raspberry Pi Model A+**, running **Rasbpian 2017-11-29 Stretch Lite** (based on Debian 9.1). | ||
Line 52: | Line 52: | ||
The default is to start **wpa_supplicant** via **dhcpcd**, as seen above. But if you want, you can force **systemd** to start the service independently. | The default is to start **wpa_supplicant** via **dhcpcd**, as seen above. But if you want, you can force **systemd** to start the service independently. | ||
- | You have to start the service against the specific interface | + | You have to start the // |
< | < | ||
Line 58: | Line 58: | ||
systemctl enable wpa_supplicant@wlan0.service | systemctl enable wpa_supplicant@wlan0.service | ||
</ | </ | ||
+ | |||
+ | After a reboot you should see the wpa_supplicant process running, and dhcpcd will configure wlan0 happily. | ||
+ | |||
+ | ===== dhcpcd process dies without configuring wlan0 ===== | ||
+ | |||
+ | This is a similar problem encountered on a **Raspberry Pi Model B Rev 2** running Raspbian GNU/Linux 11 Bullseye. The **wlan0** interface is an USB dongle **Realtek RTL8188CUS**, | ||
+ | |||
+ | At first I decided to **disable** the Systemd **wpa_supplicant.service** and let **dhcpcd** to manage the interface starting wpa_supplicant on its own, as seen above. Suddendly the system started to have random problems on bootstrap: sometimes the host resulted having the wpa_supplicant process running (lanched by dhcpcd), but **the dhcpcd process itself was die** and did not configured the IP address on the wlan0 interface. | ||
+ | |||
+ | To trace the problem I had to enable the debugging option of dhcpcd, adding the **%%-d%%** parameter in **/ | ||
+ | |||
+ | A typical log when the problem arises is the following: | ||
+ | |||
+ | < | ||
+ | Nov 15 00:17:48 rpi dhcpcd[255]: | ||
+ | Nov 15 00:17:48 rpi dhcpcd[255]: | ||
+ | Nov 15 00:17:48 rpi dhcpcd[255]: | ||
+ | Nov 15 00:17:53 rpi dhcpcd[255]: | ||
+ | Nov 15 00:17:53 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:00 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:13 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:13 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:13 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:13 rpi dhcpcd[443]: | ||
+ | Nov 15 00:18:22 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:22 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:22 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:22 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:22 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:22 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:22 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:22 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:22 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:22 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:22 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:22 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:22 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:22 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:22 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:22 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:22 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:23 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:23 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:23 rpi dhcpcd[255]: | ||
+ | Nov 15 00:18:23 rpi dhcpcd[478]: | ||
+ | Nov 15 00:18:23 rpi dhcpcd[478]: | ||
+ | Nov 15 00:18:23 rpi dhcpcd[478]: | ||
+ | Nov 15 00:18:23 rpi dhcpcd[255]: | ||
+ | </ | ||
+ | |||
+ | The error that causes dhcpcd to die is **eloop_start: | ||
+ | |||
+ | It results that wlan0 gets a sqeuence of '' | ||
+ | |||
+ | I solved the problem by letting Systemd to start wpa_supplicant on the specific wlan0 interface. This is achieved renaming the wpa_supplicant.conf file and enabling only the interface-specific version service: | ||
+ | |||
+ | < | ||
+ | mv / | ||
+ | systemctl enable wpa_supplicant@wlan0.service | ||
+ | systemctl disable wpa_supplicant.service | ||
+ | </ | ||
+ | |||
+ | At reboot, dhcpcd will fail to start its own instance of wpa_supplicant on the same device, as seen in the following debug log: | ||
+ | |||
+ | < | ||
+ | dhcpcd[415]: | ||
+ | dhcpcd[415]: | ||
+ | dhcpcd[415]: | ||
+ | dhcpcd[415]: | ||
+ | dhcpcd[415]: | ||
+ | dhcpcd[415]: | ||
+ | dhcpcd[415]: | ||
+ | dhcpcd[415]: | ||
+ | dhcpcd[415]: | ||
+ | </ | ||
+ | |||
+ | Nevertehless dhcpcd is informed by udev when the wlan0 interface is activated and then it can configure it using DHCP. | ||
+ | |||
+ | **NOTICE**: The default systemd configuration shipped with **Raspbian 11 Bullseye** does not ensure that the **wpa_supplicant@..service** is started before **dhcpcd.service**, | ||
+ | |||
+ | < | ||
+ | systemd-analyze plot > services-start-graph.svg | ||
+ | </ | ||
+ | |||
+ | Indeed you can see that **dhcpcd.service** becomes active after the **wpa_supplicant@wlan0.service**, | ||
+ | |||
+ | < | ||
+ | systemctl edit dhcpcd.service | ||
+ | </ | ||
+ | |||
+ | this will launch an editor to create the file **/ | ||
+ | |||
+ | < | ||
+ | [Unit] | ||
+ | After=wpa_supplicant@..service | ||
+ | </ | ||
+ | |||
+ | The systemd daemon will be automatically reloaded, se we can reboot. | ||
===== Web References ===== | ===== Web References ===== | ||
* [[https:// | * [[https:// |
doc/appunti/hardware/raspberrypi_wpa_supplicant_problem.1518859060.txt.gz · Last modified: 2018/02/17 10:17 by niccolo