|
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). |
| 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) and |
| 8 | +[OdinWiFiInterface](https://github.com/u-blox/ublox-odin-w2-drivers-docs-mbed-5). |
| 9 | + |
| 10 | +ESP8266Interface uses AT commands over serial interface to connect to external Wi-Fi device. OdinWiFiInterface provides Ethernet like driver to Mbed OS network stack. Network stack uses the driver to connect to Wi-Fi. |
8 | 11 |
|
9 | 12 | ### Wi-Fi class reference
|
10 | 13 |
|
11 | 14 | [](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/class_wi_fi_interface.html)
|
12 | 15 |
|
13 | 16 | ### Usage
|
14 | 17 |
|
15 |
| -To bring up the network interface: |
| 18 | +To bring up the network interface of external Wi-Fi device (for example, the ESP8266Interface): |
| 19 | + |
| 20 | +1. Instantiate an implementation of the WiFiInterface class. |
| 21 | + 1. Initialises AT command parser. |
| 22 | +1. Call the `connect` function with an SSID and password for the Wi-Fi network. |
| 23 | + 1. Commands Wi-Fi device to connect to network. |
| 24 | +1. Once connected, the WiFiInterface can be used as a target for opening [network sockets](/docs/development/reference/network-socket.html). |
| 25 | + |
| 26 | +To bring up the network interface of Ethernet like driver (for example, the OdinWiFiInterface): |
16 | 27 |
|
17 |
| -1. Instantiate an implementation of the WiFiInterface class (for example, the ESP8266Interface). |
| 28 | +1. Instantiate an implementation of the WiFiInterface class. |
| 29 | + 1. Initialises Wifi driver for the target. |
| 30 | + 1. Initialises network stack (LWIP). |
18 | 31 | 1. Call the `connect` function with an SSID and password for the Wi-Fi network.
|
| 32 | + 1. Wi-Fi driver connects to Wi-Fi network. |
| 33 | + 2. Network stack accuires IP address and DNS server address. |
| 34 | + |
19 | 35 | 1. Once connected, the WiFiInterface can be used as a target for opening [network sockets](/docs/development/reference/network-socket.html).
|
20 | 36 |
|
| 37 | +### Troubleshooting information |
| 38 | + |
| 39 | +Network interface `connect` failure reasons: |
| 40 | +1. Check that SSID and password are correct. |
| 41 | +1. Check that the IP address configuration service is working. |
| 42 | + |
21 | 43 | ### Wi-Fi example
|
22 | 44 |
|
23 | 45 | 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:
|
|
0 commit comments