How to get back to RouterOS after OpenWrt (hap ac2)

So i had Hap Ac2 (Hap Ac2), after using openwrt for a couple months, i wanna get back to RouterOS but the problem is i can't do it with all references how to get back to RouterOS:

  1. Using Netinstall (router not detected)
  2. Try Serial (no routerboot)

can someone help me

If you used the initramfs to save a copy of the firmware partition before flashing OpenWrt, then you can just flash that file back by using it as a sysupgrade (with -F to force install and -n to not try to save settings) in OpenWrt. The router will reboot to RouterOS exactly as you left it.

Unfortunately i’m not doing that, because it’s not on the tuts. Any other suggestion sir ?

Are you saying you don't wish to revert to RouterOS, or that you don't know how?

As I recall, you need a backup of your license, so your response was unclear.

Also, see: https://wiki.mikrotik.com/wiki/Manual:TOC

i wanna get back into RouterOS again, it's not that i don't know how, i've tried several tutorial from this forum and other sources, but none works,

and yes I do backup the license, but i'm not backing up the firmware partition as being said by @mk24 , because it's not on the tutorial here

Hi.
I don't have any experience with reverting mikrotik boards from openwrt.
But I was succeed to use netinstall mikrotik utility a few times to recover some unresponsive units.
You should give a try with this option.
Some tips:

  • fixed ip on you computer: 192.168.1.2
  • disable firewall and any antivirus program.
  • count 10/15 sec before release reset button,
    And don't expect to get netinstall discover your unit at 1st try. Some time at 1st try it works, some time you will take 10 attempts.

I suggest you try a few different / older Netinstall versions, that's how I was able to restore RouterOS on my RB750Gr3. Neither latest v7 nor latest v6 Netinstall worked for me, however I used 6.44.5 which DID work.

You will know it works when you see the progress bar while formatting the flash as well as installing the OS - make sure you get the matching Netinstall and RouterOS package versions

1 Like

Hi.
Same here, I used netinstall 6.47.9 and 6.48.6 to recover some rb711g-5hnd and RB450G.
But no needs to use a matching Netinstall and RouterOS. With these 2 ver, I was able to recover a few mk units to OS 7.1.2

@nomadeh @wally_walrus yes i've tried several netinstall version to the lowest possible, but still none detect my hapac2, so kinda frustrated right now

While running OpenWrt you can configure boot options by writing to the files in /sys/firmware/mikrotik/soft_config. In particular the Mikrotik tools probably need boot_proto to be bootp. Write a 1 to the file named commit to write the change to flash, then cut the power and reboot. Holding the button until the LED goes out should always force a netboot.

this is new thing, can you elaborate more about " Write a 1 to the file named commit to write the change to flash", sorry not really a tech guy LOL. did you mean i should change the default content of boot_proto from "dhcp" to "bootp" and save it, then just turn off the router and try again with netinstall ?

root@OpenWrt:~# cd /sys/firmware/mikrotik/soft_config/
root@OpenWrt:/sys/firmware/mikrotik/soft_config# cat boot_proto 
bootp [dhcp]
root@OpenWrt:/sys/firmware/mikrotik/soft_config# echo "bootp" > boot_proto
root@OpenWrt:/sys/firmware/mikrotik/soft_config# cat boot_proto
[bootp] dhcp
root@OpenWrt:/sys/firmware/mikrotik/soft_config# cat commit
dirty
root@OpenWrt:/sys/firmware/mikrotik/soft_config# echo "1" > commit
root@OpenWrt:/sys/firmware/mikrotik/soft_config# cat commit
clean

Reading "clean" from commit confirms the changes have been saved to flash. Then you can reboot holding down the reset button and it should execute a BOOTP netboot.
Also you can look at the settings in boot_device but you probably want to leave flash as an option so you can get back to OpenWrt if RouterOS doesn't install.

1 Like

Thanks for the guide, let me try first.
I’ll report it ASAP

root@HAPac2:/sys/firmware/mikrotik/soft_config# echo "1" > commit
ash: write error: Read-only file system

i get this message while doing this command @mk24

Does the file exist but you can't write it?

It may need a newer version of OpenWrt. I was testing on a recent build from the snapshot tree.

yes, it exist and i'm using latest version from the device page.

OpenWrt SNAPSHOT r19175-ffa1088f63 / LuCI Master git-22.058.70382-d29400e

root@HAPac2:/sys/firmware/mikrotik/soft_config# ls
bios_version  boot_device   boot_proto    cpu_mode      uart_speed
boot_delay    boot_key      commit        silent_boot
root@HAPac2:~# cd /sys/firmware/mikrotik/soft_config/
root@HAPac2:/sys/firmware/mikrotik/soft_config# cat boot_proto
[bootp] dhcp
root@HAPac2:/sys/firmware/mikrotik/soft_config# echo "bootp" > boot_proto
root@HAPac2:/sys/firmware/mikrotik/soft_config# cat boot_proto
[bootp] dhcp
root@HAPac2:/sys/firmware/mikrotik/soft_config# cat commit
dirty
root@HAPac2:/sys/firmware/mikrotik/soft_config# echo "1" > commit
ash: write error: Read-only file system
root@HAPac2:/sys/firmware/mikrotik/soft_config# cat commit
dirty
root@HAPac2:/sys/firmware/mikrotik/soft_config# uname -a
Linux HAPac2 5.10.107 #0 SMP Mon Mar 21 22:05:27 2022 armv7l GNU/Linux```

it seems there's no way to get back to RouterOS back after flashing openWRT.
maybe this has to be pointed out on the wiki page

What did you see?

Because the Wiki clearly states that you won't see any output until enabled. And you told @mk24
you were uncomfortable with backup of binary parititons. :wink:

???

See: https://openwrt.org/toh/mikrotik/hap_ac2#serial

Enable serial output

By default, no serial is shown during boot. To enable it, a value needs to be changed on the flash (you can do that from an OpenWrt initramfs image):

CHANGE position e030
Before bytes 40 20 08, there's a 05, you need to change it to 00

Do it at your own risk!

It seems to be asking you do do a raw hex write to a portion of the flash space...it appear it's disabled by MikroTik...not OpenWrt's fault.

So...it seems that something similar is in the tutorials...

...but you could backup that partition, find the location, edit with a Hex Editor, save, upload it, and reboot.

You should then have serial output - and hence access to RouterBoot. :bulb:

hi is very easy i has make on all mikrotik rb750GR3 hapac2 and rb5009 :wink:

I have gone back and forth with routeros and openwrt on my hAP ac2 very easily. I reverted to routerOS by using the netinstall recovery method