Unable to netboot Mikrotik hAP (RB951Ui-2nD)

Hi!
I was trying to boot firmware to mikrotik device, unsucessfully.

It is working fine using same steps on different device (hAP lite) and was even working on same device, which I aquired last year. I am not sure what is going on. Can someone give me a hint?
Working netbooting advertises itself as OpenWrt. Here I see udhcp, so it is doing at least something. All LEDs are shut, except for red POE OUT.
There is no serial console to check what is going on(there is, but requires soldering headers and modyfing some part of boot partition, which is currently beyond my abilities)
I am not sure what is going on. I previously flashed succesfuly about 15 images without problems and even compiled my own with patch to support new memories Winbond 128JV...

Code to run dnsmasq:

#!/bin/bash

IFACE_WAN="enp4s0"
IMAGE_PATH=/home/filip/openwrt_loader/

dnsmasq -i $IFACE_WAN --dhcp-range=192.168.100.100,192.168.100.200 \
--dhcp-boot=openwrt-ar71xx-mikrotik-rb-nor-flash-16M-initramfs-kernel.bin \
--enable-tftp --tftp-root=$IMAGE_PATH -d -u filip -p0 -K --log-dhcp --bootp-dynamic

dnsmasq log:

dnsmasq: started, version 2.79 DNS disabled
dnsmasq: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
dnsmasq-dhcp: DHCP, IP range 192.168.100.100 -- 192.168.100.200, lease time 1h
dnsmasq-tftp: TFTP root is /home/filip/openwrt_loader/ 
dnsmasq-dhcp: 3770257068 available DHCP range: 192.168.100.100 -- 192.168.100.200
dnsmasq-dhcp: 3770257068 vendor class: Mips_boot
dnsmasq-dhcp: 3770257068 DHCPDISCOVER(enp4s0) b8:69:f4:d1:46:69 
dnsmasq-dhcp: 3770257068 tags: enp4s0
dnsmasq-dhcp: 3770257068 DHCPOFFER(enp4s0) 192.168.100.199 b8:69:f4:d1:46:69 
dnsmasq-dhcp: 3770257068 requested options: 1:netmask, 3:router
dnsmasq-dhcp: 3770257068 bootfile name: openwrt-ar71xx-mikrotik-rb-nor-flash-16M-initramfs-kernel.bin
dnsmasq-dhcp: 3770257068 next server: 192.168.100.10
dnsmasq-dhcp: 3770257068 sent size:  1 option: 53 message-type  2
dnsmasq-dhcp: 3770257068 sent size:  4 option: 54 server-identifier  192.168.100.10
dnsmasq-dhcp: 3770257068 sent size:  4 option: 51 lease-time  1h
dnsmasq-dhcp: 3770257068 sent size:  4 option: 58 T1  30m
dnsmasq-dhcp: 3770257068 sent size:  4 option: 59 T2  52m30s
dnsmasq-dhcp: 3770257068 sent size:  4 option:  1 netmask  255.255.255.0
dnsmasq-dhcp: 3770257068 sent size:  4 option: 28 broadcast  192.168.100.255
dnsmasq-dhcp: 3770257068 sent size:  4 option:  3 router  192.168.100.10
dnsmasq-dhcp: 3770257068 available DHCP range: 192.168.100.100 -- 192.168.100.200
dnsmasq-dhcp: 3770257068 vendor class: Mips_boot
dnsmasq-dhcp: 3770257068 DHCPREQUEST(enp4s0) 192.168.100.199 b8:69:f4:d1:46:69 
dnsmasq-dhcp: 3770257068 tags: enp4s0
dnsmasq-dhcp: 3770257068 DHCPACK(enp4s0) 192.168.100.199 b8:69:f4:d1:46:69 
dnsmasq-dhcp: 3770257068 requested options: 1:netmask, 3:router
dnsmasq-dhcp: 3770257068 bootfile name: openwrt-ar71xx-mikrotik-rb-nor-flash-16M-initramfs-kernel.bin
dnsmasq-dhcp: 3770257068 next server: 192.168.100.10
dnsmasq-dhcp: 3770257068 sent size:  1 option: 53 message-type  5
dnsmasq-dhcp: 3770257068 sent size:  4 option: 54 server-identifier  192.168.100.10
dnsmasq-dhcp: 3770257068 sent size:  4 option: 51 lease-time  1h
dnsmasq-dhcp: 3770257068 sent size:  4 option: 58 T1  30m
dnsmasq-dhcp: 3770257068 sent size:  4 option: 59 T2  52m30s
dnsmasq-dhcp: 3770257068 sent size:  4 option:  1 netmask  255.255.255.0
dnsmasq-dhcp: 3770257068 sent size:  4 option: 28 broadcast  192.168.100.255
dnsmasq-dhcp: 3770257068 sent size:  4 option:  3 router  192.168.100.10
dnsmasq-tftp: sent /home/filip/openwrt_loader/openwrt-ar71xx-mikrotik-rb-nor-flash-16M-initramfs-kernel.bin to 192.168.100.199
dnsmasq-dhcp: 3770257068 available DHCP range: 192.168.100.100 -- 192.168.100.200
dnsmasq-dhcp: 3770257068 vendor class: Mips_boot
dnsmasq-dhcp: 953315401 available DHCP range: 192.168.100.100 -- 192.168.100.200
dnsmasq-dhcp: 953315401 vendor class: udhcp 1.30.1
dnsmasq-dhcp: 953315401 DHCPDISCOVER(enp4s0) b8:69:f4:d1:46:69 
dnsmasq-dhcp: 953315401 tags: enp4s0
dnsmasq-dhcp: 953315401 DHCPOFFER(enp4s0) 192.168.100.199 b8:69:f4:d1:46:69 
dnsmasq-dhcp: 953315401 requested options: 1:netmask, 3:router, 6:dns-server, 12:hostname, 
dnsmasq-dhcp: 953315401 requested options: 15:domain-name, 28:broadcast, 42:ntp-server
dnsmasq-dhcp: 953315401 bootfile name: openwrt-ar71xx-mikrotik-rb-nor-flash-16M-initramfs-kernel.bin
dnsmasq-dhcp: 953315401 next server: 192.168.100.10
dnsmasq-dhcp: 953315401 sent size:  1 option: 53 message-type  2
dnsmasq-dhcp: 953315401 sent size:  4 option: 54 server-identifier  192.168.100.10
dnsmasq-dhcp: 953315401 sent size:  4 option: 51 lease-time  1h
dnsmasq-dhcp: 953315401 sent size:  4 option: 58 T1  30m
dnsmasq-dhcp: 953315401 sent size:  4 option: 59 T2  52m30s
dnsmasq-dhcp: 953315401 sent size:  4 option:  1 netmask  255.255.255.0
dnsmasq-dhcp: 953315401 sent size:  4 option: 28 broadcast  192.168.100.255
dnsmasq-dhcp: 953315401 sent size:  4 option:  3 router  192.168.100.10
dnsmasq-dhcp: 953315401 available DHCP range: 192.168.100.100 -- 192.168.100.200
dnsmasq-dhcp: 953315401 vendor class: udhcp 1.30.1
dnsmasq-dhcp: 953315401 DHCPREQUEST(enp4s0) 192.168.100.199 b8:69:f4:d1:46:69 
dnsmasq-dhcp: 953315401 tags: enp4s0
dnsmasq-dhcp: 953315401 DHCPACK(enp4s0) 192.168.100.199 b8:69:f4:d1:46:69 
dnsmasq-dhcp: 953315401 requested options: 1:netmask, 3:router, 6:dns-server, 12:hostname, 
dnsmasq-dhcp: 953315401 requested options: 15:domain-name, 28:broadcast, 42:ntp-server
dnsmasq-dhcp: 953315401 bootfile name: openwrt-ar71xx-mikrotik-rb-nor-flash-16M-initramfs-kernel.bin
dnsmasq-dhcp: 953315401 next server: 192.168.100.10
dnsmasq-dhcp: 953315401 sent size:  1 option: 53 message-type  5
dnsmasq-dhcp: 953315401 sent size:  4 option: 54 server-identifier  192.168.100.10
dnsmasq-dhcp: 953315401 sent size:  4 option: 51 lease-time  1h
dnsmasq-dhcp: 953315401 sent size:  4 option: 58 T1  30m
dnsmasq-dhcp: 953315401 sent size:  4 option: 59 T2  52m30s
dnsmasq-dhcp: 953315401 sent size:  4 option:  1 netmask  255.255.255.0
dnsmasq-dhcp: 953315401 sent size:  4 option: 28 broadcast  192.168.100.255
dnsmasq-dhcp: 953315401 sent size:  4 option:  3 router  192.168.100.10

Thanks!

  • Are you saying that you modified the memory in this device?
  • If so, verify you compiled flashed your custom firmware in this case

What I meant by flashing is that I netbooted initramfs image an then did sysupgrade. Now I can't get initramfs to work.

If you netbooted and did a sysupgrade, OpenWrt should be installed. In addition, nothing should be preventing you from using netboot again.

  • Are you having other issues?
  • What do you see on the console of the router?
  • How did you clear the flash if you don't have console access?

You'll need to see the console.

I see I need to do more clarification. Previously I have netbooted and did sysupgrade no problem. Installed OpenWrt and it worked. No console access. On wiki sysupgrade is called flashing, that is why i was using it. I have never manipulated serial console.
Now, I cant get netboot to work using same steps as before. No console access, only log from dnsmasq. I hope now it is more clear.

I 100% understood the first time.

  • Again, unless the instructions/firmware is bad and somehow corrupted the bootloader, netboot should work
  • If netboot is not working, you'll need console access to see the issue
  • If you never had console access, I'm not sure how you formatted the flash
  • Can you verify you used: https://openwrt.org/toh/mikrotik/rb941_2nd#run_openwrt_in_ram

That is the issue, netbooting is not working. Maybe one thing I forgot to mention. I did this process before but on different device. This one is still running the Mikrotik RouterOS. Firmware comes straight from download site so it is not bad.
I used these instructions and the are not working for this device. They worked before on other devices.
If I am understanding it correctly, I have to gain access to console, which means soldering headers and go through these instructions https://openwrt.org/toh/mikrotik/rb941_2nd#how_to_enable_serial_port According those instructions, I have to download bootloader, change sequence, rebuild kernel? and flash it? This is way over my head.
And even so, I cant flash it because it can be only done from OpenWrt. So basically without console, I cant see what is preventing netboot OpenWrt, and without OpenWrt I cannot enable console.
What now?

  • I'm not sure why the instructions say this; but you should be able to upgrade netboot from OEM MikroTik, before flashing to OpenWrt - not sure about enabling the serial wihtout OpenWrt, though
  • From the commands added to loader.sh on the Wiki page, I see no reason netboot stopped working - it only loads to RAM, so you should be able to do this step all the time, without permanent flashing to the router

Also, this may help, especially the "Loading the backup RouterBOOT loader" section: https://wiki.mikrotik.com/wiki/Manual:Reset#Using_reset_button

It should be working, but it is not. ehternet led shuts off and poe led lits up and stucks. I followed exactly the steps for loading into ram and nothing.

Hi, did you manage to resolve this issue? Im experiancing the same. Im sure I flashed about a month ago RB951 hAP without problems, but now I end up as you. I tried:
openwrt-18.06.2-ar71xx-mikrotik-vmlinux-initramfs.bin
openwrt-18.06.2-ar71xx-mikrotik-vmlinux-initramfs.elf
openwrt-18.06.2-ar71xx-mikrotik-rb-nor-flash-16M-initramfs-kernel.bin

Unfortunately, no. I did not get it working. My wild gues is there is some change the switch in the processor, since loading netboot image is done with onboard software and then when openwrt loads, it does not recognize switch and cuts all communication.
I encountered one issue on different board, which loads partialy and switch is also not present. Here is the issue.
On photos of the board I did not spot the difference between old and new board.
I have no idea how to test what is the issue and how to get it working.
Did you tried last development image?

Hi I tried 18.06.0, 18.06.1, 18.06.2 and develop, no luck.

But after reading the issue you linked with 952 I found out that the openwrt is indeed runing after the boot, and the problem is, that the board changed and is not detected correctly (may be the problem is the switch, I dont know)

when I connected to port 1 (internet) and manualy set IP to 192.168.1.100 I could ssh to the box and read some stuff. The other ports ale in one segment and are connected to WAN side. So this is messed up....

root@OpenWrt:~# cat /proc/cpuinfo
system type        : Qualcomm Atheros QCA9533 ver 2 rev 0
machine            : MikroTik RouterBOARD RB951Ui-2nD
processor        : 0
cpu model        : MIPS 24Kc V7.4
BogoMIPS        : 432.53
wait instruction    : yes
microsecond timers    : yes
tlb_entries        : 16
extra interrupt vector    : yes
hardware watchpoint    : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa            : mips1 mips2 mips32r1 mips32r2
ASEs implemented    : mips16
Options implemented    : tlb 4kex 4k_cache prefetch mcheck ejtag llsc dc_aliases perf_cntr_intr_bit nan_legacy nan_2008 perf
shadow register sets    : 1
kscratch registers    : 0
package            : 0
core            : 0
VCED exceptions        : not available
VCEI exceptions        : not available


root@OpenWrt:~# cat /etc/board.json
{
    "model": {
        "id": "unknown",
        "name": "MikroTik RouterBOARD RB951Ui-2nD"
    },
    "network": {
        "lan": {
            "ifname": "eth0",
            "protocol": "static"
        },
        "wan": {
            "ifname": "eth1",
            "protocol": "dhcp"
        }
    }
}

My running board is identified as this:

root@podebrady:~# cat /proc/cpuinfo
system type             : Qualcomm Atheros QCA9533 ver 2 rev 0
machine                 : MikroTik RouterBOARD 951Ui-2nD
processor               : 0
cpu model               : MIPS 24Kc V7.4
BogoMIPS                : 432.53
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 16
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16
shadow register sets    : 1
kscratch registers      : 0
package                 : 0
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available

root@podebrady:~# cat /etc/board.json
{
        "model": {
                "id": "rb-951ui-2nd",
                "name": "MikroTik RouterBOARD 951Ui-2nD"
        },
        "led": {
                "user": {
                        "name": "USER",
                        "sysfs": "rb:green:user",
                        "trigger": "timer",
                        "delayon": 1000,
                        "delayoff": 1000
                },
                "port1": {
                        "name": "port1",
                        "sysfs": "rb:green:port1",
                        "type": "netdev",
                        "device": "eth0",
                        "mode": "link tx rx"
                },
                "port2": {
                        "name": "port2",
                        "sysfs": "rb:green:port2",
                        "trigger": "switch0",
                        "type": "switch",
                        "port_mask": "0x10",
                        "speed_mask": ""
                },
                "port3": {
                        "name": "port2",
                        "sysfs": "rb:green:port3",
                        "trigger": "switch0",
                        "type": "switch",
                        "port_mask": "0x08",
                        "speed_mask": ""
                },
                "port4": {
                        "name": "port3",
                        "sysfs": "rb:green:port4",
                        "trigger": "switch0",
                        "type": "switch",
                        "port_mask": "0x04",
                        "speed_mask": ""
                },
                "port5": {
                        "name": "port5",
                        "sysfs": "rb:green:port5",
                        "trigger": "switch0",
                        "type": "switch",
                        "port_mask": "0x02",
                        "speed_mask": ""
                },
                "wlan": {
                        "name": "WLAN",
                        "sysfs": "rb:blue:wlan",
                        "trigger": "phy0tpt"
                }
        },
        "network": {
                "lan": {
                        "ifname": "eth1.1",
                        "protocol": "static"
                },
                "wan": {
                        "ifname": "eth0",
                        "protocol": "dhcp"
                }
        },
        "switch": {
                "switch0": {
                        "enable": true,
                        "reset": true,
                        "ports": [
                                {
                                        "num": 0,
                                        "device": "eth1",
                                        "need_tag": false,
                                        "want_untag": false
                                },
                                {
                                        "num": 1,
                                        "role": "lan",
                                        "index": 4
                                },
                                {
                                        "num": 2,
                                        "role": "lan",
                                        "index": 3
                                },
                                {
                                        "num": 3,
                                        "role": "lan",
                                        "index": 2
                                },
                                {
                                        "num": 4,
                                        "role": "lan",
                                        "index": 1
                                }
                        ],
                        "roles": [
                                {
                                        "role": "lan",
                                        "ports": "1 2 3 4 0t",
                                        "device": "eth1.1"
                                }
                        ]
                }
        },
        "gpioswitch": {
                "usb_power_switch": {
                        "name": "USB Power Switch",
                        "pin": 45,
                        "default": 1
                },
                "poe_passthrough": {
                        "name": "PoE Passthrough",
                        "pin": 14,
                        "default": 0
                }
        }
}

So this looks like simple fix as this one....
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=6570f3c93aa4110efd1466a6b89742c2e11d7c11

The fix is in the staging tree:
https://git.openwrt.org/?p=openwrt/staging/xback.git;a=commit;h=5d2a3ba80cb267af4f1dfe5fcaa0d21c4d3df687