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.
To enable the onboard MediaTek WiFi support, I found it useful to follow the instructions described in the “mangoh Red WiFi and IoT card WiFi on WP76” video.
From my initial trial to make WiFi work I was missing several steps, which I describe below:
- As I describe in my initial post, I was following the “mangOH Red mt7697 WiFi using WPx5xx, WP76xx or WP77xx” instructions.
- 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”