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