OPi Zero: XR819 wifi broken in new builds


Recommended Posts

Is it possible that there have been some image changes that broke the XR819 wifi completely?
The available images for download on the Armbian page (5.3 server, and 5.4 minimal) as well as a custom built "legacy" branch linux-4.19 image all show the same behavior,
The wlan0 interface is not active and it's not possible to bring it up. And dmesg shows that module has been initialized but not much more.
Armbianmonitor support info:
5.3.9 official buster server image: http://ix.io/240Y
4.19.88 self-built, two days ago, legacy branch: http://ix.io/240U
Everything below is from the official image, but the 4.19 image shows the exact same

It is definitely not a hardware issue, I have a SD card with a an older 4.19.72 image (when the branch was still called "next") that works just fine.

ifconfig -a

Spoiler

root@orangepizero:~# ifconfig -a
dummy0: flags=130<BROADCAST,NOARP>  mtu 1500
        ether 4e:d7:ef:97:fe:24  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.9.9.74  netmask 255.255.255.0  broadcast 10.9.9.255
        inet6 fdaa::140d:159f:ef8e:f4ab  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::dad5:d85e:5d75:f4ef  prefixlen 64  scopeid 0x20<link>
        ether 02:42:a5:9f:f1:6a  txqueuelen 1000  (Ethernet)
        RX packets 214  bytes 21011 (20.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 134  bytes 18689 (18.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 39

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  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=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 3a:7d:bf:4b:79:83  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

 

ifconfig

Spoiler

root@orangepizero:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.9.9.74  netmask 255.255.255.0  broadcast 10.9.9.255
        inet6 fe80::a827:65fd:f762:999a  prefixlen 64  scopeid 0x20<link>
        inet6 fdaa::1fd5:49e8:c762:1287  prefixlen 64  scopeid 0x0<global>
        ether 02:42:a5:9f:f1:6a  txqueuelen 1000  (Ethernet)
        RX packets 1493  bytes 114739 (112.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1372  bytes 251320 (245.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 38

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

 

root@orangepizero:~# ifconfig wlan0 up
SIOCSIFFLAGS: Invalid argument

root@orangepizero:~# rfkill list
0: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no

root@orangepizero:~# journalctl -b | grep xradio
Nov 19 08:08:00 orangepizero kernel: xradio_wlan mmc1:0001:1:    Input buffers: 30 x 1632 bytes
Nov 19 08:08:00 orangepizero kernel: xradio_wlan mmc1:0001:1: Firmware Label:XR_C01.08.0043 Jun  6 2016 20:41:04
Nov 19 08:08:28 orangepizero NetworkManager[1057]: <info>  [1574150908.3204] rfkill0: found WiFi radio killswitch (at /sys/devices/platform/soc/1c10000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1/ieee80211/phy0/rfkill0) (driver xradio_wlan)

root@orangepizero:~# uname -a
Linux orangepizero 5.3.9-sunxi #19.11.3 SMP Mon Nov 18 18:49:43 CET 2019 armv7l GNU/Linux

 

Link to post
Share on other sites
Armbian is a community driven open source project. Do you like to contribute your code?

I've done some work on kernel drivers and uboot in the past, that would not be a problem.

My point is that the XR819 worked on Armbian as good as the chip allows two months ago, and now the driver doesn't even initialize properly.
The fact that it stopped working on the old 4.19 kernel branch too, makes me think this is probably not a problem with kernel patches but with the system image.

I'm happy to help, but I'm looking for some pointers.

Link to post
Share on other sites
5 hours ago, yoq said:

The fact that it stopped working on the old 4.19 kernel branch too, makes me think this is probably not a problem with kernel patches but with the system image.

 

Yeah. XR819-Wifi stopped working with stretch and buster, but still works with bionic.

 

Here's my syslog with a buster build:

ov 30 16:45:56 localhost NetworkManager[1116]: <info>  [1575132356.6690] wifi-nl80211: (wlan0): using nl80211 for WiFi device control
Nov 30 16:45:58 localhost NetworkManager[1116]: <info>  [1575132358.1449] device (wlan0): driver supports Access Point (AP) mode
Nov 30 16:45:58 localhost NetworkManager[1116]: <info>  [1575132358.1555] manager: (wlan0): new 802.11 WiFi device (/org/freedesktop/NetworkManager/Devices/4)
Nov 30 16:45:58 localhost NetworkManager[1116]: <info>  [1575132358.1656] device (wlan0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Nov 30 16:45:58 localhost kernel: [   34.419112] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Nov 30 16:45:58 localhost kernel: [   34.423469] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Nov 30 16:45:58 localhost NetworkManager[1116]: <info>  [1575132358.1790] device (wlan0): set-hw-addr: set MAC address to AA:88:8F:8F:8F:AF (scanning)
Nov 30 16:45:58 localhost NetworkManager[1116]: <info>  [1575132358.2924] device (wlan0): supplicant interface state: init -> starting
Nov 30 16:45:58 localhost wpa_supplicant[1115]: Could not set interface wlan0 flags (UP): Invalid argument
Nov 30 16:45:58 localhost wpa_supplicant[1115]: nl80211: Could not set interface 'wlan0' UP
Nov 30 16:45:58 localhost wpa_supplicant[1115]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Nov 30 16:45:58 localhost wpa_supplicant[1115]: Could not set interface wlan0 flags (UP): Invalid argument
Nov 30 16:45:58 localhost wpa_supplicant[1115]: WEXT: Could not set interface 'wlan0' UP
Nov 30 16:45:58 localhost wpa_supplicant[1115]: wlan0: Failed to initialize driver interface
Nov 30 16:45:58 localhost NetworkManager[1116]: <error> [1575132358.3304] sup-iface[0x1175c18,wlan0]: error adding interface: wpa_supplicant couldn't grab this interface.
Nov 30 16:45:58 localhost NetworkManager[1116]: <info>  [1575132358.3309] device (wlan0): supplicant interface state: starting -> down
Nov 30 17:21:39 localhost NetworkManager[1116]: <warn>  [1575134499.3085] device (wlan0): re-acquiring supplicant interface (#1).

 

Link to post
Share on other sites

Thanks, that turned out be a good place to look. On a hunch, I tried swapping out wpa_supplicant for iwd as the wifi daemon for NetworkManager, and that did the trick.

apt install iwd
systemctl disable wpa_supplicant
echo -e "\n[device]\nwifi.backend=iwd\n" >> /etc/NetworkManager/NetworkManager.conf

I may just stick with iwd, but the root cause is probably that the aging xradio driver is missing support for some ioctl and it may just be a matter of time until a future release of iwd will send that one too.

Link to post
Share on other sites

Thanks!

 

Note to others who may have encountered the same issue:

 

(Assuming that you have connected to OPi Zero via USB-TTL converter and have no LAN/WLAN connectivity) Save deb packages obtained from https://packages.debian.org/buster/armhf/iwd/download and https://packages.debian.org/buster/armhf/libell0/download to usb flash. Plug that flash into Pi Zero, mount with the command 

 

mount /dev/sda1 /some/empty/dir

cd  /some/empty/dir

dpkg - i libell*.deb

dpkg -i iwd*.deb

 

Reboot and run nmtui-connect as usual to see the list of WiFi networks and connect to yours.

 

Link to post
Share on other sites

Users wanting to use debian builds with NetworkManager/wpa_supplicant should add the following lines to /etc/NetworkManager/NetworkManager.conf:

[device]
wifi.scan-rand-mac-address=no

Ubuntu builds (bionic, focal) already contain these lines.

 

This seems to solve the current issue on systems with the xradio wifi chip (opi zero, nanopi duo etc.)

Link to post
Share on other sites
On 12/13/2019 at 7:08 PM, sanja said:

Thanks!

 

Note to others who may have encountered the same issue:

 

(Assuming that you have connected to OPi Zero via USB-TTL converter and have no LAN/WLAN connectivity) Save deb packages obtained from https://packages.debian.org/buster/armhf/iwd/download and https://packages.debian.org/buster/armhf/libell0/download to usb flash. Plug that flash into Pi Zero, mount with the command 

 

mount /dev/sda1 /some/empty/dir

cd  /some/empty/dir

dpkg - i libell*.deb

dpkg -i iwd*.deb

 

Reboot and run nmtui-connect as usual to see the list of WiFi networks and connect to yours.

 

This crashed my Orange Pi Zero LTS :(

Link to post
Share on other sites
2 hours ago, rusefi said:

 What kind of "wireless connection issues are expected"? is the warning like the one on https://www.armbian.com/orange-pi-zero/ outdated now?

I think we do not have enough feedback yet if the XR819 with the new drivers is good enough to be considered stable. Needs to be watched over a longer period of time to see if it stays connected.

 

/Offtopic: If you plan to play with Bullseye or Focal make sure to download a 20.05.2 image as the .1 images on ARMHF most likely broken due to initramfs issues.

Link to post
Share on other sites
On 6/8/2020 at 5:58 AM, Werner said:

Not really. Just keep monitoring it for a few days/weeks  for issues like packet loss, connectivity loss...common stuff to say.

For what its worth, I've been streaming a 320kbps internet radio station continuously  on an Orange Pi Zero running Armbian Buster (kernel 5.8.5) for about a month and it literally never misses a beat. So my personal experience is that neither the XR819 hardware nor the driver version that Armbian is currently using in 5.8.5 are intrinsically flawed. It is for this reason I'd love to see support for the XR819 finally make it into mainline.

 

I am planning to use Orange Pi Zero in a significant project, and the somewhat unresolved formal status of the XR819 driver is the only fly in what is otherwise the very satisfactory ointment that is the OPi0 platform.

 

Peter

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...