Difference between revisions of "RIOT-OS and IEEE 802.15.4 / 6LoWPAN"
Line 1: | Line 1: | ||
== Summary == | == Summary == | ||
Information on how to use RIOT-OS with IEEE 802.15.4 and 6LoWPAN. | Information on how to use/configure RIOT-OS with IEEE 802.15.4 and 6LoWPAN. | ||
== Requirements == | == Requirements == | ||
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|RIOT-OS Setup]] before. | ||
* Default 802.15.4 PAN ID of RIOT-OS/SAMR21-xpro: <code>0x23</code> | * Default 802.15.4 PAN ID of RIOT-OS/SAMR21-xpro: <code>0x23</code> | ||
Line 24: | Line 24: | ||
=== Or for RIOT in general: === | === Or for RIOT in general: === | ||
/Path/to/RIOT/makefiles/default-radio-settings.inc.mk | vim /Path/to/RIOT/makefiles/default-radio-settings.inc.mk | ||
cf. https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk | cf. https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk | ||
Line 31: | Line 31: | ||
* Default 802.15.4 channel ID of RIOT-OS/SAMR21-xpro: <code>26</code> | * Default 802.15.4 channel ID of RIOT-OS/SAMR21-xpro: <code>26</code> | ||
=== OPTIONAL: change HW address via RIOT Shell: === | === OPTIONAL: change HW address via RIOT Shell during runtime: === | ||
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 | ||
Line 53: | Line 53: | ||
== Used Hardware == | == Used Hardware == | ||
e.g. [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform]] | e.g. [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|SAMR21-xpro / Atmel SAM R21 Xplained Pro Evaluation Platform]] | ||
== Courses == | == Courses == | ||
Line 61: | Line 61: | ||
== References == | == References == | ||
* [[Riot-OS_Setup]] | * [[Riot-OS_Setup]|Wiki: RIOT-OS Setup] | ||
* [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform]] | * [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|SAMR21-xpro / Atmel SAM R21 Xplained Pro Evaluation Platform]] | ||
* [[Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup|Wiki: Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup]] | |||
* https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk | * https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk | ||
* RIOT-OS gcoap example: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap | * RIOT-OS gcoap example: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap | ||
[[Category:Documentation]] | [[Category:Documentation]] |
Revision as of 14:26, 28 November 2023
Summary
Information on how to use/configure RIOT-OS with IEEE 802.15.4 and 6LoWPAN.
Requirements
In order to complete these steps, you must have followed RIOT-OS Setup before.
- Default 802.15.4 PAN ID of RIOT-OS/SAMR21-xpro:
0x23
- Default 802.15.4 channel ID of RIOT-OS/SAMR21-xpro:
26
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:
vim /Path/to/RIOT/makefiles/default-radio-settings.inc.mk
cf. https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk
- Default 802.15.4 PAN ID of RIOT-OS/SAMR21-xpro:
0x23
- Default 802.15.4 channel ID of RIOT-OS/SAMR21-xpro:
26
OPTIONAL: change HW address via RIOT Shell during runtime:
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. SAMR21-xpro / Atmel SAM R21 Xplained Pro Evaluation Platform
Courses
- IT-Security master's programme: Mobile and Embedded Security ILV
References
- [[Riot-OS_Setup]|Wiki: RIOT-OS Setup]
- SAMR21-xpro / Atmel SAM R21 Xplained Pro Evaluation Platform
- Wiki: Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup
- https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk
- RIOT-OS gcoap example: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap