WiFi AP example for Odin-W2
mbed-os-example-odinw2-wifi-ap
Wi-Fi access point example for Mbed OS
Getting started with the Wi-Fi API
This is an example of a Wi-Fi access point application using the odinWiFiInterface and network socket APIs that [Mbed OS](https://github.com/ARMmbed/mbed-os) provides.
The program brings up the Wi-Fi access point and the underlying network interface and brings up a TCP echo server on access point.
Supported hardware
- [u-blox ODIN-W2](https://os.mbed.com/platforms/ublox-EVK-ODIN-W2/)
Getting started
1. Import the example.
mbed import mbed-os-example-odinw2-wifi-ap cd mbed-os-example-odinw2-wifi-ap
2. Configure the Wi-Fi to enable and use access point.
Edit mbed_app.json to include the correct Wi-Fi configurations, SSID and password:
"macros": ["DEVICE_WIFI_AP=1"], "config": { "wifi-ssid": { "help": "AP SSID", "value": "\"odin-w2\"" }, "ap-ip": { "help": "AP IP", "value": "\"ip value\"" }, "ap-netmask": { "help": "Netmask", "value": "\"netmask value\"" }, "ap-gateway": { "help": "Network gateway", "value": "\"gateway value\"" }, "ap-channel": { "help": "AP channel", "value": "\"some channel\"" }, "wifi-password": { "help": "WiFi Password", "value": "\"some pass\"" }
3. Compile and generate binary.
For example, for 'GCC':
mbed compile -t GCC_ARM -m UBLOX_EVK_ODIN_W2 ```
4. Open a serial console session with the target platform using the following parameters:
- Baud rate: 9600
- Data bits: 8
- Stop bits: 1
- Parity: None
5. Copy or drag the application 'mbed-os-example-odinw2-wifi-ap' in the folder 'mbed-os-example-odinw2-wifi-ap/BUILD/<TARGET NAME>/<PLATFORM NAME>' onto the target board.
6. The serial console should display a similar output to below, indicating a successful Wi-Fi connection:
Starting AP
AP started successfully
TCP: connected with 10.0.0.1 server
7. After the server message is displayed, connect a TCP client, upton sending a message to server, message will be echoed to client.
Limitations
1. DHCP mode is not supported.
mbed_app.json@1:b7bd774d83cb, 2018-09-24 (annotated)
- Committer:
- AmmadRehmatUbx
- Date:
- Mon Sep 24 14:51:51 2018 +0500
- Revision:
- 1:b7bd774d83cb
- Parent:
- 0:ebe81a0cdefc
mbed-os lib added
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AmmadRehmatUbx | 0:ebe81a0cdefc | 1 | { |
AmmadRehmatUbx | 0:ebe81a0cdefc | 2 | "macros": ["DEVICE_WIFI_AP=1"], |
AmmadRehmatUbx | 0:ebe81a0cdefc | 3 | "config": { |
AmmadRehmatUbx | 0:ebe81a0cdefc | 4 | "wifi-ssid": { |
AmmadRehmatUbx | 0:ebe81a0cdefc | 5 | "help": "AP SSID", |
AmmadRehmatUbx | 0:ebe81a0cdefc | 6 | "value": "\"odin-w2\"" |
AmmadRehmatUbx | 0:ebe81a0cdefc | 7 | }, |
AmmadRehmatUbx | 0:ebe81a0cdefc | 8 | "ap-ip": { |
AmmadRehmatUbx | 0:ebe81a0cdefc | 9 | "help": "AP IP", |
AmmadRehmatUbx | 0:ebe81a0cdefc | 10 | "value": "\"ip value\"" |
AmmadRehmatUbx | 0:ebe81a0cdefc | 11 | }, |
AmmadRehmatUbx | 0:ebe81a0cdefc | 12 | "ap-netmask": { |
AmmadRehmatUbx | 0:ebe81a0cdefc | 13 | "help": "Netmask", |
AmmadRehmatUbx | 0:ebe81a0cdefc | 14 | "value": "\"netmask value\"" |
AmmadRehmatUbx | 0:ebe81a0cdefc | 15 | }, |
AmmadRehmatUbx | 0:ebe81a0cdefc | 16 | "ap-gateway": { |
AmmadRehmatUbx | 0:ebe81a0cdefc | 17 | "help": "Network gateway", |
AmmadRehmatUbx | 0:ebe81a0cdefc | 18 | "value": "\"gateway value\"" |
AmmadRehmatUbx | 0:ebe81a0cdefc | 19 | }, |
AmmadRehmatUbx | 0:ebe81a0cdefc | 20 | "ap-channel": { |
AmmadRehmatUbx | 0:ebe81a0cdefc | 21 | "help": "AP channel", |
AmmadRehmatUbx | 0:ebe81a0cdefc | 22 | "value": "\"some channel\"" |
AmmadRehmatUbx | 0:ebe81a0cdefc | 23 | }, |
AmmadRehmatUbx | 0:ebe81a0cdefc | 24 | "wifi-password": { |
AmmadRehmatUbx | 0:ebe81a0cdefc | 25 | "help": "WiFi Password", |
AmmadRehmatUbx | 0:ebe81a0cdefc | 26 | "value": "\"some pass\"" |
AmmadRehmatUbx | 0:ebe81a0cdefc | 27 | } |
AmmadRehmatUbx | 0:ebe81a0cdefc | 28 | } |
AmmadRehmatUbx | 0:ebe81a0cdefc | 29 | } |