New Xiaomi router AC2100

Youd could just try

mtd write xiaomi-router-kernel1.bin kernel
mtd -r write xiaomi-router-rootfs0.bin ubi

instead of recover it via stock firmware - as @ilyas previously mentioned it already. You can get these files from the link I posted above this post or you could compile it by your own.

you can also tftp boot the "initramfs" binary file and then do a sysupgrade from there (don't need to reinstall stock and then do things from there). i think this panic you're seeing has to do with the nand driver (we saw it a lot with the MIR3P... never really solved).

Whats benefits of your firmware over @ilyas's . Still stucked in 100mbps?

And is gpio scheme for RM2100(white 6antenna) or R2100(black cylinder)?

The 100 mbps issue was on my side due to wrong cables. It's now fully working with 1000mbps. No issues discovered until now. Everything seems to be working fine. Sorry for the confusion caused by this and thank you for your help.

There are no important gains in comparison to @ilyas version. I just retained the original mt76 line in the dts file instead of pci14c3 and I fixed some issues with the WAN LEDs. Everything else is pretty similar (even if I did it completely idependently which is funny) - it's just a little closer to the original device support commit. I even didn't recognize this thread before - that's why I ported the version on my own instead of continuing @ilyas work.

If further issues appear I will try to fix them and keep the repo updated. It would be great if somebody could also test this version. I'll upload another precompiled image with a bigger featureset later on.

Edit: New precompiled version with further addons added in Post 370

I was asked for gpio led schemes. But probably you missed it because my english sorry...
Are gpio schemes in your firmware for RM2100 or R2100??

And how about mt76 driver? Did you compared with mac drivers?

It's for the white 6-antenna model (RM2100).

I think pci14c3 vs mt76 won't make a difference.

It is quite late. I went long way. I reverted to stock firmware via DHCP TFTP and started from the scratch. Currently I am using smaller image from @scp07. At first glance I do not see any issue.

nope. no difference. loads the mt76 driver regardless.

EDIT: MAIN GPIO LEDS FIXED BY @scp07. Thanks a lot.
But amber switch leds still broken? Where can I get gpio numbers of them? They are not in xqled file.

Hi @namidairo . I need help with gpio leds. Can you help little bit?
I need help on openwrt-19.07 BRANCH


I got board.d/01_leds file from MIR3P but probably they won't work. I'm not sure gpio numbers are true probably they not too. xqled file is complicated wtf is purple? How can I combine multi gpio's for red?? Black and red has same numbers?

here is the xqled file of R2100

# unify led controller for miwifi xiaoqiang
# This config should be adapted, depends on platform gpio / driver model

#config active 'active'
#		option func  sys_ok
#		option lock 0


##### led gpio defines
# single color may composed from multi gpios

config led sys
    option yellow   '10'
    option blue     '12'
    option purple   '10 12'
    option red      '10 12' # red always same with purple for old platform
    option black    '10 12' # totally turn off led
    
config led func
    option yellow   '6'
    option blue     '8'
    option purple   '6 8'
    option black    '6 8'  # totally turn off led

##### funcs defined by uplayer
#   nled: led name - sys / 
#   color:   black / yellow / blue / red / purple ...
#	trigger: on / off / blink
#	msec_on: led on hold msec   # must be around by 100ms
#	msec_off: led off hold msec
#	priority: func priority reserve for multi-task compatition
#             high prio -> low : 1 - 7, temp reserve
config func 'sys_booting'
    option nled     'sys'
    option color    'yellow'
    option trigger  'on'
    option priority '1'

config func 'sys_ok'
    option nled     'sys'
    option color    'blue'
    option trigger  'on'
    option priority '7'

config func 'sys_ftmode'
    option nled     'sys'
    option color    'purple'
    option trigger  'on'
    option priority '1'

config func 'sys_ota'
    option nled     'sys'
    option color    'yellow'
    option trigger  'blink'
    option msec_on  '600'
    option msec_off '600'
    option priority '1'

config func 'sys_safemode'
    option nled     'sys'
    option color    'yellow'
    option trigger  'blink'
    option msec_on  '800'
    option msec_off '800'
    option priority '1'

config func 'sys_fail'
    option nled     'sys'
    option color    'yellow'
    option trigger  'on'
    option priority '1'

# turn off sys led
config func 'sys_off'
    option nled     'sys'
    option color    'black'
    option trigger  'off'
    option priority '1'

# turn off func led
config func 'func_off'
    option nled     'func'
    option color    'black'
    option trigger  'off'
    option priority '1'

config func 'link_down'
    option nled     'func'
    option color    'black'      # turn off
    option trigger  'off'
    option priority '5'

config func 'link_conning'
    option nled     'func'
    option color    'blue'
    option trigger  'blink'
    option msec_on  '300'
    option msec_off '300'
    option priority '5'

config func 'link_connfail'
    option nled     'func'
    option color    'yellow'
    option trigger  'on'
    option priority '5'

config func 'link_conned'
    option nled     'func'
    option color    'blue'
    option trigger  'on'
    option priority '7'


# memtest  ongoing & fail
config func 'memtest_ongo'
    option nled     'sys'
    option color    'blue'
    option trigger  'blink'
    option msec_on  '200'
    option msec_off '200'
    option priority '1'

config func 'memtest_fail'
    option nled     'sys'
    option color    'purple'
    option trigger  'blink'
    option msec_on  '400'
    option msec_off '400'
    option priority '1'

# log upload
config func 'log_upload'
    option nled     'sys'
    option color    'blue'
    option trigger  'blink'
    option msec_on  '1000'
    option msec_off '1000'
    option priority '1'

# blue led off
config func 'blueoff'
    option nled     'sys func'
    option color    'blue'
    option trigger  'off'
    option priority '1'

# off all leds
config func 'alloff'
    option nled     'sys func'
    option color    'black'
    option trigger  'off'
    option priority '1' 

Thanks for the note ... just to make sure, is it safe to apply the firmware designed for stock if I make the modifications to the names you outlined or is it still only advised to ever use a sysupgrade file?

One day as I am using firmware from @scp07. I made wifi speed test using iperf3. It gives me 400 Mbits/sec that is better than stock one (350), and than snapshot from master (280).
During the day I had issues with HTTPS certificates several times (it was issued to Default Company Ltd). Not sure is it related to router or my ISP/VPN.

Also I wanted to install kmod-hsdma-mtk that supposed to improve WiFi performance. I got an error The installed version of package kernel is not compatible, require 4.14.180-1-2e88863cā€¦ while 4.14.180-1-7831e39dā€¦ is installed.
As far as I understend kernel and modules must be build from same git commit. So modules from https://downloads.openwrt.org/releases/19.07-SNAPSHOT/ are not reusable with our custom builds and it is time to build it myself. Right?

I am novice to OpenWrt, but acording to common sense name doesn't metter. Binary content is important. Stock firmware and OpenWrt one has different formats, so it is not interchangable.
I flashed stock firmware using factory rested with DCHP/TFTP

I meant the target partition name, as they indicated in their post, which definitely does matter.

Everything is explained in detail here: https://openwrt.org/toh/xiaomi/xiaomi_redmi_router_ac2100

Partition names if you are already on OpenWRT:

mtd write xiaomi-router-kernel1.bin kernel
mtd write xiaomi-router-rootfs0.bin ubi

Partition names if you are on stock firmware:

mtd write xiaomi-router-kernel1.bin kernel1
mtd -r write xiaomi-router-rootfs0.bin rootfs0
1 Like

Yes, you're right. That's one of the biggest downsides of using snapshot images. The only way around this would be to use the latest stable version (19.07.3). This was published on the 16th of May 2020.

Do you want me to also prepare images for 19.07.3? With that you could just install packages by using the online downloader / installer and use precompiled packages from the official download repo.

It would be really nice. But I want to learn to build it myself anyway.

New tree created for 19.07.3 - backport already in. If you use that for compilation you'll get a 19.07.3 image and you're able to use all the precompiled packages from the official download repo or directly from the package downloader in LUCI.

Github repo for the new 19.07.3 backport: https://github.com/phs07/openwrt/tree/openwrt-19.07.3_xiaomi_ac2100

I'll compile the same two image versions like for the 19.07 snapshot again and upload it later. However I won't include kmod-hsdma-mtk as I'm not completely sure if this could have an impact in terms of stability. But in contradiction to the snapshot version you'll be able to install it on top of the image directly from the precompiled packages.

Just a few seconds ago I found the first issue.

Has anyone an idea how to troubleshoot this (dmesg output):

[63295.479007] mt7615e 0000:01:00.0: Message 37 (seq 10) timeout
[63315.958463] mt7615e 0000:01:00.0: Message 50 (seq 11) timeout
[63336.437912] mt7615e 0000:01:00.0: Message 50 (seq 12) timeout
[63356.917392] mt7615e 0000:01:00.0: Message 50 (seq 13) timeout
[63377.396861] mt7615e 0000:01:00.0: Message 50 (seq 14) timeout
[63397.876372] mt7615e 0000:01:00.0: Message 50 (seq 15) timeout
[63418.355903] mt7615e 0000:01:00.0: Message 37 (seq 1) timeout
[63438.835333] mt7615e 0000:01:00.0: Message 50 (seq 2) timeout
[63459.314827] mt7615e 0000:01:00.0: Message 37 (seq 3) timeout
[63479.794264] mt7615e 0000:01:00.0: Message 50 (seq 4) timeout

I found a similar problem here: https://github.com/openwrt/mt76/issues/344 but at that topic it seemed to be a hardware issue and it was related to the usage of VHT80 and warming of the chip. I'll get two further devices within the next few weeks to check if it could be a hardware fault also on my device. Currently I think it could also be a mt76 driver issue.

Similar to the issue linked above the impact was:

  • 5Ghz Wifi is down and it's not possible to restart it (only possible by rebooting the device)

Any idea how to go on with that? I'm not experienced in troubleshooting wifi drivers so I would be really happy about some hints.

The 19.07.3 backported version is ready now.

Supported Model: Xiaomi Redmi Router AC2100 (RM2100 white edition)

Additionally to the images also all kmods are included in the zip files. The images are now completely compatible to the official download repository.

Basic version (including luci-ssl, ca-bundle, hostapd, iw-full and wpa-supplicant-mesh-openssl):

Full list of included packages in the basic version:

CONFIG_TARGET_ramips=y
CONFIG_TARGET_ramips_mt7621=y
CONFIG_TARGET_ramips_mt7621_DEVICE_xiaomi_redmi-router-ac2100=y
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
CONFIG_KERNEL_BUILD_DOMAIN="buildhost"
CONFIG_KERNEL_BUILD_USER="builder"
# CONFIG_KERNEL_KALLSYMS is not set
CONFIG_OPENSSL_ENGINE=y
CONFIG_OPENSSL_PREFER_CHACHA_OVER_GCM=y
CONFIG_OPENSSL_WITH_ASM=y
CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y
CONFIG_OPENSSL_WITH_CMS=y
CONFIG_OPENSSL_WITH_DEPRECATED=y
CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y
CONFIG_OPENSSL_WITH_PSK=y
CONFIG_OPENSSL_WITH_SRP=y
CONFIG_OPENSSL_WITH_TLS13=y
CONFIG_PACKAGE_ca-bundle=y
CONFIG_PACKAGE_hostapd=y
# CONFIG_PACKAGE_iw is not set
CONFIG_PACKAGE_iw-full=y
CONFIG_PACKAGE_libiwinfo-lua=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_libopenssl=y
CONFIG_PACKAGE_libopenssl-conf=y
CONFIG_PACKAGE_libubus-lua=y
CONFIG_PACKAGE_libustream-openssl=y
CONFIG_PACKAGE_lua=y
CONFIG_PACKAGE_openssl-util=y
CONFIG_PACKAGE_rpcd=y
CONFIG_PACKAGE_rpcd-mod-file=y
CONFIG_PACKAGE_rpcd-mod-iwinfo=y
CONFIG_PACKAGE_uhttpd=y
CONFIG_PACKAGE_wpa-supplicant-mesh-openssl=y
# CONFIG_PACKAGE_wpad-basic is not set

Advanced version including a lot more addons (useful things like OpenVPN, SothetherVPN, wireguard, socat, stunnel, ddns, wol, tcpdump, iperf3...):

If you use this image, please keep in mind to disable the startup of services you don't need (e.g. SoftetherVPN). Otherwise you will waste resources for things you don't use (you can disable services easily by going to System-->Startup in LUCI). Be careful: watchcat is also included. By default a script is predefined to reboot the device if 8.8.8.8 is not reachable for 6 hours. If you don't want that to happen you have to disable the watchcat service or modify the settings (e.g. in Luci: Services --> Watchcat).

Full list of included packages in the advanced version:

CONFIG_TARGET_ramips=y
CONFIG_TARGET_ramips_mt7621=y
CONFIG_TARGET_ramips_mt7621_DEVICE_xiaomi_redmi-router-ac2100=y
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
CONFIG_DROPBEAR_ECC=y
CONFIG_DROPBEAR_ECC_FULL=y
CONFIG_GETDNS_ENABLE_STUB_ONLY=y
CONFIG_KERNEL_BUILD_DOMAIN="buildhost"
CONFIG_KERNEL_BUILD_USER="builder"
# CONFIG_KERNEL_KALLSYMS is not set
CONFIG_LIBCURL_COOKIES=y
CONFIG_LIBCURL_FILE=y
CONFIG_LIBCURL_FTP=y
CONFIG_LIBCURL_HTTP=y
CONFIG_LIBCURL_MBEDTLS=y
CONFIG_LIBCURL_NO_SMB="!"
CONFIG_LIBCURL_PROXY=y
CONFIG_OPENSSL_ENGINE=y
CONFIG_OPENSSL_PREFER_CHACHA_OVER_GCM=y
CONFIG_OPENSSL_WITH_ASM=y
CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y
CONFIG_OPENSSL_WITH_CMS=y
CONFIG_OPENSSL_WITH_DEPRECATED=y
CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y
CONFIG_OPENSSL_WITH_PSK=y
CONFIG_OPENSSL_WITH_SRP=y
CONFIG_OPENSSL_WITH_TLS13=y
CONFIG_OPENVPN_openssl_ENABLE_DEF_AUTH=y
CONFIG_OPENVPN_openssl_ENABLE_FRAGMENT=y
CONFIG_OPENVPN_openssl_ENABLE_LZ4=y
CONFIG_OPENVPN_openssl_ENABLE_LZO=y
CONFIG_OPENVPN_openssl_ENABLE_MULTIHOME=y
CONFIG_OPENVPN_openssl_ENABLE_PF=y
CONFIG_OPENVPN_openssl_ENABLE_PORT_SHARE=y
CONFIG_OPENVPN_openssl_ENABLE_SERVER=y
CONFIG_OPENVPN_openssl_ENABLE_SMALL=y
CONFIG_PACKAGE_TAR_BZIP2=y
CONFIG_PACKAGE_TAR_GZIP=y
CONFIG_PACKAGE_TAR_XZ=y
CONFIG_PACKAGE_batctl-default=y
CONFIG_PACKAGE_bzip2=y
CONFIG_PACKAGE_ca-bundle=y
CONFIG_PACKAGE_ca-certificates=y
CONFIG_PACKAGE_cgi-io=y
CONFIG_PACKAGE_curl=y
CONFIG_PACKAGE_ddns-scripts=y
CONFIG_PACKAGE_etherwake=y
CONFIG_PACKAGE_ethtool=y
CONFIG_PACKAGE_getdns=y
CONFIG_PACKAGE_gzip=y
CONFIG_PACKAGE_hostapd=y
CONFIG_PACKAGE_iftop=y
CONFIG_PACKAGE_ip-tiny=y
CONFIG_PACKAGE_iperf3=y
# CONFIG_PACKAGE_iw is not set
CONFIG_PACKAGE_iw-full=y
CONFIG_PACKAGE_kmod-batman-adv=y
CONFIG_PACKAGE_kmod-crypto-crc32c=y
CONFIG_PACKAGE_kmod-crypto-hash=y
CONFIG_PACKAGE_kmod-lib-crc16=y
CONFIG_PACKAGE_kmod-lib-crc32c=y
CONFIG_PACKAGE_kmod-tun=y
CONFIG_PACKAGE_kmod-udptunnel4=y
CONFIG_PACKAGE_kmod-udptunnel6=y
CONFIG_PACKAGE_kmod-wireguard=y
CONFIG_PACKAGE_libbz2=y
CONFIG_PACKAGE_libcurl=y
CONFIG_PACKAGE_libgd=y
CONFIG_PACKAGE_libiwinfo-lua=y
CONFIG_PACKAGE_libjpeg=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_liblucihttp=y
CONFIG_PACKAGE_liblucihttp-lua=y
CONFIG_PACKAGE_liblzma=y
CONFIG_PACKAGE_liblzo=y
CONFIG_PACKAGE_libmbedtls=y
CONFIG_PACKAGE_libmnl=y
CONFIG_PACKAGE_libncurses=y
CONFIG_PACKAGE_libopenssl=y
CONFIG_PACKAGE_libopenssl-conf=y
CONFIG_PACKAGE_libpcap=y
CONFIG_PACKAGE_libpcre=y
CONFIG_PACKAGE_libpng=y
CONFIG_PACKAGE_libreadline=y
CONFIG_PACKAGE_librt=y
CONFIG_PACKAGE_libsmartcols=y
CONFIG_PACKAGE_libtirpc=y
CONFIG_PACKAGE_libubus-lua=y
CONFIG_PACKAGE_libustream-openssl=y
CONFIG_PACKAGE_libyaml=y
CONFIG_PACKAGE_lscpu=y
CONFIG_PACKAGE_lsof=y
CONFIG_PACKAGE_lua=y
CONFIG_PACKAGE_luci=y
CONFIG_PACKAGE_luci-app-ddns=y
CONFIG_PACKAGE_luci-app-firewall=y
CONFIG_PACKAGE_luci-app-ntpc=y
CONFIG_PACKAGE_luci-app-openvpn=y
CONFIG_PACKAGE_luci-app-opkg=y
CONFIG_PACKAGE_luci-app-vnstat=y
CONFIG_PACKAGE_luci-app-watchcat=y
CONFIG_PACKAGE_luci-app-wireguard=y
CONFIG_PACKAGE_luci-app-wol=y
CONFIG_PACKAGE_luci-base=y
CONFIG_PACKAGE_luci-compat=y
CONFIG_PACKAGE_luci-lib-ip=y
CONFIG_PACKAGE_luci-lib-ipkg=y
CONFIG_PACKAGE_luci-lib-jsonc=y
CONFIG_PACKAGE_luci-lib-nixio=y
CONFIG_PACKAGE_luci-mod-admin-full=y
CONFIG_PACKAGE_luci-mod-network=y
CONFIG_PACKAGE_luci-mod-status=y
CONFIG_PACKAGE_luci-mod-system=y
CONFIG_PACKAGE_luci-proto-ipv6=y
CONFIG_PACKAGE_luci-proto-ppp=y
CONFIG_PACKAGE_luci-proto-relay=y
CONFIG_PACKAGE_luci-proto-wireguard=y
CONFIG_PACKAGE_luci-ssl-openssl=y
CONFIG_PACKAGE_luci-theme-bootstrap=y
CONFIG_PACKAGE_ntpclient=y
CONFIG_PACKAGE_openssl-util=y
CONFIG_PACKAGE_openvpn-easy-rsa=y
CONFIG_PACKAGE_openvpn-openssl=y
CONFIG_PACKAGE_perl=y
CONFIG_PACKAGE_perlbase-base=y
CONFIG_PACKAGE_perlbase-bytes=y
CONFIG_PACKAGE_perlbase-class=y
CONFIG_PACKAGE_perlbase-config=y
CONFIG_PACKAGE_perlbase-dynaloader=y
CONFIG_PACKAGE_perlbase-errno=y
CONFIG_PACKAGE_perlbase-essential=y
CONFIG_PACKAGE_perlbase-fcntl=y
CONFIG_PACKAGE_perlbase-filehandle=y
CONFIG_PACKAGE_perlbase-getopt=y
CONFIG_PACKAGE_perlbase-io=y
CONFIG_PACKAGE_perlbase-list=y
CONFIG_PACKAGE_perlbase-net=y
CONFIG_PACKAGE_perlbase-posix=y
CONFIG_PACKAGE_perlbase-scalar=y
CONFIG_PACKAGE_perlbase-selectsaver=y
CONFIG_PACKAGE_perlbase-socket=y
CONFIG_PACKAGE_perlbase-symbol=y
CONFIG_PACKAGE_perlbase-tie=y
CONFIG_PACKAGE_perlbase-time=y
CONFIG_PACKAGE_perlbase-xsloader=y
CONFIG_PACKAGE_relayd=y
CONFIG_PACKAGE_rpcd=y
CONFIG_PACKAGE_rpcd-mod-file=y
CONFIG_PACKAGE_rpcd-mod-iwinfo=y
CONFIG_PACKAGE_rpcd-mod-luci=y
CONFIG_PACKAGE_rpcd-mod-rrdns=y
CONFIG_PACKAGE_snapshot-tool=y
CONFIG_PACKAGE_socat=y
CONFIG_PACKAGE_softethervpn-base=y
CONFIG_PACKAGE_softethervpn-server=y
CONFIG_PACKAGE_stubby=y
CONFIG_PACKAGE_stunnel=y
CONFIG_PACKAGE_tar=y
CONFIG_PACKAGE_tcpdump=y
CONFIG_PACKAGE_terminfo=y
CONFIG_PACKAGE_uhttpd=y
CONFIG_PACKAGE_unzip=y
CONFIG_PACKAGE_vnstat=y
CONFIG_PACKAGE_vnstati=y
CONFIG_PACKAGE_wakeonlan=y
CONFIG_PACKAGE_watchcat=y
CONFIG_PACKAGE_wget=y
CONFIG_PACKAGE_wireguard-tools=y
CONFIG_PACKAGE_wpa-supplicant-mesh-openssl=y
# CONFIG_PACKAGE_wpad-basic is not set
CONFIG_PACKAGE_xz=y
CONFIG_PACKAGE_xz-utils=y
CONFIG_PACKAGE_zlib=y
CONFIG_PERL_NOCOMMENT=y
CONFIG_PERL_THREADS=y
CONFIG_SOCAT_SSL=y

Compiled from https://github.com/phs07/openwrt/tree/openwrt-19.07.3_xiaomi_ac2100

If you want to compile it on your own but you still want to stay compatible to the official download repository make sure that you include these lines in your seed file used for creating the defconfig:

CONFIG_TARGET_ramips=y
CONFIG_TARGET_ramips_mt7621=y
CONFIG_TARGET_ramips_mt7621_DEVICE_xiaomi_redmi-router-ac2100=y
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
CONFIG_KERNEL_BUILD_DOMAIN="buildhost"
CONFIG_KERNEL_BUILD_USER="builder"
# CONFIG_KERNEL_KALLSYMS is not set

Additionally don't change anything from the kernel settings and don't deselect kmods. You can choose to integrate specific ones directly into your image but it's important that all of them are compiled and nothing is deselected - otherwise the vermagic will differ from the official repository.
To check if your own compilation is compatible to the official repository of 19.07.3 just test it directly from your build root:

find build_dir/ -name .vermagic -exec cat {} \;

The output should match 2e88863ccdd594fb8e842df3c25842ee

Any feedback is welcome.

4 Likes

same with the previous posts... sysupgrade will do pretty much the same but try to preserve configuration. mtd write etc is "safe" yes :slight_smile: