Support for Mikrotik Hap AC2

root@OpenWrt:~# ls -lh /sys/firmware/mikrotik/hard_config/wlan_data
-r--------    1 root     root           0 Jun 13 22:02 /sys/firmware/mikrotik/hard_config/wlan_data
root@OpenWrt:~# dd if=/sys/firmware/mikrotik/hard_config/wlan_data/data_0 of=/tmp/data_0.bin bs=512
dd: can't open '/sys/firmware/mikrotik/hard_config/wlan_data/data_0': Not a directory
root@OpenWrt:~# dd if=/sys/firmware/mikrotik/hard_config/wlan_data/data_2 of=/tmp/data_2.bin bs=512
dd: can't open '/sys/firmware/mikrotik/hard_config/wlan_data/data_2': Not a directory

You can download hard_config.bin from this link
https://drive.google.com/drive/folders/1zSbqJR_LXW3Fq7KdTKsiSq2Jc3qBf1Aq

hi @robimarko

as i saw in this PR

the eth1 is finally removed :slight_smile:

so i tried in HAP-AC2 DTS

                edma@c080000 {
                        status = "okay";
+                       qcom,poll_required = <0>;
+                       qcom,num_gmac = <1>;
                };
        };

+&gmac0 {
+       vlan_tag = <0 0x3f>;
+};

and in 02_network

        mikrotik,hap-ac2
                ucidef_add_switch "switch0" \
                        "0t@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
                ;;

but the network does not come up
do you have any suggestion ?

sorry for ping, but i really need WAN port to be able handling Vlans/Trunk
thank you

sry @robimarko

my mistake
left out one char

-mikrotik,hap-ac2
+mikrotik,hap-ac2)
                ucidef_add_switch "switch0" \
                        "0t@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
                ;;

it is working perfectly
tagged WAN , finally

It's a workaround like the whole ethernet and switch drivers.
Nice to see that you made it work.

Please dump /sys/firmware/mikrotik/hard_config/wlan_data then

root@OpenWrt:~# dd if=/sys/firmware/mikrotik/hard_config/wlan_data of=/tmp/wlan_data.bin bs=512

I have generated wlan_data.bin file by this command.
Here is the link to download:
https://drive.google.com/file/d/1rXRk0M8EBpdRkFP_IjLD-kizk96iei-G/view?usp=sharing

Just a quick heads-up for people trying to do SQM on 100+ Mbps connections with the hAP AC2 or any other IPQ4019 device.

By default it will throttle itself if you're maxing out the connection over WiFi.

This is caused by interrupts being put on a single core instead of distributing them across all cores.

This can be easily fixed with the irqbalance daemon.

opkg update
opkg install irqbalance

However you need to enable it since the package configuration file defaults to disabled.

uci set irqbalance.irqbalance.enabled=1
uci commit

Now reboot your router and check if it throttles again, you can watch the CPU usage in real time using top -d 1 and paying attention on the idle percentage.

PD: irqbalance may also speed up PPPoE and VPN connections.

1 Like


a new OpenWRT-current firmware update (with sqm) hAP-ac2-r17237-sqm.tar >>> https://files.sberdisk.ru/s/Jt4PJG8CtEz7rnD

Hi @Blaze,
What is the difference between v21.02.0-rc3 and this firmware? Only sqm?

Also, did you see my wlan_data.bin file from this post?

This firmware base on snapshot r17237-7c4d79aa1c from https://github.com/openwrt/openwrt (2021/07/31)
Kernel Version up to 5.4.134. Too I added SQM and luci-theme-openwrt-2020.

I don't saw your wlan_data.bin and you must to have data_0 and data_2

# ls -l /sys/firmware/mikrotik/hard_config/wlan_data
-r--------    1 root     root             0 Jul 31 10:45 data_0
-r--------    1 root     root             0 Jul 31 10:45 data_2

OpenWrt 21.02 RC4 iPerf3 LAN - 5GHz WLAN benchmark

Host: Linux laptop connected through Cat 5e
Client: Xiaomi X3 Pro

Channel: 52 (DFS) @ 80MHz

I'm really happy with how good this unit performs after enabling irqbalance.

Hi, can I clarify a few questions about level of support? AFAICT it's fully supported and should work great using firmware from https://openwrt.org/toh/hwdata/mikrotik/mikrotik_rbd52g-5hacd2hnd-tc_hap_ac2, but may need a few manual tweaks to get good performance (related to wifi calibration data and/or irqbalance)?

Is it generally a good pick to buy specifically to run OpenWrt on it, or are there caveats to this hardware? (And any recommended alternatives if so?)

I would look somewhere else.

The device manufacturer thinks there is not enough RAM (128 MB) to run the 802.11ax wave2 features. OpenWrt uses special packages to try to work around this (ath10k-ct-smallbuffers).

Qualcomm has not done enough

1 Like

I have this weird packet loss with IPv4 on WAN, can anyone replicate that? It's about 3% via "ping -4" on the router (same from client), mostly single packets here and there, sometimes blackout for about 20 seconds, no packet loss at all with IPv6 (measured at the same time). I had no packet loss with ROS or when directly connecting a PC with the cable modem.
I have everything pretty vanilla, except setting up WLAN. Nothing in dmesg or logs, no cpu spikes. Any ideas?

1 Like

What model cable modem you using ?

@markbirss Thomson THG571K

Ok, I had this same strange WAN packet loss and performance issue recently when connected to a Ubiquity ERX running OpenWRT. (19.07.7 and 20 RC3) with a hAP AC2

Reverting the Ubuiqty ERX back to stock vendor firmware I did not have the issue anymore

1 Like

Wasn't getting good 5G speeds with ROS, so I dedided to run latest OpenWRT snapshot from RAM and give it a go.

First things first, speeds are slower and it tops out the first CPU core while speedtesting as shown in the screenshot below. This is probably the speed bottleneck on OpenWRT. It seems that it can't properly offload the work to the other cores or something.

With stock ROS I'm also only getting 200 Mbps tops (but the CPU only gets about 30% usage though)

Over the original ONU that came from the ISP, over 5G I'm getting 240Mbps immediately, while ROS and OpenWRT creep their way up to 200-ish slowly during the test.

I've tested this multiple times to rule out inconsistencies with the internet connection.

For the time being I'm going back to ROS.

Don't forget to install and enable irqbalance otherwise you won't be utilizing all the 4 cores and thus low throughput.

Also use the performance governor like ROS does instead of OpenWrt's default on demand governor.

PD: I decided to get another router to replace my ac2 not because of throughput issues but 128MB of RAM are not enough to run OpenWrt beyond the essential routing + WiFi capabilities, also VLANs are broken on IPQ401X targets.

1 Like

There is maximum what I got with PPPoE 1Gigabit cat5e cable WAN connection: 370/390 Mbps in speedtest.net

  1. Scaling governor works perfectly with default ondemand option. I checked it by "cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq" while speedtesting. And it scales up frequency immideatly.
  2. IqrBalance enabled by uci set irqbalance.irqbalance.enabled=1
  3. SW+HW offloading enabled in default firewall setting
    So that's sad ((
1 Like