Having to restart wpa_supplicant@wlan0.service

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Having to restart wpa_supplicant@wlan0.service

Postby hendry » Sat Apr 26, 2014 5:27 am

wpa_supplicant@wlan0.service works normally quite well to establish the connection, but I've noticed that it needs restarting if say I restart my wireless AP.

$this->bbcode_second_pass_code('', '[hendry@alarmpi ~]$ systemctl status wpa_supplicant@wlan0.service
* wpa_supplicant@wlan0.service - WPA supplicant daemon (interface-specific version)
Loaded: loaded (/usr/lib/systemd/system/wpa_supplicant@.service; enabled)
Active: active (running) since Thu 1970-01-01 21:32:29 SGT; 44 years 3 months ago
Main PID: 17013 (wpa_supplicant)
CGroup: /system.slice/system-wpa_supplicant.slice/wpa_supplicant@wlan0.service
`-17013 /usr/bin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-wlan0.conf -iwlan0
Jan 01 21:32:29 alarmpi systemd[1]: Started WPA supplicant daemon (interface-specific version).')

Are you can see from `systemctl status wpa_supplicant@wlan0.service`, it gives me no usable logs as to what it's doing.

Right now i'm having to `systemctl restart wpa_supplicant@wlan0.service` and look at `ip link` or `iw wlan0 link` to see re-establish the connection.

Am I missing something? Why doesn't it just keep re-trying to establish the connection by default?
hendry
 
Posts: 40
Joined: Wed Jul 31, 2013 8:28 am
Location: Singapore

Re: Having to restart wpa_supplicant@wlan0.service

Postby sdjf » Mon Apr 28, 2014 4:03 am

I don't know why it doesn't keep retrying, but you certainly could write a short script that checked the status every once in a while and automatically restarted it. I do that for my ppp and usb networks so I don't have to restart them manually when I need them.

I have a script recording the time and date every 60 seconds, and simply added code to that script to run ifconfig for both of my networks. You could do something similar, only using whatever commands you know you need to use, and whatever frequency you want to check.

I am wondering if your device is getting assigned a different device reference when you restart it, and that could be confusing things. Look at man pages for "udevadm trigger" to see if there is anything in there that might be of use, to retrigger a udev rule that could possibly restart your service when the device gets recognized.
sdjf
 
Posts: 178
Joined: Wed May 08, 2013 1:55 pm


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 3 guests