Skip to content

Update 6LoWPAN mesh documentation #866

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

Merged
merged 5 commits into from
Jan 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions docs/reference/technology/mesh/thread_commissioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ A model network setup could look like this:

#### Building the end node application

By default, the Mbed Thread applications/examples use the static network link configuration defined in the [mesh-api configuration file](https://github.com/ARMmbed/mbed-os/blob/master/features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/mbed_lib.json). If you want to use the Thread commissioning, add the following lines to your `.json` file. You can use the [mesh-minimal](https://github.com/ARMmbed/mbed-os-example-mesh-minimal) application as an example.
By default, the Mbed Thread applications/examples use the static network link configuration defined in the [mesh-api configuration file](https://github.com/ARMmbed/mbed-os/blob/master/features/nanostack/mbed-mesh-api/mbed_lib.json). If you want to use the Thread commissioning, add the following lines to your `.json` file. You can use the [mesh minimal](../apis/mesh-api.html#mesh-example) application as an example.

- `"mbed-mesh-api.thread-use-static-link-config": false` under `"target_overrides":`
- `"macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_config.h\""]` in to the same level as `"config":` and `"target_overrides":`
Expand All @@ -35,14 +35,12 @@ Once the binary is generated, flash the binary to the end device, and run the ap

You can use [a free online tool](http://www.qr-code-generator.com/) to generate a QR code.

In the online tool, fill in the URL field. The following is an example: `v=1&eui=000b57fffe07a8be&cc=PV7TUCB0`. Fill in the correct values for your device, and ensure `v=1` is always present. The other required parameters are:
In the online tool, fill in the URL field. The following is an example: `v=1&eui=000b57fffe07a8be&cc=ABCDEFGH`. Fill in the correct values for your device, and ensure `v=1` is always present. The other required parameters are:

- `cc` is the PSKd, which is configured in the `.json` file (see the mesh-api configuration). *PSKd must be uppercase characters (0-9, A-Y excluding I,O,Q and Z)*
- `eui` is equal to the RF MAC address by default.
- `eui` is equal to the EUI64 address.

To get the MAC address for your end device, connect the node to the Thread network with static configuration enabled. In other words, `"mbed-mesh-api.thread-use-static-link-config": true`, unless you have your own configuration for the MAC address.

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());`
You can get the EUI64 address for your end device by using the `device_eui64_get` method in your application. Please see the [mesh minimal example](../apis/mesh-api.html#mesh-example) for details.

There are four additional (optional) query parameters you can put into this field:

Expand Down
9 changes: 4 additions & 5 deletions docs/reference/technology/mesh/thread_faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ Ad-hoc networks with devices from different manufacturers can be easily created

An example application is [downloadable from the Android store](https://play.google.com/store/apps/details?id=org.threadgroup.commissioner).

#### Are there any application examples? What are the Thread features supported/not supported by them?
#### Are there any application examples?

- Application examples supporting SED and REED types:
- [Mbed OS Client example](https://github.com/ARMmbed/mbed-os-example-client).
- [Mesh minimal example](https://github.com/ARMmbed/mbed-os-example-mesh-minimal).
- [Mesh minimal example](../apis/mesh-api.html#mesh-example).
- [Thread border router](https://github.com/ARMmbed/nanostack-border-router).
- [Mbed Cloud client example](https://github.com/ARMmbed/mbed-cloud-client-example)

#### How to debug and visualize the network?

Expand All @@ -50,7 +49,7 @@ Link quality and errors are easiest to debug using Wireshark.

#### How to send/receive with UDP and TCP sockets. How to use multicast groups?

The mesh minimal uses socket communication and multicasting. See more details in the [mesh minimal example](https://github.com/ARMmbed/mbed-os-example-mesh-minimal).
The mesh minimal uses socket communication and multicasting. See more details in the [mesh minimal example](../apis/mesh-api.html#mesh-example).
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Socket communication is not documented in https://os.mbed.com/docs/v5.10/apis/mesh-api.html#mesh-example. This is because file https://github.com/ARMmbed/mbed-os-example-mesh-minimal/blob/master/mesh_led_control_example.cpp is missing from the example. Can the example in docs be updated to contain all files or should the link point to the original application in github?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnotherButler can you comment on this issue.

Other changes are fine for me

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does, the file https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-mesh-minimal/file/c841ae60db06/mesh_led_control_example.cpp/ is available there.
I was a little bit confused how to find file mesh_led_control_example.cpp as it is not available in the https://os.mbed.com/docs/v5.11/apis/mesh-api.html#mesh-example.
Maybe file mesh_led_control_example.cpp could be added also to the https://os.mbed.com/docs/v5.11/apis/mesh-api.html#mesh-example if it is not confusing the user too much?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update the version of the example transcluded into https://os.mbed.com/docs/v5.11/apis/mesh-api.html#mesh-example. This should fix the issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR up: #889


#### What if my ISP does not provide IPv6 service? Why do I need IPv6 internet service? Can I use a tunneling service?

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/technology/mesh/thread_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ The key elements of Mbed OS are:

Mbed Thread is implemented in the Nanostack library, which also supports the 6LoWPAN protocol. In Mbed OS, the Thread stack runs in its own RTOS thread using an internal event scheduler. Mbed OS provides the [Mesh C++ API](../apis/mesh-api.html) for building Thread applications.

- To connect to the Thread network, use the [Thread interface API](https://github.com/ARMmbed/mbed-os/blob/master/features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/mbed-mesh-api/ThreadInterface.h).
- To connect to the Thread network, use the [Mbed Mesh API](../apis/mesh-api.html) or [Thread interface API](https://github.com/ARMmbed/mbed-os/blob/master/features/nanostack/mbed-mesh-api/mbed-mesh-api/ThreadInterface.h).
- For the socket communication over the Thread network, use the [Mbed sockets API](../apis/network-socket.html).

Nanostack provides a set of C API headers with more functionalities. The [nanostack repository](https://github.com/ARMmbed/mbed-os/tree/master/features/nanostack/FEATURE_NANOSTACK/sal-stack-nanostack/nanostack) has the following header files():
Nanostack provides a set of C API headers with more functionalities. The [nanostack repository](https://github.com/ARMmbed/mbed-os/tree/master/features/nanostack/sal-stack-nanostack/nanostack) has the following header files:

- `thread_management_if.h` for initializing the stack and managing the network data.
- `thread_commissioning_api.h` for implementing an on-mesh or a native Thread commissioner.
Expand Down