This application is the simplest one to utilize our mesh networking stack. It just joins your device to the unsecure 6LoWPAN-ND network. The canonical source for this example lives at

Example mesh application for Mbed OS

With this application, you can use our mesh networking stack. This application joins your device to the unsecure 6LoWPAN-ND network.


Building with Mbed CLI

If you'd like to use Mbed CLI to build this offline, then you should refer to the Mbed CLI documentation. The instructions here relate to using the Mbed Online Compiler

  1. Click `Import this application` button.
  2. Change the channel settings: See the file `mbed_app.json` for an example of defining an IEEE 802.15.4 channel to use.
  3. Compile the application

A binary is generated at the end of the build process.

Connect the RF shield to the board

By default, we are using the Atmel AT86RF233, which you can purchase. Place the shield on top of your board, and power it on.

Program the target

Drag and drop the binary to the target to program the application.

Update the firmware of the border router.

You can read the instructions on updating the firmware of your board working as 6LoWPAN border router here.

Please remember to connect the Ethernet cable between the border router and your router. Then, power up the board.


As soon as both the border router and the target are up and running, you can verify the correct behavior. Open a serial console, and see the IP address obtained by the device.

Note: This application uses a baud rate of 115200.


connected. IP = 2001:db8:a0b:12f0::1

You can use this IP address to ping from your PC and verify that the connection is working correctly.

Changing the radio driver (optional)

To run a 6LoWPAN-ND network, you need a working RF driver for Nanostack. This example uses the Atmel AT86RF233 by default.

To change the RF driver:

  1. Uninstall the Atmel RF driver.
  2. Install the new driver. (For example, for the FRDM-CR20A radio shield based on the MCR20A device.)
  3. Recompile your application.
Mon Aug 19 14:00:33 2019 +0100
Merge branch 'mbed-os-5.13'

* mbed-os-5.13:
Updating mbed-os to mbed-os-5.13.3 (#275)
Updating mbed-os to mbed-os-5.13.2 (#274)

Commit copied from

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Seppo Takalo 0:bde1843b9885 1 {
mbed_official 4:567d72fb3d84 2 "config": {
mbed_official 52:27692043e962 3 "enable-led-control-example": true,
mbed_official 52:27692043e962 4 "LED": "NC",
mbed_official 90:0d8804fe2ce2 5 "BUTTON": "NC",
mbed_official 120:fe68bb7d2462 6 "RELAY_CONTROL": "NC",
mbed_official 90:0d8804fe2ce2 7 "BUTTON_MODE": "PullUp"
mbed_official 16:22f072355a2c 8 },
Seppo Takalo 0:bde1843b9885 9 "target_overrides": {
Seppo Takalo 0:bde1843b9885 10 "*": {
mbed_official 63:335c8d658420 11 "nanostack.configuration": "lowpan_router",
mbed_official 105:0b691b27144a 12 "nsapi.default-mesh-type": "LOWPAN",
mbed_official 52:27692043e962 13 "mbed-mesh-api.6lowpan-nd-panid-filter": "0xffff",
mbed_official 3:2b08c6ae7415 14 "mbed-mesh-api.6lowpan-nd-channel-page": 0,
mbed_official 3:2b08c6ae7415 15 "mbed-mesh-api.6lowpan-nd-channel": 12,
mbed_official 3:2b08c6ae7415 16 "mbed-mesh-api.6lowpan-nd-channel-mask": "(1<<12)",
mbed_official 38:ea6124437f88 17 "mbed-mesh-api.heap-size": 14000,
mbed_official 40:e0b9755ae4f1 18 "mbed-trace.enable": false,
mbed_official 40:e0b9755ae4f1 19 "platform.stdio-convert-newlines": true,
mbed_official 105:0b691b27144a 20 "platform.stdio-baud-rate": 115200,
mbed_official 105:0b691b27144a 21 "atmel-rf.provide-default": true,
mbed_official 105:0b691b27144a 22 "mcr20a.provide-default": false,
mbed_official 105:0b691b27144a 23 "target.device_has_add": ["802_15_4_PHY"],
mbed_official 105:0b691b27144a 24 "": "MESH"
mbed_official 52:27692043e962 25 },
mbed_official 52:27692043e962 26 "K64F": {
mbed_official 52:27692043e962 27 "LED": "LED_RED",
mbed_official 52:27692043e962 28 "BUTTON": "SW2"
mbed_official 52:27692043e962 29 },
mbed_official 52:27692043e962 30 "K66F": {
mbed_official 52:27692043e962 31 "LED": "LED_RED",
mbed_official 52:27692043e962 32 "BUTTON": "SW2"
mbed_official 52:27692043e962 33 },
mbed_official 105:0b691b27144a 34 "KW24D": {
mbed_official 105:0b691b27144a 35 "LED": "LED1",
mbed_official 105:0b691b27144a 36 "BUTTON": "SW1"
mbed_official 105:0b691b27144a 37 },
mbed_official 119:9974bf303a9c 38 "KW41Z": {
mbed_official 119:9974bf303a9c 39 "LED": "LED1",
mbed_official 119:9974bf303a9c 40 "BUTTON": "SW3"
mbed_official 119:9974bf303a9c 41 },
mbed_official 52:27692043e962 42 "NUCLEO_F401RE": {
mbed_official 52:27692043e962 43 "LED": "NC",
mbed_official 52:27692043e962 44 "BUTTON": "USER_BUTTON"
mbed_official 52:27692043e962 45 },
mbed_official 105:0b691b27144a 46 "NUCLEO_F429ZI": {
mbed_official 105:0b691b27144a 47 "LED": "LED_RED",
mbed_official 105:0b691b27144a 48 "BUTTON": "USER_BUTTON",
mbed_official 105:0b691b27144a 49 "BUTTON_MODE": "PullDown"
mbed_official 105:0b691b27144a 50 },
mbed_official 52:27692043e962 51 "NUCLEO_F411RE": {
mbed_official 52:27692043e962 52 "LED": "NC",
mbed_official 52:27692043e962 53 "BUTTON": "USER_BUTTON"
mbed_official 52:27692043e962 54 },
mbed_official 52:27692043e962 55 "NCS36510": {
mbed_official 52:27692043e962 56 "LED": "LED1",
mbed_official 52:27692043e962 57 "BUTTON": "SW2"
Seppo Takalo 0:bde1843b9885 58 }
Seppo Takalo 0:bde1843b9885 59 }
Seppo Takalo 0:bde1843b9885 60 }