mangOH Red lost 192.168.2.2 IP & MT7697 Setup

Hi Alex,

Here are the sequence of steps I followed to get the WiFi working.

  1. Download and upload the Release 9 firmware in to mangOH Red (Instructions as per the Getting Started Guide)
  2. Download and setup the latest VM (Legato 18.07.0)
  3. Copy the following files to Windows from VM directory /home/mangoh/MediaTek_LinkIt_SDK_V4.3.0_public/out/linkit7697_hdk/MT7697_WiFi_BT_fw
    a. flash_download.ini
    b. MT7697_WiFi_BT_fw.bin
    c. mt7697_bootloader.bin
  4. Install the Mediatek firmware upload tool on Windows
  5. Select the DIP switches 1,2,3,5,6,8 up and reset the board. (You should have the console port cable connected to the PC and after reboot, check if you see 'CCCCCC…" on the monitor…I used Tera Term/Termite program with 115200 baud on this comport). Once you confirm, close the terminal program.
  6. Run the firmware upload UI tool and select the flash_download.ini (select the check boxes against the 3 files it shows) . Select the comport and leave the baud rate to default. Upload/flash now.
  7. When done, change the dip switch to 1,3,5,8
  8. Reboot the device.
  9. Follow the updated instructions on the Wiki to get mangOH 18.07.0 and build the firmware. (Start from Patch Legato section). For patching you can use the commands given in comment 37 of this post.
  10. When done, run the commands give in this post comment 37.

Ideally, you should be able to see the WiFi up and running.

Let me know how it goes.

Regards
Madan

Looks like the wifi drivers are not patched properly to the firmware. Patching is a key step here, otherwise legato wont be able to interface Mediatek Wifi.

Hi Madan,
You answered very quickly :slight_smile:.
I am trying to resolve this.
When you have flashed, did you include WIFI_RAM_CODE_MT76X7_in_flash.bin as indicated by flash_download.ini?
I flashed the three files to the module on Windows, then followed the Legato patching, updating the platform and still the same.

Oh this works with flashing the three binaries into the module.
I know what went wrong.
That’s because I didn’t use the mangOH VM before, where the firmware release is older than the firmware currently used on github. So the modules functions were modified as we assume looking at the mt7697wifi_core.ko insertion (in the file that I posted).

[ 800.716240] mt7697wifi_core: Unknown symbol mt7697q_init (err 0)
[ 800.721395] mt7697wifi_core: Unknown symbol mt7697q_write (err 0)
[ 800.727323] mt7697wifi_core: Unknown symbol mt7697_uart_open (err 0)
[ 800.734142] mt7697wifi_core: Unknown symbol mt7697q_unblock_writer (err 0)
[ 800.740645] mt7697wifi_core: Unknown symbol mt7697_uart_write (err 0)
[ 800.746996] mt7697wifi_core: Unknown symbol mt7697_uart_close (err 0)
[ 800.753736] mt7697wifi_core: Unknown symbol mt7697q_shutdown (err 0)
[ 800.759703] mt7697wifi_core: Unknown symbol mt7697_uart_read (err 0)
[ 800.766257] mt7697wifi_core: Unknown symbol mt7697q_read (err 0)
[ 800.776208] insmod (3333) used greatest stack depth: 4620 bytes left

@dfrey Maybe you should mention in the WIKI mt7697 wifi that we should use the mangOH VM or to git a specified release of the MT7697 firmware. Also a little mistake in the extraction : should be 7zr x -oLinkIt_SDK_V4.3.0_public LinkIt_SDK_V4.3.0_public.7z. But that’s quite nothing :wink:

Thank you for your instructions. :slight_smile:

Yes, that is the third .bin file. my bad.

Hi All,

I am running a script file through an application to bring up the wlan1 automatically.

I have inserted the below command in /etc/init.d/mtwifi(at the end of start function)
wpa_supplicant -D wext _b -i wlan1 -c your_ssid.wpa_supplicant.conf

Modified the /etc/network/interfaces
auto wlan1
iface wlan1 inet dhcp
pre-up /etc/init.d/mtwifi start uart 1
post-down /etc/init.d/mtwifi stop 1

I have tested this from command, it works.
Based on this above, created a script with a command ifup wlan1

Here are some observations.
When the script is run from a an application -

  1. IP address is assigned to wlan1 with router settings given
  2. Unable to ping to any IP address outside, not even the router IP

When the script is run from the command line (after changing the app to manual mode and a reboot)

  1. IP address is assigned to wlan1 with router settings given
  2. Pinging any IP address like google.com/8.8.8.8 works perfect.

One more observation (when script is run with in the Auto App) :-
A ping command or an ntp command within the script works fine.
If this is run out side the script (as an independent command or another script or shell), it doesn’t work…

So, I think for some reason the network configuration seems to work within the shell where the script is run. This is evident because of the ping in the script file worked well.

The whole purpose of this is to configure and set the wifi connectivity automatically and initialize the Device time (from any ntp server).

Is anything missing here?
Is there a better way to achieve the purpose?

Appreciate the support.

Thanks in advance.

One more thing…

Ideally changes to /etc/network/interfaces should have worked fine…but, it doesnt.
I checked the bootup sequence of the original mtwifi script (applied during MT7697 setup) execution.

mtwifi start function fails ----> cm not found
May be it is executed too early before the legato initialized.

Probably, something need to be addressed on this.

Let me make sure I understand what you’re trying to do.

  1. Connect to a WiFi AP as a client
  2. Get an IP address
  3. Get the current time from NTP

If that is what you want to do, then you can use the Legato Data Connection Service. The API documented there won’t match exactly because the Legato_patches repository includes patches to add support for multiple WiFi interfaces to the Data Connection Service.

Thanks David.
Can these API bring up ‘wlan1’ as well before they can make a connection to an WiFi AP?

Can these API bring up ‘wlan1’ as well before they can make a connection to an WiFi AP?

Yes, if you configure the data connection service to prefer wifi and setup the appropriate settings, then it will try to bring up the wifi interface and connect to the configured wifi access point.

@asyal, @davidc

I went through the sample code (WiFiClientTest) and observed that it also uses a shell script to initialize wlan1 and WiFi router connectivity. So, I continued to test my logic again.

I figured that there is an issue with GPIO2 - activating this one, causing the PING and any other TCP/HTTP transactions fail from the app and even the overall system (mangOH red).
IP configuration is all good.

I posted the case as new thread.

Please suggest how to resolve this.