This is a simple mbed client example demonstrating, registration of a device with mbed Device Connector and reading and writing values as well as deregistering on different Network Interfaces including Ethernet, WiFi, 6LoWPAN ND and Thread respectively.

Getting started with mbed Client on mbed OS

This is the mbed Client example for mbed OS. It demonstrates how to register a device with mbed Device Connector, how to read and write values, and how to deregister. If you are unfamiliar with mbed Device Connector, we recommend that you read the introduction to the data model first.

The application:

Required hardware

Requirements for non K64F board

This example application is primarily designed for FRDM-K64F board but you can also use other mbed OS supported boards to run this example application , with some minor modifications for setup.

""macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\"",

Application setup

To configure the example application, please check following:

Connection type

The application uses Ethernet as the default connection type. To change the connection type, set one of them in mbed_app.json. For example, to enable 6LoWPAN ND mode:

    "network-interface": {
        "help": "options are ETHERNET,WIFI,MESH_LOWPAN_ND,MESH_THREAD.",
        "value": "MESH_LOWPAN_ND"

Client credentials

To register the application to the Connector service, you need to create and set the client side certificate.

6LoWPAN ND and Thread settings

First you need to select the RF driver to be used by 6LoWPAN/Thread stack.

For example Atmel AT86RF233/212B driver is located in

To add that driver to you application , import library from following URL:

Then you need to enable the IPV6 functionality as the 6LoWPAN and Thread are part of IPv6 stack. Edit the mbed_app.json file to add IPV6 feature:

"target.features_add": ["CLIENT", "IPV6", "COMMON_PAL"],

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.

mbed gateway

To connect the example application in 6LoWPAN ND or Thread mode to Connector, you need to set up an mbed 6LoWPAN gateway router as follows:

The dynamic binaries use IPv6 autoconfiguration and enable the client to connect to the Connector service. The static binaries create a site-local IPv6 network and packets cannot be routed outside.

You can view debug traces from the gateway with a serial port monitor. The gateway uses baud rate 460800. The gateway IPv6 address is correctly configured when the following trace is visible: `Eth bootstrap ready, IP=XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX`.

Channel settings

The default 2.4GHz channel settings are already defined by the mbed-mesh-api to match the mbed gateway settings. The application can override these settings by adding them to the mbed_app.json file in the main project directory. For example:

    "target_overrides": {
        "*": {
            "mbed-mesh-api.6lowpan-nd-channel-page": 0,
            "mbed-mesh-api.6lowpan-nd-channel": 12,
            "mbed-mesh-api.thread-config-channel-page": 0,
            "mbed-mesh-api.thread-config-channel": 12

For sub-GHz shields (AT86RF212B) use the following overrides, 6LoWPAN ND only:

"mbed-mesh-api.6lowpan-nd-channel-page": 2,
"mbed-mesh-api.6lowpan-nd-channel": 1

For more information about the radio shields, see [the related documentation](docs/ All the configurable settings can be found in the mbed-os-example-client/mbed-os/features/FEATURE_IPV6/mbed-mesh-api/mbed_lib.json file.

Thread-specific settings

With Thread, you can change the operating mode of the client from the default router mode to a sleepy end device by adding the following override to the `mbed_app.json` file:

    "mbed-mesh-api.thread-device-type": "MESH_DEVICE_TYPE_THREAD_SLEEPY_END_DEVICE"

Ethernet settings

For running the example application using Ethernet, you need:

Wi-Fi settings

The example application uses ESP8266 WiFi Interface for managing the wireless connectivity. To run this application using WiFi, you need:

    "network-interface": {
        "help": "options are ETHERNET,WIFI,MESH_LOWPAN_ND,MESH_THREAD.",
        "value": "WIFI"

Provide your WiFi SSID and password here and leave `\"` in the beginning and end of your SSID and password (as shown in the example below). Otherwise, the example cannot pick up the SSID and password in correct format.

    "wifi-ssid": {
        "help": "WiFi SSID",
        "value": "\"SSID\""
    "wifi-password": {
        "help": "WiFi Password",
        "value": "\"Password\""

IP address setup

This example uses IPv4 to communicate with the mbed Device Connector Server except for 6LoWPAN ND and Thread. The example program should automatically get an IPv4 address from the router when connected over Ethernet.

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.

Changing socket type

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.

To change the binding mode:

Tip: The instructions in this document remain the same, irrespective of the socket mode you select.

Monitoring the application

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.


After connecting, you should see messages about connecting to mbed Device Connector:

In app_start()
IP address
Device name 6868df22-d353-4150-b90a-a878130859d9

When you click the `SW2` button on your board you should see messages about the value changes:

handle_button_click, new value of counter is 1

Testing the application

For more methods check the mbed Device Connector Quick Start.

Application resources

The application exposes three resources:

For information on how to get notifications when resource 1 changes, or how to use resources 2 and 3, take a look at the mbed Device Connector Quick Start.

Building this example

Building with mbed CLI

If you'd like to use mbed CLI to build this, then you should follow the instructions in the Handbook TODO - new link. The instructions here relate to using the Online Compiler

If you'd like to use the online Compiler, then you can Import this code into your compiler, select your platform from the top right, compile the code using the compile button, load it onto your board, press the reset button on the board and you code will run. See the client go online!

More instructions for using the mbed Online Compiler can be found at TODO - update this

Files at this revision

API Documentation at this revision

Mon Mar 20 15:15:13 2017 +0000
Commit message:
Add Nucleo F429ZI to known issues list

It's not linking with IAR.

Commit copied from

Changed in this revision Show annotated file Show diff for this revision Revisions of this file
--- a/	Wed Mar 15 15:30:13 2017 +0000
+++ b/	Mon Mar 20 15:15:13 2017 +0000
@@ -412,3 +412,6 @@
 ### mbed OS 5.4
 * [UBLOX_EVK_ODIN_W2]: This example is not compiling with IAR. See [#194](
+* [NUCLEO_F429ZI]: This example is not compiling with IAR. See [#194](
+Fix for those issues coming via; [mbed-os PR 3920] (