Okay. Here goes.
This is what I reckon I set out to achieve:
Challenge:
- Get OpenWRT installed on an Acemagician T8 Plus.
- Get OpenWRT connected to the Internet, using its onboard Wi-Fi adapter as a client.
Problem:
- The onboard Wi-Fi adapter is not supported by the standard x86 image.
- How can the necessary package(s) to support the onboard Wi-Fi adapter be installed... unless there is a working Wi-Fi connection already?
Suggested workaround:
- Use another device, which has both working Wi-Fi and an Ethernet connection, to share its Wi-Fi connection via Ethernet to the T8.
- Download and install the necessary packages to enable support for the T8's Wi-Fi adapter in OpenWRT.
- ???
- Profit
First off, this diagram illustrates the suggestion I had in mind. Can't get the RTL8821CE working inside OpenWRT? Then hook the thing up to something else which does have a working Internet connection, with an Ethernet cable. Then use that connection to carry out whatever is required to get the RTL8821CE working.
I initially intended to use my laptop as the Internet-sharing device, but then I realised I also needed to use the laptop to try to connect to the T8. I remembered that I had a spare GL.iNet GL-MT300N-V2 kicking around, which would serve the same purpose: Connect the T8 to the MT300N, then use the MT300N as a Wi-Fi client to connect to a wireless hotspot. The MT300N happened to be running OpenWRT already, which was handy; it meant I didn't have to spend time learning if - and how - Internet Connection Sharing might be possible on either Linux or Windows in 2023. Go with what I already know works.
So... that diagram was the idea. But did it actually work?
First up, prepare a USB stick with something bootable, which will work with the on-board Ethernet interfaces at the very least.
I chose to put the standard OpenWRT 22.03.5 x86_64 image on the USB stick, following the documented instructions, and booted the T8 from it. I did not bother rolling my own image first. (Any live operating system with support for the RTL8189 would have sufficed for this step of the process, but I wanted to prove OpenWRT's capability to use the RTL8189. No point copying an image to the on-board disk if the image doesn't even support the Ethernet chipset, right?)
I then plugged an Ethernet cable into each socket in turn, and worked out which one was eth0
and which one was eth1
. Looking at the sockets from the rear of the device, eth0
is on the right, furthest from the power socket, and eth1
is on the left, next to the power socket. Trial and error.
My idea was based on the guess that OpenWRT would work with the built-in Ethernet devices, even if the Wi-Fi adapter wasn't an option.
So was I right?
Well, would you look at that!
br-lan
is 192.168.1.1, as expected... and what do we have at eth1
? An IP address issued by DHCP from the MT300N! Yes! It works!
A quick ping google.com
confirmed that I at had a contiguous route out to the Internet and DNS was working. Next up: double-check the disk. I knew from earlier posts in this thread that lsblk
isn't present by default, so a quick opkg update && opkg install lsblk
later, and I could see the layout of the storage:
Yup, that partition layout looks familiar, almost as if the T8 briefly had a Windows installation on it.
Rather than mess around trying to dd
from the currently booted USB stick to the internal SSD, I figured it'd be saner to download the same .img file again, save it in /tmp
and then dd
that file to the internal SSD. That photograph shows the evidence of the file already in /tmp
but I forgot to take a photograph of the command to get the file: wget https://downloads.openwrt.org/releases/22.03.5/targets/x86/64/openwrt-22.03.5-x86-64-generic-ext4-combined-efi.img.gz
followed by the gunzip
shown in the instructions.
So far, I've got the thing booted into OpenWRT via a USB stick, with a keyboard and monitor attached. I haven't yet attempted to connect via SSH or HTTP. But the T8 still has Internet access, so I can install packages and carry out configuration as long as I can do what I need on the command line.
So, following the instructions linked earlier, I used dd
to write that image file to the internal SSD. I then installed the parted
package and checked that the /dev/sda
partition table had changed.
Yup. It's changed. Bye-bye Windows!
I powered the thing off, pulled out the USB stick, and powered it back on again.
Look, ma, no USB stick! (That single USB plug is for the keyboard.)
Sure enough, the T8 booted into OpenWRT from the internal SSD. I checked the output of ifconfig
and confirmed that, again, eth1
had picked up an IP address from the MT300N, and ping google.com
proved both Internet connectivity and DNS.
So far, so good. But what about SSH and HTTP?
So I fished out my laptop and ran a second Ethernet cable between the T8 and the laptop.
The yellow cable is in eth1
- the WAN interface. The translucent cable is in eth0
, the LAN interface (configured as part of the br-lan
bridge by default).
While I had installed several packages while booted from USB, the installation on the internal SSD was the basic installation from the 22.03.5 stable x86 image file and I had not yet made any changes, so the LAN interface should be on 192.168.1.1, and my laptop should have picked up an IP address in the 192.168.1.0/24 subnet. Sure enough the laptop did. And I was able to connect to the T8 at 192.168.1.1 via SSH:
Ditto the Web interface, in my laptop's browser:
But, like @Exio0 discovered, no wireless. Uh oh.
After installing pciutils
, I could see the 10ec:c821 device, the Realtek RTL8821CE adapter:
Now, after reading all this, I bet you're wondering, but did I manage to get the RTL8821CE working?
I did not.
opkg
showed two packages which seemed promising: kmod-rtl8821ae
and kmod-rtw88
. Neither package proved successful: iw info
still showed no results.
Some reading around suggests that doing so might be... challenging. Apparently the Linux kernel does not include support for the RTL8821CE, and Realtek is coy with providing assistance to the open-source community. However, there are efforts underway to get the RTL8821CE working.
An incomplete list of some reading material, to get started:
https://www.google.com/search?channel=fs&client=ubuntu-sn&q="rtl8821ce"+"openwrt"
So... what did I learn?
- There really is no - current - support for the RTL8821CE in OpenWRT. Doesn't mean it'll never happen, but it's not there right now.
- There is, however, support for the RTL8189, so I've just bought myself a (hopefully) very capable two-port router/firewall/VPN/whatever. And it's so tiny and cute!
- The stable 22.03.5 image absolutely will work on this device with no customisation, and no need for rolling one's own images, as long as one is satisfied with only Ethernet and no Wi-Fi.
- Anyone who wants to use the T8 with OpenWRT and the RTL8821CE wireless adapter will have to put in some work.
Lastly, thanks and apologies to @Exio0. Thanks for introducing me to this nice new toy, and apologies for any previous misunderstanding and confusion.