raheel
Posts: 32
Joined: Tue Feb 26, 2013 2:08 pm

Wifi broke after raspbian update on old Pi

Fri Jul 07, 2017 4:28 am

Hi, So my problem is a bit specific to "update of raspbian after 3 years on an older pi"!! I bought pi in 2013 and was happily running my gadgets on it over wlan. But seems something is changed from wifi thingy on RPi since then, I update my OS few days ago and my wifi broke and not connecting anymore. I connected to my hdmi tv and found that ethernet was fine but as soon as I put my wifi dongle in, it stopped responding (not able to see pi's boot response!).

Where should I look at? /etc/network/interface and wpa_supplicant.conf files need tweaking? Or something else?

Thanks in advance.

raheel
Posts: 32
Joined: Tue Feb 26, 2013 2:08 pm

Re: Wifi broke after raspbian update on old Pi

Fri Jul 07, 2017 8:56 pm

Did I miss something in my prob description? Seems no one is interested to respond!

DirkS
Posts: 10362
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Wifi broke after raspbian update on old Pi

Fri Jul 07, 2017 9:00 pm

What exactly do you mean by 'update'?
Did you do a fresh install?
Which OS and version do you have now?

Also give details of the Wifi dongle you use, such as output from 'lsusb'

raheel
Posts: 32
Joined: Tue Feb 26, 2013 2:08 pm

Re: Wifi broke after raspbian update on old Pi

Fri Jul 07, 2017 9:39 pm

What exactly do you mean by 'update'?
>> I did a fresh install and then do apt-upgrade
Did you do a fresh install?
>> Yes
Which OS and version do you have now?
>> I have got raspbian, July 2017 version

Also give details of the Wifi dongle you use, such as output from 'lsusb'
>> I have realtek wifi dongle with 8192cu model as I got output from lsusb
Edit:
output of lsusb -> Bus 001 Device 006: ID 0bda:8178 Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter

Also, the output of lsmod is not showing that my realtek device is using any resources (count was 0).

DirkS
Posts: 10362
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Wifi broke after raspbian update on old Pi

Fri Jul 07, 2017 10:42 pm

Did you try to associate your dongle with your access point / router?
If so, did you do that manually (editing /etc/wp_supplicant/wpa_supplicant.conf) or did you use the GUI?
Did you make any changes to /etc/network/interfaces?
What is the output of 'ifconfig'?

raheel
Posts: 32
Joined: Tue Feb 26, 2013 2:08 pm

Re: Wifi broke after raspbian update on old Pi

Fri Jul 07, 2017 10:48 pm

DirkS wrote:Did you try to associate your dongle with your access point / router?
If so, did you do that manually (editing /etc/wp_supplicant/wpa_supplicant.conf) or did you use the GUI?
Did you make any changes to /etc/network/interfaces?
What is the output of 'ifconfig'?
Yes I did try to associate with my router. I edit both interfaces and wpa_supplicant.conf files. I put credentials of my network, user and psk in wpa_supplicant file and reboot the pi. I am providing the output of ifconfig in few minutes. But it will be on ethernet only because pi didn't boot on wifi dongle in! However, I can see that dhcpd service got failed when it tries to bring up wlan0 during boot sequence. I am getting output of ifconfig and will post it back here.

Edit:
I just boot my pi, connecting with my hdmi tv over ethernet connected only. It didn't work when wifi dongle was in! What I found in boot sequence, two lines with red color are below:
[FAIL] Not running dhcpcd because /etc/network/interfaces ... Failed!
[FAIL] defines some interfaces that will use a DHCP client ... Failed!

DirkS
Posts: 10362
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Wifi broke after raspbian update on old Pi

Fri Jul 07, 2017 10:57 pm

Make sure that you post the output of ifconfig with the dongle plugged in.

raheel
Posts: 32
Joined: Tue Feb 26, 2013 2:08 pm

Re: Wifi broke after raspbian update on old Pi

Fri Jul 07, 2017 11:05 pm

DirkS wrote:Make sure that you post the output of ifconfig with the dongle plugged in.
But how? Pi stuck and didn't show anything on boot with wifi dongle plugged-in....!

This is my interfaces file:

Code: Select all

auto lo
iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
And below is my wpa_supplicant.conf file:

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant
GROUP=netdev
update_config=1

network={
ssid="spark"
psk="myreouterpwd"
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
auth_alg=OPEN
}

DirkS
Posts: 10362
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Wifi broke after raspbian update on old Pi

Fri Jul 07, 2017 11:15 pm

raheel wrote:
DirkS wrote:Make sure that you post the output of ifconfig with the dongle plugged in.
But how? Pi stuck and didn't show anything on boot with wifi dongle plugged-in....!
Leave ethernet cable plugged in?

Some changes I would suggest:
1. undo changes to /etc/network/interface. Thinks have changed; read the first few line of the default config below

Code: Select all

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
2. Changes wpa_supplicant.conf:

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant
GROUP=netdev
update_config=1

network={
    ssid="spark"
    psk="myreouterpwd"
}

raheel
Posts: 32
Joined: Tue Feb 26, 2013 2:08 pm

Re: Wifi broke after raspbian update on old Pi

Fri Jul 07, 2017 11:16 pm

raheel wrote:
DirkS wrote:Make sure that you post the output of ifconfig with the dongle plugged in.
But how? Pi stuck and didn't show anything on boot with wifi dongle plugged-in....!

This is my interfaces file:

Code: Select all

auto lo
iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
And below is my wpa_supplicant.conf file:

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant
GROUP=netdev
update_config=1

network={
ssid="spark"
psk="myreouterpwd"
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
auth_alg=OPEN
}
So, I removed one line from interfaces file, turn off, plugged-in wifi dongle and reboot my pi and this time I got the boot sequene.
Attached is the output of 'ifconfig' command with both eth0 and wlan0 interfaces plugged in.

DirkS
Posts: 10362
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Wifi broke after raspbian update on old Pi

Fri Jul 07, 2017 11:19 pm

raheel wrote:So, I removed one line from interfaces file, turn off, plugged-in wifi dongle and reboot my pi and this time I got the boot sequene.
Attached is the output of 'ifconfig' command with both eth0 and wlan0 interfaces plugged in.
Please re-read my post. There are more changes than just the one line. (hint: dhcp vs manual)

Can't see the output from ifconfig...

raheel
Posts: 32
Joined: Tue Feb 26, 2013 2:08 pm

Re: Wifi broke after raspbian update on old Pi

Fri Jul 07, 2017 11:29 pm

DirkS wrote:
raheel wrote:So, I removed one line from interfaces file, turn off, plugged-in wifi dongle and reboot my pi and this time I got the boot sequene.
Attached is the output of 'ifconfig' command with both eth0 and wlan0 interfaces plugged in.
Please re-read my post. There are more changes than just the one line. (hint: dhcp vs manual)

Can't see the output from ifconfig...
Great. So, I followed exactly what you have instructed for both files and leave both ethernet cable and wifi dongle plugged-in, reboot the pi. Attached is the output of 'ifconfig' command.

raheel
Posts: 32
Joined: Tue Feb 26, 2013 2:08 pm

Re: Wifi broke after raspbian update on old Pi

Fri Jul 07, 2017 11:41 pm

raheel wrote:
DirkS wrote:
raheel wrote:So, I removed one line from interfaces file, turn off, plugged-in wifi dongle and reboot my pi and this time I got the boot sequene.
Attached is the output of 'ifconfig' command with both eth0 and wlan0 interfaces plugged in.
Please re-read my post. There are more changes than just the one line. (hint: dhcp vs manual)

Can't see the output from ifconfig...
Great. So, I followed exactly what you have instructed for both files and leave both ethernet cable and wifi dongle plugged-in, reboot the pi. Attached is the output of 'ifconfig' command.
I think there is some issue with image attachment, i am pasting output of ifconfig below:

Code: Select all

pi@raspberrypi ~ $ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:c3:bf:e8  
          inet addr:192.168.1.72  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1285 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1212 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:71280 (69.6 KiB)  TX bytes:91330 (89.1 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:72 errors:0 dropped:0 overruns:0 frame:0
          TX packets:72 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:6288 (6.1 KiB)  TX bytes:6288 (6.1 KiB)

wlan0     Link encap:Ethernet  HWaddr c0:4a:00:21:e7:71  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

raheel
Posts: 32
Joined: Tue Feb 26, 2013 2:08 pm

Re: Wifi broke after raspbian update on old Pi

Sat Jul 08, 2017 12:21 am

I figure out few things after all this. I think I forgot that I didn't generate the psk through wpa_passphrase but put the same one as provided by my router. I found this when I try to debug the config thru wpa_supplicant utility where it showed me that it was not able to remove psk entry. Should I try that and reboot the pi?

Below is the output of wpa_supplicant command:

Code: Select all

pi@raspberrypi ~ $ sudo wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -D 8192cu -i wlan0 -ddddd
wpa_supplicant v1.0
random: Trying to read entropy from /dev/random
Initializing interface 'wlan0' conf '/etc/wpa_supplicant/wpa_supplicant.conf' driver '8192cu' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/etc/wpa_supplicant/wpa_supplicant.conf' -> '/etc/wpa_supplicant/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant/wpa_supplicant.conf'
ctrl_interface='DIR=/var/run/wpa_supplicant'
Line 2: unknown global field 'GROUP=netdev'.
Line 2: Invalid configuration line 'GROUP=netdev'.
update_config=1
Line: 5 - start of a new network block
ssid - hexdump_ascii(len=12):
     53 50 41 52 4b 2d 42 55 53 34 38 57               SPARK-BUS48W    
PSK (ASCII passphrase) - hexdump_ascii(len=10): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
Priority group 0
   id=0 ssid='SPARK-BUS48W'
Failed to read or parse configuration '/etc/wpa_supplicant/wpa_supplicant.conf'.
Failed to add interface wlan0
: Cancelling scan request
: Cancelling authentication timeout

DirkS
Posts: 10362
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Wifi broke after raspbian update on old Pi

Sat Jul 08, 2017 7:47 am

So did you get it to work?

raheel
Posts: 32
Joined: Tue Feb 26, 2013 2:08 pm

Re: Wifi broke after raspbian update on old Pi

Sat Jul 08, 2017 7:53 am

DirkS wrote:So did you get it to work?
Well, I did but only through adding all my static parameters directly in the interfaces file. While, I was trying to avoid that and like to use wpa_supplicant.conf file instead but that didn't work after many tries! Any ideas what might go wrong? I simply copied those IP and other params from supplicant to interfaces file and commented out the wpa-conf clause from interfaces.

DirkS
Posts: 10362
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Wifi broke after raspbian update on old Pi

Sat Jul 08, 2017 8:08 am

raheel wrote:
DirkS wrote:So did you get it to work?
Well, I did but only through adding all my static parameters directly in the interfaces file. While, I was trying to avoid that and like to use wpa_supplicant.conf file instead but that didn't work after many tries! Any ideas what might go wrong? I simply copied those IP and other params from supplicant to interfaces file and commented out the wpa-conf clause from interfaces.
If you mean static IP address: that should be set in /etc/dhcpcd.conf nowadays.
For 'standard' situations there is no need to modify /etc/network/interfaces.

Ideally you'd use a DHCP reservation in your access point, but you can add a couple of lines to set a static address in /etc/dhcpcd.conf. Add something like this at the end of that file:

Code: Select all

interface wlan0
static ip_address=192.168.1.100/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1 8.8.8.8

raheel
Posts: 32
Joined: Tue Feb 26, 2013 2:08 pm

Re: Wifi broke after raspbian update on old Pi

Sat Jul 08, 2017 8:14 am

DirkS wrote:
raheel wrote:
DirkS wrote:So did you get it to work?
Well, I did but only through adding all my static parameters directly in the interfaces file. While, I was trying to avoid that and like to use wpa_supplicant.conf file instead but that didn't work after many tries! Any ideas what might go wrong? I simply copied those IP and other params from supplicant to interfaces file and commented out the wpa-conf clause from interfaces.
If you mean static IP address: that should be set in /etc/dhcpcd.conf nowadays.
For 'standard' situations there is no need to modify /etc/network/interfaces.

Ideally you'd use a DHCP reservation in your access point, but you can add a couple of lines to set a static address in /etc/dhcpcd.conf. Add something like this at the end of that file:

Code: Select all

interface wlan0
static ip_address=192.168.1.100/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1 8.8.8.8
I got it. But how interfaces file will get to know about dhcpcd.conf file? Or is it built in the OS itself? Currently, my interfaces is looking like below:

Code: Select all

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet static
	#wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
	address 192.168.1.100
        netmask 255.255.255.0
        gateway 192.168.1.255
        wpa-essid SPARK-BUS48W
        wpa-psk psk-pasword-hidden

DirkS
Posts: 10362
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Wifi broke after raspbian update on old Pi

Sat Jul 08, 2017 8:27 am

dhcpcd5 (which uses /etc/dhcpcd.conf) uses a different mechanism than the old DHCP client. That's why you set the method to 'manual' instead of 'dhcp' or 'static'
You can actually end up with 2 IP addresses: 1 set through 'interfaces' and one through dhcpcd5

Best way forward is to adapt to the currently preferred method:
1. do not modify /etc/network/interfaces
2. add wifi info / credentials in /etc/wpasupplicant/wpa_supplicant.conf
3. for static addresses: id you don't want to / cannot change the AP settings, add them to /etc/dhcpcd.conf

Return to “Troubleshooting”