Support for Xiaomi Wifi R3P Pro?

@souk yeah what you're seeing is common when the computer gets into a "panic loop".... what you're seeing is (most likely... from my own experience) the kernel booting up, bringing up the network interfaces (and the usb port) and then running into a problem (again from my experience, failing to mount rootfs) and then panicing and starting the loop all over again...

unfortunately (and i really mean "unfortunately") since you've already told the bootloader to skip kernel0 (that's what flag_try_sys1_failed means) and since the bootloader has already successfully started kernel1, it has no idea that your boot failed... so it will merrily go on booting back into kernel1, and it won't put you back into stock xiaomi (kernel0 aka kernel_stock) for stock recovery...

very annoying, but you're going to have to break out your UART and solder on pins... but don't worry, it's really not that big a deal. i wonder what went wrong during installation... did you check if you have an ESMT or a Micron NAND chip before installing? (see the "notes" section at the end of the TOH page). Any messages about bad blocks? Any error messages during installation?

the TOH page needs an entry about "recovery using UART" (as @pjgowtham has also commented)... also "installation using UART" would be nice...

@souk i'm really interested in your problem... let me know once you have the pins soldered and your UART dusted off...

After installing kmod-fs-ntfs, I still get the same error block: No "mount.ntfs" utility available
I am not sure what additional packages i need to move to the next step.

@pjgowtham see here (i just found it myself)

https://openwrt.org/docs/guide-user/storage/writable_ntfs

iiuc kmod-fs-ntfs is read-only anyhow. ntfs-3g is apparently the way to go... (use --force-depends.. i didn't compile fuse)

Im back in, still hooked up on my router. What's the best course of action.

I have

NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron NAND 256MiB 3,3V 8-bit), 256MiB, page size: 2048, OOB size: 64

The routers functioning again, i'm just waiting from some advice from one of you clever folks before i progress.

In the meantime I will reflash the developers bin.. as i've only flashed the stock retail bin version atm.

@souk yeay!!!! you have a Micron chip! I've been waiting for someone with a Micron chip to test!

Now that you have your UART out, would you mind re-installing openwrt (and log the entire process and post it here... including the installation and the subsequent boot... and the subsequent failure)

I would like to try the following:

  1. Regular installation of OpenWRT (Micron without bad blocks)
  2. Slightly modified installation of OpenWRT (Micron with bad blocks) using 'nandwrite' instead of 'mtd write':
cd /tmp
mv openwrt-ramips-mt7621-xiaomi_mir3p-squashfs-factory.bin factory.bin
nvram set flag_try_sys1_failed=1
nvram set flag_try_sys2_failed=0
nvram set flag_boot_success=0
nvram commit
dd if=factory.bin bs=1M count=4 | nandwrite -m -p /dev/mtd9 -
dd if=factory.bin bs=1M skip=4 | nandwrite -m -p /dev/mtd10 -
reboot
  1. Super cool installation of OpenWRT (Micron with bad blocks):

tftpboot initramfs.bin

then:

copy openwrt-ramips-mt7621-xiaomi_mir3p-squashfs-sysupgrade.bin to /tmp on the router

cd /tmp
mv openwrt-ramips-mt7621-xiaomi_mir3p-squashfs-sysupgrade.bin sysupgrade.bin
ubiformat -v -y /dev/mtd9
ubiattach -p /dev/mtd9
sysupgrade /tmp/sysupgrade.bin

I need full logs (including what happens during installation, booting, etc). Do you think you can help me?

EDIT: for the "super cool installation" you'll need to setup a tftp server... any familiarity?
EDIT2: for the 'super cool installation' the steps above weren't complete...

1 Like

I'll be happy to help, if you can block out any personal information taken from my device sure.

@souk it's a "factory install"... don't worry :wink: there's nothing "personal" there (apart from maybe MAC addresses... which you can block if you want... they're not relevant)

1 Like

Okay , I will have a go now. report back in a bit..

1 Like

@souk anything?

I got distracted by the other half... Sorry. :roll_eyes:

I carried out the one other one again out of curiosity on the wiki page and it installed which is a bit strange to me. I did exactly the same method.

Fear not though I will do whatever it is you want me to do..

Was the below meant to be done via the UART?

cd /tmp
mv openwrt-ramips-mt7621-xiaomi_mir3p-squashfs-factory.bin factory.bin
nvram set flag_try_sys1_failed=1
nvram set flag_try_sys2_failed=0
nvram set flag_boot_success=0
nvram commit
dd if=factory.bin bs=1M count=4 | nandwrite -m -p /dev/mtd9 -
dd if=factory.bin bs=1M skip=4 | nandwrite -m -p /dev/mtd10 -
reboot

@souk it installed?? that's bizarre isn't it. someone on 4pda reported it "installing" fine but then entering a crash-loop once it rebooted a 2nd time... have you tried rebooting again? anything interesting in the logs? any mention of "bad block" or something (anywhere at all?) (actually did you save the log? can i see it?)

as for the block you have (cd /tmp etc) yes, that's supposed to be typed in the console (uart)... fyi it's assuming you've copied the *factory.bin file to /tmp

it's also assuming you're running that on "stock"... it will make a mess of things if you do that from openwrt :wink: if you don't want to go back to stock (and you're running this on openwrt), the invocation would be:

cd /tmp
mv openwrt-ramips-mt7621-xiaomi_mir3p-squashfs-factory.bin factory.bin
dd if=factory.bin bs=1M count=4 | nandwrite -m -p /dev/mtd8 -
flash_erase /dev/mtd9
dd if=factory.bin bs=1M skip=4 | nandwrite -m -p /dev/mtd9 -
reboot

and please save/share the logs. if you encounter anything that looks like an error, stop and ask for help or you'll probably end up with another bootloop :wink:

for the sake of testing, i would still very much appreciate it if you would go back to stock and try the original sequence (the one you just shared) (in addition)

btw, i already assumed you would probably be spending your time trying to figure out the joys of setting up a tftpd server on... windows? :wink:

EDIT: i added a command!

@SOUK @ilyas Please use "Preformatted text </>" for logs, scripts, configs and general console output.
grafik

Please edit your postings above accordingly.

1 Like
root@OpenWrt:~# opkg install fdisk
Installing fdisk (2.33-2) to root...
Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/fdisk_2.33-2_mipsel_24kc.ipk
Installing libuuid1 (2.33-2) to root...
Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/libuuid1_2.33-2_mipsel_24kc.ipk
Installing libblkid1 (2.33-2) to root...
Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/libblkid1_2.33-2_mipsel_24kc.ipk
Installing libsmartcols1 (2.33-2) to root...
Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/libsmartcols1_2.33-2_mipsel_24kc.ipk
Installing libfdisk1 (2.33-2) to root...
Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/libfdisk1_2.33-2_mipsel_24kc.ipk
Installing terminfo (6.1-4) to root...
Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/terminfo_6.1-4_mipsel_24kc.ipk
Installing libncurses6 (6.1-4) to root...
Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/libncurses6_6.1-4_mipsel_24kc.ipk
Configuring terminfo.
Configuring libuuid1.
Configuring libsmartcols1.
Configuring libblkid1.
Configuring libfdisk1.
Configuring libncurses6.
Configuring fdisk.
root@OpenWrt:/tmp# opkg --force-depends install ntfs-3g_2017.3.23-1-fuseint_mipsel_24kc.ipk
Installing ntfs-3g (2017.3.23-1-fuseint) to root...
Installing kmod-fuse (4.14.105-1) to root...
Downloading http://downloads.openwrt.org/snapshots/targets/ramips/mt7621/packages/kmod-fuse_4.14.105-1_mipsel_24kc.ipk
Configuring kmod-fuse.
Configuring ntfs-3g.
Create '/etc/filesystems'.
Add 'ntfs-3g' to known filesystems.
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for ntfs-3g:
 *      kernel (= 4.14.105-1-eb8ed4b9bf234e78fd5debca12157d30)
root@OpenWrt:/tmp# opkg -force-depends install kmod-fuse
Package kmod-fuse (4.14.105-1) installed in root is up to date.
root@OpenWrt:/tmp# /sbin/block mount
block: No "mount.ubi" utility available
block: mounting /dev/mtdblock9 (ubi) as /mnt/mtdblock9 failed (2) - No such file or directory
block: /dev/ubiblock0_0 is already mounted on /rom
block: /dev/ubi0_1 is already mounted on /overlay
block: mount.ntfs: ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root
block: mount.ntfs: failed with status 5376
block: mounting /dev/sda1 (ntfs) as /mnt/sda1 failed (22) - Invalid argument
root@OpenWrt:/tmp# opkg --force-depends install ntfs-3g-low_2017.3.23-1-fuseint_mipsel_24kc.ipk
Installing ntfs-3g-low (2017.3.23-1-fuseint) to root...
Configuring ntfs-3g-low.
root@OpenWrt:/tmp# opkg --force-depends install ntfs-3g-utils_2017.3.23-1-fuseint_mipsel_24kc.ipk
Installing ntfs-3g-utils (2017.3.23-1-fuseint) to root...
Configuring ntfs-3g-utils.
root@OpenWrt:/tmp# /sbin/block mount
block: No "mount.ubi" utility available
block: mounting /dev/mtdblock9 (ubi) as /mnt/mtdblock9 failed (2) - No such file or directory
block: /dev/ubiblock0_0 is already mounted on /rom
block: /dev/ubi0_1 is already mounted on /overlay
block: mount.ntfs: ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root
block: mount.ntfs: failed with status 5376
block: mounting /dev/sda1 (ntfs) as /mnt/sda1 failed (22) - Invalid argument
root@OpenWrt:/tmp# modprobe fuse
failed to find a module named fuse
root@OpenWrt:/tmp# opkg install fuse-utils
Installing fuse-utils (2.9.7-2) to root...
Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/fuse-utils_2.9.7-2_mipsel_24kc.ipk
Installing libfuse1 (2.9.7-2) to root...
Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/libfuse1_2.9.7-2_mipsel_24kc.ipk
Configuring libfuse1.
Configuring fuse-utils.
root@OpenWrt:/tmp# /sbin/block mount
block: No "mount.ubi" utility available
block: mounting /dev/mtdblock9 (ubi) as /mnt/mtdblock9 failed (2) - No such file or directory
block: /dev/ubiblock0_0 is already mounted on /rom
block: /dev/ubi0_1 is already mounted on /overlay
block: mount.ntfs: ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root
block: mount.ntfs: failed with status 5376
block: mounting /dev/sda1 (ntfs) as /mnt/sda1 failed (22) - Invalid argument
root@OpenWrt:/tmp# modprobe fuse
failed to find a module named fuse

@pjgowtham

I installed the OpenWRT following the information on the support page.

(i.e https://openwrt.org/inbox/xiaomi/xiaomi_r3p_pro#info)

It worked the second time around after initially bricking my device, but now i need to revert back to stock ROM for ilyas so I can run some tests for him. I see you've previously reverted back at some point earlier using kernel0 file or something.

What was the procedure / commands for that please and can we get that information on the support page?

Sure, I'll add more to the wiki.

@ilyas The wifi is working well. I couldn't benchmark it and compare it to stock but I usually have a repeater at the farthest end of the router signal. The stock firmware used to reach that distance but after installing openwrt, it doesn't anymore and not even sparingly. IMHO i think the wifi is acceptably good already though but could be pushed more.

@pjgowtham very annoying isn't it? i think is what happened: the kernel modules are installed in /lib/modules/<kernel version> ... so the fuse (etc) modules you force-installed are installed in /lib/modules/4.14.105/ while the kernel is looking for them in /lib/modules/4.14.104/ ... i just noticed that openwrt has kernel modules for previous kernel versions... try downloading/installing them manually from https://downloads.openwrt.org/snapshots/targets/ramips/mt7621/kmods/4.14.104-1-eb8ed4b9bf234e78fd5debca12157d30/

@souk if you didn't screw up your kernel_stock partition, you don't need to do anything too exciting to revert to stock... plug in a usb with miwifi.bin (stock) and run

fw_setenv flag_try_sys2_failed 1
fw_setenv flag_try_sys1_failed 0
fw_setenv uart_en 1 # enable the console
reboot

this should do the trick... it's telling the bootloader to skip the 2nd kernel and try the 1st (which is stock) especially since you have an UART you'll see a message saying it's waiting for you to press the "reset" button... press it. then it will do recovery. (at least.. that's what I remember...)

1 Like

@pjgowtham ... that may have to do with the "singlesku.dat" file that it wants (that i didn't give it...) i'll find/add that and try with it and post a new release (in a couple of days)... i got 4.4.2.1 (the older version of the driver to compile) but i haven't tested it at all... we'll see if that works better.

also, if you want to benchmark, you can download and run iperf3 https://iperf.fr/iperf-download.php#windows

you'll need one pc acting as "server":

(start->run "cmd" ... i'm not sure about the "path"... maybe i'll try it on a windows machine if you have a hard time figuring it out)
iperf3 -s

and on the client:

iperf3 -c ip.address.of.server
(e.g., iperf3 -c 192.168.1.103)

that is, if you want to benchmark :wink: otherwise, i'll get around to it eventually (i wasn't aware they had binaries for windows)

EDIT: you mentioned comparison of stock vs openwrt ... i'm assuming you mean 5.0.2.0 (my "home compiled")... someone was saying rc1 performed better.. is that your experience as well? (i don't think i used a "singlesku.dat" file for that either...)

1 Like

Thank you again, you're a book of knowledge.

FYI - I proceeded with the following via stock developer ROM:

cd /tmp
mv openwrt-ramips-mt7621-xiaomi_mir3p-squashfs-factory.bin factory.bin
nvram set flag_try_sys1_failed=1
nvram set flag_try_sys2_failed=0
nvram set flag_boot_success=0
nvram commit
dd if=factory.bin bs=1M count=4 | nandwrite -m -p /dev/mtd9 -
dd if=factory.bin bs=1M skip=4 | nandwrite -m -p /dev/mtd10 -
reboot

The second i get to the line:

dd if=factory.bin bs=1M count=4 | nandwrite -m -p /dev/mtd9 -

Im presented with an error saying the following:

/bin/ash: nandwrite: not found
root@XiaoQiang:/tmp#

My device is currently in limbo at the moment as I can't proceed with that command.

@souk sorry forgot to tell you need to install the nand-utils package for nandwrite