That's not really openwrt "related" though, since any issues would be elsewhere.
Oh, absolutely. But I want to verify that my "clever" idea to temporarily work around the lack of support for the RTL wireless interface actually does what I think it should do. If it does, it means that getting other packages onto the system would be easier than rolling custom images or manually transferring .ipk files. I appreciate the ultimate goal is to get the wireless interface inside the gizmo working under OpenWRT, so that the OP can get his gizmo online without any further dependency on Ethernet.
Well, it's here. And it's bloody tiny.
I'm off to play with it for a bit. I'll be back to let you know how I got on.
The "cacharro" is beautiful, you can't say otherwise. let me know when you try it. there is a possibility that mine was broken... who knows
I'd buy the Lanner CH-1010, but the CPU power the N95 delivers can't be bet ,)
Okay. Here goes.
This is what I reckon I set out to achieve:
- Get OpenWRT installed on an Acemagician T8 Plus.
- Get OpenWRT connected to the Internet, using its onboard Wi-Fi adapter as a client.
- 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?
- 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.
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!
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.
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-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:
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.
Omg thanks for that work, but i will ask you to try another thing, usb tethering with that device, i tried it but, in my case, didnt work and im sure you will solve it so fast, at least, faster than me.
I tried with an iPhone 12 pro, the x86 detects it but when i configure the interface to link with usb, it doesnt work…
Yeah, alright. I'll give it a go. Can't promise I'll succeed, mind; after all, I was so confident about getting the wireless adapter working assuming that the Ethernet ports could be used for Internet access, but that turned out to be wrong.
Still, it'll be an interesting learning exercise. I've never played with USB tethering with my iPhone; I've always used Wi-Fi when tethering. Should be fun to see what happens.
But that won't be tonight; I'll revisit this tomorrow. In the meantime, who knows? You could very well figure it out and beat me to it!
You will need at least 23.05~ (with kernel v6.1 based wireless driver backports) for
rtw88_8821ce support - even then I wouldn't expect much (anything). I have not checked if everything is packaged up for OpenWrt (RTW88_8821CE and the necessary firmware, well, the later you could temporarily provide yourself).
From current (general purpose linux-) v6.4:
license: Dual BSD/GPL
description: Realtek 802.11ac wireless 8821ce driver
author: Realtek Corporation
(untested, don't have any rtw88/ rt89 devices)
Alright. Once I've checked iPhone tethering, I'll shove 23.05 RC1 on it and see what I find out.
Or... while waiting for me, @Exio0 could shove 23.05 RC1 on it...
I don't think this has been merged yet... see: https://github.com/tomaspinho/rtl8821ce
There is an AUR package for Arch Linux (dkms) so I think there is an out-of-tree option.
That is an out-of-tree fork of Realtek's vendor driver, which will never be merged, but
drivers/net/wireless/realtek/rtw88/rtw8821ce.c is part of kernel v6.1 (which forms the basis of the linux wireless driver backports used in 23.05~ and master). Just OpenWrt's backports module doesn't know about it yet, so some work on the 'mac80211' packaging will be needed (again, I wouldn't expect too much of that driver, but chances are better than with the STA-only vendor driver crap).
Do you mean that I try the version 23.05.0-rc1 to see if the wireless appears?
Can I make a backup of everything I have so far and then, if that doesn't work, restore it again?
Making a backup is always a good idea.
the thing is... could i restore it then? yes, i guess...
Okay, ill give it a try. I just have to download
and try if wifi appears, right? or do i need any ipk?
When I get around to doing it, I'm going to see what the stock image provides.
I already know that Ethernet works, from testing 22.03.5 (so it's reasonable to assume that Ethernet will still work with 23.05.0-rc1).
If the Wi-Fi adapter still isn't available then, using the working Ethernet connection, I'll see if there are any new packages in the 23.05.0-rc1 repository which might be helpful.
Im with it right now, but i wont know this
Nor will I, until I try.
To be honest, I'm expecting it to fail in the same way, but I'll be pleasantly surprised if it works.