|
4 | 4 |
|
5 | 5 | The WifiInterface provides a simple C++ API for connecting to the internet over a Wi-Fi device.
|
6 | 6 |
|
7 |
| -There are multiple [Wi-Fi components](https://os.mbed.com/components/cat/wifi/) that implement the WiFiInterface class. The example below uses the [ESP8266Interface](https://github.com/armmbed/esp8266-driver). |
8 |
| - |
9 | 7 | ### Wi-Fi class reference
|
10 | 8 |
|
11 | 9 | [](https://os.mbed.com/docs/v5.8/mbed-os-api-doxy/class_wi_fi_interface.html)
|
12 | 10 |
|
13 | 11 | ### Usage
|
14 | 12 |
|
15 |
| -To bring up the network interface: |
| 13 | +To bring up the network interface of an external Wi-Fi device (for example, the ESP8266Interface): |
16 | 14 |
|
17 |
| -1. Instantiate an implementation of the WiFiInterface class (for example, the ESP8266Interface). |
| 15 | +1. Instantiate an implementation of the WiFiInterface class. |
| 16 | + 1. Initialize the AT command parser. |
18 | 17 | 1. Call the `connect` function with an SSID and password for the Wi-Fi network.
|
19 |
| -1. Once connected, the WiFiInterface can be used as a target for opening [network sockets](/docs/v5.8/reference/network-socket.html). |
| 18 | + 1. Command the Wi-Fi device to connect to network. |
| 19 | +1. Once connected, you can use the WiFiInterface as a target for opening [network sockets](/docs/v5.8/reference/network-socket.html). |
| 20 | + |
| 21 | +### Troubleshooting information |
| 22 | + |
| 23 | +Network interface `connect` failure reasons: |
| 24 | + |
| 25 | +1. Check that the SSID and password are correct. |
| 26 | +1. Check that the IP address configuration service is working. |
20 | 27 |
|
21 | 28 | ### Wi-Fi example
|
22 | 29 |
|
23 |
| -Here is an example of an HTTP client program. The program brings up an ESP8266 as the underlying network interface, and uses it to perform an HTTP transaction over a TCPSocket: |
| 30 | +Here is an example of an HTTP client program. The program brings up an ESP8266 as the underlying network interface, and uses it to perform an HTTP transaction over a TCPSocket. There are multiple [Wi-Fi components](https://os.mbed.com/components/cat/wifi/) that implement the WiFiInterface class. The example below uses the [ESP8266Interface](https://github.com/armmbed/esp8266-driver) and [OdinWiFiInterface](https://github.com/u-blox/ublox-odin-w2-drivers-docs-mbed-5). |
| 31 | + |
| 32 | +The ESP8266Interface uses AT commands over serial interface to connect to an external Wi-Fi device. The OdinWiFiInterface provides an Ethernet-like driver to the Mbed OS network stack. The network stack uses the driver to connect to Wi-Fi: |
24 | 33 |
|
25 | 34 | [](https://os.mbed.com/teams/mbed_example/code/TCPSocketWiFi_Example/file/6a4e57edc2b2/main.cpp)
|
26 | 35 |
|
|
0 commit comments