You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 24, 2019. It is now read-only.
*[mbed-cli](https://github.com/ARMmbed/mbed-cli) - to build the example programs. To learn how to build mbed OS applications with mbed-cli, see [the user guide](https://github.com/ARMmbed/mbed-cli/blob/master/README.md).
23
-
*A [serial port monitor](https://developer.mbed.org/handbook/SerialPC#host-interface-and-terminal-applications).
25
+
*[Serial port monitor](https://developer.mbed.org/handbook/SerialPC#host-interface-and-terminal-applications).
24
26
25
-
## Setting up
27
+
## Application setup
26
28
27
-
To set up the example, please:
29
+
To configure the example application, please:
28
30
29
-
1.[Build the example](#Building-the-example).
30
-
1.[Set up an IP address](#IP-address-setup). This step is optional.
31
-
1.[Set a socket type](#Setting-socket-type). This step is optional.
31
+
1.[Select the connection type](#connection-type).
32
+
1.[Set the client credentials](#client-credentials).
1.[Set up an IP address](#ip-address-setup). This step is optional.
38
+
1.[Change the socket type](#changing-socket-type). This step is optional.
32
39
33
-
### Building the example
40
+
### Connection type
34
41
35
-
To build the example application:
42
+
The application uses Ethernet as the default connection type. To change the connection type, set one of them as defined and all the rest as undefined in the beginning of the `main.cpp` file. For example, to enable 6LoWPAN ND mode:
43
+
44
+
```
45
+
#undef ETHERNET
46
+
#undef WIFI
47
+
#undef CELLULAR
48
+
#define MESH_LOWPAN_ND
49
+
#undef MESH_THREAD
50
+
```
51
+
52
+
### Client credentials
53
+
54
+
To register the application to the Connector service, you need to create and set the client side certificate.
1. Go to [mbed Device Connector](https://connector.mbed.com) and log in with your mbed account.
39
57
1. On mbed Device Connector, go to [My Devices > Security credentials](https://connector.mbed.com/#credentials) and click the **Get my device security credentials** button to get new credentials for your device.
40
-
1. Replace the credentials in `security.h` of this project's directory with content copied above.
41
-
1. Open a command line tool and navigate to the project’s directory.
42
-
1. Update mbed-os sources using the `mbed update` command.
43
-
1. Build the application by selecting the hardware board and build toolchain using the command `mbed compile -m K64F -t GCC_ARM`. mbed-cli builds a binary file under the project’s `.build` directory.
44
-
1. Plug the Ethernet cable into the board.
45
-
1. Plug the micro-USB cable into the **OpenSDA** port. The board is listed as a mass-storage device.
46
-
1. Drag the binary `.build/K64F/GCC_ARM/mbed-client-quickstart-morpheus.bin` to the board to flash the application.
47
-
1. The board is automatically programmed with the new binary. A flashing LED on it indicates that it is still working. When the LED stops blinking, the board is ready to work.
48
-
1. Press the **RESET** button on the board to run the program.
49
-
1. For verification, continue to the [Monitoring the application](#monitoring-the-application) chapter.
58
+
1. Replace the contents in `security.h` of this project's directory with content copied above.
59
+
60
+
### 6LoWPAN ND and Thread settings
61
+
62
+
6LoWPAN ND and Thread use IPv6 for connectivity. Therefore, you need to verify first that you have a working IPv6 connection. To do that, ping the Connector IPv6 address `2607:f0d0:2601:52::20` from your network.
63
+
64
+
#### mbed gateway
65
+
66
+
To connect the example application in 6LoWPAN ND or Thread mode to Connector, you need to set up an mbed 6LoWPAN gateway router. Clone the [mbed-client-example-6lowpan](https://github.com/ARMmbed/mbed-client-example-6lowpan) repository and follow the [gateway configuration](https://github.com/ARMmbed/mbed-client-example-6lowpan#gateway-configuration) instructions. Use the dynamic binary in both cases for IPv6 autoconfiguration.
67
+
68
+
#### Channel settings
69
+
70
+
In 6LoWPAN ND and Thread mode, you need to set the channel settings to match the mbed gateway settings. Channel settings can be found in the `MACROS.txt` file. For 2.4GHz shields (AT86RF233), use the following values:
Values for sub-GHz shields (AT86RF212B), **6LoWPAN ND only**:
80
+
81
+
```
82
+
YOTTA_CFG_MBED_MESH_API_6LOWPAN_ND_CHANNEL_PAGE=2
83
+
YOTTA_CFG_MBED_MESH_API_6LOWPAN_ND_CHANNEL=1
84
+
```
50
85
51
-
### IP address setup (optional)
86
+
For more information about the radio shields, see [the related documentation](docs/radio_module_identify.md).
52
87
53
-
This example uses IPv4 to communicate with the [mbed Device Connector Server](https://api.connector.mbed.com). The example program should automatically get an IPv4 address from the router when connected over Ethernet.
88
+
#### Thread-specific settings
89
+
90
+
With Thread, you can change the operating mode of the device between a router and a sleepy end device as follows:
91
+
92
+
In the `MACROS.txt` file, change the `YOTTA_CFG_MBED_MESH_API_THREAD_DEVICE_TYPE` to either `MESH_DEVICE_TYPE_THREAD_ROUTER` or `MESH_DEVICE_TYPE_THREAD_SLEEPY_END_DEVICE`.
93
+
94
+
### Ethernet settings
95
+
96
+
For running the example application using Ethernet, you need:
97
+
98
+
- An Ethernet cable.
99
+
- An Ethernet connection to the internet.
100
+
101
+
### Cellular settings
102
+
103
+
TBD
104
+
105
+
### Wi-Fi settings
106
+
107
+
The example application uses ESP8266 WiFi Interface for managing the wireless connectivity. To run this application using WiFi, you need to:
108
+
109
+
1. Have [ESP8266](https://en.wikipedia.org/wiki/ESP8266) WiFi module running [Espressif Firmware](https://codeload.github.com/espressif/ESP8266_AT/zip/master)
110
+
1. Mount WiFi module onto [K64F Grove Shield v2](https://developer.mbed.org/platforms/FRDM-K64F/#supported-seeed-studio-grove-extension)
111
+
1. Attach the shield on the K64F board.
112
+
1. In the `main.cpp` file:
113
+
- set WIFI as defined and other connection types as undefined.
114
+
- remove `#error "Remember to provide your WiFi credentials and provide in esp.connect("ssid","password");"`
115
+
-`esp.connect("ssid", "password");` , replace `ssid` and `password` with your WiFi SSID and WiFi password respectively.
116
+
117
+
118
+
### IP address setup
119
+
120
+
This example uses IPv4 to communicate with the [mbed Device Connector Server](https://api.connector.mbed.com) except for 6LoWPAN ND and Thread. The example program should automatically get an IPv4 address from the router when connected over Ethernet.
54
121
55
122
If your network does not have DHCP enabled, you have to manually assign a static IP address to the board. We recommend having DHCP enabled to make everything run smoothly.
56
123
57
-
### Changing socket type (binding mode - optional)
124
+
### Changing socket type
58
125
59
-
Your device can connect to mbed Device Connector via one of two binding modes: UDP or TCP. The default is UDP.
126
+
Your device can connect to mbed Device Connector via UDP or TCP binding mode. The default is UDP. The binding mode cannot be changed in 6LoWPAN ND or Thread mode.
60
127
61
128
To change the binding mode:
62
129
63
-
1. In the `simpleclient.h` file, find the parameter `SOCKET_MODE`.
64
-
1. The default is `M2MInterface::UDP`.
130
+
1. In the `simpleclient.h` file, find the parameter `SOCKET_MODE`. The default is `M2MInterface::UDP`.
65
131
1. To switch to TCP, change it to `M2MInterface::TCP`.
66
-
67
-
Then re-build and flash the application.
132
+
1. Rebuild and flash the application.
68
133
69
134
<spanclass="tips">**Tip:** The instructions in this document remain the same, irrespective of the socket mode you select.</span>
1. Open a command line tool and navigate to the project’s directory.
142
+
1. Update mbed-os sources using the `mbed update` command.
143
+
1.[Configure](#application-setup) the client application.
144
+
1. Build the application by selecting the hardware board and build the toolchain using the command `mbed compile -m K64F -t GCC_ARM -c -j0`. mbed-cli builds a binary file under the project’s `.build` directory.
145
+
1. Plug the Ethernet cable into the board if you are using Ethernet mode.
146
+
1. If you are using 6LoWPAN ND or Thread mode, connect and power on the gateway first.
147
+
1. Plug the micro-USB cable into the **OpenSDA** port. The board is listed as a mass-storage device.
148
+
1. Drag the binary `.build/K64F/GCC_ARM/mbed-client-quickstart-morpheus.bin` to the board to flash the application.
149
+
1. The board is automatically programmed with the new binary. A flashing LED on it indicates that it is still working. When the LED stops blinking, the board is ready to work.
150
+
1. Press the **RESET** button on the board to run the program.
151
+
1. For verification, continue to the [Monitoring the application](#monitoring-the-application) chapter.
152
+
153
+
71
154
## Monitoring the application
72
155
73
156
The application prints debug messages over the serial port, so you can monitor its activity with a serial port monitor. The application uses baud rate 115200.
* Make sure that you are using the same radio modules on both server and client sides:
4
+
5
+
* If the radio module on the gateway router supports the 2.4 GHz frequency band, the client side must have an mbed 6LoWPAN shield that uses a 2.4 GHz radio module (such as Atmel AT86RF233).
6
+
7
+
* If the radio module on the gateway router supports the sub-GHz frequency band, the client side must have an mbed 6LoWPAN shield that uses a sub-GHz radio module (such as Atmel AT86RF212B).
8
+
9
+
* An easy way to identify which frequency band your setup uses is to check the **Antenna size** on the radio module:
10
+
11
+
* The sub-GHz band antenna is larger than the 2.4 GHz antenna.
12
+
13
+
* For the client side (mbed 6LoWPAN shield connected to an FRDM-K64F board), see the image below:
0 commit comments