Support for Xiaomi Wifi R3P Pro?

:grinning: You are right of course. I'm just trying to be helpful...

Yeah))) It's finaly booted))) You're the best))
Here's the log: https://yadi.sk/i/eBXJvt-VD3x62g

Now we'll test reverting to pandora and installation of openwrt from pandora without pbboot) I'll provide log for pandora without pbboot)

Hi all! I have a R3P with Micron memory and I've just installed OpenWRT from dev stock. So, I'm ready to participate in the testing program, if there is still anything left to test :wink:

@andreykiselev welcome! yes we need Micron testers...! when you say you've "installed OpenWRT from dev stock"... is that one of my releases? which one? any problems installing? do you have logs? do you have bad blocks? (more later...)

@pellmen glad to know the universe hasn't freaked out on me and i can still think logically :wink:

however ... ahem:

[ 2.522531] nand: Micron NAND 256MiB 3,3V 8-bit
[ 2.527042] nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64

you my friend have a Micron!..... (unfortunately no bad blocks....)

let me know if the "restore" to pandorabox works

1 Like

@ilyas, Yes, it's your v0.1-rc1+mt7615e-5 (the most recent one, I guess). No problems during installation. The only thing I can see now is that I cannot mount USB stick, but I guess it's just some missing kernel module. I see in dmesg that it gets plugged in. The full log is available here: https://ufile.io/7368u. Not sure about bad blocks... My setup is a little weird, because I initially bricked the router by flashing a faulty pbboot. So, I ended up flashing a raw bin file from other chap to an empty NAND chip and soldering it on my board. And I just ignored any OOB records. So, I guess my NAND does have bad blocks, as any other NAND from factory, but my OOB does not correspond to it... Dunno if that helps :wink:

@ilyas, when we tried to revert to pandora, we tried to do this from usb flash (fat32 and it was mounting in pandora) because of 260Mb backup. But usb don't want to mount:

[  550.743585] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 1127.444190] mtk_soc_eth 1e100000.ethernet eth0: port 1 link down
[ 1138.055289] mtk_soc_eth 1e100000.ethernet eth0: port 3 link down
[ 1139.329422] mtk_soc_eth 1e100000.ethernet eth0: port 4 link up
[ 1142.363779] mtk_soc_eth 1e100000.ethernet eth0: port 3 link up
[ 1142.407425] pppoe-wan6: renamed from ppp0
[ 1390.480759] usb 1-1: USB disconnect, device number 3
[ 1537.666023] usb 1-1: new high-speed USB device number 4 using xhci-mtk
[ 1537.851143] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 1537.858059] scsi host0: usb-storage 1-1:1.0
[ 1540.435231] scsi 0:0:0:0: Direct-Access     JetFlash Transcend 8GB    1100 PQ: 0 ANSI: 0 CCS
[ 1540.447228] sd 0:0:0:0: [sda] 15663104 512-byte logical blocks: (8.02 GB/7.47 GiB)
[ 1540.455426] sd 0:0:0:0: [sda] Write Protect is off
[ 1540.460857] sd 0:0:0:0: [sda] No Caching mode page found
[ 1540.466190] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 1540.477358]  sda: sda1 sda2
[ 1540.482946] sd 0:0:0:0: [sda] Attached SCSI removable disk

[ 2059.852731] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 2059.859758] scsi host0: usb-storage 1-1:1.0
[ 2062.302590] scsi 0:0:0:0: Direct-Access     JetFlash Transcend 8GB    1100 PQ: 0 ANSI: 0 CCS
[ 2062.314229] sd 0:0:0:0: [sda] 15663104 512-byte logical blocks: (8.02 GB/7.47 GiB)
[ 2062.322467] sd 0:0:0:0: [sda] Write Protect is off
[ 2062.327847] sd 0:0:0:0: [sda] No Caching mode page found
[ 2062.333169] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 2062.344205]  sda: sda1
[ 2062.349409] sd 0:0:0:0: [sda] Attached SCSI removable disk
root@OpenWrt:~# mount
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/ubi0_1 on /overlay type ubifs (rw,noatime,ubi=0,vol=1)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
root@OpenWrt:~#

@PeLLmEn @ilyas Hm... I have the same problem with mounting USB drive. The same messages in the logs:

[ 3946.931315] usb 1-1: new high-speed USB device number 3 using xhci-mtk
[ 3947.112973] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 3947.119652] scsi host0: usb-storage 1-1:1.0
[ 3948.161998] scsi 0:0:0:0: Direct-Access     SanDisk  Cruzer Colors+   8.01 PQ: 0 ANSI: 0 CCS
[ 3948.172544] sd 0:0:0:0: [sda] 3907583 512-byte logical blocks: (2.00 GB/1.86 GiB)
[ 3948.180241] sd 0:0:0:0: [sda] Write Protect is off
[ 3948.185038] sd 0:0:0:0: [sda] Mode Sense: 45 00 00 08
[ 3948.190311] sd 0:0:0:0: [sda] No Caching mode page found
[ 3948.195649] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 3948.206359]  sda: sda1
[ 3948.210952] sd 0:0:0:0: [sda] Attached SCSI removable disk

And then I see sda and sda1 as files in dev.

so mount it
mount /dev/sda1 /path/to/mount

@lolyinseo Nope:

root@OpenWrt:~# mount /dev/sda1 /mnt/sda1
lowntfs-3g: Failed to access volume '/dev/sda1': No such file or directory

lowntfs-3g 2017.3.23 external FUSE 29 - Third Generation NTFS Driver
		Configuration type 3, XATTRS are on, POSIX ACLS are off

Copyright (C) 2005-2007 Yura Pakhuchiy
Copyright (C) 2006-2009 Szabolcs Szakacsits
Copyright (C) 2007-2017 Jean-Pierre Andre
Copyright (C) 2009 Erik Larsson

Usage:    lowntfs-3g [-o option[,...]] <device|image_file> <mount_point>

Options:  ro (read-only mount), windows_names, uid=, gid=,
          umask=, fmask=, dmask=, streams_interface=.
          Please see the details in the manual (type: man ntfs-3g).

Example: ntfs-3g /dev/sda1 /mnt/windows

News, support and information:  http://tuxera.com
ntfs-3g: Failed to access volume '/dev/sda1': No such file or directory

ntfs-3g 2017.3.23 external FUSE 29 - Third Generation NTFS Driver
		Configuration type 1, XATTRS are on, POSIX ACLS are off

Copyright (C) 2005-2007 Yura Pakhuchiy
Copyright (C) 2006-2009 Szabolcs Szakacsits
Copyright (C) 2007-2017 Jean-Pierre Andre
Copyright (C) 2009 Erik Larsson

Usage:    ntfs-3g [-o option[,...]] <device|image_file> <mount_point>

Options:  ro (read-only mount), windows_names, uid=, gid=,
          umask=, fmask=, dmask=, streams_interface=.
          Please see the details in the manual (type: man ntfs-3g).

Example: ntfs-3g /dev/sda1 /mnt/windows

News, support and information:  http://tuxera.com
mount: mounting /dev/sda1 on /mnt/sda1 failed: No such file or directory

i just write for example, check you /dev/

@lolyinseo It is actually sda1. The same message from mount with either fat or ntfs.
[UPDATE] Actually, this worked:

mount -t vfat /dev/sda1 /mnt/
[  202.624678] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

One more thing, my settings do not persist after reboot.

@ilyas, so copy to root folder worked (instead of /tmp, that said the file is too big) and we get back to pandora without issues!

1 Like

@andreykiselev @pellmen @lolyinseo

actually those aren't error messages. they're "happy messages" telling us USB is working (it doesn't mount automatically... there might be a package for doing that.. don't know what it is ;))

the "error" you were all seeing is because /mnt/sda1 doesn't exist :wink: (because you didn't create it)

mkdir /mnt/sda1
mount /dev/sda1 /mnt/sda1
1 Like

@andreykiselev about settings not persisting after reboot.. yes this is very interesting to me...

  1. can you check you can write to the filesystem? ie:
mount
cat /proc/mounts
touch /root/a
dd if=/dev/mtd1 of=/root/mtd1
ls -l /root

if the files aren't there then there's something seriously wrong... if they are, but they disappear after reboot, then there should be something in your bootlog (post it here... i'll probably notice something you didn't :wink: )

@pellmen you also have a Micron chip... do you also see the "settings are not saved" problem (someone on 4pda was also saying the same)?

@pellmen great! i suppose the file is too big, but that seems risky to me (to read from a partition you're writing to at the same time.............. seems like a stupid idea).

the really lame thing is that there's an openwrt "optimization" that apparently makes things 5% faster but it means it wastes half of our RAM as "high memory" that the kernel can't use directly... i've also noticed problems writing to /tmp (which is RAM) and "out of space" errors although there's plenty of free memory.... i mean, our NAND is 256 and our RAM is 512... there's no way it shouldn't all fit in /tmp... but it says it's "full" that's retarded. we bought a 512MB router and we can only use 256MB? unfortunately that "optimization" seems to be baked into the kernel... i'm going to try to undo it (but not today...)

anyway @pellmen... the short comment is:

that may work but it seems pretty risky... especially the bit that says mtd erase ubi... if that stuff is cached (which it probably was in your case because you were trying to read it or something) maybe it will be OK but in general it's the same as cutting off the branch you're sitting on...

so, please, keep pandorabox-backup.img on a USB stick and do it from there (ie, don't copy to /tmp)... that seems saner

@ilyas Here is the log of file creation:

root@OpenWrt:/mnt/sda1# mount
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
tmpfs on /tmp/root type tmpfs (rw,noatime,mode=755)
overlayfs:/tmp/root on / type overlay (rw,noatime,lowerdir=/,upperdir=/tmp/root/upper,workdir=/tmp/root/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
/dev/sda1 on /mnt/sda1 type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
root@OpenWrt:/mnt/sda1# cat /proroot@OpenWrt:/mnt/sda1# cat /proc/moaroot@OpenWrt:/mnt/sda1# cat /proc/mouroot@OpenWrt:/mnt/sda1# cat /proc/mounts a
/dev/root /rom squashfs ro,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,noatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,noatime 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,noatime 0 0
tmpfs /tmp/root tmpfs rw,noatime,mode=755 0 0
overlayfs:/tmp/root / overlay rw,noatime,lowerdir=/,upperdir=/tmp/root/upper,workdir=/tmp/root/work 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,size=512k,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,mode=600,ptmxmode=000 0 0
debugfs /sys/kernel/debug debugfs rw,noatime 0 0
/dev/sda1 /mnt/sda1 vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
root@OpenWrt:/mnt/sda1# toaroot@OpenWrt:/mnt/sda1# touroot@OpenWrt:/mnt/sda1# touch /roaroot@OpenWrt:/mnt/sda1# touch /ro
rom/   root/
root@OpenWrt:/mnt/sda1# touch /rooroot@OpenWrt:/mnt/sda1# touch /root/a
root@OpenWrt:/mnt/sda1# dd if =/deva/mtatd1 of=/root/mtd1
512+0 records in
512+0 records out
root@OpenWrt:/mnt/sda1# ll /rooroot@OpenWrt:/mnt/sda1# ll /root/
drwxr-xr-x    1 root     root            80 Mar  8 07:35 ./
drwxr-xr-x    1 root     root           120 Jan  1  1970 ../
-rw-r--r--    1 root     root             0 Mar  8 07:35 a
-rw-r--r--    1 root     root        262144 Mar  8 07:35 mtd1
root@OpenWrt:/mnt/sda1# reboot

And they disappeared after the reboot. The boot log is available here: https://ufile.io/wc36h.

[Update] Looking at my own log, could this be a problem?

# MTK NAND # : Use HW ECC

I actually disabled internal ECC in the NAND chip when flashing raw bin image and did not enable it back. So, U-Boot can mistakenly think that it should rely on internal NAND ECC generator and then expect to get correct verification. Do you know if it's possible to write a command sequence to NAND chip from u-boot or from the running system? I don't really want to desolder NAND chip again to set the flag.

1 Like

Maybe it will help?) I think maybe you'll compile the firmware with all packages preinstalled - it would be better, than install every package manualy.

@andreykiselev sorry i'm the wrong person to ask about anything hardware related :wink: if you know the magic sequence (what memory address, whatever) to enable ECC for your chip, yes it can be done (presumably from the kernel)... but you'd have to find that. i'll help you with the code if you need it :wink:

but it looks like your system is freaking out in general...

Data buffer not 16 bytes aligned: 8ffe16c8
...
[    3.271742] compare signature failed 1f840.
...
[    3.280011] load_fact_bbt failed
...
[   12.660959] UBIFS error (ubi0:1 pid 491): ubifs_recover_master_node: failed to recover master node
[   12.669897] UBIFS error (ubi0:1 pid 491): ubifs_recover_master_node: dumping first master node
...
[   12.787364] UBIFS (ubi0:1): background thread "ubifs_bgt0_1" stops
[   12.794761] mount_root: failed to mount -t ubifs /dev/ubi0_1 /tmp/overlay: Invalid argument
[   12.803384] mount_root: overlay filesystem has not been fully initialized yet
[   12.810868] mount_root: switching to ubifs overlay
[   12.815730] mount_root: switching to ubifs failed - fallback to ramoverlay

I guess you're rather the "exception" in that you've seriously messed around with your hardware... the average user may not have the same experience.... @souk do you think you can provide similar boot logs? your problem appears to be the same... (failure to mount ubifs partition after boot)

@andreykiselev how about stock xiaomi? any problems with that (with your hacked NAND chip i mean).... i saw the bbt messages on your log but otherwise it looks sane

could you revert to stock and try again, this time with a mtd erase of roofs0 and rootfs1 and overlay?

cd /tmp
mv openwrt-ramips-mt7621-xiaomi_mir3p-squashfs-factory.bin factory.bin
dd if=factory.bin bs=1M count=4 | mtd write - kernel1
mtd erase rootfs0
mtd erase rootfs1
mtd erase overlay
dd if=factory.bin bs=1M skip=4 | mtd write - rootfs0

@pellmen i think those mtd erases are a good idea in general...

also, @andreykiselev, if you don't mind (and especially if the mtd erase lines don't make a difference)

can you setup a tftpd server, tftp boot initramfs-kernel.bin (latest), then

ubiformat -v -y /dev/mtd9
ubiattach -p /dev/mtd9

then copy over sysupgrade.bin (to /tmp !) and:

sysupgrade sysupgrade.bin

and reboot.

I will still try to track down the "read only root" problem you're having (how annoying) but I want to see if the above give better results....

EDIT: i didn't say it very clearly, but from your boot log it's obvious that your overlay read/write partition failed to mount, so it switched to "ramoverlay" which obviously isn't persistent storage (RAM... cleared on power-off). the "why" is more interesting...

EDIT2: @andreykiselev can you also give me the output of

mtdinfo -a

2 Likes