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 https://github.com/ARMmbed/mbed-os-example-mesh-minimal

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.

Setup

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.

Testing

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.

Quote:

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.
Committer:
mbed_official
Date:
Wed Jan 18 14:00:11 2017 +0000
Revision:
36:cf12a20dc3ed
Child:
52:27692043e962
Add script to test exporters

* List also failed toolchains, run through all

.
Commit copied from https://github.com/ARMmbed/mbed-os-example-mesh-minimal

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 36:cf12a20dc3ed 1 #!/bin/bash
mbed_official 36:cf12a20dc3ed 2
mbed_official 36:cf12a20dc3ed 3 # Stop on failure
mbed_official 36:cf12a20dc3ed 4 set -eu
mbed_official 36:cf12a20dc3ed 5
mbed_official 36:cf12a20dc3ed 6 EXPORTERS=(make_armc5 make_gcc_arm make_iar uvision5 iar)
mbed_official 36:cf12a20dc3ed 7 PASSED=()
mbed_official 36:cf12a20dc3ed 8 FAILED=()
mbed_official 36:cf12a20dc3ed 9
mbed_official 36:cf12a20dc3ed 10 fail() {
mbed_official 36:cf12a20dc3ed 11 FAILED+=($1)
mbed_official 36:cf12a20dc3ed 12 return 0
mbed_official 36:cf12a20dc3ed 13 }
mbed_official 36:cf12a20dc3ed 14
mbed_official 36:cf12a20dc3ed 15 pass() {
mbed_official 36:cf12a20dc3ed 16 PASSED+=($1)
mbed_official 36:cf12a20dc3ed 17 }
mbed_official 36:cf12a20dc3ed 18
mbed_official 36:cf12a20dc3ed 19 for tool in ${EXPORTERS[*]};do
mbed_official 36:cf12a20dc3ed 20 echo "Testing on $tool"
mbed_official 36:cf12a20dc3ed 21 mbed export -m K64F -i $tool
mbed_official 36:cf12a20dc3ed 22 # Makefile builds
mbed_official 36:cf12a20dc3ed 23 if [[ $tool = make_* ]]; then
mbed_official 36:cf12a20dc3ed 24 make && pass $tool || fail $tool
mbed_official 36:cf12a20dc3ed 25 elif [[ $tool = uvision5 ]]; then
mbed_official 36:cf12a20dc3ed 26 # Keil return ERRORLEVEL 0, when build OK without warnings
mbed_official 36:cf12a20dc3ed 27 # ERRORLEVEL 1, when there was warnings. 2 or over, is not OK.
mbed_official 36:cf12a20dc3ed 28 "c:/Keil_v5/UV4/UV4.exe" -b mbed-os-example-mesh-minimal.uvprojx || \
mbed_official 36:cf12a20dc3ed 29 test $? -lt 2 && pass $tool || fail $tool
mbed_official 36:cf12a20dc3ed 30 elif [[ $tool = iar ]]; then
mbed_official 36:cf12a20dc3ed 31 "C:/Program Files (x86)/IAR Systems/Embedded Workbench 7.5/common/bin/IarBuild.exe" mbed-os-example-mesh-minimal.ewp mbed-os-example-mesh-minimal \
mbed_official 36:cf12a20dc3ed 32 && pass $tool || fail $tool
mbed_official 36:cf12a20dc3ed 33 fi
mbed_official 36:cf12a20dc3ed 34 mv BUILD BUILD_$tool
mbed_official 36:cf12a20dc3ed 35 done
mbed_official 36:cf12a20dc3ed 36
mbed_official 36:cf12a20dc3ed 37 printf "\n|%15s |%6s |\n" "Tool" "Result"
mbed_official 36:cf12a20dc3ed 38 printf "|----------------|-------|\n"
mbed_official 36:cf12a20dc3ed 39 for tool in ${PASSED[@]-};do
mbed_official 36:cf12a20dc3ed 40 printf "|%15s |%6s |\n" $tool PASS
mbed_official 36:cf12a20dc3ed 41 done
mbed_official 36:cf12a20dc3ed 42 for tool in ${FAILED[@]-};do
mbed_official 36:cf12a20dc3ed 43 printf "|%15s |%6s |\n" $tool FAIL
mbed_official 36:cf12a20dc3ed 44 done