-
Notifications
You must be signed in to change notification settings - Fork 178
Nanostack configuration options added #396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
1bd4c36
ebda130
a8ca4f5
9442d33
1f5a27e
54eb738
a08cf06
30eebfd
63bb64c
675b30d
ccda95a
f9fd30b
3b14427
c327e69
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
### Build time configuration of the stack | ||
### Build time configuration of the Nanostack | ||
|
||
To minimize the size of the produced stack, Nanostack defines a set of build options. | ||
The build time configuration of Nanostack uses the Mbed configuration system. The application needs to create an `mbed_app.json` configuration file if you want to use settings other than default settings. You can also minimize the size of the produced stack by using different build options. | ||
|
||
#### Build options | ||
|
||
This table demonstrate the difference in binary size between builds: | ||
|
||
Option Name | Features supported | Binary size in Mbed OS 5.5 | ||
------------| -------------------|------------------------------------ | ||
`ethernet_host` | Only Ethernet host support, no mesh networking. | 108 kB | ||
|
@@ -33,7 +35,7 @@ Select the device role: | |
- Mesh network. A router. (default) | ||
- Star network. A non-routing device. Also known as a host, or sleepy host. | ||
|
||
Modify your `mbed_app.json` file to tell which Nanostack configuration to choose and which configrations to use on [Mbed Mesh API](/docs/v5.6/reference/mesh.html). | ||
Modify your `mbed_app.json` file to direct which Nanostack configuration to choose. The [Mbed Mesh API](https://github.com/ARMmbed/mbed-os/blob/master/features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/mbed_lib.json) lists all configurations (6LoWPAN and Thread). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't like to link to GitHub. Ideally, the code for the mesh API would be fixed and merged, and we'd link to the generated Doxygen for it. |
||
|
||
An example of the `mbed_app.json` file: | ||
|
||
|
@@ -74,3 +76,48 @@ Then you may optionally choose to select the non-routing mode for those networks | |
|Mesh router (default) | `thread_router` | `MESH_DEVICE_TYPE_THREAD_ROUTER` | | ||
|Non-routing device | `thread_end_device` | `MESH_DEVICE_TYPE_THREAD_SLEEPY_END_DEVICE` | | ||
|
||
##### Configuration parameters for 6LoWPAN-ND and Thread | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have a PR to move configuration content to the configuration section: #366 Could you please update that PR with this content in the format of the other sections? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That might be ok, need to have a link pointing to the configuration page. Though I like the current table format, for me it is more readable. |
||
|
||
All 6LoWPAN and Thread configuration options are described below. | ||
Make sure that all your devices use the same network configuration (both nodes and border router) | ||
|
||
``` | ||
|
||
**Configurable parameters in the `mbed-mesh-api` section** | ||
|
||
| Parameter name | Value | Description | | ||
| --------------- | ------------- | ----------- | | ||
| `heap-size` | number [0-0xfffe] | Nanostack's internal heap size | | ||
|
||
**Thread related configuration parameters** | ||
|
||
| Parameter name | Value | Description | | ||
| --------------- | ------------- | ----------- | | ||
| `thread-pskd` | string [6-255 chars] | Human-scaled commissioning credentials. | | ||
| `thread-use-static-link-config` | boolean | True: Use the below link config, False: Use commissioning, ignore the below link config. | | ||
| `thread-device-type` | enum from `mesh_device_type_t` | Supported device operating modes:<br> `MESH_DEVICE_TYPE_THREAD_ROUTER`<br> `MESH_DEVICE_TYPE_THREAD_SLEEPY_END_DEVICE`<br> `MESH_DEVICE_TYPE_THREAD_MINIMAL_END_DEVICE` | | ||
| `thread-config-channel-mask` | number [0-0x07fff800] | Channel mask, 0x07fff800 is used for Thread networks (2.4GHz). | | ||
| `thread-config-channel-page` | number [0]| Channel page, 0 for 2,4 GHz radio. | | ||
| `thread-config-channel` | number [11-26] | RF channel to use. | | ||
| `thread-config-panid` | number [0-0xFFFF] | Network identifier. | | ||
| `thread-config-network-name` | string [1-16] | | ||
| `thread-config-commissioning-dataset-timestamp` | [0-0xFFFFFFFFFFFFFFFF] | [48 bit timestamp seconds]-[15 bit timestamp ticks]-[U bit] | | ||
| `thread-config-extended-panid` | byte array [8] | Extended PAN ID. | | ||
| `thread-master-key` | byte array [16]| Network master key. | | ||
| `thread-config-ml-prefix` | byte array [8] | Mesh local prefix. | | ||
| `thread-config-pskc` | byte array [16] | Pre-Shared Key for the Commissioner. | | ||
| `thread-security-policy` | number [0-0xFF] | Commissioning security policy bits. | | ||
|
||
**6LoWPAN related configuration parameters** | ||
|
||
| Parameter name | Type | Description | | ||
| --------------- | ---------| ----------- | | ||
| `6lowpan-nd-channel-mask` | number [0-0x07fff800] | Channel mask, bit-mask of channels to use. | | ||
| `6lowpan-nd-channel-page` | number [0, 2] | 0 for 2,4 GHz and 2 for sub-GHz radios. | | ||
| `6lowpan-nd-channel` | number [0-26] | RF channel to use when `channel_mask` is not defined. | | ||
| `6lowpan-nd-panid-filter` | number [0-0xffff] | Beacon PAN ID filter, 0xffff means no filtering. | | ||
| `6lowpan-nd-security-mode` | "NONE" or "PSK" | To use either no security, or Pre shared network key. | | ||
| `6lowpan-nd-psk-key-id` | number | PSK key ID when PSK is enabled. | | ||
| `6lowpan-nd-psk-key` | byte array [16] | Pre-Shared network key. | | ||
| `6lowpan-nd-sec-level` | number [1-7] | Network security level. Use default `5`. | | ||
| `6lowpan-nd-device-type` | "NET_6LOWPAN_ROUTER" or "NET_6LOWPAN_HOST" | Device mode. Router is routing packets from other device, creating a mesh network. | |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,8 @@ To get the MAC address for your end device, connect the node to the Thread netwo | |
|
||
For example, in the **mesh-minimal** application, place this `printf("MAC address = %s\n", mesh.get_mac_address());` after `printf("connected. IP = %s\n", mesh.get_ip_address());` | ||
|
||
It is also possible to use the Mesh API (ThreadInterface.h) to set values for these parameters. | ||
|
||
There are four additional (optional) query parameters you can put into this field: | ||
|
||
- `vn` Vendor name. | ||
|
@@ -55,6 +57,8 @@ Once you have completed the details, proceed to generate the QR code for your en | |
|
||
#### Using the Thread commissioning application | ||
|
||
When building a Thread example application, do not change any of the PSKc related parameters (network name, extended PAN ID or PSKc). PSKc has been precalculated for the application. The nanostack has no capability to generate PSKc on runtime. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no one has it is not limitation of nanostack but universe. only the one who knows the actual password can calculate those values There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So maybe better to remove this sentence -> The nanostack has no capability to generate PSKc on runtime. Should it be also here mentioned that we have used the "Thread Network" as a passwd? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes that is the most important information for the user. " "Thread Network" is the network password that is required by commissioning application" Something like that |
||
|
||
You can use the [Thread Android application](https://play.google.com/store/apps/details?id=org.threadgroup.commissioner) for commissioning. Download and install this on your Android device, turn on Wi-Fi and start the app. Then follow these steps after ensuring all the requirements listed above are satisfied: | ||
|
||
1. Set up a connection to the Wi-Fi access point to which the Thread border router is connected. When connected, the application lists your Thread border router(s). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The below table shows binary size in Mbed OS 5.5. Because we're going into 5.8, should we update the table, or is it OK as is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we just mention something like ->
The binary sizes in the table are just for showing the difference between different builds.