Unable to have stable Wifi with MT7697 over UART or SPI

#1

Hello mangOH forum,

I managed to get the WiFi almost working on my WP7607G using this guide and legato 18.10.3. Here’s what I’m trying:

$ ifup wlan1
Setup MT7697 UART
Device: WP76
Enable power control
Initialized MT7697 WiFi core
Started MT7697 WiFi uart core wlan1
# I copied the contents from my target, 
# where the connection is indeed working,
# so I can hopefully rule this out:
$ cat > /etc/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="SSID"
    psk="PASS"
}
$ wpa_supplicant -d -i wlan1 -c /etc/wpa_supplicant.conf

I’m also able to enumerate APs using iw wlan1 scan, just not able to connect. I recorded a verbose log of wpa_supplicant in this gist:

https://gist.github.com/sahib/8f77b1184556cbf4ebd7a9b91fe40fa5 

The issue seems to be:

[...] This is after "enable_network 0"
wlan1: Authentication with 64:d1:54:3c:c3:d3 timed out.
[...]
wlan1: Request to deauthenticate - bssid=00:00:00:00:00:00 pending_bssid=64:d1:54:3c:c3:d3 reason=3 state=ASSOCIATING
wpa_driver_nl80211_disconnect(reason_code=3)
wlan1: Event DEAUTH (12) received
wlan1: Deauthentication notification
wlan1:  * reason 3 (locally generated)
Deauthentication frame IE(s) - hexdump(len=0): [NULL]
wlan1: CTRL-EVENT-DISCONNECTED bssid=64:d1:54:3c:c3:d3 reason=3 locally_generated=1
[...]

I do use wlan0 by the way, because wlan0 fails to startup. It this a known issue? See the log below. Also, wifi client seems to be tied to wlan0 and even changing it to wlan1 via a sed -i 's/wlan0/wlan1/g' $(find -iname '*.[ch]') seems to fail at the same stage as wpa_supplicant.

$ ifup wlan0
Failed to start TI wifi
$ logread -f 
Jan  6 00:37:31 swi-mdm9x28-wp user.err kernel: [ 2249.441210] i2c-msm-v2 78b8000.i2c: NACK: slave not responding, ensure its powered: msgs(n:2 cur:0 tx) bc(rx:2 tx:1) mode:FIFO slv_addr:0x55 MSTR_STS:0x0d1300c8 OPER:0x00000010

This seems to be a similar problem as in this thread, but nobody seemed to have answered there yet,
so I figured out that I might better create a new thread.

Would be very happy if somebody could help.

#2

I managed to find it out myself. You have to run wpa_supplicant with -D wext:
My exact command was :wpa_supplicant -d -D wext -i wlan1 -c /etc/wpa_supplicant.conf.

This gave me a link, as observed by:

$ iw wlan1 link
Connected to 64:d1:54:3c:c3:d3 (on wlan1)
        SSID: MY-SSID
        freq: 2452

A udhcpc -i wlan1 later I had an IP and I was able to ping google afterwards.

#3

Hmm, internet is working, but it’s not very stable. I tried to download a large file (wget -O /dev/null http://speedtest.belwue.net/10G), but it stalled somewhere in the middle and showed a lot of those lines in dmesg:

[14639.729649] mt7697core mt7697core: mt7697_proc_80211cmd(): unsupported cmd(165)
[14639.737244] mt7697core RSP 00000000: a5 a5 a5 a5 a5 a5 a5 a5
[14639.737259] mt7697serial mt7697serial: mt7697_uart_rx_work(): rx_fcn() failed(-22)

Sometimes messages like these are interspersed:

[  564.632426] mt7697core mt7697core: mt7697_proc_mac_addr(): invalid MAC address rsp len(0 != 16)
[  564.640895] mt7697core mt7697core: mt7697_proc_80211cmd(): mt7697_proc_mac_addr() failed(-22)
[  564.819421] mt7697core mt7697core: mt7697_proc_connect_ind(): invalid connect ind len(14926 != 24)
[  564.828610] mt7697core mt7697core: mt7697_proc_80211cmd(): mt7697_proc_connect_ind() failed(-22)
[  565.809880] mt7697serial mt7697serial: mt7697_uart_rx_work(): Rx invalid message type(85)

Note that it did not seem to stall completely, but got slower the longer it ran and the more messages it produced. Letting it run without load seems to not trigger the behavior. Maybe it just takes longer. It still have the serial cable attached, if that’s important.

Any idea? Is the mt7697wifi a good choice when requiring a stable connection? Any experience on this?

EDIT: The same issue happens when using SPI (as per this thread)

[  613.337877] mt7697core mt7697core: mt7697_rx_data(): invalid Rx frame size(18)
[  613.337913] mt7697core mt7697core: mt7697_rx_raw(): mt7697_rx_data() failed(-22)
[  613.345103] mt7697core mt7697core: mt7697_proc_80211cmd(): mt7697_rx_raw() failed(-22)
#4

With the stable wifi, I cannot install itunes on windows 7 and that is really a mess. I have tried a lot but still, the internet is not working on that application. Please help me to fix the problem.

#6

Hi c.Pahl

I don’t have experience with on board Wifi. I’m using Wifi IoT card and it work well.

Thanks
Thong Nguyen