Adding OpenWrt support for Mikrotik hAP ac 3 [RBD53iG-5HacD2Hn]

Ok, im having some wifi issue using the hAP AC3 for batman-adv mesh

I created a batman-adv mesh with total of 7 nodes (mostly IPQ4018 based devices)

but the 2 hAP AC3 devices dmesg output

[   41.231384] ------------[ cut here ]------------
[   41.231438] WARNING: CPU: 3 PID: 0 at net/core/flow_dissector.c:960 __skb_flow_dissect+0x39c/0x1330
[   41.235087] Modules linked in: xt_connlimit pppoe ppp_async nf_conncount iptable_nat batman_adv ath10k_pci ath10k_core ath xt_state xt_nat xt_helper xt_conntrack xt_connmark xt_connbytes xt_REDIRECT xt_MASQUERADE xt_FLOWOFFLOAD xt_CT pppox ppp_generic nf_nat nf_flow_table_hw nf_flow_table nf_conntrack mac80211 ipt_REJECT cfg80211 xt_time xt_tcpudp xt_tcpmss xt_statistic xt_recent xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_ecn xt_dscp xt_comment xt_TCPMSS xt_LOG xt_HL xt_DSCP xt_CLASSIFY slhc sch_cake nf_reject_ipv4 nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c iptable_raw iptable_mangle iptable_filter ipt_ECN ip_tables hwmon crc_ccitt compat sch_tbf sch_ingress sch_htb sch_hfsc em_u32 cls_u32 cls_tcindex cls_route cls_matchall cls_fw cls_flow cls_basic act_skbedit act_mirred act_gact ledtrig_gpio nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 ifb ghash_generic ghash_arm_ce gf128mul gcm cmac ccm leds_gpio
[   41.235271]  xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_qcom gpio_button_hotplug crc32c_generic
[   41.330682] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 5.4.145 #0
[   41.339239] Hardware name: Generic DT based system
[   41.345422] [<c030e050>] (unwind_backtrace) from [<c030aa5c>] (show_stack+0x10/0x14)
[   41.350019] [<c030aa5c>] (show_stack) from [<c0877cc8>] (dump_stack+0x8c/0xa0)
[   41.357913] [<c0877cc8>] (dump_stack) from [<c0321424>] (__warn+0xb4/0xd0)
[   41.364943] [<c0321424>] (__warn) from [<c03214a8>] (warn_slowpath_fmt+0x68/0x78)
[   41.371806] [<c03214a8>] (warn_slowpath_fmt) from [<c073830c>] (__skb_flow_dissect+0x39c/0x1330)
[   41.379358] [<c073830c>] (__skb_flow_dissect) from [<c07393f4>] (__skb_get_hash+0x68/0x114)
[   41.388362] [<c07393f4>] (__skb_get_hash) from [<bf2ecf94>] (ieee80211_schedule_txq+0x664/0x894 [mac80211])
[   41.396524] [<bf2ecf94>] (ieee80211_schedule_txq [mac80211]) from [<bf2ed168>] (ieee80211_schedule_txq+0x838/0x894 [mac80211])
[   41.406196] [<bf2ed168>] (ieee80211_schedule_txq [mac80211]) from [<bf2eeda4>] (ieee80211_tx_pending+0xb0/0x26c [mac80211])
[   41.417574] [<bf2eeda4>] (ieee80211_tx_pending [mac80211]) from [<c0324f00>] (tasklet_action_common.constprop.0+0x64/0xec)
[   41.428494] [<c0324f00>] (tasklet_action_common.constprop.0) from [<c030226c>] (__do_softirq+0x104/0x2a0)
[   41.439600] [<c030226c>] (__do_softirq) from [<c0325400>] (irq_exit+0xb0/0x100)
[   41.449231] [<c0325400>] (irq_exit) from [<c036997c>] (__handle_domain_irq+0x78/0xc8)
[   41.456354] [<c036997c>] (__handle_domain_irq) from [<c05b5dd0>] (gic_handle_irq+0x4c/0x90)
[   41.464339] [<c05b5dd0>] (gic_handle_irq) from [<c0301a8c>] (__irq_svc+0x6c/0x90)
[   41.472492] Exception stack(0xcf865f60 to 0xcf865fa8)
[   41.480133] 5f60: 00016a4a 00000000 00016a4c c0313860 cf864000 00000003 c0c04e68 c0c04ea8
[   41.485171] 5f80: 00000000 c0b3fde8 00000000 cf865fb8 0f263000 cf865fb0 c0307f84 c0307f88
[   41.493326] 5fa0: 60000013 ffffffff
[   41.501488] [<c0301a8c>] (__irq_svc) from [<c0307f88>] (arch_cpu_idle+0x38/0x3c)
[   41.504792] [<c0307f88>] (arch_cpu_idle) from [<c034bb5c>] (do_idle+0x21c/0x270)
[   41.512426] [<c034bb5c>] (do_idle) from [<c034be40>] (cpu_startup_entry+0x18/0x1c)
[   41.519806] [<c034be40>] (cpu_startup_entry) from [<803024ac>] (0x803024ac)
[   41.527216] ---[ end trace 32983d3ea82aa6e2 ]---
[   41.541704] ath10k_ahb a800000.wifi: wmi: fixing invalid VHT TX rate code 0xff
[   43.372385] ath10k_ahb a800000.wifi: Invalid peer id 1 or peer stats buffer, peer: 8ee30e36  sta: 00000000
[   70.424846] ath10k_ahb a800000.wifi: htt tx: fixing invalid VHT TX rate code 0xff

this results in very slow ping responses and very low signal strength output with batman-adv

any ideas what could be causing this ?

a recent patch maybe ?

Do we have a working sysupgrade for this yet? uploaded

Yes, its working

I can confirm that the sysupgrade is working for the commit

Something has broken related to batman-adv in snapshot which is not related to the commit

It's most likely a generic bug not related to the hap ac3 at all.

Yes, agreed

I found this mentioned mac80211 commit recently that has reference

Tried reverting this but after about 2 minutes same issue again

Cool cool! What are the instructions to install it? I don't know how to build it up. :frowning:

Instructions are in the commit itself

BTW, does anybody know on what is the "internet" LED triggered in ROS?

1 Like

this page only details scripting the LEDs behaviour
https://wiki.mikrotik.com/wiki/Manual:System/LEDS

Looks like sysupgrade is working however anyone got luci operational

seeing:

 regexp could be something like 'pkgname*' '*file*' or similar
 e.g. opkg info 'libstd*' or opkg search '*libop*' or opkg remove 'libncur*'
root@OpenWrt:~# opkg install luci
Multiple packages (libgcc1 and libgcc1) providing same name marked HOLD or PREFER. Using latest.
Multiple packages (libgcc1 and libgcc1) providing same name marked HOLD or PREFER. Using latest.
Multiple packages (libpthread and libpthread) providing same name marked HOLD or PREFER. Using latest.
Package luci (git-20.074.84698-ead5e81) installed in root is up to date.
root@OpenWrt:~# /etc/init.d/uhttpd enable
root@OpenWrt:~# /etc/init.d/uhttpd restart
4+0 records in
4+0 records out
root@OpenWrt:~#

Oct 17:

sysupgrade file:
http://download.cloudatcost.com/download/4zguljzy52k2yfoqve7vhntde
password: voip2014

Basic process you need the initramfs file to bootp into the hapac3 once your in format the ubi partition looks like this:

 OpenWrt SNAPSHOT, r17726-ddf96861de
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                   124320     10836    113484   9% /
tmpfs                   124320        72    124248   0% /tmp
tmpfs                      512         0       512   0% /dev
root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00a00000 00020000 "kernel"
mtd1: 07600000 00020000 "ubi"
mtd2: 00080000 00010000 "Qualcomm"
mtd3: 00080000 00010000 "RouterBoot"
mtd4: 00002000 00010000 "hard_config"
mtd5: 00007e87 00010000 "dtb_config"
mtd6: 00001000 00010000 "soft_config"
root@OpenWrt:~#


ubidetach -m 1 
ubiformat /dev/mtd1 -y
root@OpenWrt:~# ubiformat /dev/mtd1 -y
ubiformat: mtd1 (nand), size 123731968 bytes (118.0 MiB), 944 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 943 -- 100 % complete
ubiformat: 944 eraseblocks have valid erase counter, mean value is 1
ubiformat: formatting eraseblock 943 -- 100 % complete


ubiattach -m 1
root@OpenWrt:~# ubiattach -m 1
UBI device number 0, total 944 LEBs (119865344 bytes, 114.3 MiB), available 920 LEBs (116817920 bytes, 111.4 MiB), LEB size 126976 bytes (124.0 KiB)

Once that's done, scp or copy the sysupgrade file to the /tmp directory and issue:

sysupgrade -v openwrt-ipq40xx-mikrotik-mikrotik_hap-ac3-squashfs-nand-sysupgrade.bin

This will get the router booted with openwrt from there you can issue update and install packages, now I am still having issues getting luci working on this so if you figure that out or have built a sysupgrade with luci working please let me know.

luci-ssl was working for me when i last tired it

Can those who have tested add their tested by tag to the PR

That would really help in getting it merged

2 Likes

what routeros version have you been using? I have 6.48.5 and cant make it work :frowning:

update: now managed to downgrade to 6.47.8 which is my factory firmware. @markbirss could you make it work?

question: should I jailbreak or wait for a more final version to be done? what do you think @voip2014? btw..the initramfs file you mention in your oct17 post is the one from may?

More details please; tell us the process you tried?

Jailbreak will not help you. A build based on Robi's PR will be a near final version, and any testing helps.

The initramfs file has -initramfs in the file name. It should end something like -initramfs-kernel.bin

It looks like @voip2014 has not provided a recent initramfs, and from an older initramfs, you will not be able to (reliably) install a sysupgrade.

You should be compiling the image yourself, or at least be aware that something could add a nasty bonus (example: botnet) to third party compiled image.

If you could not get the initramfs to start, my usual suggestions are:
Use RouterBOOT BOOTP mode (the default), and a BOOTP/TFTP server (example: dnsmasq-full on openwrt)
Start to hold in the reset button on the hapac3 before (or just after, for a different RouterBOOT version) you supply power.
Continue to hold this button in while the LED changes from off (takes some time to load RouterBOOT), to solid (stays for 5+s), to flashing (5s), to solid (5s), to off, then let go. It might be 20s of button held total, watch the changing light pattern to make sure you get to NetInstall phase.

Thanks thanks thanks!

Ok. I was trying to avoid building the image myself because I didnt want to make a mistake. But I guess that is how we learn :). I am building it now in a ubuntu VM. It seems that it take a long time, so I will leave it there overnight (btw, do you know how many steps the make has? or more or less how long would it take? I have an M1 mac and running a ubuntu server VM).

Thanks again for all your help!

Yes, absolutely.

first compiled is tools, then toolchain, target/linux compile, package, and finally target/linux install
It does take hours for the toolchain (parts that let you build for specific architecture—arm a7 in this case) to build.
these show as make -C toolchain
This only needs to happen once (if you keep the build directory). Occasional updates (to the toolchain) mean parts of it get recompiled now and again.

Once you have a toolchain, the device kernel might take 30 minutes, and another 30 minutes for the device packages and image.

These times are very hardware dependent, but should give you a rough idea.

Oct 21st

Looks like it compiled fine tonight with luci-ssl for download below:

initramfs:
Password for link: voip2014
openwrt-ipq40xx-mikrotik-mikrotik_hap-ac3-initramfs-kernel.zip
http://download.cloudatcost.com/download/s43eo1eay4aokoy84hxn0my2f

sysupgrade:
Password for link: voip2014
openwrt-ipq40xx-mikrotik-mikrotik_hap-ac3-squashfs-nand-sysupgrade.zip
http://download.cloudatcost.com/download/ayb1nx7susjk1qau0kyai0t4f

go ahead and let us know if they work, and feel free to compile it yourself if you can so far no issues on the compile with luci as of today.

Note: most app packages require 5.4.155-1-6b609bad… while 5.4.150-1-07af304a… is installed from the build above, until this is calling the right kernel most apps will not install correctly.

I managed to build it myself! But I'm not able to initramsfs. I am setting the tftp server in 192.168.1.10 as in the instructions.

Also @robimarko mentions a few console steps to sysupgrade. Is that neccesary if I included luci in the build and try to upgrade from there?

LuCI should just invoke sysupgrade in the background, but I haven't tested it