[SOLVED] MediaTek wifi , wlan1, not starting properly

Hi,

I went through the steps here:mangOH Red mt7697 WiFi · mangOH/mangOH Wiki · GitHub 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!

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.

@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”.

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).

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

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

1 Like

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

Hi,

I got my new mangOH Red WP7608 boards last week.

We need to get the mangOH running as a server on a known TCP or a HTTP port to receive data from an exernal Wi-Fi Client. We dont want to add any other wifi router to bring them into a network, since the participants in the network are only these two. We leant that WP7608 can be configured to AP mode. And we want the other device get into this wifi network to get an IP address and connect to it.

I was trying to set the AP mode using wifiWebAp already installed on the board.

  1. I started the app and opened the browser with 192.168.2.2:8080.
  2. It opened a page to configure and set the device in AP mode. I started it with the default settings.
  3. I scanned for the WiFi AP on my mobile and PC but nothing found with the default SSID configured nor there was a sign of a new Wifi ap. I tried to stop and start a couple of times but no avail.
  4. Later turned off the device.
  5. Today when powered the board, it lost the CF3 port IP address (192.168.2.2). When checked for ‘ipconfig /all’ on the host (windows 10), I get this (But earlier I used to see the ECM adapter with good IP)

Ethernet adapter Ethernet 2:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Sierra Wireless LEGATO EthLink ECM #2
Physical Address. . . . . . . . . : 16-0E-D3-FC-1C-DC
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::55bc:a980:2a8c:2b19%52(Preferred)
Autoconfiguration IPv4 Address. . : 169.254.43.25(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . :
DHCPv6 IAID . . . . . . . . . . . : 878890225
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-21-28-61-85-C0-25-E9-27-2D-8F
DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
NetBIOS over Tcpip. . . . . . . . : Enabled

I tried to reboot it a few times but it won’t get the default IP of 192.168.2.2. Seems like It got stuck somewhere.

Please suggest if anyone has a solution for this to get it back or a process to reset the device.

Thanks
Madan

I’m not familiar with Windows, but in linux I had to manually add an ip address to the interface that the mangoh was connected through.

As for the wifi issue… Can you run wifiWebAp, connect on port 8080 and show the output of the web app so that we can see that it is attempting to initialize?

Thanks for the reply.

As of now, I am not able connect to this board using CF3 USB.
Console USB is working. Not sure if it works (browser) , if I run wifiWebAp from the console.
I will give it a try.

please check my other thread as well on the same issue.