Support for Xiaomi Wifi R3P Pro?


#223

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.


#224

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


#225

Fire the information or process over and i will try.

I think we desperately need to start updating that OpenWRT support page with some links and commands etc, I think it will really help.


#226

@souk oh wait. sorry my bad... i could swear "nandwrite" was on stock xiaomi... i guess it's not. skip this one. can you try "regular" installation again? (just in case you luck out and it fails again)... although i'm starting to suspect it has to do with data in the /overlay partition that changes the equation....

EDIT: i thought the toh page has a lot of stuff... let me know what else you think we need?


#227

I used this installation method starting with the following files on my USB:

openwrt-ramips-mt7621-xiaomi_mir3p-squashfs-factory.bin
miwifi_ssh.bin

I logged in via SSH via the R3Ps router's IP address and followed the instructions found on this page:

https://openwrt.org/inbox/xiaomi/xiaomi_r3p_pro#info seen below:

cd /extdisks/sda1 #(can be different if you remove and reinsert the usb stick)
mv openwrt-ramips-mt7621-xiaomi_mir3p-squashfs-factory.bin factory.bin # give it a shorter name
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 | mtd write - kernel1
mtd erase rootfs0
mtd erase rootfs1
mtd erase overlay
dd if=factory.bin bs=1M skip=4 | mtd write - rootfs0
reboot

This was captured on the Putty interface that i was typing in the commands on:

login as: root
root@192.168.28.1's password:


BusyBox v1.19.4 (2017-08-25 14:54:27 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

 -----------------------------------------------------
       Welcome to XiaoQiang!
 -----------------------------------------------------
  $$$$$$\  $$$$$$$\  $$$$$$$$\      $$\      $$\        $$$$$$\  $$\   $$\
 $$  __$$\ $$  __$$\ $$  _____|     $$ |     $$ |      $$  __$$\ $$ | $$  |
 $$ /  $$ |$$ |  $$ |$$ |           $$ |     $$ |      $$ /  $$ |$$ |$$  /
 $$$$$$$$ |$$$$$$$  |$$$$$\         $$ |     $$ |      $$ |  $$ |$$$$$  /
 $$  __$$ |$$  __$$< $$  __|        $$ |     $$ |      $$ |  $$ |$$  $$<
 $$ |  $$ |$$ |  $$ |$$ |           $$ |     $$ |      $$ |  $$ |$$ |\$$\
 $$ |  $$ |$$ |  $$ |$$$$$$$$\       $$$$$$$$$  |       $$$$$$  |$$ | \$$\
 \__|  \__|\__|  \__|\________|      \_________/        \______/ \__|  \__|


root@XiaoQiang:~# cd /extdisks/sda1
root@XiaoQiang:/extdisks/sda1# mv openwrt-ramips-mt7621-xiaomi_mir3p-squashfs-factory.bin factory.bin
root@XiaoQiang:/extdisks/sda1# nvram set flag_try_sys1_failed=1
root@XiaoQiang:/extdisks/sda1# nvram set flag_try_sys2_failed=0
root@XiaoQiang:/extdisks/sda1# nvram set flag_boot_success=0
root@XiaoQiang:/extdisks/sda1# nvram commit
root@XiaoQiang:/extdisks/sda1# dd if=factory.bin bs=1M count=4 | mtd write - kernel1
Unlocking kernel1 ...

Writing from <stdin> to kernel1 ...  [e]4Failed to erase block
+0 records in
4+0 records out
4194304 bytes (4.0MB) copied, 1.654131 seconds, 2.4MB/s
root@XiaoQiang:/extdisks/sda1# mtd erase rootfs0
Unlocking rootfs0 ...
Erasing rootfs0 ...

Skipping bad block at 0xe80000   root@XiaoQiang:/extdisks/sda1# mtd erase rootfs1
Unlocking rootfs1 ...
Erasing rootfs1 ...

Skipping bad block at 0x8a0000
Skipping bad block at 0x1120000   root@XiaoQiang:/extdisks/sda1# mtd erase overlay
Unlocking overlay ...
Erasing overlay ...
root@XiaoQiang:/extdisks/sda1# dd if=factory.bin bs=1M skip=4 | mtd write - rootfs0
Unlocking rootfs0 ...

Writing from <stdin> to rootfs0 ...  [e]5+1 records in
5+1 records out
5636[w] bytes (5.4MB) copied, 2.133730 seconds, 2.5MB/s
root@XiaoQiang:/extdisks/sda1#

Also worth noting, any changes I make when I log in to the OpenWRT 192.168.1.1 interface are NOT saved. Creating a password shows as saved when I hit the save button, securing my WIFI with a password shows as saved too, but it doesn't actually apply or change the actual WIFI name or password. When I reboot OpenWRT is basically back to stock again and im presented with the message to create a password to secure my router / SSH. Nothing at all saves, perhaps I've got a read only file system as none of my packages will update either

opkg install* command failed with code255`


#228
root@OpenWrt:/tmp# opkg install kmod-fs-ntfs_4.14.104-1_mipsel_24kc.ipk
Installing kmod-fs-ntfs (4.14.104-1) to root...
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-fs-ntfs:
 *      kernel (= 4.14.104-1-eb8ed4b9bf234e78fd5debca12157d30)
 * opkg_install_cmd: Cannot install package kmod-fs-ntfs.
root@OpenWrt:/tmp# opkg --force-depends install kmod-fs-ntfs_4.14.104-1_mipsel_24kc.ipk
Installing kmod-fs-ntfs (4.14.104-1) to root...
Configuring kmod-fs-ntfs.
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-fs-ntfs:
 *      kernel (= 4.14.104-1-eb8ed4b9bf234e78fd5debca12157d30)
root@OpenWrt:/tmp# /sbin/block mount
block: /dev/ubiblock0_0 is already mounted on /rom
block: /dev/ubi0_1 is already mounted on /overlay
block: mounting /dev/sda1 (ntfs) as /mnt/sda1 failed (22) - Invalid argument
root@OpenWrt:/tmp# opkg install kmod-fs-ntfs_4.14.104-1_mipsel_24kc.ipk
Package kmod-fs-ntfs (4.14.104-1) installed in root is up to date.
root@OpenWrt:/tmp# opkg --force-depends install kmod-fuse_4.14.104-1_mipsel_24kc.ipk
Package kmod-fuse (4.14.104-1) installed in root is up to date.
root@OpenWrt:/tmp# /sbin/block mount
block: /dev/ubiblock0_0 is already mounted on /rom
block: /dev/ubi0_1 is already mounted on /overlay
block: mounting /dev/sda1 (ntfs) as /mnt/sda1 failed (22) - Invalid argument
root@OpenWrt:/tmp# opkg install ntfs-3g_2017.3.23-1-fuseint_mipsel_24kc.ipk
Installing ntfs-3g (2017.3.23-1-fuseint) to root...
Configuring ntfs-3g.
Create '/etc/filesystems'.
Add 'ntfs-3g' to known filesystems.
root@OpenWrt:/tmp# /sbin/block mount
block: /dev/ubiblock0_0 is already mounted on /rom
block: /dev/ubi0_1 is already mounted on /overlay
block: mounting /dev/sda1 (ntfs) as /mnt/sda1 failed (22) - Invalid argument

It's verryyyy annoying. I read a guide that asked me to check if the filesystem is supported in /proc/filesystems

root@OpenWrt:/tmp# /proc/filesystems
-ash: /proc/filesystems: Permission denied
root@OpenWrt:/tmp# cat /proc/filesystems
nodev   sysfs
nodev   rootfs
nodev   ramfs
nodev   bdev
nodev   proc
nodev   tmpfs
nodev   debugfs
nodev   sockfs
nodev   bpf
nodev   pipefs
nodev   devpts
        squashfs
nodev   jffs2
nodev   overlay
nodev   ubifs
        vfat
        msdos
        ntfs


#229

@ilyas, about the driver. I've installed the keenetic ultra (kn-1810) firmware to my router. I'll be back to testing openwrt when i'll upgrade my router to dualboot (insert one more nand and make a button to boot from one of installed chips, one nand (esmt) will be with openwrt, another (maybe samsung K9F1G08U0) for keenetic).

Driver (5.0.3.1) on keenetic works amazingly fast!!! Better then on stock or any other firmware. I can take it out (but it's already compiled, there's no sources...) if you'll tell me what files do you need.

PS: if you haven't seen this yet - MT7615 WIFI chip sources


#230

Any ideas why i seem to be getting some kind of write permission issue somewhere along the line after following the standard installation method?


#231

Maybe you could give some kind of detailed description of this write permission issue?


#232

Hi thmomas , I did a few posts above, if you don't mind scrolling up.


#233

@pjgowtham I can't truthfully say I've ever used /sbin/block mount ...what about this:

mkdir -p /mnt/sda1
ntfs-3g /dev/sda1 /mnt/sda1 -o rw,sync

in your particular case, almost certainly it's still trying to use the kmod-fs-ntfs module instead of ntfs-3g which is why you're getting the same error message


#234

@souk those are bad blocks.... so i'm curious. what happened after you installed that way and rebooted? boot loop? (i mean... you already said after the first install -- when it bootlooped -- you re-installed and it was fine)... i guess i just want to make sure you didn't get another broken install (actually i'm hoping you'll get a broken install so we can debug it and figure out what's going wrong)

EDIT: your log stops after you've done the flashing (but doesn't have a "reboot"...) do you have a log for the reboot?


#235
root@OpenWrt:~# mkdir -p /mnt/sda1
root@OpenWrt:~# ntfs-3g /dev/sda1 /mnt/sda1 -o rw,sync
1 module could not be probed
- fuse
ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root
root@OpenWrt:~# modprobe fuse
1 module could not be probed
- fuse

I don't have any latest kernel packages installed for now. I installed the packages locally from the links you gave me.


#236

@pjgowtham that is annoying :wink: what does dmesg say?

how about find /lib/modules ?


#237
root@OpenWrt:~# find /lib/modules
/lib/modules
/lib/modules/4.14.104
/lib/modules/4.14.104/crc-ccitt.ko
/lib/modules/4.14.104/fat.ko
/lib/modules/4.14.104/gpio-button-hotplug.ko
/lib/modules/4.14.104/ip6_tables.ko
/lib/modules/4.14.104/ip6t_REJECT.ko
/lib/modules/4.14.104/ip6table_filter.ko
/lib/modules/4.14.104/ip6table_mangle.ko
/lib/modules/4.14.104/ip_tables.ko
/lib/modules/4.14.104/ipt_MASQUERADE.ko
/lib/modules/4.14.104/ipt_REJECT.ko
/lib/modules/4.14.104/iptable_filter.ko
/lib/modules/4.14.104/iptable_mangle.ko
/lib/modules/4.14.104/iptable_nat.ko
/lib/modules/4.14.104/leds-gpio.ko
/lib/modules/4.14.104/ledtrig-usbport.ko
/lib/modules/4.14.104/msdos.ko
/lib/modules/4.14.104/mt7615e.ko
/lib/modules/4.14.104/nf_conntrack.ko
/lib/modules/4.14.104/nf_conntrack_ipv4.ko
/lib/modules/4.14.104/nf_conntrack_ipv6.ko
/lib/modules/4.14.104/nf_conntrack_rtcache.ko
/lib/modules/4.14.104/nf_defrag_ipv4.ko
/lib/modules/4.14.104/nf_defrag_ipv6.ko
/lib/modules/4.14.104/nf_flow_table.ko
/lib/modules/4.14.104/nf_flow_table_hw.ko
/lib/modules/4.14.104/nf_log_common.ko
/lib/modules/4.14.104/nf_log_ipv4.ko
/lib/modules/4.14.104/nf_log_ipv6.ko
/lib/modules/4.14.104/nf_nat.ko
/lib/modules/4.14.104/nf_nat_ipv4.ko
/lib/modules/4.14.104/nf_nat_masquerade_ipv4.ko
/lib/modules/4.14.104/nf_nat_redirect.ko
/lib/modules/4.14.104/nf_reject_ipv4.ko
/lib/modules/4.14.104/nf_reject_ipv6.ko
/lib/modules/4.14.104/nls_base.ko
/lib/modules/4.14.104/nls_cp437.ko
/lib/modules/4.14.104/nls_iso8859-1.ko
/lib/modules/4.14.104/nls_utf8.ko
/lib/modules/4.14.104/ppp_async.ko
/lib/modules/4.14.104/ppp_generic.ko
/lib/modules/4.14.104/pppoe.ko
/lib/modules/4.14.104/pppox.ko
/lib/modules/4.14.104/scsi_mod.ko
/lib/modules/4.14.104/sd_mod.ko
/lib/modules/4.14.104/slhc.ko
/lib/modules/4.14.104/usb-common.ko
/lib/modules/4.14.104/usb-storage.ko
/lib/modules/4.14.104/usbcore.ko
/lib/modules/4.14.104/vfat.ko
/lib/modules/4.14.104/x_tables.ko
/lib/modules/4.14.104/xhci-hcd.ko
/lib/modules/4.14.104/xhci-mtk.ko
/lib/modules/4.14.104/xhci-pci.ko
/lib/modules/4.14.104/xhci-plat-hcd.ko
/lib/modules/4.14.104/xt_FLOWOFFLOAD.ko
/lib/modules/4.14.104/xt_LOG.ko
/lib/modules/4.14.104/xt_REDIRECT.ko
/lib/modules/4.14.104/xt_TCPMSS.ko
/lib/modules/4.14.104/xt_comment.ko
/lib/modules/4.14.104/xt_conntrack.ko
/lib/modules/4.14.104/xt_limit.ko
/lib/modules/4.14.104/xt_mac.ko
/lib/modules/4.14.104/xt_mark.ko
/lib/modules/4.14.104/xt_multiport.ko
/lib/modules/4.14.104/xt_nat.ko
/lib/modules/4.14.104/xt_state.ko
/lib/modules/4.14.104/xt_tcpudp.ko
/lib/modules/4.14.104/xt_time.ko
/lib/modules/4.14.104/fuse.ko
/lib/modules/4.14.104/ntfs.ko

dmesg : https://justpaste.it/6ngpz
Too long to attach here


#238

@pjgowtham that's bizarre... nothing about 'fuse' in dmesg? wait a bit i'll try it out on my router and let you know...

EDIT: @pjgowtham until then... try this:

lsmod | grep fuse
cd /lib/modules/4.14.104
insmod ./fuse.ko
lsmod | grep fuse

#239

I got something about fuse on dmesg before. You might wanna check this out too.

[22134.749411] :MtCmdPktBudgetCtrl: bssid(255),wcid(65535),type(1)
[22136.959299] :MtCmdPktBudgetCtrl: bssid(255),wcid(65535),type(0)
[22517.321729] AP SETKEYS DONE - AKMMap=WPA2PSK, PairwiseCipher=AES, GroupCipher=AES from 02:1E:A6:08:3C:D5
[22517.321729]
[22517.332823] AP SETKEYS DONE - AKMMap=WPA2PSK, PairwiseCipher=AES, GroupCipher=AES from 84:F3:EB:AF:AD:06
[22517.332823]
[22517.343785] AP SETKEYS DONE - AKMMap=WPA2PSK, PairwiseCipher=AES, GroupCipher=AES from 84:F3:EB:AF:A7:83
[22517.343785]
[22529.750165] AP SETKEYS DONE - AKMMap=WPA2PSK, PairwiseCipher=AES, GroupCipher=AES from 24:4C:E3:7E:AB:FE
[22529.750165]
[22529.768171] AP SETKEYS DONE - AKMMap=WPA2PSK, PairwiseCipher=AES, GroupCipher=AES from E4:46:DA:77:88:64
[22529.768171]
[22818.047721] Rcv Wcid(1) AddBAReq
[22818.051004] Start Seq = 00000001
[22818.484689] :MtCmdPktBudgetCtrl: bssid(255),wcid(65535),type(1)
[22819.584619] :MtCmdPktBudgetCtrl: bssid(255),wcid(65535),type(0)
[22959.371631] :MtCmdPktBudgetCtrl: bssid(255),wcid(65535),type(1)
[22962.671512] :MtCmdPktBudgetCtrl: bssid(255),wcid(65535),type(0)
[22967.081447] :MtCmdPktBudgetCtrl: bssid(255),wcid(65535),type(1)
[22968.181381] :MtCmdPktBudgetCtrl: bssid(255),wcid(65535),type(0)
[22972.581306] :MtCmdPktBudgetCtrl: bssid(255),wcid(65535),type(1)
[22973.681349] :MtCmdPktBudgetCtrl: bssid(255),wcid(65535),type(0)
[23946.077638] fuse: Unknown symbol forget_all_cached_acls (err 0)
[23946.083642] fuse: Unknown symbol posix_acl_default_xattr_handler (err 0)
[23946.090495] fuse: Unknown symbol posix_acl_from_xattr (err 0)
[23946.096472] fuse: Unknown symbol posix_acl_access_xattr_handler (err 0)
[23946.103138] fuse: Unknown symbol posix_acl_to_xattr (err 0)
[23947.370893] fuse: Unknown symbol forget_all_cached_acls (err 0)
[23947.376861] fuse: Unknown symbol posix_acl_default_xattr_handler (err 0)
[23947.383723] fuse: Unknown symbol posix_acl_from_xattr (err 0)
[23947.389668] fuse: Unknown symbol posix_acl_access_xattr_handler (err 0)
[23947.396325] fuse: Unknown symbol posix_acl_to_xattr (err 0)
[23955.437488] fuse: Unknown symbol forget_all_cached_acls (err 0)
[23955.443491] fuse: Unknown symbol posix_acl_default_xattr_handler (err 0)
[23955.450348] fuse: Unknown symbol posix_acl_from_xattr (err 0)
[23955.456292] fuse: Unknown symbol posix_acl_access_xattr_handler (err 0)
[23955.462940] fuse: Unknown symbol posix_acl_to_xattr (err 0)
root@OpenWrt:~# lsmod | grep fuse
root@OpenWrt:~# cd /lib/modules/4.14.104
root@OpenWrt:/lib/modules/4.14.104# insmod ./fuse.ko
failed to insert ./fuse.ko
root@OpenWrt:/lib/modules/4.14.104# lsmod | grep fuse
root@OpenWrt:/lib/modules/4.14.104#

#240

@pjgowtham alright the log explains it... missing dependency for fuse (or.. did i compile the kernel with the wrong flags?)


#241

I see. I guess i'll try it out in your next release then. Thanks for your patience.


#242

@souk i guess i mis-read your message... i missed the part that says it looks like you have a read-only filesystem... can you give me your boot log? (dmesg)

also, what do the following say:

mtdinfo -a
mtdinfo -u /dev/mtd9
dd if=/dev/mtd8 of=/root/kernel-test #this is to see if you can actually write

the sooner you can get me the logs the sooner we can figure out what's wrong... i'm reluctant to "push" openwrt support for the mir3p until at least i know what's going wrong with Micron chips... so... please help :wink:

EDIT: @souk also give me the output of

mount

and run

mtd unlock ubi

and tell me if that changes anything (that's possibly the problem...)