I have deployed the Legato 19.02 application framework on my mangOH red + wp76xx board using the Leaf workspace manager environment. Now I am trying to use the onboard WiFi capabilities of the mangOH red development board.
I have been reading different posts on the mangOH Forum, and I found a reference to some instructions described in “mangOH Red mt7697 WiFi using WPx5xx, WP76xx or WP77xx”; I am following this approach, but I am having some issues in following up, as the information does not relate specifically to a Legato leaf deployed workspace. I have managed to update the onboard MediaTek MT7697 firmware as described, but I am stuck in the “Patch Legato” section. The “Legato_patches” folder, which is included in mangOH VM, only provides updates up to the Legato 18.09.00 version, so there seems to be no patches for my Legato 19.02 AF. I am not even sure if the patches are already incorporated in the latest Legato 19.02 AF so there may be no need to patch Legato 19.02 at all. At this point I am wondering if there is an updated tutorial on how to make use of the onboard WiFi capabilities of the mangOH red running a newer Legato 19.02 AF?
I will appreciate if somebody can point me on the right direction on how to proceed and start using WiFi on my deployed Legato 19.02 AF. Thanks, in advanced.
I have managed to build an updated legato system build based on 19.02 using the wifi.sdef system definition file located in $LEGATO_ROOT/modules/WiFi folder. The build required me to follow the steps described in the “Migrate from Legato 18.09.0 to 19.02.0” post, because running “mksys -t wp76xx wifi.sdef” was heaving some issues.
So basically, I had to:
Run “make wp76xx” within the Legato directory.
source $LEGATO_ROOT/build/wp76xx/config.sh into my environment aka leaf shell.
Then run “mksys -t wp76xx wifi.sdef”
Finally “update wifi.wp76xx.update 192.168.2.2”
So now I can see the WiFi related apps when I execute the “app status” on my mangOH red target board. However, when I try to start the wifiApTest app, using the “app start wifiApTest” command, I get the following messages in the logread output and the app stops; I am assuming I am still missing the Mediatek mt7697 patches updates. Any comments:
root@swi-mdm9x28-wp:~# logread -f
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | supervisor[842]/supervisor T=main | app.c app_Create() 3207 | Creating app 'wifiApTest'
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | supervisor[842]/supervisor T=main | proc.c GetFaultAction() 323 | No fault action specified for process 'wifiApTest'. Assuming 'ignore'.
Jul 10 19:05:31 swi-mdm9x28-wp user.warn Legato: -WRN- | supervisor[842]/supervisor T=main | proc.c GetWatchdogAction() 359 | wifiApTest watchdogAction '' in proc section
Jul 10 19:05:31 swi-mdm9x28-wp user.warn Legato: -WRN- | supervisor[842]/supervisor T=main | proc.c GetWatchdogAction() 359 | wifiApTest watchdogAction '' in proc section
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | supervisor[842]/supervisor T=main | app.c app_Start() 3420 | Starting app 'wifiApTest'
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | supervisor[842]/supervisor T=main | app.c CreateFileLink() 2104 | Created file link '/legato/systems/current/apps/wifiApTest/read-only/lib/libComponent_wifiApTestComponent.so' to '/legato/systems/current/appsWriteable/w
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | supervisor[842]/supervisor T=main | app.c CreateFileLink() 2104 | Created file link '/legato/systems/current/apps/wifiApTest/read-only/bin/wifiApTest' to '/legato/systems/current/appsWriteable/wifiApTest/bin/wifiApTest'
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | supervisor[842]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxCoreDumpFileBytes to value 102400.
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | supervisor[842]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxFileBytes to value 102400.
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | supervisor[842]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxLockedMemoryBytes to value 8192.
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | supervisor[842]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxFileDescriptors to value 256.
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | supervisor[842]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxMQueueBytes to value 512.
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | supervisor[842]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxThreads to value 20.
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | supervisor[842]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxQueuedSignals to value 100.
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | supervisor[842]/supervisor T=main | proc.c proc_Start() 1390 | Starting process 'wifiApTest' with pid 2025
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | supervisor[2025]/supervisor T=main | proc.c proc_Start() 1355 | Execing 'wifiApTest'
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/framework T=unknown | LE_FILENAME InitPool() 295 | Memory pool name 'framework.hashMap_refPathIteratorMap' is truncated to 'framework.hashMap_refPathIterat'
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/framework T=main | LE_FILENAME InitPool() 295 | Memory pool name 'framework.hashMap_refEventHandlers' is truncated to 'framework.hashMap_refEventHandl'
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/framework T=main | LE_FILENAME InitPool() 295 | Memory pool name 'framework.hashMap_refDefault Timer SafeRe' is truncated to 'framework.hashMap_refDefault Ti'
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/framework T=main | LE_FILENAME InitPool() 295 | Memory pool name 'framework.MessagingClientInterfaces' is truncated to 'framework.MessagingClientInterf'
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/framework T=main | LE_FILENAME InitPool() 295 | Memory pool name 'framework.hashMap_refHandlersRef' is truncated to 'framework.hashMap_refHandlersRe'
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/framework T=main | LE_FILENAME InitPool() 295 | Memory pool name 'framework.hashMap_MessagingServices' is truncated to 'framework.hashMap_MessagingServ'
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/framework T=main | LE_FILENAME InitPool() 295 | Memory pool name 'framework.hashMap_MessagingClients' is truncated to 'framework.hashMap_MessagingClie'
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/framework T=main | LE_FILENAME InitPool() 295 | Memory pool name 'framework.PipelineSIGCHLD-reports' is truncated to 'framework.PipelineSIGCHLD-repor'
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/framework T=main | LE_FILENAME fs_Init() 840 | FS prefix path "/data/le_fs/"
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/framework T=main | LE_FILENAME InitPool() 295 | Memory pool name 'framework.hashMap_refFsFileRefMap' is truncated to 'framework.hashMap_refFsFileRefM'
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/framework T=main | LE_FILENAME rand_Init() 71 | getrandom function: 0xb6d23150
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/framework T=main | LE_FILENAME le_mem_ForceAlloc() 833 | Memory pool 'framework.DestructorObjs' overflowed. Expanded to 1 blocks.
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/<invalid> T=main | _componentMain.c _wifiApTestComponent_Init() 29 | Initializing wifiApTestComponent component library.
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/framework T=main | LE_FILENAME InitPool() 295 | Memory pool name 'framework.hashMap_refle_wifiAp_ClientHand' is truncated to 'framework.hashMap_refle_wifiAp_'
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/framework T=main | LE_FILENAME msgMessage_CreatePool() 112 | Pool name truncated to 'msgs-376b52b7f3ec3cdfa5c5d29caa' for protocol '376b52b7f3ec3cdfa5c5d29caa6777f6'.
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/framework T=main | LE_FILENAME InitPool() 295 | Memory pool name 'framework.msgs-376b52b7f3ec3cdfa5c5d29caa' is truncated to 'framework.msgs-376b52b7f3ec3cdf'
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | wifiService[889]/framework T=main | LE_FILENAME ExtractFileDescriptor() 34 | Received fd (13).
Jul 10 19:05:31 swi-mdm9x28-wp user.warn Legato: -WRN- | _UNKNOWN_[2025]/framework T=main | LE_FILENAME le_fdMonitor_Create() 667 | FD Monitor object name 'wifiApTest.wifiApTestComponent.le_wifiAp' truncated to 'wifiApTest.wifiApTestComponent.'.
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/framework T=main | LE_FILENAME le_mem_ForceAlloc() 833 | Memory pool '.le_wifiAp_ClientThreadData' overflowed. Expanded to 1 blocks.
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | _UNKNOWN_[2025]/framework T=main | le_wifiAp_client.c DoConnectService() 355 | ======= Starting client for 'wifiApTest.wifiApTestComponent.le_wifiAp' service ========
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | wifiApTest[2025]/framework T=main | LE_FILENAME InitPool() 295 | Memory pool name 'framework.msgs-LogControlProtocol' is truncated to 'framework.msgs-LogControlProtoc'
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | wifiApTest[2025]/framework T=main | LE_FILENAME le_mem_ForceAlloc() 833 | Memory pool 'framework.SigMonitor' overflowed. Expanded to 1 blocks.
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | wifiApTest[2025]/framework T=main | LE_FILENAME le_mem_ForceAlloc() 833 | Memory pool 'framework.SigHandler' overflowed. Expanded to 1 blocks.
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | wifiApTest[2025]/wifiApTest_exe T=main | _main.c main() 61 | == Starting Event Processing Loop ==
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | wifiApTest[2025]/wifiApTestComponent T=main | wifiApTest.c _wifiApTestComponent_COMPONENT_INIT() 270 | ======== WiFi AP Test ========
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | wifiApTest[2025]/wifiApTestComponent T=main | wifiApTest.c Testle_wifiApStart() 201 | Start Test WiFi access point
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | wifiApTest[2025]/framework T=main | LE_FILENAME le_mem_ForceAlloc() 833 | Memory pool '.le_wifiAp_ClientData' overflowed. Expanded to 1 blocks.
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | wifiService[889]/framework T=main | LE_FILENAME le_mem_ForceAlloc() 833 | Memory pool '.le_wifiAp_ServerData' overflowed. Expanded to 1 blocks.
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | wifiService[889]/daemon T=main | le_wifiAp.c le_wifiAp_AddNewEventHandler() 89 | Add new event handler
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | wifiService[889]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_SetSsid() 696 | SSID length 10 | SSID: "wifiApSSID"
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | wifiService[889]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_SetPassPhrase() 770 | Set passphrase
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | wifiService[889]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_SetSecurityProtocol() 733 | Security protocol : 1
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | wifiService[889]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_SetDiscoverable() 851 | Set discoverability
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | wifiService[889]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_Start() 469 | Starting AP, SSID: wifiApSSID
Jul 10 19:05:31 swi-mdm9x28-wp user.debug Legato: DBUG | wifiService[889]/framework T=WifiApPaThread | LE_FILENAME PThreadStartRoutine() 360 | Set nice level to 0.
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | wifiService[889]/daemon T=WifiApPaThread | pa_wifi_ap_ti.c WifiApPaThreadMain() 243 | Started!
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | wifiService[889] | WIFI_START
Jul 10 19:05:31 swi-mdm9x28-wp user.info Legato: INFO | wifiService[889]/daemon T=WifiApPaThread | pa_wifi_ap_ti.c WifiApPaThreadMain() 260 | PARSING:WIFI_SET_EVENT : len:15
Jul 10 19:05:36 swi-mdm9x28-wp user.info Legato: INFO | wifiService[889] | Failed to start TI wifi
Jul 10 19:05:36 swi-mdm9x28-wp user.err Legato: =ERR= | wifiService[889]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_Start() 484 | WiFi AP Command Failed: (23296)wlan0 WIFI_START
Jul 10 19:05:36 swi-mdm9x28-wp user.info Legato: INFO | supervisor[842]/supervisor T=main | supervisor.c SigChildHandler() 792 | Reaping unconfigured child process 2030.
Jul 10 19:05:36 swi-mdm9x28-wp user.err Legato: =ERR= | wifiService[889]/daemon T=WifiApPaThread | pa_wifi_ap_ti.c ThreadDestructor() 192 | Unable to kill the WIFI events script
Jul 10 19:05:36 swi-mdm9x28-wp user.err Legato: =ERR= | wifiApTest[2025]/wifiApTestComponent T=main | wifiApTest.c Testle_wifiApStart() 220 | Start ERROR
Jul 10 19:05:36 swi-mdm9x28-wp user.info Legato: INFO | wifiService[889]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_SetIpRange() 978 | @AP=c0a80a01, @APstart=c0a80a0a, @APstop=c0a80a14
Jul 10 19:05:36 swi-mdm9x28-wp user.err Legato: =ERR= | wifiService[889] | ifconfig: SIOCSIFADDR: No such device
Jul 10 19:05:36 swi-mdm9x28-wp user.err Legato: =ERR= | wifiService[889]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_SetIpRange() 1007 | Unable to mount the network interface.
Jul 10 19:05:36 swi-mdm9x28-wp user.emerg Legato: *EMR* | wifiApTest[2025]/wifiApTestComponent T=main | wifiApTest.c Testle_wifiApStart() 223 | Assert Failed: 'LE_OK == le_wifiAp_SetIpRange(HOST_IP, IP_RANGE_START, IP_RANGE_END)'
Jul 10 19:05:36 swi-mdm9x28-wp user.debug Legato: DBUG | wifiService[889]/framework T=main | le_wifiAp_server.c CleanupClientData() 148 | Client 0x7f57f6bc is closed !!!
Jul 10 19:05:36 swi-mdm9x28-wp user.debug Legato: DBUG | wifiService[889]/framework T=main | le_wifiAp_server.c CleanupClientData() 174 | Found session ref 0x7f57f6bc; match found, so needs cleanup
Jul 10 19:05:36 swi-mdm9x28-wp user.info Legato: INFO | supervisor[842]/supervisor T=main | proc.c proc_SigChildHandler() 2051 | Process 'wifiApTest' (PID: 2025) has exited with exit code 1.
Jul 10 19:05:37 swi-mdm9x28-wp user.warn Legato: -WRN- | supervisor[842]/supervisor T=main | app.c app_SigChildHandler() 4015 | Process 'wifiApTest' in app 'wifiApTest' faulted: Ignored.
Jul 10 19:05:37 swi-mdm9x28-wp user.info Legato: INFO | supervisor[842]/supervisor T=main | app.c app_StopComplete() 4686 | app 'wifiApTest' has stopped.
Jul 10 19:05:37 swi-mdm9x28-wp user.info Legato: INFO | supervisor[842]/supervisor T=main | apps.c DeactivateAppContainer() 374 | Application 'wifiApTest' has stopped.
Finally I managed to get it working. Here is a brief description, in case somebody finds it useful. Note that I followed the documentation regarding “Leaf Workspace Manager”, so in my mangOH development VM I have ~/myWorkspace folder where I tested the different tutorials described in the documentation.
In the Sample Apps section of the documentation there are multiple WiFi sample apps listed, which I found in $LEGATO_ROOT/modules/WiFi/apps/sample folder. I decided to copy the $LEGATO_ROOT/modules/WiFi folder into myWorksape folder and work locally in myWorkspace.
As I was working on a Leaf workspace deployment based on Legato 19.02, I stop following the instructions once I got to the “Patch Legato” section.
Now, back to myWorkspace folder, “cd ~/myWorkspace/WiFi”. Copy the ~/mangOH/linux_kernel_modules into the WiFi folder.
Edit the wifi.sdef file and include some required kernel modules:
kernelModules:
{
linux_kernel_modules/mt7697wifi/mt7697wifi_core
linux_kernel_modules/cp2130/cp2130
linux_kernel_modules/mt7697q/mt7697q
linux_kernel_modules/mt7697serial/mt7697serial
}
Rebuild the new system deployment using the wifi.sdef definition file “mksys -t wp76xx wifi.sdef”
Update the new system deployment “update wifi.wp76xx.update 192.168.2.2”
Deploy required WiFi scripts. I used the approach described in the video above. Alternatively you can: cd linux_kernel_modules/mt7697wifi/scripts scp mtwifi root@192.168.2.2:/etc/init.d/mtwifi scp interfaces root@192.168.2.2:/etc/network/interfaces
Make the WiFi init script executable in the target: ssh root@192.168.2.2 chmod +x /etc/init.d/mtwifi
Setup the UART; run these commands on the target
Run microcom /dev/ttyAT
Run the AT command at!mapuart=17,1 to configure UART1 for use with mt7697 WiFi
Press ctrl-x to exit
Power cycle the mangOH Red
After system power cycle, I was able to ssh into the target and run the command “/sbin/ifup wlan1” which successfully enabled the wlan1 interface. You can see it listed by running the command “ifconfig -a”
I believe so. In the VM, I am working in the ~/legato_framework/legato directory where I have copied over the WiFi directory and the linux_kernel_modules folder is inside of it.
The wifi folder needs to be directly under legato_framework, not the legato subfolder. Move it up one level so it’s ~/legato_framework/Wifi and see if it works.
As well as the same error on the target device: insmod: can’t insert ‘/legato/systems/current/modules/mt7697wifi_core.ko’: No such file or directory
The weird thing is that if I navigate to /home/mangoh/legato_framework/WiFi/_build_wifi/wp77xx/modules/mt7697wifi_core/ after the build there is a mt7697wifi_core.ko file.
There was also another similar Warning the I hadn’t seen before. Looking at old terminal outputs though it had been there I just hadn’t seen it:
hi am trying to use wifi module, when i check for app status i didnt find the any wifi services running in my mangoh red board and when i issued WIFI command getting the error command not executing here i have attached the screenshot for refernce , could any one guide me what are the steps to be followed to access wifi