Adding OpenWrt support for MikroTik cAP ac

My initial cAP ac PR https://github.com/openwrt/openwrt/pull/4055

  • cAP ac based dts file
  • cAP ac based BFS
  • LEDs are in better shape
  • VLANs ... as good as you can get with ipq40xx
2 Likes

ok, opened a new thread on the new wAP AC

1 Like

I built w/ the patches provided @alaraun and it now seems to work fine, including the leds, many tx!

However, I can only boot with the backup boot loader (holding the reset key while resetting). The routerboard had the firmware upgraded to 7.1b5 before flashing. This is a showstopper as the router will be installed in the ceiling.

Any ideas? Shall I try to netinstall and then downgrade the firmware? Maybe the newer bootloader will not work w/ the sysupgrade image installed after the netboot?

Thank you again.

Yes, you should install Openwrt on top of v6 series firmware.
Regards

1 Like

I'm not too familiar with the ipx40xx series, what kind of limitations on VLANs does it have?

2 Likes

Half year ago I successfully flashed OpenWrt to one cAP ac /r2. Now I bought an other model and cannot perform netboot of the initramfs image: It starts like

dnsmasq-dhcp: available DHCP range: 192.168.1.100 -- 192.168.1.200
dnsmasq-dhcp: vendor class: ARM__boot
dnsmasq-dhcp: DHCPDISCOVER(eth0) MAC-adress
dnsmasq-dhcp: tags: eth0
dnsmasq-dhcp: DHCPOFFER(eth0) 192.168.1.171 MAC-adress
dnsmasq-dhcp: requested options: 1:netmask, 3:router

after some time turns to:

vendor class: ARM__boot
dnsmasq-dhcp: DHCPREQUEST(eth0) 0.0.0.0 MAC-adress
dnsmasq-dhcp: DHCPNAK(eth0) 0.0.0.0 MAC-adress wrong network
dnsmasq-dhcp: broadcast response

and reboots to RouterOS

[admin@MikroTik] > system routerboard print
routerboard: yes
board-name: cAP ac
model: RBcAPGi-5acD2nD
revision: r3
firmware-type: ipq4000L
factory-firmware: 6.47.9
current-firmware: 6.48.3

Does it fail due to the third revision?

Made a clean install of the ROS LTS 6.47.10 and was able to flash OpenWrt successfully.
Seems, that at the previous upgrade of ROS something went wrong for my device. Now everything is fine.

First of all, thank you very much for this! I've been using alaraun's PR and was able to install it onto my Cap AC unit quickly.

I've noticed the device connection speed (5GHz WPA2 AES) is very different whether you use OpenWRT version in-RAM or the flashed one.

OpenWRT running in memory:
For default (00) country my iPhone connects at 780 Mbit/s.
For US, iPhone and Android phones constantly connect at 886.7Mbit/s.

OpenWRT flashed onto Cap AC device
For US, iPhone connects between 351Mbit/s and 650Mbit/s. Most of the times, it is 350Mbit/s or 520Mbit/s.

Is this common? I've compiled my initfarms and sysupgrade images from the same commit. The different between installations is that when I flashed OpenWRT onto the device, I've also connected it to my router to get the access to Internet.

Another thing I'm having issues with is getting my Cap AC device to act as a regular AP. I want to be able to extend my router to the wireless devices and bridge both ports on my Cap AC so that I can just use 1 network cable for power and management.
Could someone share their working configuration here?

Thank you!

No, there shouldn't be functional differences of this kind between initramfs- and sysupgrade builds.

Thank you for this information. Probably something was wrong with the way I've applied this build then. I just re-tested everything:

  1. flashed Mikrotik's RouterOS back onto the device
  2. compiled the new binary and tested initfarms image first.
  3. Flashed the sysupgrade image onto the device and re-tested the configuration. This time I've got consistent results for connection speed and iperf tests.

Now just need to figure out how to completely remove router functionality and make it as a regular AP...

Here are my configuration files for a regular access point.
Management = vlan9
Trusted network = vlan10
Untrusted (guest) network = vlan11
Please, avoid using vlan2 in your configuration.
In my setup I reduced the "Maximum transmit power" value to 6 dBm (2.4GHz) and 13 dBm (5GHz) to improve roaming between four APs.
Current firmware version: OpenWrt 21.02.0-rc3 r16172-2aba3e9784
I did not try OpenWrt 21.02.0-rc4 yet.

/etc/config/network

config interface 'loopback'
        option ifname 'lo'                
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'
                                          
config interface 'lan'
        option proto 'static'
        option ifname 'eth1.9'
        option ipaddr '192.168.1.11'
        option netmask '255.255.255.0'
        option gateway '192.168.1.1'
        list dns '1.1.1.1'
        list dns '8.8.8.8'
        option delegate '0'  
                                   
config interface 'wifi1'             
        option type 'bridge'          
        option proto 'none'           
        option ifname 'eth1.10'       
        option auto '1'   
        option delegate '0'
        option force_link '1'
                        
config interface 'wifi2'    
        option type 'bridge'
        option proto 'none'   
        option ifname 'eth1.11'
        option auto '1'    
        option delegate '0'  
        option force_link '1'
                        
config route                
        option interface 'lan'
        option target '0.0.0.0'
        option netmask '0.0.0.0'
        option gateway '192.168.1.1'
                             
config switch 'switch0'      
        option reset '1'
        option enable_vlan '1'
                                
config switch_vlan
        option device 'switch0'
        option vlan '9'
        option ports '0t 5t'

config switch_vlan              
        option device 'switch0'      
        option vlan '10'              
        option ports '0t 5t'
 
config switch_vlan
        option device 'switch0'
        option vlan '11'
        option ports '0t 5t'

/etc/config/wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option hwmode '11g'
	option path 'platform/soc/a000000.wifi'
	option htmode 'HT20'
	option country 'US'
	option cell_density '0'
	option channel '6'
	option txpower '16'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option mode 'ap'
	option ssid 'TRUSTED'
	option encryption 'psk2+ccmp'
	option key 'trusted-network'
	option network 'wifi1'
	option ieee80211r '1'
	option mobility_domain 'abcd'
	option ft_over_ds '1'
	option ft_psk_generate_local '1'

config wifi-iface 'wifinet2'
	option device 'radio0'
	option mode 'ap'
	option ssid 'GUEST'
	option encryption 'psk2+ccmp'
	option key 'guest-network'
	option network 'wifi2'
	option isolate '1'
	option ieee80211r '1'
	option mobility_domain 'abcf'
	option ft_over_ds '1'
	option ft_psk_generate_local '1'

config wifi-device 'radio1'
	option type 'mac80211'
	option channel '149'
	option hwmode '11a'
	option path 'platform/soc/a800000.wifi'
	option htmode 'VHT40'
	option country 'US'
	option cell_density '0'
	option txpower '20'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option mode 'ap'
	option ssid 'TRUSTED'
	option encryption 'psk2+ccmp'
	option key 'trusted-network'
	option network 'wifi1'
	option ieee80211r '1'
	option ft_over_ds '1'
	option ft_psk_generate_local '1'
	option mobility_domain 'abcd'

config wifi-iface 'wifinet3'
	option device 'radio1'
	option mode 'ap'
	option ssid 'GUEST'
	option encryption 'psk2+ccmp'
	option key 'guest-network'
	option network 'wifi2'
	option isolate '1'
	option ieee80211r '1'
	option mobility_domain 'abcf'
	option ft_over_ds '1'
	option ft_psk_generate_local '1'
1 Like

Thank you very much, this is very helpful!

Hi,

Could somebody please share original SPI flash image for CAP AC?
Somehow I manage to brick it while upgrading RouterOS, now I can't boot it via recovery mode but I'm hoping to flash it with SPI programmer to reveal it back to life.

Thanks!

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?

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.