Support for Mikrotik Hap AC2

 OpenWrt SNAPSHOT, r13564-20f09090d5
 -----------------------------------------------------
root@OpenWrt:~# dmesg | egrep 'wifi|error|found|warn|fail|wir|firmware|ath'
[    0.113798] tcsr 1949000.tcsr: setting wifi_glb_cfg = 41000000
[    0.114051] tcsr 1957000.tcsr: setting wifi_noc_memtype_m0_m2 = 2222222
[    0.633900] 1 routerbootpart partitions found on MTD device spi0.0
[    0.644868] 5 routerbootpart partitions found on MTD device partitions
[    0.677744] 0x000000100000-0x000001000000 : "firmware"
[    0.762478] 2 minor-fw partitions found on MTD device firmware
[    0.762510] Creating 2 MTD partitions on "firmware":
[    0.782517] 1 squashfs-split partitions found on MTD device rootfs
[    4.347095] dwc3-qcom 8af8800.usb3: IRQ hs_phy_irq not found
[    4.347137] dwc3-qcom 8af8800.usb3: IRQ dp_hs_phy_irq not found
[    4.351830] dwc3-qcom 8af8800.usb3: IRQ dm_hs_phy_irq not found
[    4.357555] dwc3-qcom 8af8800.usb3: IRQ ss_phy_irq not found
[    4.365348] dwc3-qcom 60f8800.usb2: IRQ hs_phy_irq not found
[    4.369337] dwc3-qcom 60f8800.usb2: IRQ dp_hs_phy_irq not found
[    4.374925] dwc3-qcom 60f8800.usb2: IRQ dm_hs_phy_irq not found
[    4.380589] dwc3-qcom 60f8800.usb2: IRQ ss_phy_irq not found
[    4.700446] hub 1-0:1.0: USB hub found
[    4.733328] hub 2-0:1.0: USB hub found
[    4.771734] hub 3-0:1.0: USB hub found
[    4.804679] hub 4-0:1.0: USB hub found
[    4.812400] hub 4-0:1.0: config failed, hub doesn't have any ports! (err -19)
[   11.240161] mount_root: no usable overlay filesystem found, using tmpfs overlay
[   11.256631] urandom-seed: Seed file not found (/etc/urandom.seed)
[   12.493543] wireguard: WireGuard 1.0.20200520 loaded. See www.wireguard.com for information.
[   12.493586] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[   14.491596] ath10k_ahb a000000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000
[   14.491644] ath10k_ahb a000000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   14.504480] ath10k_ahb a000000.wifi: firmware ver 10.4b-ct-4019-fW-013-d81f62d97 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 adcbecaa
[   14.567043] ath10k_ahb a000000.wifi: failed to fetch board data for bus=ahb,vendor=0000,device=0000,subsystem-vendor=0000,subsystem-device=0000 from ath10k/QCA4019/hw1.0/board-2.bin
[   14.626281] ath10k_ahb a000000.wifi: failed to fetch board-2.bin or board.bin from ath10k/QCA4019/hw1.0
[   14.626340] ath10k_ahb a000000.wifi: failed to fetch board file: -12
[   14.634840] ath10k_ahb a000000.wifi: could not probe fw (-12)
[   15.518743] ath10k_ahb a800000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000
[   15.518840] ath10k_ahb a800000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   15.530651] ath10k_ahb a800000.wifi: firmware ver 10.4b-ct-4019-fW-013-d81f62d97 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 adcbecaa
[   15.561381] ath10k_ahb a800000.wifi: failed to fetch board data for bus=ahb,vendor=0000,device=0000,subsystem-vendor=0000,subsystem-device=0000 from ath10k/QCA4019/hw1.0/board-2.bin
[   15.624340] ath10k_ahb a800000.wifi: failed to fetch board-2.bin or board.bin from ath10k/QCA4019/hw1.0
[   15.624392] ath10k_ahb a800000.wifi: failed to fetch board file: -12
[   15.632927] ath10k_ahb a800000.wifi: could not probe fw (-12)
[   36.950478] jffs2_scan_eraseblock(): End of filesystem marker found at 0x1000
[   98.992903] jffs2: notice: (1516) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
root@OpenWrt:~#

dmesg https://pastebin.com/WCfYa4DZ

1 Like

So it's just Mikrotik changing hardware IDs to persuade people from using custom firmware, I hope this gets figured out soon

It seems the ERD data in the decompressed LZO data contains two chunks, one with ID 0x8201 and one with ID 0x8001.

If I force it to use the 0x8001 chunk I can see and use the 2.4GHz radio, if I force the 0x8201 chunk I can see the 5GHz radio (but am so far unable to connect to it).

EDIT:

Seems the 0x8001 chunk contains the calibration data for the 2.4GHz radio at offset 0x0, while the 0x8201 chunk contains the calibration data for the 5GHz radio at offset 0x0.

I was able to get both radios working by extracting the data to two files and using those in 11-ath10k-caldata. It should be possible to do it in rb_hardconfig.c by testing for the ID but I did not get that working.

4 Likes

I have tried to build https://github.com/robimarko/openwrt/tree/hAP-ac2-cleanup
and it was epic fail for me https://pastebin.com/NNYNvFDg

1 Like

I have successfully builded
from git https://github.com/robimarko/openwrt/tree/hAP-ac2-cleanup

Download >>> hAP-ac2-sqm-a28b8fe https://cloud.mail.ru/public/RMTS/3E1sbRZwu

But error with wifi is still the same :(((

# dmesg | egrep 'wifi|error|found|warn|fail|wir|firmware|ath'
[    0.106519] tcsr 1949000.tcsr: setting wifi_glb_cfg = 41000000
[    0.106782] tcsr 1957000.tcsr: setting wifi_noc_memtype_m0_m2 = 2222222
[    0.622695] 1 routerbootpart partitions found on MTD device spi0.0
[    0.633673] 5 routerbootpart partitions found on MTD device partitions
[    0.666471] 0x000000100000-0x000001000000 : "firmware"
[    0.742707] 2 minor-fw partitions found on MTD device firmware
[    0.742739] Creating 2 MTD partitions on "firmware":
[    0.762766] 1 squashfs-split partitions found on MTD device rootfs
[    3.272357] dwc3-qcom 8af8800.usb3: IRQ hs_phy_irq not found
[    3.272396] dwc3-qcom 8af8800.usb3: IRQ dp_hs_phy_irq not found
[    3.277092] dwc3-qcom 8af8800.usb3: IRQ dm_hs_phy_irq not found
[    3.282795] dwc3-qcom 8af8800.usb3: IRQ ss_phy_irq not found
[    3.290378] dwc3-qcom 60f8800.usb2: IRQ hs_phy_irq not found
[    3.294581] dwc3-qcom 60f8800.usb2: IRQ dp_hs_phy_irq not found
[    3.300179] dwc3-qcom 60f8800.usb2: IRQ dm_hs_phy_irq not found
[    3.305868] dwc3-qcom 60f8800.usb2: IRQ ss_phy_irq not found
[    3.623318] hub 1-0:1.0: USB hub found
[    3.656196] hub 2-0:1.0: USB hub found
[    3.696855] hub 3-0:1.0: USB hub found
[    3.727563] hub 4-0:1.0: USB hub found
[    3.735270] hub 4-0:1.0: config failed, hub doesn't have any ports! (err -19)
[    9.642396] mount_root: no usable overlay filesystem found, using tmpfs overlay
[    9.658555] urandom-seed: Seed file not found (/etc/urandom.seed)
[   11.248630] ath10k_mac_create, priv_size: 924  hw: 00a30342  hw->priv: 91b98247
[   12.630660] ath10k_ahb a000000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000
[   12.630707] ath10k_ahb a000000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   12.642355] ath10k_ahb a000000.wifi: firmware ver 10.4b-ct-4019-fW-013-d81f62d97 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 adcbecaa
[   12.671419] ath10k_ahb a000000.wifi: failed to fetch board data for bus=ahb,vendor=0000,device=0000,subsystem-vendor=0000,subsystem-device=0000,variant=Mikrotik-hAP-ac from ath10k/QCA4019/hw1.0/board-2.bin
[   12.733315] ath10k_ahb a000000.wifi: failed to fetch board-2.bin or board.bin from ath10k/QCA4019/hw1.0
[   12.733393] ath10k_ahb a000000.wifi: failed to fetch board file: -12
[   12.741854] ath10k_ahb a000000.wifi: could not probe fw (-12)
[   12.748709] ath10k_mac_create, priv_size: 924  hw: dc2d2189  hw->priv: df4f60bf
[   13.585946] ath10k_ahb a800000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000
[   13.586006] ath10k_ahb a800000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   13.598948] ath10k_ahb a800000.wifi: firmware ver 10.4b-ct-4019-fW-013-d81f62d97 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 adcbecaa
[   13.626599] ath10k_ahb a800000.wifi: failed to fetch board data for bus=ahb,vendor=0000,device=0000,subsystem-vendor=0000,subsystem-device=0000,variant=Mikrotik-hAP-ac from ath10k/QCA4019/hw1.0/board-2.bin
[   13.690950] ath10k_ahb a800000.wifi: failed to fetch board-2.bin or board.bin from ath10k/QCA4019/hw1.0
[   13.691004] ath10k_ahb a800000.wifi: failed to fetch board file: -12
[   13.699360] ath10k_ahb a800000.wifi: could not probe fw (-12)
[   41.901592] jffs2_scan_eraseblock(): End of filesystem marker found at 0xa000
[   88.907318] jffs2: notice: (1504) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.

I made a quick hack in the rb_hardconfig driver (patch) to have it work on my hardware.

You can find the build here.

I'm not sure what can go wrong if the caldata is not good, so use at your own risk.

5 Likes

You are magic!!!
Wifi works perfect :slight_smile:
Thank you so much.

2 Likes

Works for me aswell :slight_smile:

2 Likes

Can confirm that this also works fine for stealing neighbor's WiFi (aka client mode) just kidding :rofl:

pde, with your built I can boot MikroTik cAP ac and can connect to 2.4 and 5.0GHz

2 Likes

Installed @pde's build yesterday over ROS (and RouterBOARD) 7.1beta 2. Initramfs worked fine, but it doesn't want to boot the flashed firmware unless I use the other bootloader (by holding down reset first).
Can't use netinstall either, been trying a dozen versions and only the 7.1beta 2 one got me as far as "sending offer" but no further.
@robimarko Are the builds incompatible with the 7.1beta 2 bootloader or did I flash it wrong or something?

I dont know if ROS7 is incompatible as I have not tried it

I downgraded to ROS 6.4X (DoH was not available in v7) some time before installing OpenWRT on my unit. Did you upgraded the Routerboard firmware after installing ROS 7? If so can you get to Netinstall ROS 7 and downgrade to 6.4X?

@geminis3 Yes, I upgraded the RouterBOARD firmware right after I upgraded to ROS 7. Currently trying to use netinstall with no success so far, the device shows up but it's not installing the firmware.

Netinstall is very tricky, I had to disable all the network interfaces on my laptop to recover my router from a sudden brick with ROS. It said installing and immediately stopped, after an hour of tinkering it said erasing device and then the router came back to life.

Edit try to use ROS 6.47.2 npk firmware for Netinstall

I actually installed from 6.45.9. For Windows you can setup Hyper-V and install another Windows in it. Then netinstall only has one single network interface card and will work without any issues.

Are there any plans to achieve an officical OpenWrt firmware branch for MikroTik hAP ac2?

3 Likes

Finally managed to get back to ROS after 3 days of troubleshooting.
OpenWRT was pretty nice but I had to go back, it was severely limiting my gigabit PPPoE connection. Even with the software flow offloading turned on and with performance governor selected for the CPU I was only hitting about 430 Mbps down, which unfortunately is less than half my usual speed. (1 of the cores was basically maxed out downloading or uploading)

1 Like

The PR is stalled because Routerboot can't boot an ELF image so a stripped down copy of U-Boot was added as a workaround but that can't be merged into mainline.

Just wondering if this router is able of doing gigabit PPPoE with ROS (fasttrack I guess)?