How to use OpenThread

1,745 views
Skip to first unread message

Qiang Gu

unread,
Jul 5, 2016, 12:55:42 AM7/5/16
to openthread-users
Hi,

I have studied the OpenThread source code and run CLI example in laptop. It will be appreciated if someone could give me some comments/support.

(1) In my experiment, two or more OpenThread nodes are required to send messages to each other. It means some application examples will be developed. If C is used in this application, how can I use OpenThread to implement it?  

(2) Further, how could developers integrate C CoAP stack with OpenThread, such as libcoap? Can Wakaama LwM2M be used with OpenThread? Or there are some recommended ways/libs to develop IoT applications based on OpenThread.
 
(3) Can users set OpenThread node as Child by themselves, using CLI or some other recommended ways? In practice, some nodes are special and can be set as Child only for some purposes, such as low power consumption and installation location.

Thank you.

Best Regards,
Qiang Gu

Jonathan Hui

unread,
Jul 5, 2016, 1:05:28 AM7/5/16
to Qiang Gu, openthread-users
On Mon, Jul 4, 2016 at 9:55 PM, Qiang Gu <johnny...@gmail.com> wrote:

I have studied the OpenThread source code and run CLI example in laptop. It will be appreciated if someone could give me some comments/support.

(1) In my experiment, two or more OpenThread nodes are required to send messages to each other. It means some application examples will be developed. If C is used in this application, how can I use OpenThread to implement it?

You can use the OpenThread API defined in [1].  Note that the CLI and NCP add-ons use the same API and can serve as examples of how to interact with the OpenThread library.

 

(2) Further, how could developers integrate C CoAP stack with OpenThread, such as libcoap? Can Wakaama LwM2M be used with OpenThread? Or there are some recommended ways/libs to develop IoT applications based on OpenThread.

The API in [1] exports functions for communicating UDP messages.  Take a look at:

otNewUdpMessage
otOpenUdpSocket
otCloseUdpSocket
otBindUdpSocket
otSendUdp
 
 
(3) Can users set OpenThread node as Child by themselves, using CLI or some other recommended ways? In practice, some nodes are special and can be set as Child only for some purposes, such as low power consumption and installation location.

You can set the device mode to disable FFD functionality dynamically.  See the otSetLinkMode function in [1] for more details.

--
Jonathan Hui

Qiang Gu

unread,
Jul 5, 2016, 1:14:06 AM7/5/16
to openthread-users, johnny...@gmail.com
Hi Jonathan,

Thanks for your kindly support. I will try it. :)

Best Regards,
Qiang



在 2016年7月5日星期二 UTC+8下午1:05:28,Jonathan Hui写道:

Sarwar Khan

unread,
Aug 18, 2016, 1:16:29 PM8/18/16
to openthread-users, johnny...@gmail.com
Hi Jonathon, 
1. Does Thread with MQTT or is it only COAP?
2. Is there any information on the commissioning process via a border router and mobile application available?
Thank you for your help. 

Jonathan Hui

unread,
Aug 19, 2016, 12:58:26 AM8/19/16
to Sarwar Khan, openthread-users, Qiang Gu
Hi Sarwar,

On Thu, Aug 18, 2016 at 10:16 AM, Sarwar Khan <sarwark...@gmail.com> wrote:

1. Does Thread with MQTT or is it only COAP?

The Thread specification uses CoAP for its network control and management functions.  However, Thread operates at the network layer and is designed to transport raw IPv6 datagrams.  As a result, you can communicate any IPv6 datagrams across a Thread network (including MQTT) for your application.

2. Is there any information on the commissioning process via a border router and mobile application available?
Thank you for your help. 

Currently, OpenThread does not implement the Thread Commissioning Border Agent that is required for a mobile phone acting as a Commissioner.

--
Jonathan Hui

Sarwar Khan

unread,
Aug 19, 2016, 6:04:19 AM8/19/16
to Jonathan Hui, openthread-users, Qiang Gu
Hi Jonathon, 
Thank you for getting back to me so quickly. We are currently developing a border router using open thread and would like to know how we can best deal with the commissioning process as we are also working on the server side? Should we implement our own process for commissioning or should we become Contributors to the Theead Group? 
Look forward to hearing from you 
Thank you
Sarwar

Jonathan Hui

unread,
Aug 19, 2016, 6:09:09 PM8/19/16
to Sarwar Khan, openthread-users, Qiang Gu
Hi Sarwar,

The Thread standard includes the necessary mechanisms to support a mobile phone acting as a Commissioner.  The Thread Group has a reference implementation of the Thread Commissioning application.  You should probably join the Thread Group if you want to learn more about Thread Commissioning and have access to the reference Thread Commissioning application.  While OpenThread is an implementation of Thread, OpenThread is not affiliated with the Thread Group.

--
Jonathan Hui
Message has been deleted

Jonathan Hui

unread,
Apr 19, 2017, 11:33:53 AM4/19/17
to Reto Keller, openthread-users, Sarwar Khan, Qiang Gu
Reto,

Saying that Thread does not support TCP is incorrect.  Thread provides a generic IPv6 datagram transport, including TCP/IPv6 messages.  That said, one could argue that TCP is ill-suited for Thread networks due to higher loss rates and latency variance compared to more traditional links like Ethernet and WiFi.

--
Jonathan Hui

On Wed, Apr 19, 2017 at 6:12 AM, Reto Keller <retob...@gmail.com> wrote:
As of April.2017: Thread does NOT Support TCP and therefore not support MQTT.

Best,
Reto Keller

gied...@8devices.com

unread,
Apr 20, 2017, 3:28:35 AM4/20/17
to openthread-users, retob...@gmail.com, sarwark...@gmail.com, johnny...@gmail.com, jon...@nestlabs.com
Second that. Some time ago I've tested ssh connections over the Thread network. Wouldn't say it worked great, but satisfactory at the very least. Also, one should keep in mind that TCP is ill-suited for sleepy/low power battery powered devices. If there's no such devices and network is small and in star formation (or max number of hops is small), there's no intrinsic problem of using TCP. I would even argue, that in several special cases TCP could be better than UDP as it provides automatic load balancing.

Alex Brickner

unread,
Apr 24, 2017, 4:37:41 PM4/24/17
to openthread-users, retob...@gmail.com, sarwark...@gmail.com, johnny...@gmail.com, jon...@nestlabs.com
Are you able to post any samples code and/or guides that you used to get SSH and TCP running?

xvh xvh

unread,
Dec 12, 2018, 10:16:41 AM12/12/18
to openthread-users
Hi Sarwar,
I'm currently developing MQTT-SN client library based only on OpenThread with OT project conventions as an alternative for Nordic demo. I've already done proof of concept and the library should be usable in three months. You can check project status on https://github.com/kyberpunk/openthread-mqttsn. I think MQTT-SN is still good alternative for MQTT on UDP networks.

@Jonathan: It is very easy to develop custom applications with OpenThread. Great job.

Dne čtvrtek 18. srpna 2016 19:16:29 UTC+2 Sarwar Khan napsal(a):

Jonathan Hui

unread,
Dec 13, 2018, 12:02:18 AM12/13/18
to xvh xvh, openthread-users
Great to hear about this project and your experience in developing with OpenThread! Keep us up to date on your developments.

--
Jonathan Hui

--
You received this message because you are subscribed to the Google Groups "openthread-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openthread-use...@googlegroups.com.
To post to this group, send email to openthre...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openthread-users/e968779d-8c71-4ac1-8d4a-fdef694ba0de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

xvh xvh

unread,
Dec 28, 2019, 1:45:55 PM12/28/19
to openthread-users
Hi. I can say that MQTT-SN client is finished now. It works pretty well and everything is documented.

Currently I've left only source examples in mentioned repository and integrated MQTT-SN directly to OT fork. It is easier to integrate with CLI app and all platforms than separately built library. You can check here: https://github.com/kyberpunk/openthread/

Dne středa 12. prosince 2018 16:16:41 UTC+1 xvh xvh napsal(a):
Reply all
Reply to author
Forward
0 new messages