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:
Tue Jul 23 12:01:47 2019 +0100
Revision:
126:48203bfdf420
Merge pull request #273 from ARMmbed/update_master

Update master to match 5.13.1
.
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 126:48203bfdf420 1 /*
mbed_official 126:48203bfdf420 2 * Copyright (c) 2019, Arm Limited and affiliates.
mbed_official 126:48203bfdf420 3 * SPDX-License-Identifier: Apache-2.0
mbed_official 126:48203bfdf420 4 *
mbed_official 126:48203bfdf420 5 * Licensed under the Apache License, Version 2.0 (the "License");
mbed_official 126:48203bfdf420 6 * you may not use this file except in compliance with the License.
mbed_official 126:48203bfdf420 7 * You may obtain a copy of the License at
mbed_official 126:48203bfdf420 8 *
mbed_official 126:48203bfdf420 9 * http://www.apache.org/licenses/LICENSE-2.0
mbed_official 126:48203bfdf420 10 *
mbed_official 126:48203bfdf420 11 * Unless required by applicable law or agreed to in writing, software
mbed_official 126:48203bfdf420 12 * distributed under the License is distributed on an "AS IS" BASIS,
mbed_official 126:48203bfdf420 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
mbed_official 126:48203bfdf420 14 * See the License for the specific language governing permissions and
mbed_official 126:48203bfdf420 15 * limitations under the License.
mbed_official 126:48203bfdf420 16 */
mbed_official 126:48203bfdf420 17
mbed_official 126:48203bfdf420 18 #ifndef WISUN_TEST_CERTIFICATES_H_
mbed_official 126:48203bfdf420 19 #define WISUN_TEST_CERTIFICATES_H_
mbed_official 126:48203bfdf420 20
mbed_official 126:48203bfdf420 21 const uint8_t WISUN_ROOT_CERTIFICATE[] = {
mbed_official 126:48203bfdf420 22 "-----BEGIN CERTIFICATE-----\r\n"
mbed_official 126:48203bfdf420 23 "MIIBLzCB1qADAgECAhQooDtB2DFWFsDlkVyeKLkkFq27vTAKBggqhkjOPQQDAjAN\r\n"
mbed_official 126:48203bfdf420 24 "MQswCQYDVQQDEwJDQTAiGA8wMDAwMDEwMTAwMDAwMFoYDzk5OTkxMjMxMjM1OTU5\r\n"
mbed_official 126:48203bfdf420 25 "WjANMQswCQYDVQQDEwJDQTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABG0ZABD+\r\n"
mbed_official 126:48203bfdf420 26 "g8Nvc9KBpw/aHhoim9KrqzOYP5qTmZgS8uxM/eqeAJ6vrSivWFT2fxHuzXG+yfvs\r\n"
mbed_official 126:48203bfdf420 27 "oPNgBJhv/YNhM9KjEDAOMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSAAwRQIg\r\n"
mbed_official 126:48203bfdf420 28 "CK00/WNqrLzSt7QtustgbL+kibXBuWFeYBjU5yPbaHECIQD8aFwPt2/oXLOSa7gB\r\n"
mbed_official 126:48203bfdf420 29 "9nwpA1rsmzCJLvb8ouxQ3uhXbg==\r\n"
mbed_official 126:48203bfdf420 30 "-----END CERTIFICATE-----"
mbed_official 126:48203bfdf420 31 };
mbed_official 126:48203bfdf420 32
mbed_official 126:48203bfdf420 33 const uint8_t WISUN_SERVER_CERTIFICATE[] = {
mbed_official 126:48203bfdf420 34 "-----BEGIN CERTIFICATE-----\r\n"
mbed_official 126:48203bfdf420 35 "MIIBbzCCARUCFHsX/aO/8skZ/3NAQrzQ957H/aNYMAoGCCqGSM49BAMCMA0xCzAJ\r\n"
mbed_official 126:48203bfdf420 36 "BgNVBAMTAkNBMCIYDzAwMDAwMTAxMDAwMDAwWhgPOTk5OTEyMzEyMzU5NTlaMGMx\r\n"
mbed_official 126:48203bfdf420 37 "CzAJBgNVBAYTAkZJMQ0wCwYDVQQIDARPdWx1MQ0wCwYDVQQHDARPdWx1MQ0wCwYD\r\n"
mbed_official 126:48203bfdf420 38 "VQQKDAR0ZXN0MQ0wCwYDVQQDDAR0ZXN0MRgwFgYJKoZIhvcNAQkBFgl0ZXN0QHRl\r\n"
mbed_official 126:48203bfdf420 39 "c3QwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQtbrqK+Z2gWz9rgvS4fgkWn1kb\r\n"
mbed_official 126:48203bfdf420 40 "wERr15kFr7CmNM63gAmMyS08m5/sBYps5XUdIwF+Pz8uYmk4LpSl+o0OLkmaMAoG\r\n"
mbed_official 126:48203bfdf420 41 "CCqGSM49BAMCA0gAMEUCIDknuOd/stYYgK3oztxspnKBHoOO8UcUB3PH2AfIq24e\r\n"
mbed_official 126:48203bfdf420 42 "AiEA8OMJ44i3TKToinV1IATm81mqu+5pBqYu4RtX0E/xP88=\r\n"
mbed_official 126:48203bfdf420 43 "-----END CERTIFICATE-----"
mbed_official 126:48203bfdf420 44 };
mbed_official 126:48203bfdf420 45
mbed_official 126:48203bfdf420 46 const uint8_t WISUN_SERVER_KEY[] = {
mbed_official 126:48203bfdf420 47 "-----BEGIN EC PRIVATE KEY-----\r\n"
mbed_official 126:48203bfdf420 48 "MHcCAQEEIEvbJ9SG/qeud6z3oRb+sROxk6/HWHQWtcucDFq3grzooAoGCCqGSM49\r\n"
mbed_official 126:48203bfdf420 49 "AwEHoUQDQgAELW66ivmdoFs/a4L0uH4JFp9ZG8BEa9eZBa+wpjTOt4AJjMktPJuf\r\n"
mbed_official 126:48203bfdf420 50 "7AWKbOV1HSMBfj8/LmJpOC6UpfqNDi5Jmg==\r\n"
mbed_official 126:48203bfdf420 51 "-----END EC PRIVATE KEY-----"
mbed_official 126:48203bfdf420 52 };
mbed_official 126:48203bfdf420 53
mbed_official 126:48203bfdf420 54 const uint8_t WISUN_CLIENT_CERTIFICATE[] = {
mbed_official 126:48203bfdf420 55 "-----BEGIN CERTIFICATE-----\r\n"
mbed_official 126:48203bfdf420 56 "MIIBbzCCARUCFHsX/aO/8skZ/3NAQrzQ957H/aNZMAoGCCqGSM49BAMCMA0xCzAJ\r\n"
mbed_official 126:48203bfdf420 57 "BgNVBAMTAkNBMCIYDzAwMDAwMTAxMDAwMDAwWhgPOTk5OTEyMzEyMzU5NTlaMGMx\r\n"
mbed_official 126:48203bfdf420 58 "CzAJBgNVBAYTAkZJMQ0wCwYDVQQIDARPdWx1MQ0wCwYDVQQHDARPdWx1MQ0wCwYD\r\n"
mbed_official 126:48203bfdf420 59 "VQQKDAR0ZXN0MQ0wCwYDVQQDDAR0ZXN0MRgwFgYJKoZIhvcNAQkBFgl0ZXN0QHRl\r\n"
mbed_official 126:48203bfdf420 60 "c3QwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARIJ0hVdYmPsTFmY3glVAzE6dRE\r\n"
mbed_official 126:48203bfdf420 61 "6Vp3rEUwqKqfMaJWvxd8EszaMP6PUwn4bprMkUPRmISTe8T17K8ZSRi8gun7MAoG\r\n"
mbed_official 126:48203bfdf420 62 "CCqGSM49BAMCA0gAMEUCIQCtQwnVemwlIUoXeMZ1WE3JHj9XAIbxg2lweRJ91XaV\r\n"
mbed_official 126:48203bfdf420 63 "VgIgDyft6+GF3u31VmTljTMAZZcCNRXDP0eNha+gB0TlGhY=\r\n"
mbed_official 126:48203bfdf420 64 "-----END CERTIFICATE-----"
mbed_official 126:48203bfdf420 65 };
mbed_official 126:48203bfdf420 66
mbed_official 126:48203bfdf420 67 const uint8_t WISUN_CLIENT_KEY[] = {
mbed_official 126:48203bfdf420 68 "-----BEGIN EC PRIVATE KEY-----\r\n"
mbed_official 126:48203bfdf420 69 "MHcCAQEEIOxOq1xL+Hv5hg6Zg41pVXpkjLTkZxXrBHJcExTUMAftoAoGCCqGSM49\r\n"
mbed_official 126:48203bfdf420 70 "AwEHoUQDQgAESCdIVXWJj7ExZmN4JVQMxOnUROlad6xFMKiqnzGiVr8XfBLM2jD+\r\n"
mbed_official 126:48203bfdf420 71 "j1MJ+G6azJFD0ZiEk3vE9eyvGUkYvILp+w==\r\n"
mbed_official 126:48203bfdf420 72 "-----END EC PRIVATE KEY-----"
mbed_official 126:48203bfdf420 73 };
mbed_official 126:48203bfdf420 74
mbed_official 126:48203bfdf420 75 #endif /* WISUN_TEST_CERTIFICATES_H_ */