Difference between revisions of "RIOT-OS and IEEE 802.15.4 / 6LoWPAN"

From Embedded Lab Vienna for IoT & Security
Jump to navigation Jump to search
(Created page with "== Summary == Information on how to use RIOT-OS with IEEE 802.15.4 and 6LoWPAN. == Requirements == In order to complete these steps, you must have followed Riot-OS_Setup before. == Configure IEEE 802.15.4 PAN/Channel ID== === Via RIOT Shell: === ifconfig 6 set pan_id 0xbeef ifconfig 6 set channel 23 === Set Channel/PAN ID via Makefile of your application, e.g.: === CFLAGS += -DCONFIG_IEEE802154_DEFAULT_CHANNEL=16 CFLAGS += -DCONFIG_IEEE802154_DEFAULT_...")
 
Line 7: Line 7:
In order to complete these steps, you must have followed [[Riot-OS_Setup]] before.
In order to complete these steps, you must have followed [[Riot-OS_Setup]] before.


== Configure IEEE 802.15.4 PAN/Channel ID==
== Configure IEEE 802.15.4 PAN/Channel ID in RIOT ==


=== Via RIOT Shell:  ===
=== Via RIOT Shell:  ===
Line 27: Line 27:
  ifconfig 6 set addr_long 02:0:0:0:0:0:0:2
  ifconfig 6 set addr_long 02:0:0:0:0:0:0:2


== Test 802.15.4/6LoWPAN with RIOT gcoap example ==
RIOT's gcoap example can be found here: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap
README: https://github.com/RIOT-OS/RIOT/blob/master/examples/gcoap/README.md
Flash it on e.g. two SAMR21-xpro devices.
It may be necessary to specify the sending / outgoing interface. This can be done by appending the number of the network interface to the (link-local) IPv6 address (e.g. <code>%6</code>"):
coap get [fe80::d8b8:65ff:feee:121b%6]:5683 /.well-known/core
=> <code>fe80::d8b8:65ff:feee:121b%6</code> => fe80::[..] is the remote link-local address, but "%6" specifies the local interface ID of node where this command is submitted.
The interface ID is stated when you perform <code>ifconfig</code> on your local node. Normally this interface ID is 6 or 7.


== Used Hardware ==
== Used Hardware ==
Line 34: Line 49:
== Courses ==
== Courses ==


TODO:
* IT-Security master's programme: Mobile and Embedded Security ILV
* [[A course where this documentation was used]] (2017, 2018)
* [[Another one]] (2018)


== References ==
== References ==
Line 42: Line 55:
* [[Riot-OS_Setup]]
* [[Riot-OS_Setup]]
* [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform]]
* [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform]]
* RIOT-OS gcoap example: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap


[[Category:Documentation]]
[[Category:Documentation]]

Revision as of 17:51, 27 November 2023

Summary

Information on how to use RIOT-OS with IEEE 802.15.4 and 6LoWPAN.

Requirements

In order to complete these steps, you must have followed Riot-OS_Setup before.

Configure IEEE 802.15.4 PAN/Channel ID in RIOT

Via RIOT Shell:

ifconfig 6 set pan_id 0xbeef
ifconfig 6 set channel 23

Set Channel/PAN ID via Makefile of your application, e.g.:

CFLAGS += -DCONFIG_IEEE802154_DEFAULT_CHANNEL=16
CFLAGS += -DCONFIG_IEEE802154_DEFAULT_PANID=0xcafe

Or for RIOT in general:

/Path/to/RIOT/makefiles/default-radio-settings.inc.mk

OPTIONAL: change HW address via RIOT Shell:

ifconfig 6 set addr_long 02:0:0:0:0:0:0:2

Test 802.15.4/6LoWPAN with RIOT gcoap example

RIOT's gcoap example can be found here: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap

README: https://github.com/RIOT-OS/RIOT/blob/master/examples/gcoap/README.md

Flash it on e.g. two SAMR21-xpro devices.

It may be necessary to specify the sending / outgoing interface. This can be done by appending the number of the network interface to the (link-local) IPv6 address (e.g. %6"):

coap get [fe80::d8b8:65ff:feee:121b%6]:5683 /.well-known/core

=> fe80::d8b8:65ff:feee:121b%6 => fe80::[..] is the remote link-local address, but "%6" specifies the local interface ID of node where this command is submitted.

The interface ID is stated when you perform ifconfig on your local node. Normally this interface ID is 6 or 7.

Used Hardware

e.g. Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform

Courses

  • IT-Security master's programme: Mobile and Embedded Security ILV

References