Xiaomi WiFi Router 3G

Ok, I've earned the basic trust level, so now I can reply. :wink:

Not much actually. I've seen it usually after first boot following sysupgrade. I supposed it had something to do with 'opkg update' and 'opkg install', because after each sysupgrade I restore ddns-scripts (with dependencies). Except those, I haven't seen any new "Data buffer not 16 bytes aligned" message for 4 days of uptime. So I've checked it specifically, with 'opkg update' (nothing in logs) and 'opkg install mtr' (several "Data buffer not 16 bytes aligned" entries). This looks like an 100% reproducible way for me.

Just did a build (OpenWrt SNAPSHOT r6745-b1f5dd3) with standard kernel (4.14.34) and wireguard seems to work just as expected. No reboots. The interface goes up automatically when the router boots and my Android device that is also running latest wireguard snapshot (0.0.20180420) can connect without issues.

Ok, i did never write anything other than configs because i build my firmware always with all needed packages...
So the unaligned access is only on writes.
Hopfully with no data loss or corruption...
If i had time, i will take a look in the mentioned mtd patch...

1 Like

Hi, can someone post guide or link for wireguard installation guide? I never use it before. Thanks :wink:

Also for me, I'm using Windows 10 with https://tunsafe.com/ client.

i tested it. here is the error from the crash log:

[   59.290912] CPU 3 Unable to handle kernel paging request at virtual address 00000010, epc == 8f122d44, ra == 8f122d1c
[   59.301505] Oops[#1]:
[   59.303770] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.14.34 #0
[   59.309748] task: 8fc44b00 task.stack: 8fc70000
[   59.314252] $ 0   : 00000000 00000001 00000000 fffffffe
[   59.319465] $ 4   : 00000000 805c0000 8f243864 00000020
[   59.324689] $ 8   : 8f243874 c0000000 f0000000 ff000000
[   59.329906] $12   : ffff0000 00000007 00000018 c66b9a56
[   59.335116] $16   : 8e80c840 8f796000 8d810000 00000000
[   59.340325] $20   : 8e94e800 80550000 805568e8 ffffffff
[   59.345534] $24   : 00000000 8000cf54
[   59.350745] $28   : 8fc70000 8fc15ae8 8d810054 8f122d1c
[   59.355955] Hi    : 00002665
[   59.358815] Lo    : 94af5487
[   59.361721] epc   : 8f122d44 noise_handshake_begin_session+0xd04/0x12b0 [wireguard]
[   59.369348] ra    : 8f122d1c noise_handshake_begin_session+0xcdc/0x12b0 [wireguard]
[   59.376962] Status: 11007c03      KERNEL EXL IE
[   59.381136] Cause : 40800008 (ExcCode 02)
[   59.385133] BadVA : 00000010
[   59.388002] PrId  : 0001992f (MIPS 1004Kc)
[   59.392074] Modules linked in: pppoe ppp_async pppox ppp_generic nf_conntrack_ipv6 mt76x2e mt7603e mt76 mac80211 iptable_nat ipt_REJECT$
[   59.462829]  sch_htb sch_hfsc sch_ingress ledtrig_usbport ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_mangle ip6table$
[   59.488504] Process swapper/3 (pid: 0, threadinfo=8fc70000, task=8fc44b00, tls=00000000)
[   59.496553] Stack : 00000001 8e9e8958 8f11cc80 8e343400 8fd4c000 401d5829 00000040 8e80c840
[   59.504891]         805b1718 00000003 8e80c840 00000000 8d810000 00000000 8e94e800 80550000
[   59.513227]         805568e8 ffffffff 8d810054 8032ad50 8d810000 8032a918 00000000 00000000
[   59.521566]         00000000 80550000 8e80c840 805561b8 8d810000 805b1718 00000003 805788f8
[   59.529900]         8e94e800 00000001 8ead5d80 8032b5fc 8feffa08 8d810000 00000001 8fc15b94
[   59.538232]         ...
[   59.540682] Call Trace:
[   59.543144] [<8f122d44>] noise_handshake_begin_session+0xd04/0x12b0 [wireguard]
[   59.550437] [<8032b5fc>] __dev_queue_xmit+0x6f0/0x85c
[   59.555487] [<8033b6c0>] neigh_xmit+0x104/0x1ec
[   59.560011] [<8e9ca718>] nf_flow_offload_ip_hook+0x564/0x5ac [nf_flow_table]
[   59.567048] [<80366c64>] nf_hook_slow+0x58/0x104
[   59.571669] [<80325d34>] __netif_receive_skb_core+0x5f0/0xc5c
[   59.577387] [<8032c028>] netif_receive_skb_internal+0xd8/0xf0
[   59.583115] [<8041c824>] br_pass_frame_up+0xdc/0x144
[   59.588055] [<8041cdb8>] br_handle_frame_finish+0x52c/0x570
[   59.593603] [<8041d184>] br_handle_frame+0x330/0x3dc
[   59.598545] [<80325ecc>] __netif_receive_skb_core+0x788/0xc5c
[   59.604278] [<80328c90>] process_backlog+0x98/0x160
[   59.609135] [<8032c494>] net_rx_action+0x150/0x30c
[   59.613931] [<8044d610>] __do_softirq+0x128/0x2ec
[   59.618624] [<800328e0>] irq_exit+0x98/0xcc
[   59.622809] [<80239abc>] plat_irq_dispatch+0xfc/0x138
[   59.627844] [<8000b5a8>] except_vec_vi_end+0xb8/0xc4
[   59.632790] [<8000cf70>] r4k_wait_irqoff+0x1c/0x24
[   59.637581] [<8006620c>] do_idle+0xe4/0x168
[   59.641748] [<80066488>] cpu_startup_entry+0x24/0x2c
[   59.646687] Code: 8e020048  00431024  00402025 <8c420010> 8c420014  0040f809  27b30018  0040a825  8e02009c
[   59.656413]
[   59.658074] ---[ end trace 05987436b60c7b6c ]---

Did you change the kernel config?
Eg. preemption?

i found the error. offloading and wireguard dont work. I disabled offloading in the firewall settings now wireguard is working.

1 Like

Have you opened a bug report regarding this issue on the Flyspray tracker? Because then @nbd might be able to have a look and hopefully fix the issue :slight_smile:

Hi guys.
I installed LEDE on sunday, but my router has only 10% available RAM most of the time.

I looked the processes and there is nothing that shows the high consumption.

What will be the problem?
I have installed Transmission, Network Shares, SQM, HDD Idle, uHTTPd, Dynamic DNS and Adblock.

Thanks for the help and sorry for my english.

Do you really mean available and not free?
Kernel buffers read and write if you access storage device.
Whats your value for buffer?

1 Like

I used this opkgscriptsh plugin, but after the upgrade, this folder /usr/lib/OpenWrtScripts has been deleted.
Whats wrong?

It is completly normal when much read/write occurs than linux uses most of the ram as diskcache and flushes only if other programs will need the memory. Check the cached memory amount with "top" in a ssh session
There is nothing to worry about.

Wifi 2.4 Ghz is now running pretty well with the latest commit.

Thank you nbd and updatete for your efforts.

Only problem left is one of my two usb disk not getting recognized.

xhci-mtk 1e1c0000.xhci: Mismatch between completed Set TR Deq Ptr command & xHCI internal state.

1 Like

Thats my output of free, but i do not use a storage device other than the integrated nand.
I only use sqm, openvpn and luci.

root@OpenWrt_MiR3G:~# free
             total       used       free     shared    buffers     cached
Mem:        253652      79432     174220       1092       5796      20444
-/+ buffers/cache:      53192     200460

Luci is only consistent with buffer and free on my device...

What are your values after restart?

You could try to flush caches with following commands:
ssh -> router:

  • sync (write cached data to disk)
  • echo 3 > /proc/sys/vm/drop_caches
1 Like

Apparently has 175MB in cache:

Mem: 226132K used, 27300K free, 2508K shrd, 1656K buff, 175144K cached
CPU:   0% usr   0% sys   0% nic  98% idle   0% io   0% irq   0% sirq
Load average: 0.17 0.28 0.31 3/81 24641
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
23717  3668 nobody   S     2892   1%   0% /usr/sbin/smbd -F
  136     2 root     IW       0   0%   0% [kworker/1:1]
24641 24633 root     R     1220   0%   0% top
24632  1383 root     S     1136   0%   0% /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 22 -K 300 -T 3
 4401     1 transmis SN    4892   2%   0% transmission-daemon -g /home/transmission -f
 1252     1 root     S     1728   1%   0% /sbin/netifd
 2637     1 root     S     1712   1%   0% /usr/sbin/hostapd -s -P /var/run/wifi-phy0.pid -B /var/run/hostapd-phy0.conf
    7     2 root     SW       0   0%   0% [ksoftirqd/0]
  195     2 root     SW       0   0%   0% [kswapd0]
 7826     1 dnsmasq  S     7936   3%   0% /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c -k -x /var/run/dnsmasq/dnsmasq.cfg01411c.pid
 3437     1 root     S     2620   1%   0% /usr/sbin/uhttpd -f -h /www -r Skyrim -x /cgi-bin -u /ubus -t 60 -T 30 -k 20 -A 1 -n 3 -N 100 -R -p 0.0.0.0:80 -p [::]:80 -C /etc/ssl/mycert.crt -K /etc/ss
 3669     1 root     S     2468   1%   0% /usr/sbin/nmbd -F
 3668     1 root     S     2460   1%   0% /usr/sbin/smbd -F
 1177     1 root     S     2200   1%   0% /sbin/rpcd
 2462     1 root     S     1712   1%   0% /usr/sbin/hostapd -s -P /var/run/wifi-phy1.pid -B /var/run/hostapd-phy1.conf
    1     0 root     S     1556   1%   0% /sbin/procd
 1324     1 root     S     1428   1%   0% /usr/sbin/odhcpd
 3816     1 root     S     1408   1%   0% /bin/sh /usr/lib/ddns/dynamic_dns_updater.sh -v 0 -S duckdns -- start
 1160     1 root     S     1276   1%   0% /sbin/logd -S 64
 1356     1 root     S     1208   0%   0% /usr/sbin/crond -f -c /etc/crontabs -l 8
 3966     1 root     S<    1208   0%   0% /usr/sbin/ntpd -n -N -S /usr/sbin/ntpd-hotplug -p 0.openwrt.pool.ntp.org -p 1.openwrt.pool.ntp.org -p 2.openwrt.pool.ntp.org -p 3.openwrt.pool.ntp.org
24614  3816 root     S     1208   0%   0% sleep 600
  657     1 root     S     1204   0%   0% /sbin/ubusd
24633 24632 root     S     1204   0%   0% -ash
 1541  1252 root     S     1204   0%   0% udhcpc -p /var/run/udhcpc-eth0.2.pid -s /lib/netifd/dhcp.script -f -t 0 -i eth0.2 -x hostname:Skyrim -C -O 121
 1383     1 root     S     1068   0%   0% /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 22 -K 300 -T 3
 1526  1252 root     S     1032   0%   0% odhcp6c -s /lib/netifd/dhcpv6.script -Ntry -P0 -t120 eth0.2
 3468     1 root     S      972   0%   0% /usr/sbin/vsftpd
 1410     1 root     S      908   0%   0% /usr/bin/hd-idle -d -i 0 -a sda -i 600
  658     1 root     S      904   0%   0% /sbin/askfirst /usr/libexec/login.sh
    8     2 root     IW       0   0%   0% [rcu_sched]
   66     2 root     IW       0   0%   0% [kworker/3:1]
    3     2 root     IW       0   0%   0% [kworker/0:0]
  510     2 root     SW       0   0%   0% [usb-storage]
  196     2 root     IW       0   0%   0% [kworker/2:1]
   14     2 root     SW       0   0%   0% [ksoftirqd/1]
   24     2 root     SW       0   0%   0% [ksoftirqd/3]
   19     2 root     SW       0   0%   0% [ksoftirqd/2]
24512     2 root     IW       0   0%   0% [kworker/u8:2]
24564     2 root     IW       0   0%   0% [kworker/u8:0]
   13     2 root     SW       0   0%   0% [migration/1]
   23     2 root     SW       0   0%   0% [migration/3]
   18     2 root     SW       0   0%   0% [migration/2]
   10     2 root     SW       0   0%   0% [migration/0]
24615     2 root     IW       0   0%   0% [kworker/u8:1]
  386     2 root     SW       0   0%   0% [ubi_bgt0d]
    2     0 root     SW       0   0%   0% [kthreadd]
  484     2 root     SW       0   0%   0% [ubifs_bgt0_1]
   11     2 root     SW       0   0%   0% [cpuhp/0]
  678     2 root     SW       0   0%   0% [jbd2/sda1-8]
  393     2 root     IW<      0   0%   0% [kworker/3:1H]
  391     2 root     IW<      0   0%   0% [kworker/0:1H]
  392     2 root     IW<      0   0%   0% [kworker/1:1H]
  394     2 root     IW<      0   0%   0% [kworker/2:1H]
  255     2 root     IW<      0   0%   0% [pencrypt]
  257     2 root     IW<      0   0%   0% [pdecrypt]
  171     2 root     IW<      0   0%   0% [watchdogd]
  140     2 root     IW<      0   0%   0% [crypto]
  138     2 root     IW<      0   0%   0% [writeback]
  142     2 root     IW<      0   0%   0% [kblockd]
  679     2 root     IW<      0   0%   0% [ext4-rsv-conver]
  508     2 root     SW       0   0%   0% [scsi_eh_0]
  509     2 root     IW<      0   0%   0% [scsi_tmf_0]
 2089     2 root     IW       0   0%   0% [kworker/2:2]

After the flush command:

Mem: 56692K used, 196740K free, 2508K shrd, 816K buff, 8088K cached

Thanks again! :slight_smile:

1 Like

But you shouldn't flush the caches because with the cache you use the unused mem.
So this commands are only for testing!

1 Like

The Hdd data coruption issue may finally have been resolved so there is no need to stay on 4.4 kernel anymore. Can anyone confirm this?
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/generic/pending-4.14/103-MIPS-c-r4k-fix-data-corruption-related-to-cache-coherence.patch;h=3cfbd2ce9169e8eff7a891438753ba8201cf5294;hb=79126770868995faa8656f6687a88d385802e34b

Sometimes my 2.4 network gets an exclamation and no internet signal. What will it be?

Are you using the latest snapshot?

I use this:

OpenWrt SNAPSHOT r6744-751746c / LuCI Master (git-18.111.46781-6280487)