Difference between revisions of "RIOT-OS and IEEE 802.15.4 / 6LoWPAN"
(5 intermediate revisions by one other user not shown) | |||
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 channel ID of RIOT-OS/SAMR21-xpro: <code>26</code> | |||
== Configure IEEE 802.15.4 PAN/Channel ID in RIOT == | == Configure IEEE 802.15.4 PAN/Channel ID in RIOT == | ||
Line 11: | Line 14: | ||
=== Via RIOT Shell: === | === Via RIOT Shell: === | ||
ifconfig | * Use <code>ifconfig</code> to determine the 802.15.4/6LoWPAN interface ID of SAMR21-xpro (<code>7</code> in this case): | ||
ifconfig | |||
ifconfig | |||
# Iface 7 HWaddr: 57:98 Channel: 26 Page: 0 NID: 0x23 PHY: O-QPSK | |||
[...] | |||
# Long HWaddr: E2:F9:02:0F:36:26:A2:68 | |||
[...] | |||
# inet6 addr: fe80::e0f9:20f:3626:a268 scope: link VAL | |||
* Note: All <code>ifconfig</code> config options can be shown with <code>ifconfig <interface id> set</code>. | |||
* Configure Channeld/PAN ID: | |||
ifconfig 7 set pan_id 0xbeef | |||
ifconfig 7 set channel 23 | |||
=== Set Channel/PAN ID via Makefile of your application, e.g.: === | === Set Channel/PAN ID via Makefile of your application, e.g.: === | ||
Line 21: | Line 37: | ||
=== 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 | ||
=== OPTIONAL: change HW address via RIOT Shell: === | * Default 802.15.4 PAN ID of RIOT-OS/SAMR21-xpro: <code>0x23</code> | ||
* Default 802.15.4 channel ID of RIOT-OS/SAMR21-xpro: <code>26</code> | |||
=== 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 47: | Line 66: | ||
== Used Hardware == | == Used Hardware == | ||
* Remote IoTLab [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|SAMR21-xpro / Atmel SAM R21 Xplained Pro Evaluation Platform]] | |||
* [[Atmel_SAM_R21_Xplained_Pro]] | |||
== Courses == | == Courses == | ||
Line 55: | Line 75: | ||
== 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]] |
Latest revision as of 19:24, 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:
- Use
ifconfig
to determine the 802.15.4/6LoWPAN interface ID of SAMR21-xpro (7
in this case):
ifconfig # Iface 7 HWaddr: 57:98 Channel: 26 Page: 0 NID: 0x23 PHY: O-QPSK [...] # Long HWaddr: E2:F9:02:0F:36:26:A2:68 [...] # inet6 addr: fe80::e0f9:20f:3626:a268 scope: link VAL
- Note: All
ifconfig
config options can be shown withifconfig <interface id> set
.
- Configure Channeld/PAN ID:
ifconfig 7 set pan_id 0xbeef ifconfig 7 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
- Remote IoTLab SAMR21-xpro / Atmel SAM R21 Xplained Pro Evaluation Platform
- Atmel_SAM_R21_Xplained_Pro
Courses
- IT-Security master's programme: Mobile and Embedded Security ILV