Xiaomi Mi Router 4 won't boot after flashing an image

I have a Xiaomi Mi Router 4, which didn't had official support for it, until recently. Before I was using OpenWRTInvasion, and today I decided to flash the official snapshot for the router I have which is available here OpenWRT-Snapshots starting with the name xiaomi_mi-router-4-. So I ssh into the router, cd /tmp, wget https://downloads.openwrt.org/snapshots/targets/ramips/mt7621/openwrt-ramips-mt7621-xiaomi_mi-router-4-squashfs-kernel1.bin and then I ran mtd write openwrt-ramips-mt7621-xiaomi_mi-router-4-squashfs-kernel1.bin kernel. I forgot to type kernel1. And now after rebooting the device, it won't boot any more, I can't ssh into it either. Is the router bricked? or can it be repaired?

Use bootloader to recover.
If you have pure "4" model, you can also try 19.07.7 mir3g images.

How to use bootloader, how do I get access to that?

You need to press and hold reset button then powering your router, the button should be released moments later then the unit should be available at 192.168.1.1

I tried pressing and holding the reset button when powering on the router, for 5,10 and even 15 seconds, the LED keeps blinking yellow and nothing happens. If I try to ping the device I get this,

From 127.0.0.1 icmp_seq=272 Destination Host Unreachable
From 127.0.0.1 icmp_seq=273 Destination Host Unreachable
From 127.0.0.1 icmp_seq=274 Destination Host Unreachable
From 127.0.0.1 icmp_seq=275 Destination Host Unreachable
From 127.0.0.1 icmp_seq=276 Destination Host Unreachable
From 127.0.0.1 icmp_seq=277 Destination Host Unreachable
From 127.0.0.1 icmp_seq=278 Destination Host Unreachable
From 127.0.0.1 icmp_seq=279 Destination Host Unreachable
From 127.0.0.1 icmp_seq=280 Destination Host Unreachable
From 127.0.0.1 icmp_seq=281 Destination Host Unreachable
From 127.0.0.1 icmp_seq=282 Destination Host Unreachable
From 127.0.0.1 icmp_seq=283 Destination Host Unreachable
From 127.0.0.1 icmp_seq=284 Destination Host Unreachable
From 127.0.0.1 icmp_seq=285 Destination Host Unreachable
From 127.0.0.1 icmp_seq=286 Destination Host Unreachable
From 127.0.0.1 icmp_seq=287 Destination Host Unreachable
From 127.0.0.1 icmp_seq=288 Destination Host Unreachable
From 127.0.0.1 icmp_seq=289 Destination Host Unreachable
From 127.0.0.1 icmp_seq=290 Destination Host Unreachable
From 127.0.0.1 icmp_seq=291 Destination Host Unreachable
From 127.0.0.1 icmp_seq=294 Destination Host Unreachable
From 127.0.0.1 icmp_seq=295 Destination Host Unreachable
From 127.0.0.1 icmp_seq=296 Destination Host Unreachable
From 127.0.0.1 icmp_seq=297 Destination Host Unreachable
From 127.0.0.1 icmp_seq=298 Destination Host Unreachable
From 127.0.0.1 icmp_seq=299 Destination Host Unreachable
From 127.0.0.1 icmp_seq=300 Destination Host Unreachable
From 127.0.0.1 icmp_seq=301 Destination Host Unreachable
From 127.0.0.1 icmp_seq=302 Destination Host Unreachable
From 127.0.0.1 icmp_seq=303 Destination Host Unreachable
From 127.0.0.1 icmp_seq=304 Destination Host Unreachable
^C
--- 192.168.1.1 ping statistics ---
307 packets transmitted, 0 received, +203 errors, 100% packet loss, time 310082ms
pipe 4

How long do I have to press and hold the button?

Before when it was working the router when powered on showed yellow LED when it is turned on and turned blue when it was ready to use.

Sorry, for whatever reason I thought that breed is already installed.
Please see the whole process here.

Ah! I don't understand this sorry, a bit out of my understanding. Do I need some hardware stuff to fix it? If there is a software thing, I can understand that no problem,

You will need to solder 3 pins to the board and connect to it using a console cable.

So otherwise it is bricked?

This is how I take it. You can avoid soldering, but you will need a proper cable.

I think no need to solder, the router is waiting for new fw via tftp when flashes in orange.
So I'm suggesting to follow the de-brick procedure, link can be found on this page.

This is not my router model, I have Xiaomi Mi Router 4, 4A is a different model. Will it work for my model as well? If yes are you talking about this link - Xiaomi Mi Router 4A Gigabit Edition (R4AG/R4A Gigabit) -- fully supported and flashable with OpenWRTInvasion - #678 by Zorro ? The program used is running on windows, I don't have a windows machine, is there no way to do this in Linux?

Sorry, @apoorv569, I cannot tell you.

Maybe the method can work but first you need to get the OEM firmware. If you have it, you can check the de-brick section this page.
There you can find 2 examples for Linux OSs.

So after creating the tftp server as described here - https://mohammadthalif.wordpress.com/2010/03/05/installing-and-testing-tftpd-in-ubuntudebian/ ,(<- this link is in the debrick section, stock recovery section) I just paste the image in the tftp server folder and router should auto pick that up?

EDIT: I tried connecting through tftp I connected my router to the laptop via ethernet cable set the IP to 192.168.1.2 and gateway to 192.168.1.1 in the connection editor, and ran tftp 192.168.1.2 then I typed put miwifi.bin and after few seconds it says connection timed out.

The 4A Gigabit is a completely different chipset. Don't try to follow any instructions for the 4A Gigabit.

This is your PC's loopback interface. It means you don't have an interface configured with an external address (ideally 192.168.1.X). Without that you can't ping to a network outside the PC.
Generally it's a good idea to connect an unmanaged switch between the PC and the router you're trying to recover. Then you can set up the PC port and the settings will stay in place while the router reboots, because the PC doesn't see the Ethernet cable being "disconnected."

That's your IP. So you tried to TFTP to your PC not the router.

No, I connected the router to a laptop, with all other network turned off (wifi and all), just the router with a ethernet cable, manually set its IP to 192.168.1.2 then ran tftp. It connected successfully, I was able to ping 192.168.1.2.

You need to tftp to the router's IP, likely 192.168.1.1, which you could find from the bootloader prompt. Do you have serial access to the bootloader?

Of course you can ping 192.168.1.2, that is inside your PC. Ping times will be really fast too.

Yes, it should be 192.168.1.1, but that address won't ping, (guessing) because of the soft brick I suppose. Let me try again, as we talk..

So, I'm connecting the router to my laptop now. With all other connections turned off.

Many bootloaders in recovery mode won't answer pings. They don't do anything but TFTP or whatever method they are supposed to accept.

Alright I have connected the router, no other connections, just the router, and no manual configuration done..

I ran tftp 192.168.1.1, should I use binary or ascii mode?

Running put miwifi.bin gives me,

tftp: sendto: Network is unreachable