Trying to get OpenWrt running on RouterBOARD wsAP 5Hac2nD

Has anyone been able to get openwrt-ar71xx-mikrotik-rb-nor-flash-16M-ac-initramfs-kernel.bin to run and give access to the shell on one of these RBwsAP-5Hac2nD routers by Mikrotik? Because console is disabled on this gear it's difficult to see what's going on. When I TFTP the Openwrt firmware it appears to be working but I have no access on any interface. They are nearly identical to the RB952Ui-5ac2nD which works except with 2 less ports on the switch.

Chances of success are pretty low to add support for a new device, so without console to be able to see what’s happening ...

Thanks Sparks
I guess that's why I'm here asking in case someone has any other ideas. I've been compiling from the 19.07.2 build and hoping to get lucky with the firmware recognising it and setting up the network correctly.
I've been pretty much following the commit for the RB952Ui-5ac2nD and adding the wsAP-5Hac2nD in the same files. But you're correct chances are pretty low without the console so I'm hoping trial and error would get me in. It definitely seems like it's not setting up the network correctly so any input is appreciated.

1 Like

If you’re game, pop the case open and take some hires photos and post them here. Maybe console pinout is hidden/buried?

Other devices people have found ways to get a telnet daemon running by exporting a oem firmware config backup, adding/ modifying values then restoring the config onto the device .

Thanks Sparks
I had already opened it up to see if it had a serial console marked on the board and there is some random pads on the board but my understanding is the Mikrotik disable the console in the bootloader.
This isn't my image I got it off the net but you can see the pads I'm talking about.

There is UART on those pads, but its disabled in the hwconfig bits.
It can be enabled if you can dump the SPI flash

1 Like

Thanks but I have no idea how to do that.

Howdy. I have a bus pirate and I'm comfortable with SPI flash. I've just ordered one of these units because I needed 802.3af POE input. I'm not familiar with the porting process for this type of thing, however. Are there guides that would apply?

There aren't really any particularly good guides, because adding support for a new device takes so much knowledge that most information is just simply assumed to be known already. The wiki provides a couple of relevant documents, but that's about it:

Collecting as much information as possible should always be the first step, then one might look into what devices are already supported -- there may very well already be something that is reasonably close and could just be modified.

I managed to dump the SPI flash:

If you do want to add support for it:
First, make sure you can build an OpenWrt master branch image for one of the similar ath79 qca953x Mikrotik devices. I would try CONFIG_TARGET_ath79_mikrotik_DEVICE_mikrotik_routerboard-951ui-2nd=y
Then, make the same kinds of changes one of the previous qca953x add-device commits did:, just adjust to suit:

would suggest adding a custom build file with uci-defaults to enable wi-fi, so you still have access if the ethernet or switch settings are incorrect.

Then, build and BOOTP boot the initramfs image for your newly added device

Thanks for the pointers. I will try building and flashing the 951ui-2nd image and working from there. When the board boots a initramfs image over BOOTP, should I expect to see serial output? Or is there a patch I need to make to the bootloader to allow serial output?

I usually avoid running the wrong image, to avoid the slight chance of damaging hardware, but these devices are near identical. An extra LED and button, then different OpenWrt network config. Looking again, 952ui-5ac2nd has the ath10k PCI card like this device.

You should see serial output from when your image starts (OpenWrt decompressor, then Linux console). The bootloader (RouterBoot) will not output console if the bit for no_uart (LSB) in the HW options hard_config tag is set. You can change this, but should not need to unless you don't get any Linux console, ethernet, or wi-fi. Need it—see dropdown:

set Mikrotik bootloader console Provided the bootloader has console capability (some don't). From your dump, your hw_opts hardcfg tag is at offset `0xe048: 00 04 00 15 0c 29 40 01` LSB is at `0xe04f: 0x01`. Turn off no_uart by masking that with bit 0 unset: `0x01 | 0xfe = 0`. Then need to deal with the NOR minimum erase size to actually write it.

The BOOTP seems to be working, but I'm not seeing any ethernet activity. When I attach the TX pin (GPIO10) to my 3.3v serial dongle, weirdly enough that causes the device to not get to BOOTP. Under a normal boot all the LEDs flash for a moment, then LD600 is solid for 5s, then flashing for 5s, then BOOTP begins. With TX connected to a computer, all the LEDs come on and just stay on.

I just broke the TX pad off the board :frowning:. I'll try flashing an image with WiFi enabled just for kicks, and after that I'll get out the magnet wire and fix the TX pin and experiment some more.

Booyah! Thanks for the uci-defaults tip!
I'll see what i can get working on the Ethernet front.

Sounds like this may not the pin you think it is, then? If only board UART TX + GND is attached, nothing should be interrupted.

I've been there. It hurt.

Nice! Maybe start by checking dmesg & swconfig. Just ask if you get stuck or would like more help.

One note on 22.03; we have a small initramfs image size restriction, with slightly more room on master after, but if your image booted, great.

Okay, I'm making some progress.
All three Ethernet ports work, but they're all on "lan" which is eth0.
Here's what the datasheet has:

The WAN port is on P0, and the two LAN ports are on P1 and P2. I think what I need to do is have GMAC1 (eth1) driving the LAN switch, and then configure P0 to be mapped to GMAC1 (eth1). But I'm not sure how to configure the Mux that determines what GMAC0 talks to.

You could try what the map does for the eth0 node in DTS:

&eth0 {
	status = "okay";

	phy-handle = <&swphy0>;

	gmac-config {
		device = <&gmac>;
		switch-phy-swap = <1>;

The switch & gmac drivers are here in openwrt: There is also a switch-phy-addr-swap option.