sonettguy
Posts: 142
Joined: Wed Jan 10, 2018 7:29 pm
Location: texas, USA

unknown interface wlan0 after using wlan0

Tue Aug 21, 2018 8:03 pm

I'm struggling with the fragile nature of communicating with my headless pi zero w. (Running Rasbian Stretch.) When I take it out with me, like to my favorite coffee shop, it often connects to WiFi, then drops the signal within a half hour or so. To get it back, I run the following script in the background on boot.

Code: Select all

 1 #!/bin/bash
 2 sleep 5m
 3 while true ; do
 4         if ifconfig wlan0 | grep -q "inet addr:" ; then
 5                 sleep 5m
 6         else
 7                 echo "Network connection down. Attempting reconnection."
 8                 ifup --force wlan0
 9                 sleep 2m
10         fi
11 done
I see in two postings that some say ifup is obsolete. I have been using the Debian support documentation and saw nothing. Does it being obsolete mean that it is not working? When the script runs, it gives me the following error.

Code: Select all

pi@xx:/usr/bin $ bash net_mgr.sh
Network connection down. Attempting reconnection.
ifup: unknown interface wlan0
^C
So, I looked for wlan0 using ifconfig. Oh, well, its right there. I looked for it using ifquery. Oh, it's gone. What the heck?

Code: Select all

pi@xx:/usr/bin $ ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65xxx
        inet 127.x.x.x  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 2  bytes 230 (230.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2  bytes 230 (230.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

mon1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        unspec 00-DA-35-xx-xx-xx-xx-xx-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)
        RX packets 274822  bytes 58167822 (55.4 MiB)
        RX errors 0  dropped 3  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether b8:27:eb:xx:xx:xx  txqueuelen 1000  (Ethernet)
        RX packets 6459  bytes 916894 (895.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2147  bytes 325456 (317.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

pi@xx:/usr/bin $ ifquery -l
lo
wlan1
wlan2

pi@xx:/usr/bin $ ifconfig -v wlan0 up
SIOCSIFFLAGS: Operation not permitted
WARNING: at least one error occured. (-1)
So, I rebooted to get the internet connection back again. I went back to the terminal and tried "sudo ip link set wlan0 down" and I predictably lost the connection. I followed by typing "sudo ip link set wlan0 up." Nothing. It just goes back to prompt. It doesn't report an error nor does it give me the internet connection back.

I need some help in understanding why it appears I have wlan0 in some cases and not others. I need help to also understand why taking it down works, but bringing it up doesn't.

Here is the daemon.log for the first error reported in this post.

Code: Select all

Aug 21 09:59:10 pi systemd[1]: Started Session c2 of user pi.
Aug 21 10:22:05 pi systemd[1]: Reloading.
Aug 21 10:46:56 pi systemd[1]: Reloading.
Aug 21 11:09:53 pi dhcpcd[219]: wlan0: carrier lost
Aug 21 11:09:54 pi dhcpcd[219]: wlan0: deleting address fe80::fdaa:8445:xxxx:xxxx
Aug 21 11:09:54 pi avahi-daemon[236]: Withdrawing address record for fe80::fdaa:8445:xxxx:xxxx on wlan0.
Aug 21 11:09:54 pi avahi-daemon[236]: Leaving mDNS multicast group on interface wlan0.IPv6 with address fe80::fdaa:8445:xxxx:xxxx.
Aug 21 11:09:54 pi avahi-daemon[236]: Interface wlan0.IPv6 no longer relevant for mDNS.
Aug 21 11:09:55 pi dhcpcd[219]: wlan0: deleting default route via 192.168.1.1
Aug 21 11:09:55 pi dhcpcd[219]: wlan0: deleting route to 192.168.1.0/24
Aug 21 11:09:55 pi avahi-daemon[236]: Withdrawing address record for 192.168.x.x on wlan0.
Aug 21 11:09:55 pi avahi-daemon[236]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.x.x.
Aug 21 11:09:55 pi avahi-daemon[236]: Interface wlan0.IPv4 no longer relevant for mDNS.
Aug 21 11:09:55 pi dhcpcd[219]: wlan0: carrier acquired
Aug 21 11:09:55 pi dhcpcd[219]: wlan0: IAID eb:0d:xx:xx
Aug 21 11:09:55 pi dhcpcd[219]: wlan0: adding address fe80::fdaa:8445:xxxx:xxxx
Aug 21 11:09:55 pi dhcpcd[219]: wlan0: probing address 192.168.x.x/24
Aug 21 11:09:55 pi dhcpcd[219]: wlan0: soliciting an IPv6 router
Aug 21 11:09:56 pi avahi-daemon[236]: Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::fdaa:8445:xxxx:xxxx.
Aug 21 11:09:56 pi avahi-daemon[236]: New relevant interface wlan0.IPv6 for mDNS.
Aug 21 11:09:56 pi avahi-daemon[236]: Registering new address record for fe80::fdaa:8445:xxxx:xxxx on wlan0.*.
Aug 21 11:09:58 pi dhcpcd[18075]: sending commands to master dhcpcd process
Aug 21 11:09:58 pi dhcpcd[219]: control command: /sbin/dhcpcd -k wlan0
Aug 21 11:09:58 pi dhcpcd[219]: wlan0: removing interface
Aug 21 11:10:00 pi avahi-daemon[236]: Interface wlan0.IPv6 no longer relevant for mDNS.
Aug 21 11:10:00 pi avahi-daemon[236]: Leaving mDNS multicast group on interface wlan0.IPv6 with address fe80::fdaa:8445:xxxx:xxxx.
Aug 21 11:10:00 pi avahi-daemon[236]: Withdrawing address record for fe80::fdaa:8445:xxxx:xxxx on wlan0.
Since I take my pi out on the road with me, it would be nice if I had a way to get the terminal via bluetooth. I figured the app bluterm would be just what the doctor ordered, but dispite the fact that I can pair with my iPhone, I can't get any app, blueterm, yACK BLE or Bluefruit, to give me a terminal screen. Most don't connect at all. Any suggestions on this would be welcomed as well.

sonettguy
Posts: 142
Joined: Wed Jan 10, 2018 7:29 pm
Location: texas, USA

Re: unknown interface wlan0 after using wlan0

Mon Sep 10, 2018 6:01 pm

No suggestions in the case of the disappearing wlan0?

Return to “Troubleshooting”