# Using the Wi-Fi Library

The Wi-Fi features of LinkIt 7697 are provided through the **LWiFi** library. Its interface is very similar to the Arduino Wi-Fi library, therefore most of the examples should work without needing modifications.

## Scanning for Nearby Wi-Fi Network <a href="#usingthewi-filibrary-scanningfornearbywi-finetwork" id="usingthewi-filibrary-scanningfornearbywi-finetwork"></a>

The board comes with an **LWiFi library** that provides nearly the same interface as the Arduino's WiFi library. In this section, you'll learn how to run the **ScanNetwork** example, which shows a list of nearby Wi-Fi access points, the steps are as follows:

1. Select **File > Examples > LWiFi > ScanNetworks**.

![](https://3972650740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY4gduUSLWOCI23CXUWej%2Fuploads%2FmDEmgH23qZNozGfkNhgo%2Fscan_network_example.png?alt=media\&token=9c450221-e436-499b-aed3-02c0dbe683d4)

2\. Click the **Upload** button and wait for the **Done Uploading** message to appear.

3\. Click the **Serial Monitor** button in the toolbar, as shown below:

![](https://3972650740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY4gduUSLWOCI23CXUWej%2Fuploads%2FDph2YVNG0fWTBOSW5rzN%2Fserial_monitor.png?alt=media\&token=0b7f80a9-a518-4c9c-85bb-99db704c525f)

4\. Adjust the **Baud rate** setting to **9,600**. A list of nearby access points and their signal strength should appear in the output window, for example.

![](https://3972650740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY4gduUSLWOCI23CXUWej%2Fuploads%2FI0S701wi8O7v6J3ujwAr%2Fserial_monitor_baud.png?alt=media\&token=54f358e2-7796-48fe-a2a4-a07ece3ac030)

You can press the onboard **RST** button to re-run the sketch without having to reconnect to the serial monitor. This is because the **RST** button only resets the MT7697 SoC but not the CP2102N chipset. The COM port is always available even when the SoC has been reset.

### Connecting to a Web Server <a href="#usingthewi-filibrary-connectingtoawebserver" id="usingthewi-filibrary-connectingtoawebserver"></a>

```
char ssid[] = "yourNetwork"; // your network SSID (name) 
char pass[] = "secretPassword"; // your network password (use for WPA, or use as key for WEP)
```

```
// Make a HTTP request: 
client.println("GET /linkit_7697_ascii.txt HTTP/1.0"); 
client.println("Host: download.labs.mediatek.com"); 
client.println("Accept: */*"); 
client.println("Connection: close"); 
client.println();
```

```
  _      _       _    _____ _     ______ __ ___ ______ 
 | |    (_)     | |  |_   _| |   |____  / // _ \____  |
 | |     _ _ __ | | __ | | | |_      / / /| (_) |  / / 
 | |    | | '_ \| |/ / | | | __|    / / '_ \__, | / /  
 | |____| | | | |   < _| |_| |_    / /| (_) |/ / / /   
 |______|_|_| |_|_|\_\_____|\__|  /_/  \___//_/ /_/
```
