Support for Mikrotik Hap AC2

I haven't performed an iPerf 3 test but I transferred a movie from my phone to my laptop (both 2x2 wave2 clients over 5GHz) at 250-300mbps.

Phone is Xiaomi X3 NFC and laptop is 2017 Helios 300.

successfully compiled for the hAPac2 and installed the image using dhcp/tftp, followed by sysupgrade to make it permanent.
Could somebody document the 'config device' items in /etc/config/network and why they are needed in this Mikrotik ipq40xx hardware? This type of 'config device' entry is not documented in general OpenWrt documentation and I'd like to understand the what and why.
Other than that everything went smooth and I can now use this device as AP with all physical interfaces bridged (5 x ethernet + 2 x wifi). Did away with the wan items in 'network' and added eth1 to the bridge, together with wlan0 and wlan1.
A big thank you to all that made OpenWrt come to life on this device!

Any a new builds of OpenWRT are available for hAP ac2?

Thanks.

24.04.2021 last build link

1 Like

How install this (https://downloads.openwrt.org/releases/21.02.0-rc1/targets/ipq40xx/mikrotik/) on Hap AC2 if possible?

Good news, support for this board should be backported on time for OpenWrt 21.02 (see pull request). However, there is still an issue I'm investigaging, where on some boards the wifi interfaces don't work because of missing calibration data.

If you have a hap-ac2 device running on OpenWrt, it would be very helpful to:

  • describe your board (approx. date of purchase, hardware revision). For instance I have one that was bought in october 2019, has /939/r2 written on the back, and its MAC starts with 74:4D:28
  • copy-paste the partition layout from dmesg, for instance mine is:
[    0.746135] spi-nor spi0.0: w25q128jv (16384 Kbytes)
[    0.746199] 3 fixed-partitions partitions found on MTD device spi0.0
[    0.751062] Creating 3 MTD partitions on "spi0.0":
[    0.757427] 0x000000000000-0x000000080000 : "Qualcomm"
[    0.763004] 0x000000080000-0x000000100000 : "RouterBoot"
[    0.772971] 3 routerbootpart partitions found on MTD device RouterBoot
[    0.773003] Creating 3 MTD partitions on "RouterBoot":
[    0.778977] 0x00000000e000-0x00000000f000 : "hard_config"
[    0.784993] 0x000000010000-0x000000017bbc : "dtb_config"
[    0.790390] 0x00000003d000-0x00000003e000 : "soft_config"
[    0.795860] 0x000000100000-0x000001000000 : "firmware"

I'm interested to see if there is always a gap between hard_config and dtb_config, see http://lists.openwrt.org/pipermail/openwrt-devel/2021-April/034911.html for details.

1 Like

I just installed the latest snapshot. Everything seems fine until now.

Can't remember date of purchase
MAC starts with 74:4d:28
SN ends with /939/r2

[    0.630984] spi-nor spi0.0: w25q128jv (16384 Kbytes)
[    0.631049] 3 fixed-partitions partitions found on MTD device spi0.0
[    0.635947] Creating 3 MTD partitions on "spi0.0":
[    0.642337] 0x000000000000-0x000000080000 : "Qualcomm"
[    0.647880] 0x000000080000-0x000000100000 : "RouterBoot"
[    0.657922] 3 routerbootpart partitions found on MTD device RouterBoot
[    0.657953] Creating 3 MTD partitions on "RouterBoot":
[    0.663868] 0x00000000e000-0x00000000f000 : "hard_config"
[    0.669871] 0x000000010000-0x000000017bbc : "dtb_config"
[    0.675406] 0x00000003d000-0x00000003e000 : "soft_config"
[    0.680612] 0x000000100000-0x000001000000 : "firmware"
[    0.690140] 2 minor-fw partitions found on MTD device firmware
[    0.690173] Creating 2 MTD partitions on "firmware":
[    0.695977] 0x000000000000-0x0000002e0000 : "kernel"
[    0.701957] 0x0000002e0000-0x000000f00000 : "rootfs"
[    0.706822] mtd: device 7 (rootfs) set to be root filesystem
[    0.711214] 1 squashfs-split partitions found on MTD device rootfs
[    0.716599] 0x0000005e0000-0x000000f00000 : "rootfs_data"

I do not have any /sys/firmware/mikrotik/hard_config/wlan_data/ directory, but a file /sys/firmware/mikrotik/hard_config/wlan_data

hi @bjonglez

sn: /050/r2
mac: 08:55:31

dmesg:

[    0.754045] spi-nor spi0.0: w25q128jv (16384 Kbytes)
[    0.754113] 3 fixed-partitions partitions found on MTD device spi0.0
[    0.759089] Creating 3 MTD partitions on "spi0.0":
[    0.765463] 0x000000000000-0x000000080000 : "Qualcomm"
[    0.771074] 0x000000080000-0x000000100000 : "RouterBoot"
[    0.781044] 3 routerbootpart partitions found on MTD device RouterBoot
[    0.781077] Creating 3 MTD partitions on "RouterBoot":
[    0.786959] 0x00000000e000-0x00000000f000 : "hard_config"
[    0.793049] 0x000000010000-0x000000017bbc : "dtb_config"
[    0.798479] 0x00000003d000-0x00000003e000 : "soft_config"
[    0.803885] 0x000000100000-0x000001000000 : "firmware"

ls -l /sys/firmware/mikrotik/hard_config/wlan_data/
-r--------    1 root     root             0 May  2 00:40 data_0
-r--------    1 root     root             0 May  2 00:40 data_2

Date of purchase: October 2018
Early revision with 256MB of RAM (Nanya NT5CC128M16IP-DI)
S/N ends with /809, MAC starts with CC:2D::E0

[ 0.634202] spi-nor spi0.0: w25q128jv (16384 Kbytes)
[ 0.634564] 3 fixed-partitions partitions found on MTD device spi0.0
[ 0.639649] Creating 3 MTD partitions on "spi0.0":
[ 0.646042] 0x000000000000-0x000000080000 : "Qualcomm"
[ 0.651622] 0x000000080000-0x000000100000 : "RouterBoot"
[ 0.661519] 3 routerbootpart partitions found on MTD device RouterBoot
[ 0.661556] Creating 3 MTD partitions on "RouterBoot":
[ 0.667521] 0x00000000e000-0x00000000f000 : "hard_config"
[ 0.673603] 0x000000010000-0x000000018251 : "dtb_config"
[ 0.679020] 0x00000003d000-0x00000003e000 : "soft_config"
[ 0.684417] 0x000000100000-0x000001000000 : "firmware"

Wireless interfaces working as expected. However I can't get MIMO on 5ghz, just on 2.4ghz. Dmesg shows only 128MB of RAM instead of the full 256MB. And no other issues, except:

[ 558.220630] ath10k_ahb a800000.wifi: Firmware lacks feature flag indicating a retry limit of > 2 is OK, requested limit: 4

It seems like neither the mac address start nor serial number end are indicating the longer hard_config.
@bjonglez, could you please give your factory routerboot version to see if that is different? My hap ac2 with 0x1000 hard_config is 6.44:

root@OpenWrt:~# cat /sys/firmware/mikrotik/hard_config/board_product_code 
RBD52G-5HacD2HnD
root@OpenWrt:~# cat /sys/firmware/mikrotik/hard_config/board_identifier 
hap-dk
root@OpenWrt:~# cat /sys/firmware/mikrotik/hard_config/booter_version 
6.44

I would also like a dd copy of the RouterBoot partition to investigate if you are happy to share it.

Cheers

@bjonglez
'New style' hAP ac^2 bought in Russia
Date of manufacture: 29 September 2019
Date of purchase: 13 December 2019
MAC starts with C4:AD:34
SN ends with /5D92/931

 -----------------------------------------------------
 OpenWrt SNAPSHOT, r16594-e8a5670122
 -----------------------------------------------------
[    0.631789] spi-nor spi0.0: w25q128jv (16384 Kbytes)
[    0.632001] 3 fixed-partitions partitions found on MTD device spi0.0
[    0.637085] Creating 3 MTD partitions on "spi0.0":
[    0.643476] 0x000000000000-0x000000080000 : "Qualcomm"
[    0.649020] 0x000000080000-0x000000100000 : "RouterBoot"
[    0.659027] 3 routerbootpart partitions found on MTD device RouterBoot
[    0.659059] Creating 3 MTD partitions on "RouterBoot":
[    0.665008] 0x00000000e000-0x00000000f000 : "hard_config"
[    0.671066] 0x000000010000-0x000000017bbc : "dtb_config"
[    0.676483] 0x00000003d000-0x00000003e000 : "soft_config"
[    0.681832] 0x000000100000-0x000001000000 : "firmware"
root@mikrotik:~# cat /sys/firmware/mikrotik/hard_config/board_product_code
RBD52G-5HacD2HnD
root@mikrotik:~# cat /sys/firmware/mikrotik/hard_config/board_identifier
hap-dk
root@mikrotik:~# cat /sys/firmware/mikrotik/hard_config/booter_version
6.43.10
root@mikrotik:~# ls -l /sys/firmware/mikrotik/hard_config/wlan_data/
-r--------    1 root     root             0 Apr 24 22:42 data_0
-r--------    1 root     root             0 Apr 24 22:42 data_2
root@mikrotik:~#

I have only one issue with the 100 Mbit/s leds Support for Mikrotik Hap AC2 - #283 by Blaze

Currently, the hard_config will always be seen with a size of 0x1000 on the system, because that's the default size in the routerbootparts driver. But from all the boot logs so far, there is always enough space for a 0x2000 partition (0x0e000-0x10000 instead of 0x0e000-0x0f000), so that means we can increase it safely, thanks everybody.

The board I have is kinda of strange because it's the first one I see where the hard_config data extends beyond 0x1000. But I saw other hap-ac2 boards where data was extending almost to the 0x1000 limit.

FYI routerboot version is 6.43.10 on my "strange" board so again it seems unrelated.

1 Like

Sure, here it is if you're curious about it.

1 Like
  • Ordered dec 2019 from/in the Netherlands
  • /923/r2
  • 74:4D:28
[    0.628780] spi-nor spi0.0: w25q128jv (16384 Kbytes)
[    0.629005] 3 fixed-partitions partitions found on MTD device spi0.0
[    0.634122] Creating 3 MTD partitions on "spi0.0":
[    0.640434] 0x000000000000-0x000000080000 : "Qualcomm"
[    0.646062] 0x000000080000-0x000000100000 : "RouterBoot"
[    0.656025] 3 routerbootpart partitions found on MTD device RouterBoot
[    0.656059] Creating 3 MTD partitions on "RouterBoot":
[    0.661998] 0x00000000e000-0x00000000f000 : "hard_config"
[    0.668025] 0x000000010000-0x000000017bbc : "dtb_config"
[    0.673557] 0x00000003d000-0x00000003e000 : "soft_config"
[    0.678753] 0x000000100000-0x000001000000 : "firmware"
[    0.691007] 2 minor-fw partitions found on MTD device firmware
[    0.691041] Creating 2 MTD partitions on "firmware":
[    0.695754] 0x000000000000-0x0000002e0000 : "kernel"
[    0.701898] 0x0000002e0000-0x000000f00000 : "rootfs"
[    0.706607] mtd: device 7 (rootfs) set to be root filesystem
[    0.711073] 1 squashfs-split partitions found on MTD device rootfs
[    0.716404] 0x0000005e0000-0x000000f00000 : "rootfs_data"

Hi to all

i am struggling with tagged WAN port
is somebody succeeded in adding tagged vlans on WAN?


config device 'wan_eth1_dev'
        option name 'eth1'
        option macaddr '08:55:31:7e:66:fe'

config device
        option type '8021q'
        option ifname 'eth1'
        option name 'eth1.200'

config interface 'w200'
        option proto 'dhcp'
        option ifname 'eth1.200'

i tried to capture with tcpdump/wireshark
and i don't see any vlan200 packet
wireshark show that it is vlan1 ?

what i am doing wrong ?

@NPeca75 The WAN port is not an independent device, just another port (number 5 for this device) on the internal switch that the Qualcomm driver mangles. Try to tag the port and cpu port on the switch as well. Check with swconfig.
/etc/config/network section something like:

config switch_vlan
	option device 'switch0'
	option vlan '20' # turns out vlan 200 is too high for the driver
	option vid '200'
	option ports '0t 5t'

config interface 'w200'
	option proto 'dhcp'
	option ifname 'eth1.200' # or maybe 'eth0.200'?

VLANs 1 and 2 are special because of the Qualcomm EDMA driver.

This works for me:

tail /etc/config/network 
config switch_vlan
	option device 'switch0'
	option vlan '20'
	option ports '5t 0t'

config switch_vlan
	option device 'switch0'
	option vid '200'
	option vlan '22'
	option ports '5t 0t'
swconfig dev switch0 show | tail -n 12
VLAN 1:
	vid: 1
	ports: 0 1 2 3 4 
VLAN 2:
	vid: 2
	ports: 0t 5 
VLAN 20:
	vid: 20
	ports: 0t 5t 
VLAN 22:
	vid: 200
	ports: 0t 5t 

hi @johnth

unfortnately, nope

here what i am find in swconfig

        pvid: 2
        link: port:5 link:up speed:1000baseT full-duplex txflow rxflow auto
VLAN 1:
        vid: 1
        ports: 0 1 2 3 4
VLAN 2:
        vid: 2
        ports: 0t 5

so i tried:
swconfig dev switch0 vlan 2 set ports '0t 5t'
to make tagged Vlan2
and it is working

unfortunately, it is working only on "whole" eth1
and only by hand from CLI
so i could write whatever i want in /etc/config/network it is hard coded to 2(U)
and most important, it is only one Vlan on whole ETH1
no multi Vlans/Trunk

big regression compared to ROS and/or other OpenWRT devices

my goal is mostly to use OpenWRT as managed switch+multi Vlan/SSID AP
So , Trunk on input (WAN) with few Vlans, every Vlan have own SSID + device act as managed switch transforming tagged to access ports. All this supported with SNMP+LibreNMS

I had the same issue, and I think I've found a workaround: https://github.com/openwrt/openwrt/pull/3037#issuecomment-835504399.

Is snapshot stable enough to use it as daily driver?

1 Like

No crashes since flashing it. Even when using experimental stuff that isn't supported in RouterOS like WPA3. Wireless signal also seems more resilient.
Disclaimer: no guarantees it will work the same for your board/configuration

Hopefully this will become a stable release soon. I've donated to the OpenWrt via Software Freedom Conservancy so they hopefully have enough money/time to approve this in the near future.

1 Like