User avatar
ksharindam
Posts: 162
Joined: Sat Jan 09, 2016 4:16 pm

Sometimes wlan0 interface does not come up when I insert wifi adapter

Mon Nov 05, 2018 2:29 am

Sometimes wlan0 interface does not come up when I insert wifi adapter in Raspberry Pi 2.
Then I have to manually run

Code: Select all

sudo ifconfig wlan0 up
to start wifi.
It is somewhat random. I could not find a way to reproduce it.

This problem was not in Jessie. When I replace the latest version of dhcpcd5 with the Jessie version of dhcpcd5, the problem disappears.

I use TP-LINK 725N wifi adapter (Realtek), Raspberry Pi 2, and Raspbian Stretch.

Is there anybody who is having the same problem?
How to diagnosis or solve the problem?

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Sometimes wlan0 interface does not come up when I insert wifi adapter

Mon Nov 05, 2018 3:02 am

I have just started running raspbian on a pi zero and appreciate your comment about the dhcpcd, I think I will try the jessie version to see if it will solve my problem getting ssh working.

have been doing wired ethernet/ssh for nearly 6 years now on pi's but with archlinuxarm, and this raspbian setup is new territory for me, so I don't have any kind of elegant solution for your issue, but can tell you that what I do to make sure my ethernet IPs stay up on my non-raspbian pi's is to run a simple bash script that does a number of things (call it my heartbeat script) every minute or two, and as it loops through it's tasks, one of them is to re-issue the ifconfig commands for every ethernet subnet I want to keep running.

another approach might be to write a udev rule to automatically bring up ethernet. I am just not sure if that would keep the connections viable, a systemd service with "restart on failure" would probably be better for this.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

User avatar
ksharindam
Posts: 162
Joined: Sat Jan 09, 2016 4:16 pm

Re: Sometimes wlan0 interface does not come up when I insert wifi adapter

Fri Nov 09, 2018 3:32 am

I have solved the problem by replacing the /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant file with the older version from jessie.
It seems there is a problem in wpa_supplicant_start() function in stretch version of 10-wpa_supplicant file.

Return to “Raspberry Pi OS”