Support for Mikrotik Hap AC2

If you like you can test my current build that I've compiled 2 weeks ago. It's pre-installed with bunch of packages I'm playing with (SQM, OpenVPN, WPA3, DDNS, dnscrypt-proxy2, Adblock etc.) but seems stable enough and I haven't noticed any issues with txpower or WiFi range in general. Though, there is no added support for external storage or usb.

I would like to thank @geminis3 for build instructions and all contributors for making this small router useful. Keep up good work and let's hope for stable branch in the future :+1:.

2 Likes

@Xarlith thanks for firmware. Awesome to have Adblock in my MikroTik.
Where is Adblock can be activated in config at the build step or this package can be installed manually (any deps for Adblock package)?

Regards,
Blaze

can you install mwan3 on this build/kernel ? thx

As long as snapshot's dependencies are still met you should be able to install it yourself with the package manager.

Additional packages were activated at build step just because dependencies in snapshots repository change constantly and I wanted a build that can be flashed and ready to go anytime in the future. No special kernel modules are required for adblock.

@geminis3 and probably @f00b4r0 I have tried your build instructions and stuck on these errors:

# git clone https://github.com/openwrt/openwrt.git
Cloning in "openwrt" ...
remote: Enumerating objects: 41, done.
remote: Counting objects: 100% (41/41), done.
remote: Compressing objects: 100% (35/35), done.
remote: Total 535173 (delta 11), reused 20 (delta 6), pack-reused 535132
Receiving objects: 100% (535173/535173), 185.25 MiB | 3.02 MiB/s, done.
Definition of changes: 100% (365671/365671), done.

# cd openwrt

# git remote add foobar https://github.com/f00b4r0/openwrt.git

# git fetch foobar
remote: Enumerating objects: 391, done.
remote: Counting objects: 100% (391/391), done.
remote: Total 777 (delta 391), reused 391 (delta 391), pack-reused 386
Receiving objects: 100% (777/777), 154.98 KiB | 762.00 KiB/s, done.
Change detection: 100% (457/457) completed with 138 local objects.
From https://github.com/f00b4r0/openwrt
 * [new branch] 18.06.4-bp -> foobar/18.06.4-bp
 * [new branch] 18.06.8-bp -> foobar/18.06.8-bp
 * [new branch] 07.19.3-bp -> foobar/07.19.3-bp
 * [new branch] broken-v18.06.1-bp -> foobar/broken-v18.06.1-bp
 * [new branch] f00fixes -> foobar/f00fixes
 * [new branch] hAP-ac2-cleanup -> foobar/hAP-ac2-cleanup
 * [new branch] hap-ac2 -> foobar/hap-ac2
 * [new branch] lede-17.01 -> foobar/lede-17.01
 * [new branch] master -> foobar/master
 * [new branch] openwrt-18.06 -> foobar/openwrt-18.06
 * [new branch] rbfixes -> foobar/rbfixes
 * [new branch] rbspifixes -> foobar/rbspifixes
 * [new branch] v18.06.0-bp -> foobar/v18.06.0-bp
 * [new branch] v18.06.1-bp -> foobar/v18.06.1-bp

# git merge foobar/hAP-ac2-cleanup
Auto-merge target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch
CONFLICT (content): Merge conflict at target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch
Auto-merge target/linux/ipq40xx/image/Makefile
Auto-merge target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
Auto-merge target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
Auto-merge target/linux/ipq40xx/base-files/etc/board.d/02_network
CONFLICT (content): Merge conflict at target/linux/ipq40xx/base-files/etc/board.d/02_network
Auto-merge target/linux/ipq40xx/Makefile
Auto-merge target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c
Auto merge package/firmware/ipq-wifi/Makefile
CONFLICT (content): Merge conflict in package/firmware/ipq-wifi/Makefile
The automatic merge failed; fix conflicts and commit the result.

# git rebase
package/firmware/ipq-wifi/Makefile: needs merge
target/linux/ipq40xx/base-files/etc/board.d/02_network: needs merge
target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch: needs merge
error: rebase failed: You have un-indexed changes.
error: Also, there are uncommitted changes in your index.
error: Make a commit or hide them.

# git merge foobar/hAP-ac2-cleanup
error: Unable to merge because you have files that are not merged.
hint: Correct them in the working directory, then run "git add/rm <file>",
hint: to flag the fix and commit.
fatal: Exit due to unresolved conflict.

# uname -a
Linux porteus 5.8.12-porteus # 2 SMP Sun Sep 27 12:52:11 UTC 2020 x86_64 GNU/Linux

Model: MS-7A12 1.0
 OS: Arch Linux x86_64
 Kernel: 5.8.12-porteus
 Uptime: up 34 minutes
 Packages: 0
 Shell: bash 5.0.18
 Resolution: 1920x1080
 DE: XFCE
 WM: Xfwm4
 WM Theme: Default
 Theme: Adwaita [GTK2], Raleigh [GTK3]
 Icons: NuoveXT2 [GTK2/3]
 Terminal: Xfce4-terminal
 CPU: Intel Core i5-6600K (4) @ 3.9GHz
 GPU: AMD Radeon R7 360
 Memory: 556MB/15982MB

Which skin is this that you are using?

openwrt2020

1 Like

Thanks for the build. Been running this last few days and it seems pretty stable. I am using the 5Ghz radio in client mode for my WAN uplink. Speeds are actually much better that I was getting with router OS.
Also my first time trying openwrt. Getting the PXE installation to work was the hardest. But once installed, open wrt's webui is very intuitive.

1 Like

this build is very responsive when open it via browser, i use for dumb AP

I want try to complie my own build. Can you provide the link to me how to complie the build ?

Thanks

This is how to build firmware >>> Support for Mikrotik Hap AC2
but at this moment as I pointed here:
https://github.com/openwrt/openwrt/pull/3037#issuecomment-703524463
the build can't be successful, because we have:

Conflicting files
package/firmware/ipq-wifi/Makefile
target/linux/ipq40xx/base-files/etc/board.d/02_network
target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch

This is my how to.

  1. Download ISO nemesis-xfce-20.10.11-k5.4.50-x86_64.iso (Arch Linux version of Porteus)
    http://www.mediafire.com/file/z7aa9e5fjv7mar6/nemesis-xfce-20.10.11-k5.4.50-x86_64.iso/file

Logins and passwords (look at this screenshot):
porteus-min

  1. Install Nemesis on your flash drive or HDD >>> https://pastebin.com/czT9QPx2
    NOTE. File system that you will be clone openwrt must to be POSIX filesystem (like as ext2, ext4...) and to have a good supply of free space.
    By default all changes will be saved on /mnt/sdb1 (look at option changes=/dev/sdb1 in /boot/syslinux/porteus.cfg)
    Warning! /mnt/sdb1 must to be POSIX filesystem (like as ext2, ext4...)

  2. Boot up from your USB Flash drive or HDD
    Nemesis via second menu - Xfce (changes)

  3. Open terminal and run these commands:

su
toor
export FORCE_UNSAFE_CONFIGURE=1
env FORCE_UNSAFE_CONFIGURE=1
setup-pman
# where is /mnt/sdb1 is POSIX filesystem (like as ext2, ext4...)
cd /mnt/sdb1/
pacman -Syu
pacman -S bash bc bin86 binutils bzip2 cdrkit coreutils diffutils fastjar file-roller findutils firefox flex gawk gcc gettext git intltool libusb libxslt make ncurses openssl patch perl-extutils-makemaker pkgconf python3 rsync sharutils time unzip util-linux wget zlib
git clone https://github.com/openwrt/openwrt.git
cd openwrt
git remote add foobar https://github.com/f00b4r0/openwrt.git
git fetch foobar
git config --global user.email "here-is-your@email.com"
git config --global user.name "here-is-your-nikname"
git merge foobar/hAP-ac2-cleanup
git rebase
./scripts/feeds update -a && ./scripts/feeds install -a
# copy your .config to openwrt/
# you can rename config.buildinfo from ready mikrotik hap-ac2 firmware to .config
# and copy this .config to openwrt/
# press Ctrl+H to see hidden files and folders
make menuconfig
make -j4 V=cs
# (where 4 is CPU core - look at your PC configuration)
# share your build of firmware for community.

#NOTE.
#Initial compilation takes like an hour but subsequent builds are fast, make sure to run each time you rebase (aka update local OpenWRT repo)
./scripts/feeds update -a && ./scripts/feeds install -a
make clean

I try to install openwrt but fail. I follow this link


but no luck. I use tiny pxe and "Method 3 - Use a running RouterOS to enable TFTP netboot" to install

Fixed merge conflicts, rebase working good now

I'm going to build an image now to check if it works

I have rebased the tree and pushed it.
So all of the conflicts are resolved.

You can build again by getting the latest tree

1 Like

yeah, but it doesn't includes the multi caldata fixes by @f00b4r0 for newer units?

If you can send me a link to the patch I can include that too.

1 Like

btw I already compiled it from my repo

EDIT: the build it's working as expected on my unit

Hm, I tested that and it actually breaks caldata extract on my board.
So, I cant include that.

1 Like

Those LED-s are driven by the PHY-s directly, by default PHY only enables the gigabit ones and not 10/100 ones.
QCA fixes that up in U-boot usually but Mikrotik does it from userspace.
My hAP has been out of the case all of the time, so I did not notice it.

I have a PR for a proper PHY driver, so I might as well integrate this as well for these cases.

2 Likes