Manually Install WiFi package or firmware file?

I was able to install DietPi on top of Orange Pi’s recently released (May 9, 2022) Debian image for the OPi Zero 2. Everything, including ethernet, works great except for wifi. It fails to scan in dietpi-config and when I enter my SSID and its password manually, it also fails. I am attempting to use DHCP. I also tried static with no success. If I were to guess, I would say the driver/firmware for the AW859A wireless/BT chip is missing. I have Orange Pi’s Github firmware repository cloned. The firmware files include firmware for the wireless chip. However, I don’t know if that is actually the problem and I thought I would check here to see if there was better option for enabling and using wifi generally for any board. Please let me know what additional information that you might need from me and thank you very much for your time.

Welcome to our community. Let’s check with our developer @MichaIng if he has an idea.

Thank you for having me! I think Dietpi is very cool. I have tried it on a couple of RPi 4’s and a one of my Radxa Zero’s. This is my first time using dietpi-installer to install it on top of a version of Debian.

My gut tells me it is the firmware for the network chip on the card, but I don’t know how to install firmware for devices in dietpi.

I thought maybe it was a password issue and I used wpa_passphrase “MySSID” “MyPasskey” and then pasting the resulting network information and encrypted key to wpa_supplicant.conf and then running iwconfig. I am assuming that didn’t work work because it is all managed through dierpi-config.

I ran lshw -short. I also have an HTML file saved with the full output. I didn’t see an option to upload. Probably wise. Let me know if you need the full output too. In any event, the wifi adapter isn’t listed. I am still looking for the actual driver. At the moment, all I have been able to find is the ini file at GitHub - orangepi-xunlong/firmware: Orange Pi specific firmware

H/W path  Device  Class      Description
========================================
                  system     OrangePi Zero2
/0                bus        Motherboard
/0/0              processor  cpu
/0/1              processor  cpu
/0/2              processor  cpu
/0/3              processor  cpu
/0/4              memory     984MiB System memory
/1        usb1    bus        EHCI Host Controller
/2        usb2    bus        EHCI Host Controller
/2/1              bus        USB2.0 HUB
/2/1/1            input      Macally RFKeyboard
/3        usb3    bus        EHCI Host Controller
/4        usb4    bus        EHCI Host Controller
/5        usb5    bus        Generic Platform OHCI controller
/6        usb6    bus        Generic Platform OHCI controller
/7        usb7    bus        Generic Platform OHCI controller
/8        usb8    bus        Generic Platform OHCI controller
/9        eth0    network    Ethernet interface
H/W path  Device  Class      Description
========================================
                  system     OrangePi Zero2
/0                bus        Motherboard
/0/0              processor  cpu
/0/1              processor  cpu
/0/2              processor  cpu
/0/3              processor  cpu
/0/4              memory     984MiB System memory
/1        usb1    bus        EHCI Host Controller
/2        usb2    bus        EHCI Host Controller
/2/1              bus        USB2.0 HUB
/2/1/1            input      Macally RFKeyboard
/3        usb3    bus        EHCI Host Controller
/4        usb4    bus        EHCI Host Controller
/5        usb5    bus        Generic Platform OHCI controller
/6        usb6    bus        Generic Platform OHCI controller
/7        usb7    bus        Generic Platform OHCI controller
/8        usb8    bus        Generic Platform OHCI controller
/9        eth0    network    Ethernet interface

Currently we don’t allow html files to be upload. All fine for now.

1 Like

Indeed I guess then the firmware is not covered by Debian’s generic WiFi firmware packages but the OrangePi image was shipped with an own one. Is there an APT repository for kernel and firmware?

ls -l /etc/apt/sources.list.d

But the WiFi interface is present already?

ip a

The Orange Pi Zero 2 has an onboard wifi adapter. It isn’t listed when using ip a.

I haven’t changed or added repositories in sources.list. With the exception of bullseye-security, the apt repositories are set to the US ftp debian mirror. I refuse to use the mirror that is included with Orange Pi’s debian image.

I think Armbian’s image is pulling the firmware for a repo they have. I am going take a look at sources.list on one of my other OPi Zero 2’s that is running the OPi Zero 2 Armbian image. I know that the repo’s it uses are deb.debian.org but I believe their firmware is pulling from an Armbian repo not debian. I will check it out and follow-up.

And thank very much for even taking a look at this thread. I know this board is not supported by Dietpi. I just wanted to give it a shot. So thank you for commenting.

The mirrors should be reset by the DietPi-Installer to deb.debian.org, which is a mirror director and should hence be a good choice in every case. bulleye-security should definitely stay as it ships short-term security updates for packages. Or do you mean that you removed the dedicated repository that was added by Orange Pi’s image? That wouldn’t be the Debian mirror, but a dedicated kernel/firmware repository which probably ships a dedicated firmware for the onboard WiFi chip.

Yes, Armbian ships with an own firmware package armbian-firmware, which is in case of using Armbian as base image also kept by the DietPi-Installer (instead of using Debian’s set of WiFi firmware packages then). I’m not 100% sure whether this includes one for the Zero 2 onboard firmware, but it should, since Armbian officially supports this SBC. However, when using it, use the official Armbian Bullseye image as basis, instead of one provided by Orange Pi: Orange Pi Zero 2 – Armbian
Or is it that one that you already used?

I didn’t need to remove the OPi repositories. Dietpi removed and replaced automatically. I wouldn’t have know that they needed to be the deb.debian.org instead of ftp.us.debian…

That is probably the issue then. I will change the apt repositories to deb.debían.org for the others when I get home from work, run the apt update and upgrades, and then report back.

Usually there shouldn’t be any difference between deb.debian.org and ftp.us.debin. The first one is just the global mirror that will redirect you to a local site.

No, neither DietPi not DietPi-Installer do remove custom repositories in /etc/apt/sources.list.d for generic devices, aside of a small number of known ones. But it does replace the main Debian repository mirror in /etc/apt/sources.list only, with deb.debian.org, which however does not affect the available packages, only how fast packages are downloaded, how much the global Internet grid is used (distance). So if there is no OPi repository now, there was none before.

Which image did you use now, one provided by OrangePi or the one provided by Armbian? I suggest to use the latter, so you are sure the intended firmware is installed as APT package and there is some level of quality. The manufacturer’s images are usually not well composed, something with loose files not attached to packages, which may then be overwritten by package installs. E.g. we had this issue with Radxa Zero, where the Debian firmware packages were able to overwrite the onboard WiFi driver. Something similar may have occurred in your case, which is ruled out when using the Armbian image.

I bump this topic up. Recently i moved from Armbian to DietPi running Orange Pi Zero 2 for my HA Supervised. And DietPi is great and tiny as usual :wave:
On Armbian i managed to get wifi and bt working with these steps:
Adding to /boot/armbianEnv.txt

extraboardargs=modules_load=uwe5622_bsp_sdio,sprdbt_tty,sprdwl_ng

Adding to /etc/modules-load.d/modules.conf

uwe5622_bsp_sdio
sprdwl_ng
sprdbt_tty

And finally making this trick

systemctl --no-reload enable aw859a-bluetooth.service

So when i moved to DietPi and did some magic with NetworkManager (btw, i think it would be great to include in DIetPi some sort of script to change for HA Supervised installation) - i even could bring up Wifi working (which is unnecessary for me).

But i got stuck on BT working :frowning:
This code replaced with hciattach gives an error about /dev/ttyBT0 .

I saw that OPi Zero 3 has same aw859a working with DietPi.
So is there any hints to bring it up on OPi Zero 2 ?

Might need to build it
https://linux-sunxi.org/Wifi

Also…seems to be a known issue

Firmware repository

Poking around…found a similar discussion over on armbian forums

Which points to below

other than that…I’m at a loss

There’s no trouble with WiFi - i managed to run it easily.
It shows available networks and connects fine.
Problem is only with Bluetooth.
As was commented here i get bluetooth service started, and even bluetoothctl running, but showing no available controller.

Also here’s some movements about Bluetooth

First of all, adding the modules to /etc/modules-load.d/ is sufficient, no need to add them to armbianEnv.txt/dietpiEnv.txt as well. For Bluetooth it seems to be required to run this service which likely attaches/enables the Bluetooth adapter via UART device.

Here is the service: build/packages/bsp/sunxi/aw859a-bluetooth.service at 567a310bf74792331243810188a8b42de686d153 · armbian/build · GitHub
Remove the ExecStartPre which is not required.
It executes a binary, which you need as well: build/packages/blobs/bt/hciattach/hciattach_opi_arm64 at 567a310bf74792331243810188a8b42de686d153 · armbian/build · GitHub

Yep, i did exactly this way. The only thing i realised - sprdbt_tty doesn’t work without sprdwl_ng.
If we load sprdwl_ng from /etc/modules-load.d/modules.conf - then we get soft reboot stuck until hard reset.
If we’re doing this way - then it’s ok.

So did small script for bringing up WiFi and Bluetooth on Orange Pi Zero 2

mkdir /tmp/download/
chown -Rv _apt:root /tmp/download/
chmod -Rv 700 /tmp/download/
cd /tmp/download/
apt install rfkill
wget https://raw.githubusercontent.com/armbian/build/567a310bf74792331243810188a8b42de686d153/packages/bsp/sunxi/aw859a-bluetooth.service
cp aw859a-bluetooth.service /lib/systemd/system/
systemctl enable aw859a-bluetooth.service
wget https://github.com/armbian/build/raw/567a310bf74792331243810188a8b42de686d153/packages/blobs/bt/hciattach/hciattach_opi_arm64
mv hciattach_opi_arm64 hciattach_opi
install -m 755 hciattach_opi /usr/bin
wget https://raw.githubusercontent.com/armbian/build/main/packages/bsp/sunxi/aw859a-wifi.service
cp aw859a-wifi.service /lib/systemd/system/
systemctl enable aw859a-wifi.service

Oh, that is good to know. In fact we currently add sprdbt_tty only when Bluetooth is enabled on Orange Pi Zero 3 and 3B. I’ll retest on Zero 3 and in case adjust this, to always load both for Bluetooth.

So it means it does now work? I guess we need to do the exact same thing on Zero 3 and 3B, since those use the same WiFi chip.

To be honest i’m not good at bash :slight_smile:
At first i tried to modprobe both sprdbt_tty and sprdwl_ng to check if wifi and bt becomes available.
Then i put them into modules.conf (as armbian do). But after soft reboot i got my opi zero 2 stuck in somewhere.
Plugged display and realised that it stucks on “bldo2: disabling”.
So removing sprdwl_ng from modules.conf - normal boot
Adding sprdwl_ng to modules.conf - always stuck after soft reboot.
Making power reset - normal boot.

So then i removed it from modules.conf and make it run as a service - it worked great. Both wifi and bluetooth are available and working flawlessly.

With sprdwl_ng only in modules.conf, does it fail to boot as well? And in case, does it work when you add them in correct order:

sprdwl_ng
sprdbt_tty

That’s exactly as i’m adding

Ok, so i checked several times

  1. If no modules.conf and services enabled (from my post - booting is fine.
  2. disabled services, enable only sprdwl_ng to modules.conf, soft reboot - stuck on same “bldo2: disabling”
  3. after hard reset it stops on same place “bldo2: disabling, cldo1: disabling”. (i think there’s some filesystem error after hard reset - checked with e2fsck -y /dev/sdb1 - fixed some errors).
  4. undo changes in modules.conf on my pc
  5. put sd-card back, boot fine.
  6. re-enable services back - soft reboot, boot fine.

I think that running from modules.conf is just “in a wrong time” comparing to services…
So the way it should run - services.