Support for Xiaomi Wifi R3P Pro?


#283

@pellmen OK i can't see anything obviously wrong.. is this your system? are you using pb-boot instead of uboot? and how did it "crash" (ie, bootlog).... if they compiled their own bootloader, it might be hard-coded to boot from 0x200000 (ie, no "kernel0" and "kernel1" magic)... assuming that (and guessing at how it " crashed") here's a hack:

dd if=factory.bin of=kernel1.bin bs=1M count=4
cat kernel1.bin factory.bin | mtd write - firmware

in other words, assuming the bootloader will always load from 0x200000, we'll put our openwrt kernel there (overwriting "kernel_stock"), then copy the factory.bin over so we'll end up with kernel1 + kernel1 + ubi on disk... at boot the bootloader will load the kernel from 0x200000 and then the kernel will mount rootfs at 0xa00000 ... at least, that's the idea. it's a hack. try it :slight_smile:


#284

@lolyinseo well it can't load the mac address either... what i hope is that the dts file is all busted up and this will give me an opportunity to discover the bugs... but then... maybe the mt7615 code is all bogus and untested :wink: remember, they didn't come out and say "hey we'd love you to test this code we think it's great..." we just grabbed their code, so it's not fair to expect it to work :wink:

but of course... maybe it's something as simple as "the package doesn't put the eeprom files in the right place" :slight_smile:


#285

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


#286

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)


#287

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:


#288

@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...)


#289

@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


#290

@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:


#291

@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:~#

#292

@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.


#293

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


#294

@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

#295

i just write for example, check you /dev/


#296

@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.

#297

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


#298

@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!


#299

@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

#300

@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)?


#301

@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


#302

@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.