Xiaomi WiFi Router 3G

That's very kind of you. Im quite excited to try build my own image. I all ready setup the environment. and build a test image. I notice that the kernel of my image is 4.9.82 and i didn't see any options to change this on the menuconfig. How did you change what kernel to build and is any specific reason you choose the for 4.14 ?
I aslo notice that you included userspace packages like luci i will like to do the same. but i din't figure it out yet :stuck_out_tongue:

add user space packages from
make menuconfig

to change default kernel change following in /target/linux/ramips/Makefile

@@ -13,7 +13,7 @@ SUBTARGETS:=mt7620 mt7621 mt76x8 rt288x rt305x rt3883
 FEATURES:=squashfs gpio
 MAINTAINER:=John Crispin <john@phrozen.org>
 
-KERNEL_PATCHVER:=4.9
+KERNEL_PATCHVER:=4.14

Incase you mess up router it is easy to recover if you have usb to serial ttl converter..

Changed to 4.14 to try HW offload

updated build to latest master (wifi fixes) https://github.com/openwrt/openwrt/commit/1f427bd6166afa2aa11384fa559be9459397a0fe
https://www.dropbox.com/s/k5wmyprw1wx4x2v/openwrt-ramips-mt7621-mir3g-squashfs-sysupgrade.tar?dl=0

1 Like

Guess it will be useful to spread interrupts across cores/threads

Thanks! Saw you post in another thread and was compiling version with your script...
Latest master https://github.com/openwrt/openwrt/commit/e52e8480add7607fe9643111d34ac3efdecad29a
Gcc 7.3
Kerner 4.14
latest MT76 https://github.com/openwrt/mt76/commit/cda627fd8feffdadfcd692fbb6d823d455aa19ab
Interrupts spread accross CPUs

You can test HW offload by using
iptables -I FORWARD 1 -m conntrack --ctstate RELATED,ESTABLISHED -j FLOWOFFLOAD

What are the benefits of this?

interrupts 2.4g/5g/ethernet/usb are spread across all 4 cpus thus cpu0 does not get hammered servicing all interrupts. i.e. should result in better performance

1 Like

I was wondering were the option for the user space packages was until i decided to clone again the repo, that solved the problem.

for the serial i did install permanent port on the back since i need it 4 times so far.

For the compilation i had only a small problem with the usb over ip. I excluded for now from the configuration.

Im considering flashing new u-boot, did anyone tried that so far ?

Tutorial: How to change the mac on the eeprom.
The 5Ghz radio is quite stubborn. Changing the mac with uci dosen't allow clients to connect. Only by writing on the eeprom i find that is possible to fix this. Since i didn't find anywhere else how to do it im sharing the way i used to solve this problem.

** Disclaimer: be careful, openwrt by default have lock the partition writing and we going to undo this. Wrong actions can hard brick your device. uart will not save you **

Ok, the setting that you will need to change is located in the mtd3 partition
dev: size erasesize name
mtd0: 00080000 00020000 "Bootloader"
mtd1: 00040000 00020000 "Config"
mtd2: 00040000 00020000 "Bdata"
mtd3: 00040000 00020000 "Factory" <---------------
mtd4: 00040000 00020000 "crash"
mtd5: 00040000 00020000 "crash_syslog"
mtd6: 00040000 00020000 "reserved0"
mtd7: 00400000 00020000 "kernel_stock"
mtd8: 00400000 00020000 "kernel"
mtd9: 07580000 00020000 "ubi"
you should have the same partition table else don't continue

  1. dump the partition
    dd if=/dev/mtd3 of=/tmp/mtd3
    (is a good idea to keep a backup from all the partitions so repeat this command changing the mtd3 with mtd0 mtd1 ... mtd8
    eg. dd if=/dev/mtd0 of=/tmp/mtd0
    you can skip mtd9 you can recover with out it in case something is go wrong)

  2. edit it on the computer with a hex editor (this step probably can be done here as well, i didn't spend the time to find how)

    a) transfer the file ( i chose scp for this step)
    (on the computer side)
    scp root@192.168.1.1:/tmp/mtd3 . (change the ip here if needed, don't forget the dot in the end, is a part of the command)

    b) find the mac
    find_the_mac

    c) open with a hex editor and find your mac (you should have only one result otherwise something is wrong)
    save_it

    d) edit with your desired mac and save it

  3. transfer the file back to your router
    (on the computer side)
    scp mtd3 root@192.168.1.1:/tmp/

  4. unlock the partition (you will need to install kmod-mtd-rw)
    insmod mtd-rw i_want_a_brick=1

  5. write the partition (be careful now)
    mtd write /tmp/mtd3 /dev/mtd3

  6. check before reboot the partition hash
    md5sum /tmp/mtd3
    md5sum /dev/mtd3
    they should match else write again the partition in the step 5
    if you did overwrite some other partition by mistyping DON'T REBOOT
    especially if is the mtd0 (is the u-boot partition your router will not boot if you overwrite it)
    If you didn't keep a backup in the beginning ask someone to send you the partition you need.

  7. reboot
    hopefully everything worked out

if you did find it useful give it a thumps up :sunny:

1 Like

i am sorry, but where i can find download link for minimal sysupgrade image with 4.14 kernel?

thanks

Official 4.14 sysupgrade images does not exist before "master" (snapshots) have switched to this kernel for the ramips architecture. So you either have to compile yourself or use unofficial images from someone else.

Could you please add dnscrypt-proxy with plugins support and sqm to your next image? I would like to run some tests. Thanks.

is this correct?
this script needs to be placed in /etc/init.d/set_cpu_affinity
make it executeable with chmod +x /etc/init.d/set_cpu_affinity
is this all? is kernel 4.14 needed for that or is it also possible with 4.9.x?
how to check if it is executed?

hi @mcaptur,

any way to fix this issue ?

Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-usb-storage:
 * 	kernel (= 4.9.85-1-45f0911785241c9bd2fe32250a47856f) * 	kernel (= 4.9.85-1-45f0911785241c9bd2fe32250a47856f) * 
 * opkg_install_cmd: Cannot install package kmod-usb-storage.

Im tryting to use usbstorage
Bus 001 Device 005: ID ffff:5678

but it doesnt works

and dont forget:

service set_cpu_affinity enable

TRy this https://www.dropbox.com/s/k5wmyprw1wx4x2v/openwrt-ramips-mt7621-mir3g-squashfs-sysupgrade.tar?dl=0
has kmod-usb-storage built-in....

Hello, I have a Linksys WAG120N ADSL router running through PPPOE bridged mode and I managed get the internet connection on the Mi 3G working by setting up a PPPOE interface using Luci. Though I can't seem to find a way to get DSL link status on OpenWRT. I really don't want to switch Mi 3G back to client mode and switch WAG120N back to PPPOE mode as WAG120N is doing its job poorly and I've managed to get really good results keeping it this way. I would really love to see DSL link status(as in attenuation, upstream and downstream rates) on OpenWRT. Is this even possible?

To make things clear:

ISP => WAG120N pass-through(PPPOE bridged) => Xiaomi 3G (PPPOE interface)

@mcaptur,

thanks !!! im close, but i need to mount now the filesystem and i need to install addons, ext.. and vfat: kmod-fs-vfat, please, could you compile and share it with me

root@RO:/# block info
/dev/mtdblock9: UUID="988608117" VERSION="1" TYPE="ubi"
/dev/ubiblock0_0: UUID="a08531ea-4eef5df2-7d77f973-974fb441" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/ubi0_1: UUID="005e3da5-bcca-4883-9305-98acdf222bd0" VERSION="w4r0" MOUNT="/overlay" TYPE="ubifs"
/dev/sda1: UUID="0000-0000" VERSION="FAT32" TYPE="vfat"


Installing kmod-fs-vfat (4.9.85-1) to root...
Downloading http://downloads.lede-project.org/snapshots/targets/ramips/mt7621/packages/kmod-fs-vfat_4.9.85-1_mipsel_24kc.ipk
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-fs-vfat:
 * 	kernel (= 4.9.85-1-45f0911785241c9bd2fe32250a47856f) * 	kernel (= 4.9.85-1-45f0911785241c9bd2fe32250a47856f) * 	kernel (= 4.9.85-1-45f0911785241c9bd2fe32250a47856f) * 	kernel (= 4.9.85-1-45f0911785241c9bd2fe32250a47856f) * 
 * opkg_install_cmd: Cannot install package kmod-fs-vfat.

> Installing blockd (2018-02-11-3d239815-1) to root...
> Downloading http://downloads.lede-project.org/snapshots/targets/ramips/mt7621/packages/blockd_2018-02-11-3d239815-1_mipsel_24kc.ipk
> Collected errors:
>  * satisfy_dependencies_for: Cannot satisfy the following dependencies for blockd:
 * 	kernel (= 4.9.85-1-45f0911785241c9bd2fe32250a47856f) * 
 * opkg_install_cmd: Cannot install package blockd.

Hi there in hungary we built an image with common nas functions like transmission, dlna, usb storage (ext4,vfat,fuse,ntfs-3g,nfsd,exfat), usb serial (cp2102,pl2303),samba,vsftpd,adblock, etherwake,ddns,mysql,etc...We used the stable released kernel (4.4.112) because of the hdd corruption bug which is presented in the new kernels.

We also added our autoumount hotplug script which is mount anonymous drives to /share by label if present if not then by uuid.
And our extension webserver which is created for create a lot of things for example statistics, format hdd, add label to hdd, create easily openvpn, guest wifi configuration and so on.. It is accessible on router_ip:9091 port( user and password like in luci which is also included.)If you want you could try it. There is a manifest file for included packages. Also available for dlink dir860l which uses the same soc. https://drive.google.com/open?id=1YDlmp94Tqmp2CNJ7CrAoEFMAYhjpPYm4

Maybe the changelog, and the firmware contain untranslated hungarian content.

@HeadLess @dissent1 found that his builds running on 7.3 do not suffer from the /dev/sd* data corruption issue. I also do not see it on mine.