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

Hi guys,

Even though I was able to install the snapshot build and everything seemed to work, it appeared that wifi range is very low. Within 1.2meters away SpeedTest on wifi shows ~95mbps (it's around limit of my ISP plan), within ~5 meters only ~2mbps, in 7m -- it drops connection immediately (some devices just don't see the endpoint), while initial mikrotik firmware was able to keep connection stable within 20meters (and 2 walls).

I've tried playing with channels, channels' width, country, disabling 2.4G -- nothing helps. Any ideas how to debug, localize a cause and/or configure?

Can you try removing the board-2.bin from /lib/firmware/ath10k?
Its a bug for it to be included on Mikrotik subtarget, the patch for it is pending

1 Like

@robimarko it helped! 80mbps in the furthest room without changing anything else. Thanks a lot!
P.s. jic exact path was /lib/firmware/ath10k/QCA4019/hw1.0/

Great to bear that, I will see about speeding up merging of the patch for that

1 Like

It was merged now, so next snapshots should work out of the box.

2 Likes

...pls see my (poor) perfomance trial tests with a hap-ac3 and cap-ac here: Adding OpenWrt support for MikroTik cAP ac - #86 by VanillaFord

Hey @robimarko

JIC I sysupgraded my ac3 a ~week ago to 22.03-rc5 all seems to work well that far without any special hacks (wire & wireless).

Great to hear that

And which file do I need to name as "vmlinux" which gets TFTPed to the device? The initramfs or the sysupgrade? Thx.

For TFTP boot you usually send the initramfs image.

1 Like

I tried but that did not work. The device successfully passed DHCP, downloaded the file via TFTP, but I was never able to reach it on the OWRT default IP. Have no serial access yet, so cant confirm what went wrong.

FYI,this is a hAP ac³ LTE6 kit version but as to my knowledge it is exactly the same as the hAP ac³ plus a mini-PCI port. So theoretically it should boot with the hAP ac³ initramfs image.

MOD: after adding serial, this is what I see:

Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset),  D - Delta,  S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.BF.3.1.1-00096
S - IMAGE_VARIANT_STRING=DAABANAZA
S - OEM_IMAGE_VERSION_STRING=CRM
S - Boot Config, 0x00000021
S - Core 0 Frequency, 0 MHz
B -       262 - PBL, Start
B -      1341 - bootable_media_detect_entry, Start
B -      1682 - bootable_media_detect_success, Start
B -      1697 - elf_loader_entry, Start
B -      5104 - auth_hash_seg_entry, Start
B -      7269 - auth_hash_seg_exit, Start
B -    577861 - elf_segs_hash_verify_entry, Start
B -    694158 - PBL, End
B -    694183 - SBL1, Start
B -    782768 - pm_device_init, Start
D -         6 - pm_device_init, Delta
B -    784289 - boot_flash_init, Start
D -     45976 - boot_flash_init, Delta
B -    834463 - boot_config_data_table_init, Start
D -      3864 - boot_config_data_table_init, Delta - (419 Bytes)
B -    841647 - clock_init, Start
D -      7561 - clock_init, Delta
B -    853733 - CDT version:2,Platform ID:8,Major ID:1,Minor ID:0,Subtype:0
B -    857221 - sbl1_ddr_set_params, Start
B -    862207 - cpr_init, Start
D -         2 - cpr_init, Delta
B -    866699 - Pre_DDR_clock_init, Start
D -         4 - Pre_DDR_clock_init, Delta
D -     13147 - sbl1_ddr_set_params, Delta
B -    879977 - pm_driver_init, Start
D -         2 - pm_driver_init, Delta
B -    951827 - sbl1_wait_for_ddr_training, Start
D -        30 - sbl1_wait_for_ddr_training, Delta
B -    967591 - Image Load, Start
D -    143575 - QSEE Image Loaded, Delta - (267732 Bytes)
B -   1111668 - Image Load, Start
D -      1445 - SEC Image Loaded, Delta - (2048 Bytes)
B -   1121955 - Image Load, Start
D -     16696 - APPSBL Image Loaded, Delta - (29260 Bytes)
B -   1139070 - QSEE Execution, Start
D -        58 - QSEE Execution, Delta
B -   1145198 - SBL1, End
D -    453125 - SBL1, Delta
S - Flash Throughput, 1853 KB/s  (299459 Bytes,  161589 us)
S - DDR Frequency, 672 MHz

Event when the TFTP upload of the initramfs file is done, nothing changes on the serial output.

MOD2: after changing the boot order from try-nand_then_ethernet to try_ethernet_then_nand the unit booted to initramfs successfully.

Next question is if I can just sysupgrade the unit? this is the mtd table:

root@OpenWrt:/tmp# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00080000 00010000 "Qualcomm"
mtd1: 00080000 00010000 "RouterBoot"
mtd2: 00002000 00010000 "hard_config"
mtd3: 00007e24 00010000 "dtb_config"
mtd4: 00001000 00010000 "soft_config"

Can i use this for flashing ROS > V6.46.6 ? Any other way ?

If you have any working OpenWRT devices already (this isn't your first to flash), the tftp server built into stock OpenWRT already handles booting newer Mikrotik devices just fine. It supports bootp (the ancient technology Mikrotik uses instead of DHCP booting) right out of the box. I've done that for ages, and didn't even realize/notice there was an issue with flashing the newer firmwares for over a year.

Unfortunately that's no help if this is your first OpenWRT device, but if it's not, that's very much the way to go.

1 Like

There is a solution for windows:

This modified tftpd64 does bootp and tftp so it can be used to feed OWRT initramfs (or other) images to MikroTik devices. Important thing is to make sure the device is on version 6 ROS and bootloader, and not version 7.

1 Like

RBwAPG-5HacD2HnD r3 6.46.8
Linux OpenWrt 5.10.138 #0 SMP Sat Sep 3 02:55:34 2022 armv7l GNU/Linux
ipq40xx/mikrotik arm_cortex-a7_neon-vfpv4'
'OpenWrt 22.03.0 r19685-512e76967f'

What i needed to do additionaly is set MAC<>IP mapping for dnsmasq

and bootp server IP and filename:

Flashing works also with RouterOS > 6.46.6

Got a better solution

just add

bootp-dynamic

to /etc/dnsmasq.conf

and dnsmasq dhcp/bootp will also serve bootp requests:

daemon.info dnsmasq-dhcp[1]: BOOTP(br-lan) 192.168.1.102 2c:c8:1b:6e:XX:XX
daemon.info dnsmasq-tftp[1]: sent /tmp/tmp/owrt.bin to 192.168.1.102

hope this helps someone with MikroTik APs that want to switch from RouterOS to OWRT.

1 Like

I just bricked my hap ac3 lte6-kit.

I had such mtd table:

root@OpenWrt:/tmp# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00080000 00010000 "Qualcomm"
mtd1: 00080000 00010000 "RouterBoot"
mtd2: 00002000 00010000 "hard_config"
mtd3: 00007e24 00010000 "dtb_config"
mtd4: 00001000 00010000 "soft_config"

I loaded latest build via netboot, and did

ubidetach -m 1
ubiformat /dev/mtd1 -y 
ubiattach -m 1
sysupgrade -v openwrt-ipq40xx-mikrotik-mikrotik_hap-ac3-squashfs-nand-sysupgrade.bin

After that, after boot ac3 turn on all lights. There is no packets send on any interface, reset for 5, 10, 15 and 300 seconds does not help.

Is there any option to unbrick it?

First of all, you are in the wrong topic.

https://forum.openwrt.org/t/adding-support-for-mikrotik-hap-ac3-lte6-kit-d53gr-5hacd2hnd/

Second, you loaded the wrong image, with the wrong method. The Hap AC3 is not completely the same as at Hap AC3 LTE6 kit. You need to recover to ROS version 6 via netboot, and then start again based on the commit message of the LTE6 kit and NOT the one you mentioned.

Thank you, you are true.

The only on issue is that mikrotik does not send any packets at all. Netboot is not working. Is there any other options?