al177 / esp8089

Linux kernel module driver for the ESP8089 WiFi chip
GNU General Public License v2.0
180 stars 114 forks source link

Linux driver esp8266 long ping #26

Closed voloviq closed 6 years ago

voloviq commented 6 years ago

Hello, I encounter some problem with access to the network through wifi. Device and driver connect to access point. The connection is stable. The problem is when I ping this device. Please take a look at the log

PING 192.168.1.213 (192.168.1.213) 56(84) bytes of data. 64 bytes from 192.168.1.213: icmp_seq=1 ttl=64 time=802 ms 64 bytes from 192.168.1.213: icmp_seq=2 ttl=64 time=36.3 ms 64 bytes from 192.168.1.213: icmp_seq=3 ttl=64 time=753 ms 64 bytes from 192.168.1.213: icmp_seq=4 ttl=64 time=43.5 ms 64 bytes from 192.168.1.213: icmp_seq=5 ttl=64 time=193 ms 64 bytes from 192.168.1.213: icmp_seq=6 ttl=64 time=77.0 ms 64 bytes from 192.168.1.213: icmp_seq=7 ttl=64 time=56.0 ms 64 bytes from 192.168.1.213: icmp_seq=8 ttl=64 time=293 ms 64 bytes from 192.168.1.213: icmp_seq=9 ttl=64 time=2640 ms 64 bytes from 192.168.1.213: icmp_seq=10 ttl=64 time=1640 ms 64 bytes from 192.168.1.213: icmp_seq=11 ttl=64 time=640 ms 64 bytes from 192.168.1.213: icmp_seq=12 ttl=64 time=75.0 ms 64 bytes from 192.168.1.213: icmp_seq=13 ttl=64 time=240 ms 64 bytes from 192.168.1.213: icmp_seq=14 ttl=64 time=14.3 ms 64 bytes from 192.168.1.213: icmp_seq=15 ttl=64 time=3.10 ms 64 bytes from 192.168.1.213: icmp_seq=16 ttl=64 time=29.3 ms 64 bytes from 192.168.1.213: icmp_seq=17 ttl=64 time=114 ms 64 bytes from 192.168.1.213: icmp_seq=18 ttl=64 time=41.0 ms 64 bytes from 192.168.1.213: icmp_seq=19 ttl=64 time=207 ms 64 bytes from 192.168.1.213: icmp_seq=20 ttl=64 time=651 ms 64 bytes from 192.168.1.213: icmp_seq=21 ttl=64 time=1217 ms 64 bytes from 192.168.1.213: icmp_seq=22 ttl=64 time=639 ms 64 bytes from 192.168.1.213: icmp_seq=23 ttl=64 time=1252 ms 64 bytes from 192.168.1.213: icmp_seq=24 ttl=64 time=245 ms 64 bytes from 192.168.1.213: icmp_seq=25 ttl=64 time=548 ms 64 bytes from 192.168.1.213: icmp_seq=26 ttl=64 time=1122 ms 64 bytes from 192.168.1.213: icmp_seq=27 ttl=64 time=796 ms 64 bytes from 192.168.1.213: icmp_seq=28 ttl=64 time=365 ms 64 bytes from 192.168.1.213: icmp_seq=29 ttl=64 time=5048 ms 64 bytes from 192.168.1.213: icmp_seq=30 ttl=64 time=5027 ms 64 bytes from 192.168.1.213: icmp_seq=31 ttl=64 time=4027 ms 64 bytes from 192.168.1.213: icmp_seq=32 ttl=64 time=3027 ms 64 bytes from 192.168.1.213: icmp_seq=33 ttl=64 time=2027 ms 64 bytes from 192.168.1.213: icmp_seq=34 ttl=64 time=1027 ms 64 bytes from 192.168.1.213: icmp_seq=35 ttl=64 time=1931 ms 64 bytes from 192.168.1.213: icmp_seq=36 ttl=64 time=5387 ms 64 bytes from 192.168.1.213: icmp_seq=37 ttl=64 time=4387 ms 64 bytes from 192.168.1.213: icmp_seq=38 ttl=64 time=13706 ms 64 bytes from 192.168.1.213: icmp_seq=39 ttl=64 time=12698 ms 64 bytes from 192.168.1.213: icmp_seq=40 ttl=64 time=11690 ms 64 bytes from 192.168.1.213: icmp_seq=41 ttl=64 time=10682 ms 64 bytes from 192.168.1.213: icmp_seq=42 ttl=64 time=9681 ms 64 bytes from 192.168.1.213: icmp_seq=43 ttl=64 time=8674 ms From 192.168.1.213 icmp_seq=88 Destination Host Unreachable From 192.168.1.213 icmp_seq=89 Destination Host Unreachable From 192.168.1.213 icmp_seq=90 Destination Host Unreachable From 192.168.1.213 icmp_seq=91 Destination Host Unreachable From 192.168.1.213 icmp_seq=92 Destination Host Unreachable From 192.168.1.213 icmp_seq=93 Destination Host Unreachable From 192.168.1.213 icmp_seq=94 Destination Host Unreachable From 192.168.1.213 icmp_seq=95 Destination Host Unreachable From 192.168.1.213 icmp_seq=96 Destination Host Unreachable From 192.168.1.213 icmp_seq=97 Destination Host Unreachable From 192.168.1.213 icmp_seq=98 Destination Host Unreachable From 192.168.1.213 icmp_seq=99 Destination Host Unreachable From 192.168.1.213 icmp_seq=100 Destination Host Unreachable From 192.168.1.213 icmp_seq=101 Destination Host Unreachable From 192.168.1.213 icmp_seq=102 Destination Host Unreachable From 192.168.1.213 icmp_seq=103 Destination Host Unreachable From 192.168.1.213 icmp_seq=104 Destination Host Unreachable From 192.168.1.213 icmp_seq=105 Destination Host Unreachable From 192.168.1.213 icmp_seq=106 Destination Host Unreachable From 192.168.1.213 icmp_seq=107 Destination Host Unreachable From 192.168.1.213 icmp_seq=108 Destination Host Unreachable From 192.168.1.213 icmp_seq=109 Destination Host Unreachable From 192.168.1.213 icmp_seq=110 Destination Host Unreachable From 192.168.1.213 icmp_seq=111 Destination Host Unreachable From 192.168.1.213 icmp_seq=112 Destination Host Unreachable From 192.168.1.213 icmp_seq=113 Destination Host Unreachable From 192.168.1.213 icmp_seq=114 Destination Host Unreachable From 192.168.1.213 icmp_seq=115 Destination Host Unreachable From 192.168.1.213 icmp_seq=116 Destination Host Unreachable From 192.168.1.213 icmp_seq=117 Destination Host Unreachable From 192.168.1.213 icmp_seq=118 Destination Host Unreachable From 192.168.1.213 icmp_seq=119 Destination Host Unreachable From 192.168.1.213 icmp_seq=120 Destination Host Unreachable From 192.168.1.213 icmp_seq=121 Destination Host Unreachable From 192.168.1.213 icmp_seq=122 Destination Host Unreachable From 192.168.1.213 icmp_seq=123 Destination Host Unreachable From 192.168.1.213 icmp_seq=124 Destination Host Unreachable From 192.168.1.213 icmp_seq=125 Destination Host Unreachable From 192.168.1.213 icmp_seq=126 Destination Host Unreachable From 192.168.1.213 icmp_seq=127 Destination Host Unreachable From 192.168.1.213 icmp_seq=128 Destination Host Unreachable From 192.168.1.213 icmp_seq=129 Destination Host Unreachable From 192.168.1.213 icmp_seq=130 Destination Host Unreachable From 192.168.1.213 icmp_seq=131 Destination Host Unreachable From 192.168.1.213 icmp_seq=132 Destination Host Unreachable From 192.168.1.213 icmp_seq=133 Destination Host Unreachable From 192.168.1.213 icmp_seq=134 Destination Host Unreachable From 192.168.1.213 icmp_seq=135 Destination Host Unreachable From 192.168.1.213 icmp_seq=136 Destination Host Unreachable From 192.168.1.213 icmp_seq=137 Destination Host Unreachable From 192.168.1.213 icmp_seq=138 Destination Host Unreachable 64 bytes from 192.168.1.213: icmp_seq=46 ttl=64 time=94862 ms 64 bytes from 192.168.1.213: icmp_seq=47 ttl=64 time=104698 ms From 192.168.1.213 icmp_seq=183 Destination Host Unreachable From 192.168.1.213 icmp_seq=184 Destination Host Unreachable From 192.168.1.213 icmp_seq=185 Destination Host Unreachable From 192.168.1.213 icmp_seq=186 Destination Host Unreachable From 192.168.1.213 icmp_seq=187 Destination Host Unreachable From 192.168.1.213 icmp_seq=188 Destination Host Unreachable From 192.168.1.213 icmp_seq=189 Destination Host Unreachable From 192.168.1.213 icmp_seq=190 Destination Host Unreachable From 192.168.1.213 icmp_seq=191 Destination Host Unreachable From 192.168.1.213 icmp_seq=192 Destination Host Unreachable From 192.168.1.213 icmp_seq=193 Destination Host Unreachable From 192.168.1.213 icmp_seq=194 Destination Host Unreachable From 192.168.1.213 icmp_seq=195 Destination Host Unreachable From 192.168.1.213 icmp_seq=196 Destination Host Unreachable From 192.168.1.213 icmp_seq=197 Destination Host Unreachable From 192.168.1.213 icmp_seq=198 Destination Host Unreachable From 192.168.1.213 icmp_seq=199 Destination Host Unreachable From 192.168.1.213 icmp_seq=200 Destination Host Unreachable From 192.168.1.213 icmp_seq=201 Destination Host Unreachable From 192.168.1.213 icmp_seq=202 Destination Host Unreachable From 192.168.1.213 icmp_seq=203 Destination Host Unreachable From 192.168.1.213 icmp_seq=225 Destination Host Unreachable From 192.168.1.213 icmp_seq=226 Destination Host Unreachable From 192.168.1.213 icmp_seq=227 Destination Host Unreachable From 192.168.1.213 icmp_seq=228 Destination Host Unreachable From 192.168.1.213 icmp_seq=229 Destination Host Unreachable From 192.168.1.213 icmp_seq=230 Destination Host Unreachable From 192.168.1.213 icmp_seq=231 Destination Host Unreachable From 192.168.1.213 icmp_seq=232 Destination Host Unreachable From 192.168.1.213 icmp_seq=233 Destination Host Unreachable From 192.168.1.213 icmp_seq=234 Destination Host Unreachable From 192.168.1.213 icmp_seq=235 Destination Host Unreachable From 192.168.1.213 icmp_seq=236 Destination Host Unreachable From 192.168.1.213 icmp_seq=237 Destination Host Unreachable From 192.168.1.213 icmp_seq=238 Destination Host Unreachable From 192.168.1.213 icmp_seq=239 Destination Host Unreachable From 192.168.1.213 icmp_seq=240 Destination Host Unreachable From 192.168.1.213 icmp_seq=241 Destination Host Unreachable From 192.168.1.213 icmp_seq=242 Destination Host Unreachable From 192.168.1.213 icmp_seq=243 Destination Host Unreachable From 192.168.1.213 icmp_seq=244 Destination Host Unreachable From 192.168.1.213 icmp_seq=245 Destination Host Unreachable From 192.168.1.213 icmp_seq=246 Destination Host Unreachable From 192.168.1.213 icmp_seq=247 Destination Host Unreachable From 192.168.1.213 icmp_seq=248 Destination Host Unreachable 64 bytes from 192.168.1.213: icmp_seq=85 ttl=64 time=183271 ms From 192.168.1.213 icmp_seq=421 Destination Host Unreachable From 192.168.1.213 icmp_seq=422 Destination Host Unreachable From 192.168.1.213 icmp_seq=423 Destination Host Unreachable

Sometimes I capture 4 or more ping immediately all at the same time not one by one. I check all logs and found nothing, not errors not warnings

cat /var/log/messages | grep esp

Jun 4 14:00:05 uuuu user.warn kernel: [ 3.481102] esp_sdio_dummy_probe enter Jun 4 14:00:05 uuuu user.warn kernel: [ 3.698298] esp_sdio_init power up OK Jun 4 14:00:05 uuuu user.warn kernel: [ 4.328482] esp_host:bdf5087c3deb Jun 4 14:00:05 uuuu user.warn kernel: [ 4.328482] esp_target: e826c2b3c9fd 57 18202 Jun 4 14:00:05 v user.warn kernel: [ 4.337886] esp_readwrite_file: file /system/lib/modules/test_results filp_open error Jun 4 14:00:05 uuuu user.warn kernel: [ 4.374375] esp_sdio_remove enter Jun 4 14:00:05 uuuu user.warn kernel: [ 5.000521] esp_sdio: initializing netlink Jun 4 14:00:05 uuuu user.warn kernel: [ 5.020455] esp_host:bdf5087c3deb Jun 4 14:00:05 uuuu user.warn kernel: [ 5.020455] esp_target: e826c2b3c9fd 57 18202 Jun 4 14:00:05 uuuu user.warn kernel: [ 10.343256] esp_op_add_interface STA Jun 4 14:00:05 uuuu user.info kernel: [ 11.728551] wlan0: RX AssocResp from b0:4e:26:f0:cf:a3 (capab=0x1431 status=0 aid=1) Jun 4 14:00:05 uuuu user.warn kernel: [ 11.743603] esp_op_ampdu_action RX START b0:4e:26:f0:cf:a3 tid 0 0 Jun 4 14:00:08 uuuu user.warn kernel: [ 18.918399] esp_op_ampdu_action TX START, addr:b0:4e:26:f0:cf:a3,tid:0,state:1 Jun 4 14:00:08 uuuu user.warn kernel: [ 18.948542] esp_op_ampdu_action TX OPERATION, addr:b0:4e:26:f0:cf:a3,tid:0,state:2

cat /var/log/messages | grep wlan

Jun 4 14:00:05 uuuu user.info kernel: [ 10.347365] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready Jun 4 14:00:05 uuuu user.info kernel: [ 11.654622] wlan0: authenticate with b0:4e:26:f0:cf:a3 Jun 4 14:00:05 uuuu user.info kernel: [ 11.660390] wlan0: send auth to b0:4e:26:f0:cf:a3 (try 1/3) Jun 4 14:00:05 uuuu user.info kernel: [ 11.678600] wlan0: authenticated Jun 4 14:00:05 uuuu user.info kernel: [ 11.688410] wlan0: associate with b0:4e:26:f0:cf:a3 (try 1/3) Jun 4 14:00:05 uuuu user.info kernel: [ 11.728551] wlan0: RX AssocResp from b0:4e:26:f0:cf:a3 (capab=0x1431 status=0 aid=1) Jun 4 14:00:05 uuuu user.info kernel: [ 11.736521] IPv6: ADDRCONF(NETDEVCHANGE): wlan0: link becomes ready Jun 4 14:00:05 uuuu user.info kernel: [ 11.743114] wlan0: associated

And now is the best. I have some pice of hardware with the same firmware which works very well. I make changes hardware nothings helps.

I discovered also that when connect to old access point ping works normally. I'm confused what can be wrong, where to find a potential problem?

I issue iwconfig and I see something strange

wlan0 IEEE 802.11 ESSID:"serwis"
Mode:Managed Frequency:2.412 GHz Access Point: D8:B6:B7:9A:F2:55
Bit Rate=72.2 Mb/s Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr=2352 B
Encryption key:off Power Management:off Link Quality=40/70 Signal level=-70 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0

The driver negotiates Bit Rate=72.2 Mb/s it is possible ?. On my laptop driver negotiate only 6Mb/s or 1Mb/s?

CRImier commented 6 years ago

So, can the problem only be replicated on a specific piece of hardware?

voloviq commented 6 years ago

Maybe it is a good idea, I check my wifi dongle on RPI.

voloviq commented 6 years ago

Hi again, so on RPI, results are fantastic ping is 2ms sometimes 3ms transfer of file as well. Currently, I see that on my board still appears process from the driver. Process name is "195 2 root SW 0 0% 1% [ksdioirqd/mmc0]". It does not take CPU to much but it constantly appears. This irq can be a cause of a problem?

al177 commented 6 years ago

It's normal.

SDIO doesn't generate hard interrupts on all host controller types, so this kthread listens to the bus and notifies the driver whenever there's a pending interrupt.