Installing OpenWrt on Mercusys MR90X v1.2

Both stock firmwares with date "230808" (ie. version 1.0.1 and 1.20) are binary identical. With that firmware, fw_setenv leads to a permission denied error if I remember correctly, and there's no sudo available, so you can't simply change the tp_boot_idx variable to "0". And you don't have to.

The installation instructions from the Wiki clearly state "If the result is tp_boot_idx=1 then install MERCUSYS stock firmware using web interface and start from the p.2". It doesn't tell you to check for tp_boot_idx=0 or similar, simply because that won't happen - it only switches back and forth between not present and tp_boot_idx=1 with every firmware update. If you see tp_boot_idx=1, just reinstall the stock firmware once more and start over.

If you didn't have tp_boot_idx=1 in the first place, you're ready to go, and you can safely disregard any "Bad CRC, using default environment" (it just means you have never updated the firmware before). In step 17 from the Wiki, you will set up the environment properly anyway.

The Wiki is too complicated in one point, though: You don't have to use piping through SSH in order to upload the full busybox binary. You can simply upload it via SCP on port 20001 (just not SFTP). This is also less error-prone, since e.g. piping binary files in Windows won't work correctly - see what happened to stephendt. If you have to use piping and you're on Windows, use WSL instead.

1 Like

scp exists in windows, at least in Win11, there's also winscp.

I'll change that part of the wiki from ssh to scp.

EDIT: done!

Thank you for the help.

When I enter the command "ubirmvol /dev/ubi0 -N kernel"

I get the following error message below:
ubirmvol: error!: cannot UBI remove volume
error 1 (Operation not permitted)

Am I getting the error message because I installed busybox incorrectly?

I'm going to take a break and have a look at it again tomorrow with fresh eyes.
Thanks again.

Yes, I used a Ubuntu Live USB to complete the install.

I'll give WinSCP a crack myself and summarise my notes when I finally have success.

1 Like

I will wait for your summarised notes before I take the router out of the box for another attempt.

I have installed OpenWRT on three different Xiaomi routers, but I'm not making any progress on the Mercusys MR90x v1.2

I've tried Windows 10 with WinSCP, Putty and Bitvise and I've tried direct ssh in Fedora [ ssh -p 20001 root@192.168.1.1]. Fedora required extra steps with setting up the encryption keys.

I might try an Ubuntu Live USB and maybe Windows 11 on subsequent attempts.

OK I got the job done. It was easy in the end, WinSCP actually pushed the files without corrupting them unlike SSH. Here's my notes, which is much easier than the official wiki:

This was from a MR90x v1.2 with 1.0.1 Build 20230808 firmware, using Windows 11 24H2.

You will need:

  1. WinSCP

  2. choco install winscp

  3. Telnet application (e.g. Putty)

  4. choco install putty

To flash:

  1. Set a static IP on your ethernet interface with an IP address within the 192.168.1.x subnet (e.g. 192.168.1.10)

  2. Access the WebUI on 192.168.1.1 and set your login password as “Longpassword1!”

  3. Open WinSCP and access SSH on port 20001, user is “root”. I didn’t need a password, weirdly.

  4. Upload the following items from your Mercusys MR90x folder on your PC to the /tmp/ folder on the router. Easiest way to do this is copy in Windows File Explorer and paste in WinSCP.

1. busybox
2. initramfs-kernel.bin
  1. Once uploaded, log in via SSH. No password was required for me:

  2. ssh -oHostKeyAlgorithms=+ssh-rsa -p 20001 root@192.168.1.1

  3. Modify the IPTV config via VIM:

  4. vim /etc/hotplug.d/iface/65-iptv

1. Add the following after #!/bin/sh

  1. telnetd -l /bin/login.sh

2. Save & exit
  1. Log into the WebUI again and go to Advanced -> Network → IPTV/VLAN. Enable the service & save. This should enable telnet, which allows for some more advanced commands.

  2. Open Putty and connect to 192.168.1.1 via Telnet (port 23). Run the following command to flash the files:

  3. cd /tmp && chmod a+x busybox && ubirmvol /dev/ubi0 -N kernel && ubimkvol /dev/ubi0 -n 1 -N kernel -s 9MiB && ./busybox ubiupdatevol /dev/ubi0_1 /tmp/initramfs-kernel.bin

  4. If there are no errors, run “reboot” to reboot your router.

  5. Your MR90x should boot with OpenWrt temporarily, located at 192.168.1.1

  6. Once logged in, flash an OpenWrt sysupgrade file to finish the process.

  7. You are done!

2 Likes

Thanks for your detailed notes.

I will have to read up on how to add the correct host key to known_hosts.
I got stuck after entering the following command:

ssh -oHostKeyAlgorithms=+ssh-rsa -p 20001 root@192.168.1.1

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:rODAWc8rTn5mpbrej21xYKaBHhDqtsWFosjhhatvRyd.
Please contact your system administrator.
Add correct host key in C:\Users\Leet/.ssh/known_hosts to get rid of this message.
Offending RSA key in C:\Users\Leet/.ssh/known_hosts:2
Host key for [192.168.1.1]:20001 has changed and you have requested strict checking.
Host key verification failed.

Thanks Stephendt, I managed to get it working.

For others who might be having trouble I will help shed light on where I went wrong.

I ignored this step "6. Log into the WebUI again and go to Advanced -> Network → IPTV/VLAN. Enable the service & save" on subsequent attempts because it was already enabled from my previous attempts at installing OpenWRt.

So I disabled IPTV/VLAN, edited 65-iptv then enabled IPTV/VLAN which allowed me to successfully telnet via port 23.

Also, for those not familiar with using vim, some basic commands:
press "ESC" key to enter edit mode.
press ":w" to write and ":x" to exit vim editor.

You can just turn off IPTV/VLAN and then turn it on again if you've already configured the file before.

For VIM:

i = insert mode
Right click = paste
ESC = exit insert mode
:wq! = Write & Quit

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.