Adding OpenWrt support for MikroTik cAP ac

I don't have a Cap ac, but hopefully you won't need an image.

Mikrotik Netinstall can be tricky. The timing is slightly longer than shown (for the bootloader before RouterBOOT), so watch the LED to confirm.

First, reset the RouterBOOT soft_config settings. Do this by holding the reset button during boot time until LED light starts flashing (~5 seconds), then release.

RouterOS should not normally touch the qcom bootloader, routerboot hard_config, or routerboot backup bootloader (which can be used by starting to hold the reset button before power is applied).

If the LED does not respond as expected at boot with reset button held (5 seconds blinking (reset settings), 5 more seconds solid (capsman), 5 more seconds off (netinstall)) then you likely have an issue with bootloader or hard_config bits on your SPI-NOR. If the problem is caused by something done from RouterOS, you are better off asking Mikrotik support, or your distributor, as hard_config contains device-specific settings, and Mikrotik does do silent hardware revisions.
If the LEDs are responding as expected, watch the WAN port with tcpdump or wireshark after 20+ seconds of reset button.

You are right. I manage to recover it with netinstall. It just turns out that onboard Intel i219-v NIC in Thinkpad T14 g2 laptop doesn't like netinstall and I had to use USB NIC.

Thank you!

1 Like

Since the wAP ac is identical to the cAP ac, except for the missing LED's and the possibility to power it also via DC jack, I previously installed successfully @hmpfe's build for the hAP ac2, see above. Now I wanted to try your build. It boots the initramfs image via TFTP without any issue, but I cannot flash the sysupgrade image using "sysupgrade -n". I also tried to start from various ROS 6-versions. [Surely, your image works fine for the cAP ac.] The reason I'm writing, is just to understand why the build does not upload to the wAP ac, although they are identical. Do you know what could go wrong with the wAP ac?

1 Like

Hello, I flash image from Hap AC2 to CAP AC successfully.
How I back to ROS, netinstall not see my router?
Thanks.

I merged @alaraun's PR on 21.02 release. Seemed like minimal fuss to get it to compile, just a patch with a bad header.

system boot's and seems stable in its default configuration.

but i can't get VLAN's to work. I've spent many nights on it - i'm still not convinced it isn't me...
my last attempt however, I had port 2 (eth0.1) with a static networkable address which i've been using to configure br-lan with port 1 (eth0.2 (yes confusing)) and turning on VLAN filtering in the bridge (br-lan) kills both ports even though port 2 (eth0.1) is not in the bridge (br-lan).

so i'll have to reset it again to continue.

i'm really at a loss here. I have 3 cAP ac, and 4 other mikrotik switches. i'm convinced my wifi issues would be resolved with non mikrotik drivers, but mikrotik's wifiwave2 (not mikrotik drivers) doesn't look like it will come to cAP AC, even at the recently released 7.1 (testing) where i'd have thought debugging stuff would come out (so smaller) there still isn't any push for 128MB devices like cAP ac.
I went for mikrotik so that I would have some continuity in my network configuration.

it hurts a bit when I look at other wifi solutions such as TP-Links OMADA and see how I could have had more integration between switches and access points. all under one hat.

so that leaves me with having OMADA for wifi, and mikrotik for switches. could be worse i suppose.

openwrt at least would have soften the blow as I would not have had to fork out. OMADA is gonna cost £450 :frowning: (3x 620HD)

openwrt feels so tantalisingly close. WiFi 5 wave2 would have been a sweet upgrade from stock.

Many others have been able to use VLAN, so it is most likely a configuration problem. This platform does not have a DSA switch driver (yet—in development), so you need to configure the (cap ac SoC hardware) switch and ports with switch_vlan stanzas, as well as the software bridges. Very similar problem here: VLAN configuration issues on 21.02 Mikrotik device (non-DSA switch setup) - #6 by johnth. You will need to provide more details of your config or wanted setup if you want specific guidance.

These (swconfig VLAN) numbers come from the switch_vlan option vlan. You can change them if it helps you.

I didn't realise I had made that assumption.
I've jumped in on 21.02 and have only read up on DSA configuration, again with the assumption that previous configuration systems wouldn't co exist.

Thank you for this steer!

Any heroic souls still working on this? It looks like @alaraun's PR was merged on Feb 1st, but there was a comment about this not working on some devices.

If the changes were in master when 21.02.2 was released, then does that mean cAP AC's are now supported (to some extent)? If so, the device page might need updating to indicate the progress on supporting this device.

I might try flashing this to one of my cAP AC's tomorrow unless folks recommend against. I'd love something with 802.11k/v/r support.

I'm not sure what that means by certain devices. Perhaps https://github.com/openwrt/openwrt/pull/4679 is needed for some models?

What he meant is that it will work for devices that are from the same batch, ofhers may have reduced wlan performance without dynamic BDF PR

Hi robimarko,

Many thanks for your efforts.

Can the openwrt page for CAP AC be updated to reflect this addition to master branch? Or almost finished?

If it's not yet in master, can you provide a link to a build, and installation instructions to get from stock please?

Cheers

I just did thr dynamic BDF, not the entire cAP ac support

@alaraun are you responsible for updating the support page? If your PR is now merged, and robimarko PR is also merged, then we're good to go?

Helo everyone,

Came here to get 802.11r running on my MT devices.
I just tested the latest snapshot as of July 15th with a cap-ac and hap-ac3.
Well, with a 1Gbps Internet downlink, an a client connected via LAN, I can only get 345Mbps (both, cap-ac and hap-ac3).
When setting the device in dump-AP mode, adding eth1 and eth2 to the bridge, I get 590Mbps on the cap- ac and 745Mbps on the hap-ac3.

Wifi performance is at best at bit above standard MT wifi drivers, while wifiwave2 in ROSv7 on the hap-ac3 delivers up to twice the performance (280Mbps vs. 590+Mbps on 5Ghz band)

Am I doing something wrong or is this as good as it gets?

Hello VanillaFord,

could you please summarize your results?

2.4 GHz (20 MHz)

  • cAP ac with RouterOS 6.x / 7.x: ?
  • cAP ac with OpenWrt 22.03 snapshot: ?
  • hAP ac3 with RouterOS 6.x / 7.x: ?
  • hAP ac3 with OpenWrt 22.03 snapshot: ?
  • hAP ac3 with MikroTik´s wifiwave2 package: ?

5 GHz (80 MHz)

  • cAP ac with RouterOS 6.x / 7.x: ?
  • cAP ac with OpenWrt 22.03 snapshot: ?
  • hAP ac3 with RouterOS 6.x / 7.x: ?
  • hAP ac3 with OpenWrt 22.03 snapshot: ?
  • hAP ac3 with MikroTik´s wifiwave2 package: ?

...first I want to know why even LAN/WAN traffik can not saturate the 1Gbps Link, which both devices can on ROSv6 and v7 just fine.
Without that, using openWRT on these MT devices is pretty useless and WiFi performance will see a side effect from that, I am sure.

So, did I do something wrong? Is there a package, that installs as a dump AP right away, to rule out a possible user error?

as a teaser, this I did a while back, with my Samsung S20FE phone:

...openWRT 22.03 snapshot only gave me 280Mbps :zipper_mouth_face:

1 Like

So, I downloaded OpenWrt 22.03.0-rc6 and flashed it on to a cAP ac.
First insights:

  1. DSA is different
  2. VLANs on IPQ40xx is different

To cut a long story short, how can I use the cAP ac as a dumb access point with tagged VLAN for wireless traffic in and outgoing on its WAN interface?

Network / Switch

  • So, "CPU(eth0)" is a kind of master port, which has to be tagged as well when I want to tag the uplink interfaces, i.e. WAN (eth0.2)

    Network / Interfaces / Devices
  • After creating VLAN 1000, 2000 and 3000 on the switch, new devices appeared as devices, i.e. "eth0.2.1000", "eth0.2.2000", "eth0.2.3000"
    Network / Interfaces
  • I created new interfaces, unmanaged, with "eth0.2.1000", "eth0.2.2000", "eth0.2.3000"
  • For testing purposed I activated DHCP client on e.g. "eth0.2.1000" and it received an IP address from the layer 3 switch the WAN-port (eth0.2) is connected to within the VLAN 1000
    Network / Wireless
  • I setup an SSID on wlan0 selected the Interfaces of "eth0.2.1000" and saved.
  • When I connected to, the client didn´t receive any IP address from VLAN 1000
    Network / Interfaces / Devices
  • So I wanted to create a bridge and put in the WAN-port (eth0.2) and wlan0, except I couldn´t save it.

Has anyone succeded configuring a working SSID with tagged VLAN on the uplink port? If so, could you please share screenshots of your settings?

I did it like this (AP has only one eth port)

config device
        option name 'br-lan10'
        option type 'bridge'
        option bridge_empty '1'
        list ports 'eth0.10'

config interface 'lan-lan10'
        option proto 'none'
        option device 'br-lan10'
        option defaultroute '0'
        option peerdns '0'
        option delegate '0'

config wifi-iface 'wifinet1'
	option device 'radio0'
	option mode 'ap'
	option ssid 'lan10'
	option network 'lan-lan10'
      option disabled '0'
1 Like

First, thanks to the developers who got this image baked for us to download. It's really cool to get 802.11r on mikrotik with openwrt. I'm trying to get my device working with OpenWRT. I am a dev, but no experience with wifi or embedded. My goal is to use this as a dumb access point: I want to bring in tagged VLAN traffic on the wan port and split into three SSIDs. I have three other devices with this same vlan setup, each different hardware (archer a7, nighthawk 6700, eap615)

I'm having issues with my device crashing. It seems to happen when I use wifi. I first feared power issues, so used the OEM PSU. After reading logs, I see there are kernel warnings and after some amount of traffic the device becomes unresponsive on all interfaces. I can get some throughput some times, but generally it crashes before completing a web speed test.

my setup:

  • running openwrt-ipq40xx-mikrotik-mikrotik_cap-ac-initramfs-kernel.bin
  • ram fs; not flashed, netbooting each time
  • installing luci to get GUI since i'm not quick with scp/files/uci
  • wan port on a bridge
  • bridge vlan filtering; i think this is the "new" DSA technique

Log output:

Thu May 11 21:09:07 2023 kern.err kernel: [ 1954.481329] ath10k_ahb a000000.wifi: Cannot communicate with firmware, previous wmi cmds: 36965:165144 40859:165144 37004:164840 36965:164736, jiffies: 165449, attempting restart restart firmware, dev-flags: 0 x142
...
Thu May 11 21:09:09 2023 kern.info kernel: [ 1956.225691] ieee80211 phy1: Hardware restart was requested
Thu May 11 21:09:09 2023 kern.err kernel: [ 1956.227298] ath10k_ahb a800000.wifi: firmware crashed! (guid 62fde83e-073b-4519-8de9-b295182da434)
Thu May 11 21:09:09 2023 kern.info kernel: [ 1956.230223] ath10k_ahb a800000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000
Thu May 11 21:09:09 2023 kern.warn kernel: [ 1956.231933] ath10k_ahb a000000.wifi: removing peer, cleanup-all, deleting: peer 60374022 vdev: 0 addr: 18:fd:74:1c:b3:99
Thu May 11 21:09:09 2023 kern.info kernel: [ 1956.239152] ath10k_ahb a800000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
Thu May 11 21:09:09 2023 kern.info kernel: [ 1956.255918] ieee80211 phy0: Hardware restart was requested
Thu May 11 21:09:09 2023 kern.info kernel: [ 1956.263192] ath10k_ahb a800000.wifi: firmware ver 10.4b-ct-4019-fW-13-5ae337bb1 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 6b2b5c5b
Thu May 11 21:09:09 2023 kern.info kernel: [ 1956.279477] ath10k_ahb a800000.wifi: board_file api 1 bmi_id N/A crc32 6909f41a
Thu May 11 21:09:09 2023 kern.info kernel: [ 1956.301625] ath10k_ahb a800000.wifi: htt-ver 2.2 wmi-op 6 htt-op 4 cal pre-cal-file max-sta 32 raw 0 hwcrypto 1
client_loop: send disconnect: Broken pipe

Any answers would be helpful, also wondering...
Has anyone else gotten tagged vlans and 2+ SSIDs working with this hardware?
Has anyone seen similar output to this?
Is this a common failure mode?
Is this because I haven't flashed my onboard storage? I want to find out why I'm crashing before flashing if possible.
Do I need to post more info?

Quite possibly. ath10k is memory hungry. On devices with (relatively) little memory, a custom package kmod-ath10k-ct-smallbuffers is used which reduces ath10k memory usage, but because of OpenWrt build system limitations, it does not get used in the initramfs images built with buildbot (TARGET_PER_DEVICE_ROOTFS, maybe) settings. I cannot remember, but there may also be issues replacing packages in the initramfs build. Check with opkg list-installed | grep ath10k on device to confirm. Once you install, and reboot, you should get the smallbuffers variant.

There is some work being done to make this a module option, and/or automatic, rather than a different compiled ath10k build: https://github.com/openwrt/openwrt/pull/11584
If you build your own image, building for only this device may work, otherwise you can switch ath10k to the smallbuffers variant in the target level Makefile: https://github.com/openwrt/openwrt/blob/0ce356bbba44ae573aca7104ca4d547bcdf816c5/target/linux/ipq40xx/Makefile#L19.

ath10k-ct has some additional options for configuring the wifi firmware, but very few should need them: https://www.candelatech.com/ath10k-10.4.php

1 Like