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 MBEDTLS_WISUN_CONFIG_H_
mbed_official 126:48203bfdf420 19 #define MBEDTLS_WISUN_CONFIG_H_
mbed_official 126:48203bfdf420 20
mbed_official 126:48203bfdf420 21 #define MBEDTLS_ENTROPY_MAX_SOURCES 4 // save 320 bytes of RAM (default is 20 entropy source)
mbed_official 126:48203bfdf420 22 #define MBEDTLS_SSL_MAX_CONTENT_LEN 4096 // Use 4kB buffers for input and output instead of 16kB
mbed_official 126:48203bfdf420 23
mbed_official 126:48203bfdf420 24 //#define MBEDTLS_DEBUG_C
mbed_official 126:48203bfdf420 25
mbed_official 126:48203bfdf420 26 /* mbed TLS feature support */
mbed_official 126:48203bfdf420 27 #define MBEDTLS_ECP_NIST_OPTIM
mbed_official 126:48203bfdf420 28 #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
mbed_official 126:48203bfdf420 29 #undef MBEDTLS_ECP_DP_SECP192R1_ENABLED
mbed_official 126:48203bfdf420 30 #undef MBEDTLS_ECP_DP_SECP224R1_ENABLED
mbed_official 126:48203bfdf420 31 #undef MBEDTLS_ECP_DP_SECP384R1_ENABLED
mbed_official 126:48203bfdf420 32 #undef MBEDTLS_ECP_DP_SECP521R1_ENABLED
mbed_official 126:48203bfdf420 33 #undef MBEDTLS_ECP_DP_SECP192K1_ENABLED
mbed_official 126:48203bfdf420 34 #undef MBEDTLS_ECP_DP_SECP224K1_ENABLED
mbed_official 126:48203bfdf420 35 #undef MBEDTLS_ECP_DP_SECP256K1_ENABLED
mbed_official 126:48203bfdf420 36 #undef MBEDTLS_ECP_DP_BP256R1_ENABLED
mbed_official 126:48203bfdf420 37 #undef MBEDTLS_ECP_DP_BP384R1_ENABLED
mbed_official 126:48203bfdf420 38 #undef MBEDTLS_ECP_DP_BP512R1_ENABLED
mbed_official 126:48203bfdf420 39 #undef MBEDTLS_ECP_DP_CURVE25519_ENABLED
mbed_official 126:48203bfdf420 40
mbed_official 126:48203bfdf420 41 #ifdef MBEDTLS_SSL_TLS_C
mbed_official 126:48203bfdf420 42 #define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
mbed_official 126:48203bfdf420 43 #define MBEDTLS_SSL_PROTO_TLS1_2
mbed_official 126:48203bfdf420 44 #define MBEDTLS_SSL_EXPORT_KEYS
mbed_official 126:48203bfdf420 45 #define MBEDTLS_SSL_ALL_ALERT_MESSAGES
mbed_official 126:48203bfdf420 46 #endif
mbed_official 126:48203bfdf420 47
mbed_official 126:48203bfdf420 48 /* mbed TLS modules */
mbed_official 126:48203bfdf420 49 #define MBEDTLS_BIGNUM_C
mbed_official 126:48203bfdf420 50 #define MBEDTLS_CIPHER_C
mbed_official 126:48203bfdf420 51 #define MBEDTLS_AES_C
mbed_official 126:48203bfdf420 52 #define MBEDTLS_CCM_C
mbed_official 126:48203bfdf420 53 #define MBEDTLS_CTR_DRBG_C
mbed_official 126:48203bfdf420 54 #define MBEDTLS_ECP_C
mbed_official 126:48203bfdf420 55 #define MBEDTLS_MD_C
mbed_official 126:48203bfdf420 56 #define MBEDTLS_PK_C
mbed_official 126:48203bfdf420 57 #define MBEDTLS_SHA256_C
mbed_official 126:48203bfdf420 58 #ifdef MBEDTLS_SSL_TLS_C
mbed_official 126:48203bfdf420 59 #define MBEDTLS_SSL_COOKIE_C
mbed_official 126:48203bfdf420 60 #define MBEDTLS_SSL_CLI_C
mbed_official 126:48203bfdf420 61 #define MBEDTLS_SSL_SRV_C
mbed_official 126:48203bfdf420 62 #endif
mbed_official 126:48203bfdf420 63 #define MBEDTLS_NIST_KW_C
mbed_official 126:48203bfdf420 64 #define MBEDTLS_PEM_PARSE_C
mbed_official 126:48203bfdf420 65 #define MBEDTLS_BASE64_C
mbed_official 126:48203bfdf420 66 #define MBEDTLS_SHA1_C
mbed_official 126:48203bfdf420 67
mbed_official 126:48203bfdf420 68 /* Save RAM at the expense of ROM */
mbed_official 126:48203bfdf420 69 #define MBEDTLS_AES_ROM_TABLES
mbed_official 126:48203bfdf420 70 #define MBEDTLS_AES_FEWER_TABLES
mbed_official 126:48203bfdf420 71
mbed_official 126:48203bfdf420 72 /* Save RAM by adjusting to our exact needs */
mbed_official 126:48203bfdf420 73 #define MBEDTLS_ECP_MAX_BITS 256
mbed_official 126:48203bfdf420 74 #undef MBEDTLS_MPI_MAX_SIZE
mbed_official 126:48203bfdf420 75 #define MBEDTLS_MPI_MAX_SIZE 128 // 256 bits is 32 bytes
mbed_official 126:48203bfdf420 76
mbed_official 126:48203bfdf420 77 /* Save ROM and a few bytes of RAM by specifying our own ciphersuite list */
mbed_official 126:48203bfdf420 78 #define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8
mbed_official 126:48203bfdf420 79
mbed_official 126:48203bfdf420 80 /* Optimization. Remove all not needed stuff */
mbed_official 126:48203bfdf420 81 #define MBEDTLS_X509_USE_C
mbed_official 126:48203bfdf420 82 #define MBEDTLS_X509_CRT_PARSE_C
mbed_official 126:48203bfdf420 83 #undef MBEDTLS_SSL_SERVER_NAME_INDICATION
mbed_official 126:48203bfdf420 84 #undef MBEDTLS_SELF_TEST
mbed_official 126:48203bfdf420 85 #undef MBEDTLS_SSL_ENCRYPT_THEN_MAC
mbed_official 126:48203bfdf420 86 #undef MBEDTLS_SSL_EXTENDED_MASTER_SECRET
mbed_official 126:48203bfdf420 87 #define MBEDTLS_ASN1_PARSE_C
mbed_official 126:48203bfdf420 88 #define MBEDTLS_ASN1_WRITE_C
mbed_official 126:48203bfdf420 89 #define MBEDTLS_ECDH_C
mbed_official 126:48203bfdf420 90 #define MBEDTLS_ECDSA_C
mbed_official 126:48203bfdf420 91 #undef MBEDTLS_ERROR_C
mbed_official 126:48203bfdf420 92 #define MBEDTLS_GCM_C
mbed_official 126:48203bfdf420 93 #define MBEDTLS_OID_C
mbed_official 126:48203bfdf420 94 #define MBEDTLS_PK_PARSE_C
mbed_official 126:48203bfdf420 95 #define MBEDTLS_PK_WRITE_C
mbed_official 126:48203bfdf420 96 #undef MBEDTLS_RSA_C
mbed_official 126:48203bfdf420 97 #undef MBEDTLS_VERSION_C
mbed_official 126:48203bfdf420 98 #undef MBEDTLS_CERTS_C
mbed_official 126:48203bfdf420 99 #undef MBEDTLS_HMAC_DRBG_C
mbed_official 126:48203bfdf420 100 #define MBEDTLS_CIPHER_MODE_CBC
mbed_official 126:48203bfdf420 101 #undef MBEDTLS_CIPHER_PADDING_PKCS7
mbed_official 126:48203bfdf420 102 #undef MBEDTLS_ECDSA_DETERMINISTIC
mbed_official 126:48203bfdf420 103 #undef MBEDTLS_SSL_SESSION_TICKETS
mbed_official 126:48203bfdf420 104 #undef MBEDTLS_VERSION_FEATURES
mbed_official 126:48203bfdf420 105 #undef MBEDTLS_X509_CHECK_KEY_USAGE
mbed_official 126:48203bfdf420 106 #undef MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
mbed_official 126:48203bfdf420 107 #undef MBEDTLS_ERROR_STRERROR_DUMMY
mbed_official 126:48203bfdf420 108 #undef MBEDTLS_SSL_ALPN
mbed_official 126:48203bfdf420 109 #undef MBEDTLS_SSL_TICKET_C
mbed_official 126:48203bfdf420 110 #undef MBEDTLS_HAVE_SSE2
mbed_official 126:48203bfdf420 111 #undef MBEDTLS_PLATFORM_MEMORY
mbed_official 126:48203bfdf420 112 #undef MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
mbed_official 126:48203bfdf420 113 #undef MBEDTLS_DEPRECATED_WARNING
mbed_official 126:48203bfdf420 114 #undef MBEDTLS_DEPRECATED_REMOVED
mbed_official 126:48203bfdf420 115 #undef MBEDTLS_CAMELLIA_SMALL_MEMORY
mbed_official 126:48203bfdf420 116 #undef MBEDTLS_CIPHER_MODE_CFB
mbed_official 126:48203bfdf420 117 #undef MBEDTLS_CIPHER_MODE_CTR
mbed_official 126:48203bfdf420 118 #undef MBEDTLS_CIPHER_NULL_CIPHER
mbed_official 126:48203bfdf420 119 #undef MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS
mbed_official 126:48203bfdf420 120 #undef MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN
mbed_official 126:48203bfdf420 121 #undef MBEDTLS_CIPHER_PADDING_ZEROS
mbed_official 126:48203bfdf420 122 #undef MBEDTLS_ENABLE_WEAK_CIPHERSUITES
mbed_official 126:48203bfdf420 123 #define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
mbed_official 126:48203bfdf420 124 #undef MBEDTLS_ECP_DP_CURVE25519_ENABLED
mbed_official 126:48203bfdf420 125 #define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
mbed_official 126:48203bfdf420 126 #undef MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
mbed_official 126:48203bfdf420 127 #define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
mbed_official 126:48203bfdf420 128 #undef MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
mbed_official 126:48203bfdf420 129 #undef MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
mbed_official 126:48203bfdf420 130 #undef MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
mbed_official 126:48203bfdf420 131 #undef MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
mbed_official 126:48203bfdf420 132 #define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
mbed_official 126:48203bfdf420 133 #undef MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
mbed_official 126:48203bfdf420 134 #undef MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
mbed_official 126:48203bfdf420 135 #undef MBEDTLS_PK_PARSE_EC_EXTENDED
mbed_official 126:48203bfdf420 136 #undef MBEDTLS_GENPRIME
mbed_official 126:48203bfdf420 137 #undef MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
mbed_official 126:48203bfdf420 138 #undef MBEDTLS_MEMORY_DEBUG
mbed_official 126:48203bfdf420 139 #undef MBEDTLS_MEMORY_BACKTRACE
mbed_official 126:48203bfdf420 140 #undef MBEDTLS_PK_RSA_ALT_SUPPORT
mbed_official 126:48203bfdf420 141 #undef MBEDTLS_PKCS1_V15
mbed_official 126:48203bfdf420 142 #undef MBEDTLS_PKCS1_V21
mbed_official 126:48203bfdf420 143 #undef MBEDTLS_RSA_NO_CRT
mbed_official 126:48203bfdf420 144 #undef MBEDTLS_SSL_AEAD_RANDOM_IV
mbed_official 126:48203bfdf420 145 #undef MBEDTLS_RSA_NO_CRT
mbed_official 126:48203bfdf420 146 #undef MBEDTLS_SSL_DEBUG_ALL
mbed_official 126:48203bfdf420 147 #undef MBEDTLS_SSL_FALLBACK_SCSV
mbed_official 126:48203bfdf420 148 #undef MBEDTLS_SSL_HW_RECORD_ACCEL
mbed_official 126:48203bfdf420 149 #undef MBEDTLS_SSL_CBC_RECORD_SPLITTING
mbed_official 126:48203bfdf420 150 #undef MBEDTLS_SSL_RENEGOTIATION
mbed_official 126:48203bfdf420 151 #undef MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
mbed_official 126:48203bfdf420 152 #undef MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE
mbed_official 126:48203bfdf420 153 #undef MBEDTLS_SSL_PROTO_TLS1
mbed_official 126:48203bfdf420 154 #undef MBEDTLS_SSL_PROTO_TLS1_1
mbed_official 126:48203bfdf420 155 #undef MBEDTLS_SSL_DTLS_BADMAC_LIMIT
mbed_official 126:48203bfdf420 156 #undef MBEDTLS_SSL_TRUNCATED_HMAC
mbed_official 126:48203bfdf420 157 #undef MBEDTLS_THREADING_ALT
mbed_official 126:48203bfdf420 158 #undef MBEDTLS_THREADING_PTHREAD
mbed_official 126:48203bfdf420 159 #undef MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3
mbed_official 126:48203bfdf420 160 #undef MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
mbed_official 126:48203bfdf420 161 #undef MBEDTLS_X509_RSASSA_PSS_SUPPORT
mbed_official 126:48203bfdf420 162 #undef MBEDTLS_ZLIB_SUPPORT
mbed_official 126:48203bfdf420 163 #undef MBEDTLS_AESNI_C
mbed_official 126:48203bfdf420 164 #undef MBEDTLS_ARC4_C
mbed_official 126:48203bfdf420 165 #undef MBEDTLS_BLOWFISH_C
mbed_official 126:48203bfdf420 166 #undef MBEDTLS_CAMELLIA_C
mbed_official 126:48203bfdf420 167 #undef MBEDTLS_DES_C
mbed_official 126:48203bfdf420 168 #undef MBEDTLS_DHM_C
mbed_official 126:48203bfdf420 169 #undef MBEDTLS_HAVEGE_C
mbed_official 126:48203bfdf420 170 #undef MBEDTLS_MD2_C
mbed_official 126:48203bfdf420 171 #undef MBEDTLS_MD4_C
mbed_official 126:48203bfdf420 172 #undef MBEDTLS_MD5_C
mbed_official 126:48203bfdf420 173 #undef MBEDTLS_MEMORY_BUFFER_ALLOC_C
mbed_official 126:48203bfdf420 174 #undef MBEDTLS_PADLOCK_C
mbed_official 126:48203bfdf420 175 #undef MBEDTLS_PEM_WRITE_C
mbed_official 126:48203bfdf420 176 #undef MBEDTLS_PKCS5_C
mbed_official 126:48203bfdf420 177 #undef MBEDTLS_PKCS11_C
mbed_official 126:48203bfdf420 178 #undef MBEDTLS_PKCS12_C
mbed_official 126:48203bfdf420 179 #undef MBEDTLS_PLATFORM_C
mbed_official 126:48203bfdf420 180 #undef MBEDTLS_RIPEMD160_C
mbed_official 126:48203bfdf420 181 #undef MBEDTLS_SHA512_C
mbed_official 126:48203bfdf420 182 #undef MBEDTLS_SSL_CACHE_C
mbed_official 126:48203bfdf420 183 #undef MBEDTLS_THREADING_C
mbed_official 126:48203bfdf420 184 #define MBEDTLS_X509_CREATE_C
mbed_official 126:48203bfdf420 185 #define MBEDTLS_X509_CRT_WRITE_C
mbed_official 126:48203bfdf420 186 #undef MBEDTLS_XTEA_C
mbed_official 126:48203bfdf420 187
mbed_official 126:48203bfdf420 188 #include "mbedtls/check_config.h"
mbed_official 126:48203bfdf420 189
mbed_official 126:48203bfdf420 190 #endif /* MBEDTLS_WISUN_CONFIG_H */
mbed_official 126:48203bfdf420 191