Adding OpenWrt support for Asus RT-AC57U v2

Status update

Naming scheme changes

Now we use ASUS model names instead of the name of the reference board they are based on. This will help avoid confusion in the future. The only places that still mention apjet01 are branch names in our repository and one .dtsi file. From now on, use the name of your device (e.g. ASUS RT-AC59U v1) when selecting target profile in menuconfig.

USB support is merged

1 Like

Hi!
I have rt-ac58u v2 too, and already for a year waiting for openwrt for that, since with original firmware it is useless for me. Main use will be connecting to public wifi, and acting as a router, repeating it with my password and name with firewall and dhcp.
Thank You for your effort!

Status update

QCN5502 Wi-Fi

With looi's patch for ath9k our 802.11n Wi-Fi worked fine. This is amazing, I never thought we'd get to this point this fast. Big thanks to @looi! Use our apjet01-802.11n feature branch if you want to build from source. Not adding this to other branches since it contains a patch that is only relevant for our devices and is unlikely to get into OpenWrt as-is.

Please note that without technical details about this specific SoC we can't get the same level of performance as stock firmware for 802.11n 2.4GHz Wi-Fi.

Community images

This is our top priority now. I will try to make them available this week. I wanted to make them fully reproducible, but some of the packages include info like path to where your source code was when you compiled it. So you can't really get identical images. Prefer building from source if you can, otherwise I will still share my own images soon. I just don't feel like I'm at a point where I can guarantee that my environment is secure enough to produce images for other people. But my standards are much higher than most people's so maybe that's no big deal.

Other things

  • merged upstream master branch
  • apjet01-rebase branch now tracks apjet01 instead of apjet01-dev (consider -dev branch unstable)
  • bugs fixed:
    • invalid MAC address on ethernet interfaces
    • invalid MAC address on qca9888 (5GHz 802.11ac) interface
    • LEDs for Wi-Fi and USB don't work

@Lewe4kin Hi! I'm glad we can be helpful! There's already working code that you can use to build from source and unofficial images are coming shortly.

1 Like

Does someone have the image for RT-AC58U v2 to share? Tried compiling from source in Debian. But I'm getting errors, which I can't resolve with my Debian version.

Hi! As I said, I will release it soon.

However, I am curious about your problem. Could you share the list of all commands you have run and the error message you got?

Unofficial images have arrived!

@XAM fyi

Hi! I have just pushed my builds. Before you install them, please read below.


First, you NEED to check your device's partition table to make sure you won't corrupt the data there by installing our image. Even better would be if you backup the partitions. This ensures you can safely recover from mistakes or failures.

  • enable ssh on stock firmware and log in via ssh
  • use dd or cp or cat to copy devices starting with mtd in /dev to somewhere on the router's filesystem as regular files
  • copy those files to your PC via sshfs or scp

Next, go to our forum page and confirm that your partition table matches what we have. How to get your partition table?

  • cat /proc/mtd will show it in the form of device size erasesize name. You can deduce the start position of each partition because they are sequential (except for rootfs that is inside linux); end = start + size obviously.
  • OR search first lines in dmesg output, it will list them as "start-end : name". If you can't find it, reboot and retry immediately.

Next section is relevant if you didn't install or upgraded anything on your router and can spare some time to help us before you overwrite stock firmware. Would be nice if you could save everything under /lib/firmware/ and share it. Output of ip a would also help if you don't mind sharing your MAC addresses (unique to your device).


Finally, install OpenWrt image. See instructions on where to find images and how to install via tftp on our wiki page. Full install + boot may take up to around 4 minutes. I've included a lot of drivers for better compatibility with whatever you might want to connect via USB.

Please, share your experiences using this build. Your input is valuable!

1 Like

I want to share all needed for you files and info. But there is a little problem, I am very new to linux. Could you please write commands that i need to use?
starting from here: use dd or cp or cat to copy devices starting with mtd in /dev to somewhere
and command for that too
Would be nice if you could save everything under /lib/firmware/ and share it. Output of ip a would also help if you don't mind sharing your MAC addresses (unique to your device).
i already got inside ssh.
I am using Kali linux, so as i understand i have scp packadge installed by default
so scp command would be great too
P.S Also can provide fw version if that is needed for you, what is installed right now

Install a normal distro like Fedora or Debian. Kali is not for beginners. It is ONLY for PROFESSIONALS who are doing penetration testing. Don't take my word for it, Kali developers themselves advise you against using it. Please read the kali link in full. Do not proceed until you have installed something other than a penetration testing distro.


On the router:

mkdir /tmp/home/root/share
cd /tmp/home/root/share
uname -a > uname.txt
cat /proc/mtd > mtd-partitions.txt
dmesg > full-dmesg.txt
dmesg | sed -n '/Creating [0-9] MTD partitions/,/^[^0][^x]/p' > dmesg-partitions.txt
ip a > ip-a.txt
find /dev -name 'mtd?' '!' -name 'mtd6' -exec cp '{}' /tmp/home/root/share/ \;

On PC:

mkdir ~/router-backup
scp -r admin@192.168.50.1:/tmp/home/root/share ~/router-backup/
scp -r admin@192.168.50.1:/lib/firmware ~/router-backup/
cd
tar --exclude='mtd[01345]' -cf public-backup.tar router-backup/

On the router again: cd ; rm -rf /tmp/home/root/share/

Send public-backup.tar to me. I will send you my email address in private message.

1 Like

My main pc is on windows, I use kali (on ancient laptop) when I want to play with airodump-ng, or when something needs to be done in linux :slight_smile:
File is sent to your email.
Thank You!

Ok, sucssefully installed it on my 58U v2!
As a 5 ghz client works great! As a 2,4 ghz client works poorly, weak signal, but I cannot verify is it driver or firmware, or hardware itself, because previously I never tested 2,4 ghz on that router.
Great job! Keep going!
Thank You!!!

Great to hear! Sorry for not replying to your message/email. I got it, but was very busy.

Our driver is the bottleneck. It is expected and stock ASUS firmware will definitely perform better because they have another driver. 2.4GHz chip on this board is called qcn5502 and it is fairly new. We don't have enough information about it in order to make it work as good as it can.

Thank you! Also don't forget about @merlin and @looi, we wouldn't get here without them!

P.S.:

You can do this on any desktop Linux distro :wink:

@alex.const ,
I want to send you dump my router info.
Rootfs section does not match on my router.
Please send me your mail.

Hi @alex.const ,

I've been testing your build for a few days and its working really good.
Wifi 2.4 signal range is diminished but 5ghz is fine.

One question, which repository should we use for installing packages?
The file distfeeds.conf was missing but even creating and configuring, i couldn't make it work and manual install was giving wrong architecture error.

Anyway, Great work.

I didn't get your partition info as reported by dmesg since the buffer was probably filled and older entries got overwritten. But judging from the contents of /proc/mtd it seems OK that rootfs section is a bit different in size because it should be completely contained inside the linux partition. If you reboot the router, connect as fast as possible and run dmesg or more specifically dmesg | sed -n '/Creating [0-9] MTD partitions/,/^[^0][^x]/p' you should see that the end of rootfs partition is the same as the end of linux partition. And its start is higher than start of linux. Hence, one is inside the other. If so, you can try installing the image. I will update the wiki to clarify this. Thanks.

Hi, @Randomico!

Thank you!

Yes, as noted in this thread, we lack access to some information needed to improve the driver for this chip.

Unfortunately, packages from official repositories quickly go out of sync if you use a snapshot version, i.e. something based on master branch as opposed to a release branch. If you need extra packages you can either

  • build the whole image from source (will take a few hours, need basic understanding of OpenWrt build process)
  • build the packages you need from source (quicker, need to understand the process in a bit more detail) and install them directly as files in LUCI.
  • ask me to include new packages in future builds (if device has enough space + will have to wait until next releases, but don't need to know anything)

By the way, I have included a lot of packages you personally might not need so creating your own image from source with fewer packages will also improve boot time and save a bit of space.

1 Like

@alex.const,
I am uploading the "openwrt-ath79-generic-asus_rt-ac59u-v1-squashfs-factory.bin" image via tftp to my router.
After the reboot, the old official firmware remains.

  • Please provide very detailed list of steps you performed
  • Make sure you're flashing only after the power LED started blinking slowly (two seconds to change state, 4 seconds for full cycle)
  • Do not reboot the router manually after flashing - it will reboot when it's finished

Appreciate the info, your second suggestion did what i needed.

Thank you!

  1. Set IP Address on nic as 192.168.1.10/24
  2. Power off router
  3. Push and hold reset button
  4. Power on router
  5. Wait for slow power led blinking
  6. Execute comand "tftp 192.168.1.1 -c put ./openwrt-ath79-generic-asus_rt-ac59u-v1-squashfs-factory.bin" without errors
  7. The router reboots immediately. Without pressing a button

All steps seem correct, so I don't understand why the install process hasn't worked for you, sorry. It would be easier to figure out if you had access to the UART console, but this requires soldering and a special TTL-USB adapter so this might not be an option for you.