Mikrotik RB912R-2nD

I got a Mikrotik RB912R-2nD which is the LtAP Mini. It runs the same SoC as the RB951Ui-2nD and same flash/memory size. So I assumed I could get OpenWRT to load without issue. So far no such luck. What would be needed to get OpenWRT running on this device? I've got a OpenWRT environment setup so I can compile so willing to give anything a try.

-NVRDUNN

The following is the boot info:

    Board type: RB912R-2nD
 Serial number: 877Axxxxxxxx

Firmware version: 6.42
CPU frequency: 650 MHz
Memory speed: 300 MHz
Memory size: 64 MiB
Storage size: 16 MiB
Build time: 2018-04-13 11:06:05

Looks like I just need to get the machine ID added?

[ 0.000000] MIPS: no machine found for id 'ltap-hb', supported machines:

NVRDUNN

There was a PR submitted for this which got merged to master:

https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=6570f3c93aa4110efd1466a6b89742c2e11d7c11

Please help me understand: Why is a commit regarding fix RB941-2nD detection relevant for RB912R-2nD?

Fully agreed that the reply was a bit vague :slight_smile:
I was wondering if this was another case of the "RB" part being added to the string suddenly ..

Regards

I did more digging yesterday and it looks like the hardware is very similar to the rbwapr-2nd. Same SoC, no additional switch or WiFi chips, mPCIe and such. The 912R adds on board GPS. Since I have a build environment setup, I will attempt to add this device following the changes used for the rbwapr-2nd.

Using the RBWAPR-2ND as a reference, got the 912R to boot OpenWRT and now sees the Ethernet interface:

[ 0.126460] MIPS: machine is MikroTik RouterBOARD RB912R-2nD

I can access LuCI but when I try to perform the sysupgrade with "openwrt-ar71xx-mikrotik-rb-nor-flash-16M-squashfs-sysupgrade.bin" I get the following two errors in the system log:

Tue Feb 12 19:38:13 2019 daemon.err uhttpd[1042]: Image check 'platform_check_image' failed.
Tue Feb 12 19:38:26 2019 daemon.err uhttpd[1042]: Image check 'fwtool_check_image' failed.

Not sure what I need to fix to load the upgrade. Any guidance would be great.

There is a patch for this platform.
Be sure that you are building 16 MB image (not large as for 951ui).
I've checked that initframs and sysupgrade working.

From 3f62237292a1b94f1f68d72b8d6a6c402535d218 Mon Sep 17 00:00:00 2001
From: Alexander Rumyankov <alex@rumyankovs.com>
Date: Wed, 24 Apr 2019 09:53:10 -0400
Subject: [PATCH] add support for RB912R-2nD

---
 target/linux/ar71xx/base-files/etc/board.d/01_leds     | 1 +
 target/linux/ar71xx/base-files/etc/board.d/02_network  | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh             | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh           | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh | 2 ++
 target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c | 2 ++
 target/linux/ar71xx/files/arch/mips/ath79/machtypes.h  | 1 +
 target/linux/ar71xx/image/mikrotik.mk                  | 2 +-
 8 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index 887d41f..bbda22a 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -691,6 +691,7 @@ rb-mapl-2nd)
 	ucidef_set_led_netdev "lan" "LAN" "rb:green:eth" "eth0"
 	ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt"
 	;;
+rb-ltap-hb|\
 rb-wap-2nd)
 	ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000"
 	ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network
index 5874384..341c1f7 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -113,6 +113,7 @@ ar71xx_setup_interfaces()
 	rb-sxt2n|\
 	rb-sxt5n|\
 	rb-wap-2nd|\
+	rb-ltap-hb|\
 	rb-wapg-5hact2hnd|\
 	re355|\
 	re450|\
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index a7b3c9a..c76b01d 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -379,6 +379,7 @@ get_status_led() {
 	rb-lhg-5nd|\
 	rb-map-2nd|\
 	rb-mapl-2nd|\
+	rb-ltap-hb|\
 	rb-wap-2nd)
 		status_led="rb:green:user"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 8fcc116..14b66e6 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -1112,6 +1112,9 @@ ar71xx_board_detect() {
 	*"RouterBOARD wAP 2nD r2")
 		name="rb-wap-2nd"
 		;;
+	*"RouterBOARD RB912R-2nD")
+		name="rb-ltap-hb"
+		;;
 	*"RouterBOARD wAP G-5HacT2HnD")
 		name="rb-wapg-5hact2hnd"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index f1ab934..787c6ae 100644
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -716,6 +716,7 @@ platform_check_image() {
 	rb-map-2nd|\
 	rb-mapl-2nd|\
 	rb-wap-2nd|\
+	rb-ltap-hb|\
 	rb-wapg-5hact2hnd)
 		return 0
 		;;
@@ -742,6 +743,7 @@ platform_pre_upgrade() {
 	rb-map-2nd|\
 	rb-mapl-2nd|\
 	rb-wap-2nd|\
+	rb-ltap-hb|\
 	rb-wapg-5hact2hnd)
 		# erase firmware if booted from initramfs
 		[ -z "$(rootfs_type)" ] && mtd erase firmware
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
index a9f3fc9..265c830 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
@@ -14,6 +14,7 @@
  *  - MikroTik RouterBOARD 750 r2
  *  - MikroTik RouterBOARD LHG 5nD
  *  - MikroTik RouterBOARD wAP2nD
+ *  - MikroTik RouterBOARD RB912R-2nD
  *  - MikroTik RouterBOARD wAP G-5HacT2HnDwAP (wAP AC)
  *
  *  Preliminary support for the following hardware
@@ -1116,6 +1117,7 @@ MIPS_MACHINE_NONAME(ATH79_MACH_RB_962, "962", rb962_setup);
 MIPS_MACHINE_NONAME(ATH79_MACH_RB_750UPR2, "750-hb", rb750upr2_setup);
 MIPS_MACHINE_NONAME(ATH79_MACH_RB_LHG5, "lhg", rblhg_setup);
 MIPS_MACHINE_NONAME(ATH79_MACH_RB_WAP, "wap-hb", rbwap_setup);
+MIPS_MACHINE_NONAME(ATH79_MACH_RB_LTAP, "ltap-hb", rbwap_setup);
 MIPS_MACHINE_NONAME(ATH79_MACH_RB_CAP, "cap-hb", rbcap_setup);
 MIPS_MACHINE_NONAME(ATH79_MACH_RB_MAP, "map2-hb", rbmap_setup);
 MIPS_MACHINE_NONAME(ATH79_MACH_RB_WAPAC, "wapg-sc", rbwapgsc_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index 6977985..80e9351 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -224,6 +224,7 @@ enum ath79_mach_type {
 	ATH79_MACH_RB_MAP,			/* Mikrotik RouterBOARD mAP2nD */
 	ATH79_MACH_RB_MAPL,			/* Mikrotik RouterBOARD mAP L-2nD */
 	ATH79_MACH_RB_WAP,			/* Mikrotik RouterBOARD wAP2nD */
+	ATH79_MACH_RB_LTAP,			/* MikroTik RouterBOARD RB912R-2nD */
 	ATH79_MACH_RB_WAPAC,			/* Mikrotik RouterBOARD wAPG-5HacT2HnD */
 	ATH79_MACH_RB_SXTLITE2ND,		/* Mikrotik RouterBOARD SXT Lite 2nD */
 	ATH79_MACH_RB_SXTLITE5ND,		/* Mikrotik RouterBOARD SXT Lite 5nD */
diff --git a/target/linux/ar71xx/image/mikrotik.mk b/target/linux/ar71xx/image/mikrotik.mk
index 1241563..7ca25b5 100644
--- a/target/linux/ar71xx/image/mikrotik.mk
+++ b/target/linux/ar71xx/image/mikrotik.mk
@@ -41,7 +41,7 @@ define Device/rb-nor-flash-16M
   LOADER_TYPE := elf
   KERNEL_INSTALL := 1
   KERNEL := kernel-bin | lzma | loader-kernel
-  SUPPORTED_DEVICES := rb-750-r2 rb-750up-r2 rb-750p-pbr2 rb-911-2hn rb-911-5hn rb-941-2nd rb-951ui-2nd rb-952ui-5ac2nd rb-962uigs-5hact2hnt rb-lhg-5nd rb-map-2nd rb-mapl-2nd rb-wap-2nd
+  SUPPORTED_DEVICES := rb-750-r2 rb-750up-r2 rb-750p-pbr2 rb-911-2hn rb-911-5hn rb-941-2nd rb-951ui-2nd rb-952ui-5ac2nd rb-962uigs-5hact2hnt rb-lhg-5nd rb-map-2nd rb-mapl-2nd rb-wap-2nd rb-ltap-hb
   IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 -e | pad-to $$$$(BLOCKSIZE) | \
 	append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
 endef
-- 
2.7.4

And additional patch to enable LTE modem:

From 28206bde53db4aee18568db6b32c5f78b949afb7 Mon Sep 17 00:00:00 2001
From: Alexander Rumyankov <alex@rumyankovs.com>
Date: Thu, 25 Apr 2019 02:46:48 -0400
Subject: [PATCH] fix USB modem for Mikrotik LTap

---
 .../ar71xx/files/arch/mips/ath79/mach-rbspi.c      | 24 +++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
index 265c830..6b67623 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
@@ -966,6 +966,28 @@ static void __init rbwap_setup(void)
 }
 
 /*
+ * Init the ltAP hardware.
+ * The ltAP 2nD has a single ethernet port and PCI.
+ */
+static void __init rbltap_setup(void)
+{
+        u32 flags = RBSPI_HAS_WLAN0 | RBSPI_HAS_USB | RBSPI_HAS_PCI;
+
+        if (!rbspi_platform_setup())
+                return;
+
+        rbspi_peripherals_setup(flags);
+
+        /* GMAC1 is HW MAC, WLAN0 MAC is HW MAC + 1 */
+        rbspi_network_setup(flags, 0, 1, 0);
+
+        ath79_register_leds_gpio(-1, ARRAY_SIZE(rbwap_leds), rbwap_leds);
+
+        /* wAP has a single reset button as GPIO 16 */
+        rbspi_register_reset_button(RBWAP_GPIO_BTN_RESET);
+}
+
+/*
  * Init the cAP hardware (EXPERIMENTAL).
  * The cAP 2nD has a single ethernet port, and a global LED switch.
  */
@@ -1117,7 +1139,7 @@ MIPS_MACHINE_NONAME(ATH79_MACH_RB_962, "962", rb962_setup);
 MIPS_MACHINE_NONAME(ATH79_MACH_RB_750UPR2, "750-hb", rb750upr2_setup);
 MIPS_MACHINE_NONAME(ATH79_MACH_RB_LHG5, "lhg", rblhg_setup);
 MIPS_MACHINE_NONAME(ATH79_MACH_RB_WAP, "wap-hb", rbwap_setup);
-MIPS_MACHINE_NONAME(ATH79_MACH_RB_LTAP, "ltap-hb", rbwap_setup);
+MIPS_MACHINE_NONAME(ATH79_MACH_RB_LTAP, "ltap-hb", rbltap_setup);
 MIPS_MACHINE_NONAME(ATH79_MACH_RB_CAP, "cap-hb", rbcap_setup);
 MIPS_MACHINE_NONAME(ATH79_MACH_RB_MAP, "map2-hb", rbmap_setup);
 MIPS_MACHINE_NONAME(ATH79_MACH_RB_WAPAC, "wapg-sc", rbwapgsc_setup);
-- 
2.7.4
1 Like

@drwatson32 does the LTE modem work for you? For me, it almost always gets detected as Marvell Nezha 1286:8130, and then after a minute or so gets disconnected (more details in separate thread).

@amq

These boards have a cascaded IRQ setup, meaning USB will die if Wireless is used.
Can you confirm if wifi is running while your modem also runs?

If yes: could you please retest your modem but make sure wifi is disabled upfront.

Thanks,

Koen

@xback thanks for the suggestion! I tried disabling wifi with /etc/config/wireless and rebooting:

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '11'
        option hwmode '11g'
        option path 'platform/qca953x_wmac'
        option htmode 'HT20'
        option disabled '1'

But the modem won't show up, just the same Marvell device. What's also interesting is that the initial /sys/class/gpio/gpio13/value is equal to zero (on), while there is nothing in dmesg about this device on boot, just toggling it to 1 and back to 0 triggers it.

@amq
Thank you for trying.

Ill check in the office if we have such device.
If we do I'll try it out .. no promises.

@xback I was able to get it working, see Support for MikroTik LtAP mini with R11e-LTE

@amq Did you have to make changes to the GPIO settings? I my RB921R-2nD booting and seeing the base PCI hub. I still can't see anything in the mPCIe port. I've verified the mPCIe card works on other devices using a USB to mPCIe adapter. I've tried adding GPIO13 and toggling between high and low with what seems to be no change.

No, it worked for me as is.