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:
Mon Aug 19 14:00:33 2019 +0100
Revision:
128:e7faff9c9fd9
Parent:
52:27692043e962
Merge branch 'mbed-os-5.13'

* mbed-os-5.13:
Updating mbed-os to mbed-os-5.13.3 (#275)
Update mesh_minimal_startup.py
Updating mbed-os to mbed-os-5.13.2 (#274)

.
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 52:27692043e962 21 if ! mbed export -m K64F -i $tool; then
mbed_official 52:27692043e962 22 fail $tool
mbed_official 52:27692043e962 23 continue
mbed_official 52:27692043e962 24 fi
mbed_official 36:cf12a20dc3ed 25 # Makefile builds
mbed_official 36:cf12a20dc3ed 26 if [[ $tool = make_* ]]; then
mbed_official 36:cf12a20dc3ed 27 make && pass $tool || fail $tool
mbed_official 36:cf12a20dc3ed 28 elif [[ $tool = uvision5 ]]; then
mbed_official 36:cf12a20dc3ed 29 # Keil return ERRORLEVEL 0, when build OK without warnings
mbed_official 36:cf12a20dc3ed 30 # ERRORLEVEL 1, when there was warnings. 2 or over, is not OK.
mbed_official 36:cf12a20dc3ed 31 "c:/Keil_v5/UV4/UV4.exe" -b mbed-os-example-mesh-minimal.uvprojx || \
mbed_official 36:cf12a20dc3ed 32 test $? -lt 2 && pass $tool || fail $tool
mbed_official 36:cf12a20dc3ed 33 elif [[ $tool = iar ]]; then
mbed_official 36:cf12a20dc3ed 34 "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 35 && pass $tool || fail $tool
mbed_official 36:cf12a20dc3ed 36 fi
mbed_official 36:cf12a20dc3ed 37 mv BUILD BUILD_$tool
mbed_official 36:cf12a20dc3ed 38 done
mbed_official 36:cf12a20dc3ed 39
mbed_official 36:cf12a20dc3ed 40 printf "\n|%15s |%6s |\n" "Tool" "Result"
mbed_official 36:cf12a20dc3ed 41 printf "|----------------|-------|\n"
mbed_official 36:cf12a20dc3ed 42 for tool in ${PASSED[@]-};do
mbed_official 36:cf12a20dc3ed 43 printf "|%15s |%6s |\n" $tool PASS
mbed_official 36:cf12a20dc3ed 44 done
mbed_official 36:cf12a20dc3ed 45 for tool in ${FAILED[@]-};do
mbed_official 36:cf12a20dc3ed 46 printf "|%15s |%6s |\n" $tool FAIL
mbed_official 36:cf12a20dc3ed 47 done