View: 10943|Reply: 9

OrangePi Zero WLAN0 swaps to WLAN1

[Copy link]

4

threads

8

posts

40

credits

Novice

Rank: 1

credits
40
Published in 2017-5-20 22:42:52 | Show all floors |Read mode
Hi,

I am trying to get WIFI working on my OrangePi Zero.   Most of the time when it boots, wlan0 gets changed to wlan1 and it makes the wifi connection.  However on some boots this does not occur and then WIFI fails.    Any idea why this is happening and how to get the WIFI stable on each boot?  The dmesg line where the swap occurs is :

[   38.910648] systemd-udevd[119]: renamed network interface wlan0 to wlan1

When it works, ifconfig looks like:

***********************************************************
root@OrangePizero:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 2e:97:b1:cb:11:b0
          inet6 addr: fe80::2c97:b1ff:fecb:11b0/64 Scopeink
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:600 (600.0 B)
          Interrupt:114

lo        Link encapocal Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1104 (1.0 KiB)  TX bytes:1104 (1.0 KiB)

p2p0      Link encap:Ethernet  HWaddr 2c:97:b1:cb:11:b2
          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)

wlan1     Link encap:Ethernet  HWaddr 2c:97:b1:cb:11:b1
          inet addr:192.168.42.14  Bcast:192.168.42.255  Mask:255.255.255.0
          inet6 addr: fe80::2e97:b1ff:fecb:11b1/64 Scopeink
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:39 errors:0 dropped:0 overruns:0 frame:0
          TX packets:45 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5325 (5.2 KiB)  TX bytes:4898 (4.7 KiB)
******************************************************
When it fails the ifconfig looks like:
******************************************************
root@OrangePizero:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 2e:97:b1:cb:11:b0
          inet6 addr: fe80::2c97:b1ff:fecb:11b0/64 Scopeink
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:572 (572.0 B)
          Interrupt:114

lo        Link encapocal Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  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:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

p2p0      Link encap:Ethernet  HWaddr 2c:97:b1:cb:11:b2
          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)

wlan0     Link encap:Ethernet  HWaddr 2c:97:b1:cb:11:b1
          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)
*******************************************************
My /etc/network/interfaces  is:
*******************************************************
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

# Local loopback
auto lo
iface lo inet loopback

#auto eth0
#iface eth0 inet dhcp

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

allow-hotplug wlan1
iface wlan1 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
******************************************************
root@OrangePizero:~# uname -a
Linux OrangePizero 3.4.39 #3 SMP PREEMPT Mon Nov 28 10:12:06 CST 2016 armv7l GNU/Linux






9

threads

634

posts

4452

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
4452
Published in 2017-5-21 02:45:01 | Show all floors
Try this.
https://www.armbian.com/orange-pi-zero/
You won't have such problems, but beware that wireless chip is low quality.

4

threads

8

posts

40

credits

Novice

Rank: 1

credits
40
 Author| Published in 2017-5-23 06:15:38 | Show all floors
I installed armbian and it always seems to choose wlan0.     Therefore, that port does seem to be a better fit than the Debian one.   For Debian I had to do a lot more configuration to get WIFI working as well.  
I only want to be an MQTT client with the OrangePi Zero, so I hope the wireless chip is sufficient for that.   I guess I will not know until I experiment some more.  
Thank you for the pointer to armbian.  

2

threads

10

posts

2001

credits

Gold member

Rank: 6Rank: 6

credits
2001
Published in 2022-1-22 04:04:44 | Show all floors
You can try this to lock the onboard wifi to wlan0:
1. Change the value for Predictable Network Names (so you will get wlan0,  wlan1, eth0, eth1, etc):
  1. nano /boot/armbianEnv.txt
Copy code

and add:
  1. extraargs=net.ifnames=0
Copy code


2. Assign the Network name to the device driver:
  1. nano /etc/udev/rules.d/72-wlan-geo-dependent.rules
Copy code

and add:
  1. ACTION=="add", SUBSYSTEM=="net", DRIVERS=="xradio_wlan", NAME="wlan0"
Copy code



If that does not work, you can try:

  1. nano /etc/udev/rules.d/70-persistent-net.rules
Copy code

and add:
  1. ACTION=="add", SUBSYSTEM=="net", DRIVERS=="xradio_wlan", NAME="wlan0"
Copy code


Reboot. The Pi Zero onboard wifi should now consistently appear as wlan0.

--Chris

0

threads

13

posts

64

credits

Registered member

Rank: 2

credits
64
Published in 2023-2-22 11:19:24 | Show all floors
The topics you share really meaningful to me, I will regularly follow your website. stumble guys

0

threads

10

posts

32

credits

Novice

Rank: 1

credits
32
Published in 2023-3-9 11:28:21 | Show all floors
直到很多年后,经历时光和世事,某一刻才突然明白,原来,我们这一生,社会经历很多坎坷和选择的,脚下走的每一步路,都与未来息息相关。
福彩双色球走势图澳洲幸运20走势图幸运飞艇走势图
Published in 5 daybefore | Show all floors
Hello! I just now would like to offer a huge thumbs up for the wonderful info you might have here on this post. I am returning to your website for additional soon.        Learn more
Published in 5 daybefore | Show all floors
Substantially, the post is really the freshest on that noteworthy topic. I concur with your conclusions and also can eagerly look forward to your coming updates. Simply just saying thanks definitely will not simply be acceptable, for the amazing lucidity in your writing. I can promptly grab your rss feed to stay informed of any updates. Fabulous work and also much success in your business endeavors!        Find out here
Published in 4 daybefore | Show all floors
It’s actually a nice and useful piece of information. I am satisfied that you just shared this helpful info with us. Please stay us informed like this. Thank you for sharing.        Discover more
Published in 4 daybefore | Show all floors
There are some attention-grabbing time limits on this write-up but I don’t know if I see all of them heart to heart. There may possibly be some validity but I will consider maintain viewpoint until I look into it additional. Great article , thanks and we want additional! Added to FeedBurner at the same time.        Find out here
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list