Skip to content

Example : DTLS Echo

Michael edited this page Mar 28, 2017 · 3 revisions

6LBR-Demo contains a simple echo server using DTLS transport layer. This example will explain you how to set it up on WisMote platform. It is also possible to run it on Econotag by adapting the target and the upload command accordingly.

How to build the node

In examples/6lbr-demo :

make TARGET=wismote WITH_TINYDTLS=1 WITH_DTLS_ECHO=1

Upload the firmware to the node :

Set the node in bootloader mode 
msp430-bsl5-uart -p /dev/ttyUSB0 --parity-none --erase=0x8000-0x3FFFF 6lbr-demo.wismote
Reset the node

How to build the test client

Once done, you could for example use TinyDTLS client example to test the echo server. Download the native version of TinyDTLS, in tests/client.c update the pre-shared key if you have modified it. Then build TinyDTLS :

./configure
make

How to tests

Once build, check in 6LBR webserver that the node is connected (it should appear in the sensors page). You can now use the test client :

./tests/dtls-client <node address> 20220

Each line typed in the terminal will be send to the node and echoed back to the client.

Configuration

  • DTLS_CONF_IDENTITY_HINT : Identity hint to be used in handshake (default is 'Client_identity')

  • DTLS_CONF_IDENTITY_HINT_LENGTH : Length in bytes of the identity hint

  • DTLS_CONF_PSK_KEY : Pre-shared secret key

  • DTLS_CONF_PSK_KEY_LENGTH : Pre-shared secret key length

  • DTLS_ECHO_PORT : Port of the DTLS Echo server

Clone this wiki locally