[SOLVED] MediaTek wifi , wlan1, not starting properly


#1

Hi,

I went through the steps here:https://github.com/mangOH/mangOH/wiki/mangOH-Red-mt7697-WiFi and followed along the video here: https://www.youtube.com/watch?v=KDO835vo1Lg&t=2036s to install the wifi driver and scripts.

Once the github page ends, it doesn’t specify how to start the wifi, so following the video:

root@swi-mdm9x28:~# /sbin/ifup wlan1

Setup MT7697 UART
Device: WP76
Enable power control
Initialized Linux WiFi modules
Initialized MT7697 WiFi core
Started MT7697 WiFi uart core wlan1
root@swi-mdm9x28:~# wifi ap setssid "SIERRA TEST WIFI"
SSID set successfully.
root@swi-mdm9x28:~# wifi ap start wlan1
starting...

logread:
> Jun 12 16:58:33 swi-mdm9x28 user.info Legato: INFO | wifiService[855]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_SetSsid() 1235 | SSID length 16 | SSID: “SIERRA TEST WIFI”

Jun 12 16:58:33 swi-mdm9x28 user.debug Legato:  DBUG | wifiService[855]/daemon T=main | le_wifiClient.c CloseSessionEventHandler() 455 | sessionRef 0x7f57dd8c GetFirstSessionRef (nil)
Jun 12 16:58:33 swi-mdm9x28 user.debug Legato:  DBUG | wifiService[855]/framework T=main | le_wifiClient_server.c CleanupClientData() 139 | Client 0x7f57dd8c is closed !!!
Jun 12 16:58:33 swi-mdm9x28 user.debug Legato:  DBUG | wifiService[855]/framework T=main | le_wifiAp_server.c CleanupClientData() 139 | Client 0x7f57dcfc is closed !!!
Jun 12 16:58:37 swi-mdm9x28 user.debug Legato:  DBUG | wifiService[855]/framework T=main | LE_FILENAME ExtractFileDescriptor() 34 | Received fd (11).
Jun 12 16:58:37 swi-mdm9x28 user.debug Legato:  DBUG | wifiService[855]/framework T=main | LE_FILENAME ExtractFileDescriptor() 34 | Received fd (15).
Jun 12 16:58:37 swi-mdm9x28 user.info Legato:  INFO | wifiService[855]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_Start() 795 | AP starts
Jun 12 16:58:37 swi-mdm9x28 user.debug Legato:  DBUG | wifiService[855]/framework T=main | LE_FILENAME le_mem_ForceAlloc() 841 | Memory pool 'framework.DestructorObjs' overflowed. Expanded to 4 blocks.
Jun 12 16:58:37 swi-mdm9x28 user.info Legato:  INFO | wifiService[855]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_Start() 811 | SSID = SIERRA TEST WIFI
Jun 12 16:58:37 swi-mdm9x28 user.debug Legato:  DBUG | wifiService[855]/framework T=WifiApPaThread | LE_FILENAME PThreadStartRoutine() 362 | Set nice level to 0.
Jun 12 16:58:37 swi-mdm9x28 user.debug Legato:  DBUG | wifiService[855]/framework T=WifiApPaThread | LE_FILENAME le_mem_ForceAlloc() 841 | Memory pool 'framework.DestructorObjs' overflowed. Expanded to 5 blocks.
Jun 12 16:58:37 swi-mdm9x28 user.info Legato:  INFO | wifiService[855]/daemon T=WifiApPaThread | pa_wifi_ap_ti.c WifiApPaThreadMain() 264 | Started!
Jun 12 16:58:37 swi-mdm9x28 user.info Legato:  INFO | wifiService[855]/daemon T=WifiApPaThread | pa_wifi_ap_ti.c WifiApPaThreadMain() 285 | PARSING:WIFI_SET_EVENT : len:15
Jun 12 16:58:37 swi-mdm9x28 user.info Legato:  INFO | wifiService[855] | WIFI_START
Jun 12 16:58:37 swi-mdm9x28 user.err Legato: =ERR= | wifiService[855] | ifup: interface wlan1 already configured
Jun 12 16:58:37 swi-mdm9x28 user.info Legato:  INFO | wifiService[855]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_Start() 832 | WiFi Access Point Command('/legato/systems/current/apps/wifiService/read-only/pa_wifi.sh wlan1 WIFI_START') OK
Jun 12 16:58:37 swi-mdm9x28 user.info Legato:  INFO | wifiService[855] | WIFI_WLAN_UP
Jun 12 16:58:37 swi-mdm9x28 user.info Legato:  INFO | wifiService[855]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_Start() 853 | WiFi Access Point Command('/legato/systems/current/apps/wifiService/read-only/pa_wifi.sh wlan1 WIFI_WLAN_UP') OK
Jun 12 16:58:37 swi-mdm9x28 user.info Legato:  INFO | wifiService[855]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_Start() 923 | AP configuration: interface=wlan1 ssid=SIERRA TEST WIFI channel=1 max_num_sta=10
Jun 12 16:58:37 swi-mdm9x28 user.info Legato:  INFO | wifiService[855]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_Start() 928 | LE_WIFIAP_SECURITY_NONE
Jun 12 16:58:37 swi-mdm9x28 user.info Legato:  INFO | wifiService[855]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_Start() 1005 | hostapd.conf: ignore_broadcast_ssid=0
Jun 12 16:58:37 swi-mdm9x28 user.info Legato:  INFO | wifiService[855]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_Start() 1029 | Waiting 15s for WiFi driver availability ...
Jun 12 16:58:52 swi-mdm9x28 user.info Legato:  INFO | wifiService[855]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_Start() 1033 | Start Access Point
Jun 12 16:58:52 swi-mdm9x28 user.info Legato:  INFO | wifiService[855] | WIFIAP_HOSTAPD_START
Jun 12 16:58:52 swi-mdm9x28 user.info Legato:  INFO | wifiService[855]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_Start() 1057 | WiFi Access Point Command('/legato/systems/current/apps/wifiService/read-only/pa_wifi.sh wlan1 WIFIAP_HOSTAPD_START') OK
Jun 12 16:58:52 swi-mdm9x28 user.debug Legato:  DBUG | wifiService[855]/framework T=main | le_wifiAp_server.c CleanupClientData() 139 | Client 0x7f57dd8c is closed !!!
Jun 12 16:58:52 swi-mdm9x28 user.debug Legato:  DBUG | wifiService[855]/daemon T=main | le_wifiClient.c CloseSessionEventHandler() 455 | sessionRef 0x7f57dcfc GetFirstSessionRef (nil)
Jun 12 16:58:52 swi-mdm9x28 user.debug Legato:  DBUG | wifiService[855]/framework T=main | le_wifiClient_server.c CleanupClientData() 139 | Client 0x7f57dcfc is closed !!!
Jun 12 16:58:52 swi-mdm9x28 user.info Legato:  INFO | wifiService[855] | Configuration file: /tmp/hostapd.conf
Jun 12 16:58:52 swi-mdm9x28 user.info Legato:  INFO | wifiService[855] | Using interface wlan1 with hwaddr 00:0c:43:76:87:22 and ssid "SIERRA TEST WIFI"
Jun 12 16:58:52 swi-mdm9x28 user.debug kernel: [  455.043493] mt7697core MAC 00000000: 00 00 00 00 00 00
Jun 12 16:58:52 swi-mdm9x28 user.info Legato:  INFO | wifiService[855] | Failed to set beacon parameters
Jun 12 16:58:52 swi-mdm9x28 user.info Legato:  INFO | wifiService[855] | Interface initialization failed
Jun 12 16:58:52 swi-mdm9x28 user.info Legato:  INFO | wifiService[855] | wlan1: interface state UNINITIALIZED->DISABLED
Jun 12 16:58:52 swi-mdm9x28 user.info Legato:  INFO | wifiService[855] | wlan1: AP-DISABLED 
Jun 12 16:58:52 swi-mdm9x28 user.info Legato:  INFO | wifiService[855] | wlan1: Unable to setup interface.
Jun 12 16:58:52 swi-mdm9x28 user.info Legato:  INFO | wifiService[855] | wlan1: interface state DISABLED->DISABLED
Jun 12 16:58:52 swi-mdm9x28 user.info Legato:  INFO | wifiService[855] | wlan1: AP-DISABLED 
Jun 12 16:58:52 swi-mdm9x28 user.info Legato:  INFO | wifiService[855] | hostapd_free_hapd_data: Interface wlan1 wasn't started
Jun 12 16:58:52 swi-mdm9x28 user.info Legato:  INFO | wifiService[855] | nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Jun 12 16:58:52 swi-mdm9x28 user.debug kernel: [  455.141648] mt7697core MAC 00000000: 00 00 00 00 00 00

The ssid doesn’t appear looking from my computer or phone. Dip switches up are 1,3,5,8.

Is there anything I could be missing?

Thanks for your help!


#2

I’m not sure why, but there are TWO Wiki pages describing how to make this work. I initially tried the one you did with no success. The other one, which is similar (and has an almost-but-not-quite-identical URL), but has more steps, worked for me:

I think, in my case, it was the “mapuart” AT command that got me going. The documentation wasn’t clear on what, exactly, this did so I was nervous that I might somehow lose the console (or AT command access) after doing it, but it works fine and has no negative consequences (at least so far as I can tell).

I will caution that once you get it working, you may be extremely disappointed with the performance. I’m unable to get much more than about 850kbps out of the WiFi. It’s not useless, but for my application, it’s close to useless.


#3

@fgodfrey,

I had both wikis open, and I used the one that you linked to, I just accidentally posted the wrong wiki link.

and so you booted and run with success?

I just ran again, re-did the at command, and am still seeing “Failed to set beacon parameters”.


#4

I have, but I have not tried AP mode. I’m running in STA mode. “ifup wlan1” almost works correctly, but doesn’t correctly start wpa_supplicant for WPA2 networks (this is for STA mode).

I think you may have a problem prior to the beacon mode error, though, since mt7697core seems to be trying to come up with a MAC address of all zero’s.

Try doing an “lsmod” and see what kernel modules are loaded? You should have mt7697common mt7697q mt7697serial mt7697wifi and, mangoh (not sure if that is mandatory).


#5

root@swi-mdm9x28:~# lsmod
Tainted: G
2_mt7697wifi_core 70639 0 - Live 0xbf02e000 (O)
mac80211 437300 0 - Live 0xbf101000
cfg80211 476220 2 2_mt7697wifi_core,mac80211, Live 0xbf060000
spisvc 1069 0 - Live 0xbf05e000 (O)
9_mangoh_red_dv5 8172 0 - Live 0xbf058000 (O)
4_bmi160_i2c 1396 0 - Live 0xbf054000 (O)
3_bmp280_i2c 2631 0 - Live 0xbf050000 (O)
3_bmi160 5472 1 4_bmi160_i2c, Live 0xbf04b000 (O)
2_bmp280 9493 1 3_bmp280_i2c, Live 0xbf02a000 (O)
1_mt7697serial 8150 1 2_mt7697wifi_core, Live 0xbf024000 (O)
1_mt7697q 19783 1 2_mt7697wifi_core, Live 0xbf01a000 (O)
0_ltc294x 5591 0 - Live 0xbf015000 (O)
0_led 1935 0 - Live 0xbf011000 (O)
0_cp2130 20502 1 1_mt7697q, Live 0xbf007000 (O)
0_bq24296 10860 0 - Live 0xbf000000 (O)

It looks like I have those modules loaded


#6

SOLVED:

config set dataConnectionService:/wifi/SSID “SSID of your WiFi” string
config set dataConnectionService:/wifi/passphrase “password” string
config set dataConnectionService:/wifi/interface wlan1 string
config set dataConnectionService:/wifi/wpaSupplicantDriver wext string
config set dataConnectionService:/wifi/secProtocol 3 int

^ this does not work

Use the command line ‘wifi ap’ commands

root@swi-mdm9x28:~# wifi ap setssid "SIERRAWIFI"
SSID set successfully.
root@swi-mdm9x28:~# wifi ap setdriver 1
WPA driver set to ‘wext’.
root@swi-mdm9x28:~# wifi ap setmaxclients 1
Max number of clients set to 1.
oot@swi-mdm9x28:~# wifi ap setsecurityproto 1
root@swi-mdm9x28:~# wifi ap setpassphrase "knockknock"
Passphrase set.
root@swi-mdm9x28:~# wifi ap setdiscoverable 1
Discoverable set to 1.
root@swi-mdm9x28:~# wifi ap start wlan1


#7

Awesome work guys :clap:t3:. Very excited to try out the MT functionality when it’s supported on the WP85.