<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://elvis.hcw.ac.at/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=TBuchi</id>
	<title>Elvis Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://elvis.hcw.ac.at/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=TBuchi"/>
	<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php/Special:Contributions/TBuchi"/>
	<updated>2026-09-10T15:31:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.5</generator>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12918</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12918"/>
		<updated>2023-12-12T19:28:32Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT|Raspberry Pi 3B+]]&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested yet): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
&lt;br /&gt;
== Setup/Config 802.15.4/6LoWPAN on a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /boot/config.txt&lt;br /&gt;
 # enable OpenLabs 802.15.4 radio module&lt;br /&gt;
 dtoverlay=at86rf233, speed=3000000&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Configure the default PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Configure the default channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ip link set lowpan0 down&lt;br /&gt;
 ip link set wpan0 down&lt;br /&gt;
 iwpan phy phy0 set channel 0 26 # same network ID and channel as RIOT default&lt;br /&gt;
 iwpan dev wpan0 set pan_id 0x23 # same network ID and channel as RIOT default&lt;br /&gt;
 ip link add link wpan0 name lowpan0 type lowpan&lt;br /&gt;
 ip link set wpan0 up&lt;br /&gt;
 ip link set lowpan0 up&lt;br /&gt;
&lt;br /&gt;
* Afterwards the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on Raspberry has a link-local IPv6 address:&lt;br /&gt;
&lt;br /&gt;
 root@raspberrypi:~# ip a&lt;br /&gt;
 1: lo: [...]&lt;br /&gt;
 2: eth0: [...]&lt;br /&gt;
 3: wlan0: [...]&lt;br /&gt;
 4: wpan0: &amp;lt;BROADCAST,NOARP,UP,LOWER_UP&amp;gt; mtu 123 qdisc pfifo_fast state UNKNOWN group default qlen 300&lt;br /&gt;
    link/ieee802.15.4 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
 5: lowpan0@wpan0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1000&lt;br /&gt;
    link/6lowpan 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet6 fe80::343a:7cc:6541:2b31/64 scope link&lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE/CAUTION: Every reboot changes the link-local IPv6 address of the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on the Raspberry!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See [[#PERSISTENT wpan0 and lowpan0 configuration]] to configure a persistent link-local address.&lt;br /&gt;
&lt;br /&gt;
There are also scripts available to create/delete a lowpan interface (or to create/delete a monitor interface): https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
=== PERSISTENT wpan0 and lowpan0 configuration ===&lt;br /&gt;
&lt;br /&gt;
With static long hardware address and static link-local IPv6 address (to avoid a random link-local IPv6 address on each reboot).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Persistent WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Clone riot-makers/wpan-raspbian GitHub repo:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/riot-makers/wpan-raspbian&lt;br /&gt;
 cd wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
* Copy some helper (shell) scripts to a well-known location:&lt;br /&gt;
&lt;br /&gt;
 sudo cp -r usr/local/sbin/* /usr/local/sbin/.&lt;br /&gt;
 sudo chmod +x /usr/local/sbin/*&lt;br /&gt;
&lt;br /&gt;
* Afterwards copy files for systemd integration:&lt;br /&gt;
&lt;br /&gt;
 sudo cp etc/default/lowpan /etc/default/.&lt;br /&gt;
 sudo cp etc/systemd/system/lowpan.service /etc/systemd/system/.&lt;br /&gt;
&lt;br /&gt;
* Modify 802.15.4 channel ID and PAN ID in &amp;lt;code&amp;gt;/etc/default/lowpan&amp;lt;/code&amp;gt; as needed:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/default/lowpan&lt;br /&gt;
 CHN=&amp;quot;13&amp;quot;&lt;br /&gt;
 PAN=&amp;quot;0xbeef&amp;quot;&lt;br /&gt;
 # set MAC to &amp;quot;&amp;quot; for random mac/hw address&lt;br /&gt;
 MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&lt;br /&gt;
 # set IPv6 to &amp;quot;&amp;quot; if not required; note: set a prefix length&lt;br /&gt;
 #IP6=&amp;quot;fdaa:bb:cc:dd::1/64&amp;quot;&lt;br /&gt;
 # Set ACK requests (Only enable if all devices on your PAN support ACKs)&lt;br /&gt;
 ACKREQ=0&lt;br /&gt;
&lt;br /&gt;
Note: &amp;lt;code&amp;gt;MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&amp;lt;/code&amp;gt; was taken from https://jan.newmarch.name/IoT/LinuxJournal/Routing/, this results in a link-local address of &amp;lt;code&amp;gt;fe80::1&amp;lt;/code&amp;gt; for the Raspberry.&lt;br /&gt;
&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;lowpan.service&amp;lt;/code&amp;gt; autostart, start 6LoWPAN service and verification:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl enable lowpan.service&lt;br /&gt;
 sudo systemctl start lowpan.service&lt;br /&gt;
 ifconfig&lt;br /&gt;
 lowpan0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 1280&lt;br /&gt;
    inet6 fe80::1  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;&lt;br /&gt;
    unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)&lt;br /&gt;
    RX packets 0  bytes 0 (0.0 B)&lt;br /&gt;
    RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
    TX packets 19  bytes 2114 (2.0 KiB)&lt;br /&gt;
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
 wpan0: flags=195&amp;lt;UP,BROADCAST,RUNNING,NOARP&amp;gt;  mtu 123&lt;br /&gt;
        unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 300  (UNSPEC)&lt;br /&gt;
        RX packets 72  bytes 2016 (1.9 KiB)&lt;br /&gt;
        RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
        TX packets 74  bytes 5320 (5.1 KiB)&lt;br /&gt;
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
&lt;br /&gt;
== Verification of 6LoWPAN connectivity between a Raspberry and a SAMR21-xpro == &lt;br /&gt;
&lt;br /&gt;
* Use RIOT&#039;s gnrc_networking example and build it for the SAMR21-xpro board, flash the firmware to the SAMR21-xpro and connect via &amp;lt;code&amp;gt;pyterm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 cd RIOT/examples/gnrc_networking&lt;br /&gt;
 make BOARD=samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro flash&lt;br /&gt;
 make BOARD=samr21-xpro term&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; to determine the 802.15.4/6LoWPAN interface ID of SAMR21-xpro (&amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt; in this case):&lt;br /&gt;
&lt;br /&gt;
 ifconfig&lt;br /&gt;
 # Iface  7  HWaddr: 57:98  Channel: 26  Page: 0  NID: 0x23  PHY: O-QPSK&lt;br /&gt;
 [...]&lt;br /&gt;
 #           Long HWaddr: E2:F9:02:0F:36:26:A2:68&lt;br /&gt;
 [...]&lt;br /&gt;
 #           inet6 addr: fe80::e0f9:20f:3626:a268  scope: link  VAL&lt;br /&gt;
&lt;br /&gt;
* Note: All &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; config options can be shown with &amp;lt;code&amp;gt;ifconfig &amp;lt;interface id&amp;gt; set&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* RIOT-OS default 802.15.4 channel is 26 and default  PAN ID 0x23. If you change them, make sure to change them in the SAMR21-xpro configuration aswell:&lt;br /&gt;
** [optional] Change the channel to 13 and the PAN ID to 0xbeef (see [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|RIOT-OS and IEEE 802.15.4 / 6LoWPAN]] for more information):&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 13&lt;br /&gt;
&lt;br /&gt;
=== Ping test from Raspberry to SAMR21-xpro ===&lt;br /&gt;
&lt;br /&gt;
* Multicast ping test through interface &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; to group &amp;lt;code&amp;gt;ff02::1&amp;lt;/code&amp;gt; (all nodes in the link-local):&lt;br /&gt;
&lt;br /&gt;
 ping ff02::1%lowpan0        &lt;br /&gt;
 PING ff02::1%lowpan0(ff02::1%lowpan0) 56 data bytes&lt;br /&gt;
 64 bytes from fe80::1%lowpan0: icmp_seq=1 ttl=64 time=0.195 ms&lt;br /&gt;
 64 bytes from fe80::e0f9:20f:3626:a268%lowpan0: icmp_seq=1 ttl=64 time=10.4 ms (DUP!)&lt;br /&gt;
&lt;br /&gt;
* Unicast ping (change to link-local IPv6 address of your SAMR21-xpro):&lt;br /&gt;
&lt;br /&gt;
 ping fe80::e0f9:20f:3626:a268%lowpan0&lt;br /&gt;
 ping fe80::e0f9:20f:3626:a268%lowpan0&lt;br /&gt;
 PING fe80::e0f9:20f:3626:a268%lowpan0(fe80::e0f9:20f:3626:a268%lowpan0) 56 data bytes&lt;br /&gt;
 64 bytes from fe80::e0f9:20f:3626:a268%lowpan0: icmp_seq=1 ttl=64 time=23.0 ms&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
=== Ping test from SAMR21-xpro to Raspberry ===&lt;br /&gt;
&lt;br /&gt;
* Multicast ping test through interface 7 to group ff02::1:&lt;br /&gt;
&lt;br /&gt;
 # ping6 ff02::1%7&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=0 ttl=64 rssi=-61 dBm time=8.309 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=1 ttl=64 rssi=-61 dBm time=6.124 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=2 ttl=64 rssi=-59 dBm time=6.461 ms&lt;br /&gt;
 #&lt;br /&gt;
 # --- ff02::1 PING statistics ---&lt;br /&gt;
 # 3 packets transmitted, 3 packets received, 0% packet loss&lt;br /&gt;
 # round-trip min/avg/max = 6.124/6.964/8.309 ms&lt;br /&gt;
&lt;br /&gt;
* Unicast ping from SAMR21-xpro to Raspberry 6LoWPAN interface:&lt;br /&gt;
&lt;br /&gt;
 # ping6 fe80::1%7&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=0 ttl=64 rssi=-61 dBm time=8.467 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=1 ttl=64 rssi=-61 dBm time=7.966 ms&lt;br /&gt;
&lt;br /&gt;
== Test CoAP communication between Raspberry and SAMR21-xpro ==&lt;br /&gt;
&lt;br /&gt;
* Install &amp;lt;code&amp;gt;python3-pip&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;aiocoap&amp;lt;/code&amp;gt; on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install python3-pip&lt;br /&gt;
 pip3 install --upgrade &amp;quot;aiocoap[all]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Clone &amp;lt;code&amp;gt;aiocoap&amp;lt;/code&amp;gt; repo and start the included simple CoAP server:&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/chrysn/aiocoap.git&lt;br /&gt;
 cd aiocoap&lt;br /&gt;
 python3 server.py&lt;br /&gt;
&lt;br /&gt;
* Use gcoap example on SAMR21-xpro (RIOT-OS repo already cloned):&lt;br /&gt;
&lt;br /&gt;
 cd ~/RIOT/example/gcoap&lt;br /&gt;
 make BOARD=samr21-xpro         //build gcoap example&lt;br /&gt;
 make BOARD=samr21-xpro flash       //flah gcoap to samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro term     //start pyterm&lt;br /&gt;
&lt;br /&gt;
* [optional] Reset SAMR21-xpro and change 6LoWPAN settings:&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 13&lt;br /&gt;
&lt;br /&gt;
* Send a CoAP request to the CoAP server:&lt;br /&gt;
&lt;br /&gt;
coap put [fe80::1%7] 5683 /send test&lt;br /&gt;
&lt;br /&gt;
== Possible Problems with 6LoWPAN, SAMR21-xpro and Raspberry Pi (with Openlabs 802.15.4 radio) ==&lt;br /&gt;
&lt;br /&gt;
* 6LoWPAN: RIOT does not receive packets from Linux when short_addr is set #11033&lt;br /&gt;
** GitHub issue: https://github.com/RIOT-OS/RIOT/issues/11033&lt;br /&gt;
** By default this is not set (i.e. in RIOT gnrc_networking example!)&lt;br /&gt;
* &#039;&#039;&#039;Do not use Raspberry Pi 4 with OpenLabs 802.15.4 radio module:&#039;&#039;&#039;&lt;br /&gt;
** At least with the newest available Kernel (i.e. 5.10 during our tests) it was &#039;&#039;&#039;only possible to send&#039;&#039;&#039; 802.15.4 packets to SAMR21-xpro and the Raspberry &#039;&#039;&#039;did not receive&#039;&#039;&#039; any packets from SAMR21-xpro.&lt;br /&gt;
** It is better to use a Raspberry Pi 3B(+)&lt;br /&gt;
*** Successfully tested with Raspbian 9 (Stretch), Raspbian 10 (Buster) and Raspbian 11 (Bullseye)&lt;br /&gt;
* Monitoring 802.15.4/6LoWPAN traffic: Correct channel ID must be set (RIOT-OS default: 26)&lt;br /&gt;
* Communication SAMR21-xpro&amp;lt;-&amp;gt;Raspberry: The same channel ID (RIOT-OS default: 26) and PAN ID need to be set (RIOT-OS default: 0x23)&lt;br /&gt;
&lt;br /&gt;
== TODO: Monitoring/Sniffing 802.15.4/6LoWPAN radio with a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* [[Raspberry_Pi_802.15.4_radio_module]] https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
* SAMR21-xpro: &lt;br /&gt;
** Remote IoT-Lab [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
** [[Atmel_SAM_R21_Xplained_Pro]]&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* Documentation was (mostly) created based on our CoMatrix project: https://comatrix.eu&lt;br /&gt;
* [[Riot-OS_Setup|Wiki: Riot-OS Setup]]&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|Wiki: RIOT-OS and IEEE 802.15.4 / 6LoWPAN]]&lt;br /&gt;
* Linux WPAN Tools: https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
* Python CoAP implementation/library: https://github.com/chrysn/aiocoap&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://linux-wpan.org/documentation.html&lt;br /&gt;
* https://www.linuxjournal.com/content/low-power-wireless-6lowpan-ieee802154-and-raspberry-pi&lt;br /&gt;
* http://morschi.com/2017/04/05/hands-on-riot-6lowpan/&lt;br /&gt;
&lt;br /&gt;
=== Persistent WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
* https://jan.newmarch.name/IoT/LinuxJournal/Routing/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN&amp;diff=12830</id>
		<title>RIOT-OS and IEEE 802.15.4 / 6LoWPAN</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN&amp;diff=12830"/>
		<updated>2023-11-28T14:34:44Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to use/configure RIOT-OS with IEEE 802.15.4 and 6LoWPAN. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
In order to complete these steps, you must have followed [[Riot-OS_Setup|RIOT-OS Setup]] before.&lt;br /&gt;
&lt;br /&gt;
* Default 802.15.4 PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Default 802.15.4 channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure IEEE 802.15.4 PAN/Channel ID in RIOT ==&lt;br /&gt;
&lt;br /&gt;
=== Via RIOT Shell:  ===&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; to determine the 802.15.4/6LoWPAN interface ID of SAMR21-xpro (&amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt; in this case):&lt;br /&gt;
&lt;br /&gt;
 ifconfig&lt;br /&gt;
 # Iface  7  HWaddr: 57:98  Channel: 26  Page: 0  NID: 0x23  PHY: O-QPSK&lt;br /&gt;
 [...]&lt;br /&gt;
 #           Long HWaddr: E2:F9:02:0F:36:26:A2:68&lt;br /&gt;
 [...]&lt;br /&gt;
 #           inet6 addr: fe80::e0f9:20f:3626:a268  scope: link  VAL&lt;br /&gt;
&lt;br /&gt;
* Note: All &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; config options can be shown with &amp;lt;code&amp;gt;ifconfig &amp;lt;interface id&amp;gt; set&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Configure Channeld/PAN ID:&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 23&lt;br /&gt;
&lt;br /&gt;
=== Set Channel/PAN ID via Makefile of your application, e.g.: === &lt;br /&gt;
&lt;br /&gt;
 CFLAGS += -DCONFIG_IEEE802154_DEFAULT_CHANNEL=16&lt;br /&gt;
 CFLAGS += -DCONFIG_IEEE802154_DEFAULT_PANID=0xcafe&lt;br /&gt;
&lt;br /&gt;
=== Or for RIOT in general: === &lt;br /&gt;
&lt;br /&gt;
 vim /Path/to/RIOT/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
&lt;br /&gt;
cf. https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
&lt;br /&gt;
* Default 802.15.4 PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Default 802.15.4 channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OPTIONAL: change HW address via RIOT Shell during runtime: ===&lt;br /&gt;
&lt;br /&gt;
 ifconfig 6 set addr_long 02:0:0:0:0:0:0:2&lt;br /&gt;
&lt;br /&gt;
== Test 802.15.4/6LoWPAN with RIOT gcoap example ==&lt;br /&gt;
&lt;br /&gt;
RIOT&#039;s gcoap example can be found here: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap&lt;br /&gt;
&lt;br /&gt;
README: https://github.com/RIOT-OS/RIOT/blob/master/examples/gcoap/README.md&lt;br /&gt;
&lt;br /&gt;
Flash it on e.g. two SAMR21-xpro devices.&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;code&amp;gt;%6&amp;lt;/code&amp;gt;&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
 coap get [fe80::d8b8:65ff:feee:121b%6]:5683 /.well-known/core&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; &amp;lt;code&amp;gt;fe80::d8b8:65ff:feee:121b%6&amp;lt;/code&amp;gt; =&amp;gt; fe80::[..] is the remote link-local address, but &amp;quot;%6&amp;quot; specifies the local interface ID of node where this command is submitted.&lt;br /&gt;
&lt;br /&gt;
The interface ID is stated when you perform &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; on your local node. Normally this interface ID is 6 or 7.&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
e.g. [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|SAMR21-xpro / Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [[Riot-OS_Setup|Wiki: RIOT-OS Setup]]&lt;br /&gt;
* [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|SAMR21-xpro / Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
* [[Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup|Wiki: Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup]]&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
* RIOT-OS gcoap example: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12829</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12829"/>
		<updated>2023-11-28T14:28:07Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT|Raspberry Pi 3B+]]&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested yet): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
&lt;br /&gt;
== Setup/Config 802.15.4/6LoWPAN on a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Configure the default PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Configure the default channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ip link set lowpan0 down&lt;br /&gt;
 ip link set wpan0 down&lt;br /&gt;
 iwpan phy phy0 set channel 0 26 # same network ID and channel as RIOT default&lt;br /&gt;
 iwpan dev wpan0 set pan_id 0x23 # same network ID and channel as RIOT default&lt;br /&gt;
 ip link add link wpan0 name lowpan0 type lowpan&lt;br /&gt;
 ip link set wpan0 up&lt;br /&gt;
 ip link set lowpan0 up&lt;br /&gt;
&lt;br /&gt;
* Afterwards the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on Raspberry has a link-local IPv6 address:&lt;br /&gt;
&lt;br /&gt;
 root@raspberrypi:~# ip a&lt;br /&gt;
 1: lo: [...]&lt;br /&gt;
 2: eth0: [...]&lt;br /&gt;
 3: wlan0: [...]&lt;br /&gt;
 4: wpan0: &amp;lt;BROADCAST,NOARP,UP,LOWER_UP&amp;gt; mtu 123 qdisc pfifo_fast state UNKNOWN group default qlen 300&lt;br /&gt;
    link/ieee802.15.4 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
 5: lowpan0@wpan0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1000&lt;br /&gt;
    link/6lowpan 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet6 fe80::343a:7cc:6541:2b31/64 scope link&lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE/CAUTION: Every reboot changes the link-local IPv6 address of the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on the Raspberry!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See [[#PERSISTENT wpan0 and lowpan0 configuration]] to configure a persistent link-local address.&lt;br /&gt;
&lt;br /&gt;
There are also scripts available to create/delete a lowpan interface (or to create/delete a monitor interface): https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
=== PERSISTENT wpan0 and lowpan0 configuration ===&lt;br /&gt;
&lt;br /&gt;
With static long hardware address and static link-local IPv6 address (to avoid a random link-local IPv6 address on each reboot).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Persistent WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Clone riot-makers/wpan-raspbian GitHub repo:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/riot-makers/wpan-raspbian&lt;br /&gt;
 cd wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
* Copy some helper (shell) scripts to a well-known location:&lt;br /&gt;
&lt;br /&gt;
 sudo cp -r usr/local/sbin/* /usr/local/sbin/.&lt;br /&gt;
 sudo chmod +x /usr/local/sbin/*&lt;br /&gt;
&lt;br /&gt;
* Afterwards copy files for systemd integration:&lt;br /&gt;
&lt;br /&gt;
 sudo cp etc/default/lowpan /etc/default/.&lt;br /&gt;
 sudo cp etc/systemd/system/lowpan.service /etc/systemd/system/.&lt;br /&gt;
&lt;br /&gt;
* Modify 802.15.4 channel ID and PAN ID in &amp;lt;code&amp;gt;/etc/default/lowpan&amp;lt;/code&amp;gt; as needed:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/default/lowpan&lt;br /&gt;
 CHN=&amp;quot;13&amp;quot;&lt;br /&gt;
 PAN=&amp;quot;0xbeef&amp;quot;&lt;br /&gt;
 # set MAC to &amp;quot;&amp;quot; for random mac/hw address&lt;br /&gt;
 MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&lt;br /&gt;
 # set IPv6 to &amp;quot;&amp;quot; if not required; note: set a prefix length&lt;br /&gt;
 #IP6=&amp;quot;fdaa:bb:cc:dd::1/64&amp;quot;&lt;br /&gt;
 # Set ACK requests (Only enable if all devices on your PAN support ACKs)&lt;br /&gt;
 ACKREQ=0&lt;br /&gt;
&lt;br /&gt;
Note: &amp;lt;code&amp;gt;MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&amp;lt;/code&amp;gt; was taken from https://jan.newmarch.name/IoT/LinuxJournal/Routing/, this results in a link-local address of &amp;lt;code&amp;gt;fe80::1&amp;lt;/code&amp;gt; for the Raspberry.&lt;br /&gt;
&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;lowpan.service&amp;lt;/code&amp;gt; autostart, start 6LoWPAN service and verification:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl enable lowpan.service&lt;br /&gt;
 sudo systemctl start lowpan.service&lt;br /&gt;
 ifconfig&lt;br /&gt;
 lowpan0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 1280&lt;br /&gt;
    inet6 fe80::1  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;&lt;br /&gt;
    unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)&lt;br /&gt;
    RX packets 0  bytes 0 (0.0 B)&lt;br /&gt;
    RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
    TX packets 19  bytes 2114 (2.0 KiB)&lt;br /&gt;
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
 wpan0: flags=195&amp;lt;UP,BROADCAST,RUNNING,NOARP&amp;gt;  mtu 123&lt;br /&gt;
        unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 300  (UNSPEC)&lt;br /&gt;
        RX packets 72  bytes 2016 (1.9 KiB)&lt;br /&gt;
        RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
        TX packets 74  bytes 5320 (5.1 KiB)&lt;br /&gt;
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
&lt;br /&gt;
== Verification of 6LoWPAN connectivity between a Raspberry and a SAMR21-xpro == &lt;br /&gt;
&lt;br /&gt;
* Use RIOT&#039;s gnrc_networking example and build it for the SAMR21-xpro board, flash the firmware to the SAMR21-xpro and connect via &amp;lt;code&amp;gt;pyterm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 cd RIOT/examples/gnrc_networking&lt;br /&gt;
 make BOARD=samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro flash&lt;br /&gt;
 make BOARD=samr21-xpro term&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; to determine the 802.15.4/6LoWPAN interface ID of SAMR21-xpro (&amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt; in this case):&lt;br /&gt;
&lt;br /&gt;
 ifconfig&lt;br /&gt;
 # Iface  7  HWaddr: 57:98  Channel: 26  Page: 0  NID: 0x23  PHY: O-QPSK&lt;br /&gt;
 [...]&lt;br /&gt;
 #           Long HWaddr: E2:F9:02:0F:36:26:A2:68&lt;br /&gt;
 [...]&lt;br /&gt;
 #           inet6 addr: fe80::e0f9:20f:3626:a268  scope: link  VAL&lt;br /&gt;
&lt;br /&gt;
* Note: All &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; config options can be shown with &amp;lt;code&amp;gt;ifconfig &amp;lt;interface id&amp;gt; set&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* RIOT-OS default 802.15.4 channel is 26 and default  PAN ID 0x23. If you change them, make sure to change them in the SAMR21-xpro configuration aswell:&lt;br /&gt;
** [optional] Change the channel to 13 and the PAN ID to 0xbeef (see [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|RIOT-OS and IEEE 802.15.4 / 6LoWPAN]] for more information):&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 13&lt;br /&gt;
&lt;br /&gt;
=== Ping test from Raspberry to SAMR21-xpro ===&lt;br /&gt;
&lt;br /&gt;
* Multicast ping test through interface &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; to group &amp;lt;code&amp;gt;ff02::1&amp;lt;/code&amp;gt; (all nodes in the link-local):&lt;br /&gt;
&lt;br /&gt;
 ping ff02::1%lowpan0        &lt;br /&gt;
 PING ff02::1%lowpan0(ff02::1%lowpan0) 56 data bytes&lt;br /&gt;
 64 bytes from fe80::1%lowpan0: icmp_seq=1 ttl=64 time=0.195 ms&lt;br /&gt;
 64 bytes from fe80::e0f9:20f:3626:a268%lowpan0: icmp_seq=1 ttl=64 time=10.4 ms (DUP!)&lt;br /&gt;
&lt;br /&gt;
* Unicast ping (change to link-local IPv6 address of your SAMR21-xpro):&lt;br /&gt;
&lt;br /&gt;
 ping fe80::e0f9:20f:3626:a268%lowpan0&lt;br /&gt;
 ping fe80::e0f9:20f:3626:a268%lowpan0&lt;br /&gt;
 PING fe80::e0f9:20f:3626:a268%lowpan0(fe80::e0f9:20f:3626:a268%lowpan0) 56 data bytes&lt;br /&gt;
 64 bytes from fe80::e0f9:20f:3626:a268%lowpan0: icmp_seq=1 ttl=64 time=23.0 ms&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
=== Ping test from SAMR21-xpro to Raspberry ===&lt;br /&gt;
&lt;br /&gt;
* Multicast ping test through interface 7 to group ff02::1:&lt;br /&gt;
&lt;br /&gt;
 # ping6 ff02::1%7&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=0 ttl=64 rssi=-61 dBm time=8.309 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=1 ttl=64 rssi=-61 dBm time=6.124 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=2 ttl=64 rssi=-59 dBm time=6.461 ms&lt;br /&gt;
 #&lt;br /&gt;
 # --- ff02::1 PING statistics ---&lt;br /&gt;
 # 3 packets transmitted, 3 packets received, 0% packet loss&lt;br /&gt;
 # round-trip min/avg/max = 6.124/6.964/8.309 ms&lt;br /&gt;
&lt;br /&gt;
* Unicast ping from SAMR21-xpro to Raspberry 6LoWPAN interface:&lt;br /&gt;
&lt;br /&gt;
 # ping6 fe80::1%7&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=0 ttl=64 rssi=-61 dBm time=8.467 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=1 ttl=64 rssi=-61 dBm time=7.966 ms&lt;br /&gt;
&lt;br /&gt;
== Test CoAP communication between Raspberry and SAMR21-xpro ==&lt;br /&gt;
&lt;br /&gt;
* Install &amp;lt;code&amp;gt;python3-pip&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;aiocoap&amp;lt;/code&amp;gt; on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install python3-pip&lt;br /&gt;
 pip3 install --upgrade &amp;quot;aiocoap[all]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Clone &amp;lt;code&amp;gt;aiocoap&amp;lt;/code&amp;gt; repo and start the included simple CoAP server:&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/chrysn/aiocoap.git&lt;br /&gt;
 cd aiocoap&lt;br /&gt;
 python3 server.py&lt;br /&gt;
&lt;br /&gt;
* Use gcoap example on SAMR21-xpro (RIOT-OS repo already cloned):&lt;br /&gt;
&lt;br /&gt;
 cd ~/RIOT/example/gcoap&lt;br /&gt;
 make BOARD=samr21-xpro         //build gcoap example&lt;br /&gt;
 make BOARD=samr21-xpro flash       //flah gcoap to samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro term     //start pyterm&lt;br /&gt;
&lt;br /&gt;
* [optional] Reset SAMR21-xpro and change 6LoWPAN settings:&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 13&lt;br /&gt;
&lt;br /&gt;
* Send a CoAP request to the CoAP server:&lt;br /&gt;
&lt;br /&gt;
coap put [fe80::1%7] 5683 /send test&lt;br /&gt;
&lt;br /&gt;
== Possible Problems with 6LoWPAN, SAMR21-xpro and Raspberry Pi (with Openlabs 802.15.4 radio) ==&lt;br /&gt;
&lt;br /&gt;
* 6LoWPAN: RIOT does not receive packets from Linux when short_addr is set #11033&lt;br /&gt;
** GitHub issue: https://github.com/RIOT-OS/RIOT/issues/11033&lt;br /&gt;
** By default this is not set (i.e. in RIOT gnrc_networking example!)&lt;br /&gt;
* &#039;&#039;&#039;Do not use Raspberry Pi 4 with OpenLabs 802.15.4 radio module:&#039;&#039;&#039;&lt;br /&gt;
** At least with the newest available Kernel (i.e. 5.10 during our tests) it was &#039;&#039;&#039;only possible to send&#039;&#039;&#039; 802.15.4 packets to SAMR21-xpro and the Raspberry &#039;&#039;&#039;did not receive&#039;&#039;&#039; any packets from SAMR21-xpro.&lt;br /&gt;
** It is better to use a Raspberry Pi 3B(+)&lt;br /&gt;
*** Successfully tested with Raspbian 9 (Stretch), Raspbian 10 (Buster) and Raspbian 11 (Bullseye)&lt;br /&gt;
* Monitoring 802.15.4/6LoWPAN traffic: Correct channel ID must be set (RIOT-OS default: 26)&lt;br /&gt;
* Communication SAMR21-xpro&amp;lt;-&amp;gt;Raspberry: The same channel ID (RIOT-OS default: 26) and PAN ID need to be set (RIOT-OS default: 0x23)&lt;br /&gt;
&lt;br /&gt;
== TODO: Monitoring/Sniffing 802.15.4/6LoWPAN radio with a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
* SAMR21-xpro: [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* Documentation was (mostly) created based on our CoMatrix project: https://comatrix.eu&lt;br /&gt;
* [[Riot-OS_Setup|Wiki: Riot-OS Setup]]&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|Wiki: RIOT-OS and IEEE 802.15.4 / 6LoWPAN]]&lt;br /&gt;
* Linux WPAN Tools: https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
* Python CoAP implementation/library: https://github.com/chrysn/aiocoap&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://linux-wpan.org/documentation.html&lt;br /&gt;
* https://www.linuxjournal.com/content/low-power-wireless-6lowpan-ieee802154-and-raspberry-pi&lt;br /&gt;
* http://morschi.com/2017/04/05/hands-on-riot-6lowpan/&lt;br /&gt;
&lt;br /&gt;
=== Persistent WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
* https://jan.newmarch.name/IoT/LinuxJournal/Routing/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12828</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12828"/>
		<updated>2023-11-28T14:27:47Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* ([[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT|Raspberry Pi 3B+]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested yet): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
&lt;br /&gt;
== Setup/Config 802.15.4/6LoWPAN on a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Configure the default PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Configure the default channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ip link set lowpan0 down&lt;br /&gt;
 ip link set wpan0 down&lt;br /&gt;
 iwpan phy phy0 set channel 0 26 # same network ID and channel as RIOT default&lt;br /&gt;
 iwpan dev wpan0 set pan_id 0x23 # same network ID and channel as RIOT default&lt;br /&gt;
 ip link add link wpan0 name lowpan0 type lowpan&lt;br /&gt;
 ip link set wpan0 up&lt;br /&gt;
 ip link set lowpan0 up&lt;br /&gt;
&lt;br /&gt;
* Afterwards the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on Raspberry has a link-local IPv6 address:&lt;br /&gt;
&lt;br /&gt;
 root@raspberrypi:~# ip a&lt;br /&gt;
 1: lo: [...]&lt;br /&gt;
 2: eth0: [...]&lt;br /&gt;
 3: wlan0: [...]&lt;br /&gt;
 4: wpan0: &amp;lt;BROADCAST,NOARP,UP,LOWER_UP&amp;gt; mtu 123 qdisc pfifo_fast state UNKNOWN group default qlen 300&lt;br /&gt;
    link/ieee802.15.4 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
 5: lowpan0@wpan0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1000&lt;br /&gt;
    link/6lowpan 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet6 fe80::343a:7cc:6541:2b31/64 scope link&lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE/CAUTION: Every reboot changes the link-local IPv6 address of the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on the Raspberry!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See [[#PERSISTENT wpan0 and lowpan0 configuration]] to configure a persistent link-local address.&lt;br /&gt;
&lt;br /&gt;
There are also scripts available to create/delete a lowpan interface (or to create/delete a monitor interface): https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
=== PERSISTENT wpan0 and lowpan0 configuration ===&lt;br /&gt;
&lt;br /&gt;
With static long hardware address and static link-local IPv6 address (to avoid a random link-local IPv6 address on each reboot).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Persistent WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Clone riot-makers/wpan-raspbian GitHub repo:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/riot-makers/wpan-raspbian&lt;br /&gt;
 cd wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
* Copy some helper (shell) scripts to a well-known location:&lt;br /&gt;
&lt;br /&gt;
 sudo cp -r usr/local/sbin/* /usr/local/sbin/.&lt;br /&gt;
 sudo chmod +x /usr/local/sbin/*&lt;br /&gt;
&lt;br /&gt;
* Afterwards copy files for systemd integration:&lt;br /&gt;
&lt;br /&gt;
 sudo cp etc/default/lowpan /etc/default/.&lt;br /&gt;
 sudo cp etc/systemd/system/lowpan.service /etc/systemd/system/.&lt;br /&gt;
&lt;br /&gt;
* Modify 802.15.4 channel ID and PAN ID in &amp;lt;code&amp;gt;/etc/default/lowpan&amp;lt;/code&amp;gt; as needed:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/default/lowpan&lt;br /&gt;
 CHN=&amp;quot;13&amp;quot;&lt;br /&gt;
 PAN=&amp;quot;0xbeef&amp;quot;&lt;br /&gt;
 # set MAC to &amp;quot;&amp;quot; for random mac/hw address&lt;br /&gt;
 MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&lt;br /&gt;
 # set IPv6 to &amp;quot;&amp;quot; if not required; note: set a prefix length&lt;br /&gt;
 #IP6=&amp;quot;fdaa:bb:cc:dd::1/64&amp;quot;&lt;br /&gt;
 # Set ACK requests (Only enable if all devices on your PAN support ACKs)&lt;br /&gt;
 ACKREQ=0&lt;br /&gt;
&lt;br /&gt;
Note: &amp;lt;code&amp;gt;MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&amp;lt;/code&amp;gt; was taken from https://jan.newmarch.name/IoT/LinuxJournal/Routing/, this results in a link-local address of &amp;lt;code&amp;gt;fe80::1&amp;lt;/code&amp;gt; for the Raspberry.&lt;br /&gt;
&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;lowpan.service&amp;lt;/code&amp;gt; autostart, start 6LoWPAN service and verification:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl enable lowpan.service&lt;br /&gt;
 sudo systemctl start lowpan.service&lt;br /&gt;
 ifconfig&lt;br /&gt;
 lowpan0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 1280&lt;br /&gt;
    inet6 fe80::1  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;&lt;br /&gt;
    unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)&lt;br /&gt;
    RX packets 0  bytes 0 (0.0 B)&lt;br /&gt;
    RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
    TX packets 19  bytes 2114 (2.0 KiB)&lt;br /&gt;
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
 wpan0: flags=195&amp;lt;UP,BROADCAST,RUNNING,NOARP&amp;gt;  mtu 123&lt;br /&gt;
        unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 300  (UNSPEC)&lt;br /&gt;
        RX packets 72  bytes 2016 (1.9 KiB)&lt;br /&gt;
        RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
        TX packets 74  bytes 5320 (5.1 KiB)&lt;br /&gt;
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
&lt;br /&gt;
== Verification of 6LoWPAN connectivity between a Raspberry and a SAMR21-xpro == &lt;br /&gt;
&lt;br /&gt;
* Use RIOT&#039;s gnrc_networking example and build it for the SAMR21-xpro board, flash the firmware to the SAMR21-xpro and connect via &amp;lt;code&amp;gt;pyterm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 cd RIOT/examples/gnrc_networking&lt;br /&gt;
 make BOARD=samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro flash&lt;br /&gt;
 make BOARD=samr21-xpro term&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; to determine the 802.15.4/6LoWPAN interface ID of SAMR21-xpro (&amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt; in this case):&lt;br /&gt;
&lt;br /&gt;
 ifconfig&lt;br /&gt;
 # Iface  7  HWaddr: 57:98  Channel: 26  Page: 0  NID: 0x23  PHY: O-QPSK&lt;br /&gt;
 [...]&lt;br /&gt;
 #           Long HWaddr: E2:F9:02:0F:36:26:A2:68&lt;br /&gt;
 [...]&lt;br /&gt;
 #           inet6 addr: fe80::e0f9:20f:3626:a268  scope: link  VAL&lt;br /&gt;
&lt;br /&gt;
* Note: All &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; config options can be shown with &amp;lt;code&amp;gt;ifconfig &amp;lt;interface id&amp;gt; set&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* RIOT-OS default 802.15.4 channel is 26 and default  PAN ID 0x23. If you change them, make sure to change them in the SAMR21-xpro configuration aswell:&lt;br /&gt;
** [optional] Change the channel to 13 and the PAN ID to 0xbeef (see [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|RIOT-OS and IEEE 802.15.4 / 6LoWPAN]] for more information):&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 13&lt;br /&gt;
&lt;br /&gt;
=== Ping test from Raspberry to SAMR21-xpro ===&lt;br /&gt;
&lt;br /&gt;
* Multicast ping test through interface &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; to group &amp;lt;code&amp;gt;ff02::1&amp;lt;/code&amp;gt; (all nodes in the link-local):&lt;br /&gt;
&lt;br /&gt;
 ping ff02::1%lowpan0        &lt;br /&gt;
 PING ff02::1%lowpan0(ff02::1%lowpan0) 56 data bytes&lt;br /&gt;
 64 bytes from fe80::1%lowpan0: icmp_seq=1 ttl=64 time=0.195 ms&lt;br /&gt;
 64 bytes from fe80::e0f9:20f:3626:a268%lowpan0: icmp_seq=1 ttl=64 time=10.4 ms (DUP!)&lt;br /&gt;
&lt;br /&gt;
* Unicast ping (change to link-local IPv6 address of your SAMR21-xpro):&lt;br /&gt;
&lt;br /&gt;
 ping fe80::e0f9:20f:3626:a268%lowpan0&lt;br /&gt;
 ping fe80::e0f9:20f:3626:a268%lowpan0&lt;br /&gt;
 PING fe80::e0f9:20f:3626:a268%lowpan0(fe80::e0f9:20f:3626:a268%lowpan0) 56 data bytes&lt;br /&gt;
 64 bytes from fe80::e0f9:20f:3626:a268%lowpan0: icmp_seq=1 ttl=64 time=23.0 ms&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
=== Ping test from SAMR21-xpro to Raspberry ===&lt;br /&gt;
&lt;br /&gt;
* Multicast ping test through interface 7 to group ff02::1:&lt;br /&gt;
&lt;br /&gt;
 # ping6 ff02::1%7&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=0 ttl=64 rssi=-61 dBm time=8.309 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=1 ttl=64 rssi=-61 dBm time=6.124 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=2 ttl=64 rssi=-59 dBm time=6.461 ms&lt;br /&gt;
 #&lt;br /&gt;
 # --- ff02::1 PING statistics ---&lt;br /&gt;
 # 3 packets transmitted, 3 packets received, 0% packet loss&lt;br /&gt;
 # round-trip min/avg/max = 6.124/6.964/8.309 ms&lt;br /&gt;
&lt;br /&gt;
* Unicast ping from SAMR21-xpro to Raspberry 6LoWPAN interface:&lt;br /&gt;
&lt;br /&gt;
 # ping6 fe80::1%7&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=0 ttl=64 rssi=-61 dBm time=8.467 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=1 ttl=64 rssi=-61 dBm time=7.966 ms&lt;br /&gt;
&lt;br /&gt;
== Test CoAP communication between Raspberry and SAMR21-xpro ==&lt;br /&gt;
&lt;br /&gt;
* Install &amp;lt;code&amp;gt;python3-pip&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;aiocoap&amp;lt;/code&amp;gt; on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install python3-pip&lt;br /&gt;
 pip3 install --upgrade &amp;quot;aiocoap[all]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Clone &amp;lt;code&amp;gt;aiocoap&amp;lt;/code&amp;gt; repo and start the included simple CoAP server:&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/chrysn/aiocoap.git&lt;br /&gt;
 cd aiocoap&lt;br /&gt;
 python3 server.py&lt;br /&gt;
&lt;br /&gt;
* Use gcoap example on SAMR21-xpro (RIOT-OS repo already cloned):&lt;br /&gt;
&lt;br /&gt;
 cd ~/RIOT/example/gcoap&lt;br /&gt;
 make BOARD=samr21-xpro         //build gcoap example&lt;br /&gt;
 make BOARD=samr21-xpro flash       //flah gcoap to samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro term     //start pyterm&lt;br /&gt;
&lt;br /&gt;
* [optional] Reset SAMR21-xpro and change 6LoWPAN settings:&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 13&lt;br /&gt;
&lt;br /&gt;
* Send a CoAP request to the CoAP server:&lt;br /&gt;
&lt;br /&gt;
coap put [fe80::1%7] 5683 /send test&lt;br /&gt;
&lt;br /&gt;
== Possible Problems with 6LoWPAN, SAMR21-xpro and Raspberry Pi (with Openlabs 802.15.4 radio) ==&lt;br /&gt;
&lt;br /&gt;
* 6LoWPAN: RIOT does not receive packets from Linux when short_addr is set #11033&lt;br /&gt;
** GitHub issue: https://github.com/RIOT-OS/RIOT/issues/11033&lt;br /&gt;
** By default this is not set (i.e. in RIOT gnrc_networking example!)&lt;br /&gt;
* &#039;&#039;&#039;Do not use Raspberry Pi 4 with OpenLabs 802.15.4 radio module:&#039;&#039;&#039;&lt;br /&gt;
** At least with the newest available Kernel (i.e. 5.10 during our tests) it was &#039;&#039;&#039;only possible to send&#039;&#039;&#039; 802.15.4 packets to SAMR21-xpro and the Raspberry &#039;&#039;&#039;did not receive&#039;&#039;&#039; any packets from SAMR21-xpro.&lt;br /&gt;
** It is better to use a Raspberry Pi 3B(+)&lt;br /&gt;
*** Successfully tested with Raspbian 9 (Stretch), Raspbian 10 (Buster) and Raspbian 11 (Bullseye)&lt;br /&gt;
* Monitoring 802.15.4/6LoWPAN traffic: Correct channel ID must be set (RIOT-OS default: 26)&lt;br /&gt;
* Communication SAMR21-xpro&amp;lt;-&amp;gt;Raspberry: The same channel ID (RIOT-OS default: 26) and PAN ID need to be set (RIOT-OS default: 0x23)&lt;br /&gt;
&lt;br /&gt;
== TODO: Monitoring/Sniffing 802.15.4/6LoWPAN radio with a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
* SAMR21-xpro: [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* Documentation was (mostly) created based on our CoMatrix project: https://comatrix.eu&lt;br /&gt;
* [[Riot-OS_Setup|Wiki: Riot-OS Setup]]&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|Wiki: RIOT-OS and IEEE 802.15.4 / 6LoWPAN]]&lt;br /&gt;
* Linux WPAN Tools: https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
* Python CoAP implementation/library: https://github.com/chrysn/aiocoap&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://linux-wpan.org/documentation.html&lt;br /&gt;
* https://www.linuxjournal.com/content/low-power-wireless-6lowpan-ieee802154-and-raspberry-pi&lt;br /&gt;
* http://morschi.com/2017/04/05/hands-on-riot-6lowpan/&lt;br /&gt;
&lt;br /&gt;
=== Persistent WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
* https://jan.newmarch.name/IoT/LinuxJournal/Routing/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN&amp;diff=12827</id>
		<title>RIOT-OS and IEEE 802.15.4 / 6LoWPAN</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN&amp;diff=12827"/>
		<updated>2023-11-28T14:27:18Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to use/configure RIOT-OS with IEEE 802.15.4 and 6LoWPAN. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
In order to complete these steps, you must have followed [[Riot-OS_Setup|RIOT-OS Setup]] before.&lt;br /&gt;
&lt;br /&gt;
* Default 802.15.4 PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Default 802.15.4 channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure IEEE 802.15.4 PAN/Channel ID in RIOT ==&lt;br /&gt;
&lt;br /&gt;
=== Via RIOT Shell:  ===&lt;br /&gt;
&lt;br /&gt;
 ifconfig 6 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 6 set channel 23&lt;br /&gt;
&lt;br /&gt;
=== Set Channel/PAN ID via Makefile of your application, e.g.: === &lt;br /&gt;
&lt;br /&gt;
 CFLAGS += -DCONFIG_IEEE802154_DEFAULT_CHANNEL=16&lt;br /&gt;
 CFLAGS += -DCONFIG_IEEE802154_DEFAULT_PANID=0xcafe&lt;br /&gt;
&lt;br /&gt;
=== Or for RIOT in general: === &lt;br /&gt;
&lt;br /&gt;
 vim /Path/to/RIOT/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
&lt;br /&gt;
cf. https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
&lt;br /&gt;
* Default 802.15.4 PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Default 802.15.4 channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OPTIONAL: change HW address via RIOT Shell during runtime: ===&lt;br /&gt;
&lt;br /&gt;
 ifconfig 6 set addr_long 02:0:0:0:0:0:0:2&lt;br /&gt;
&lt;br /&gt;
== Test 802.15.4/6LoWPAN with RIOT gcoap example ==&lt;br /&gt;
&lt;br /&gt;
RIOT&#039;s gcoap example can be found here: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap&lt;br /&gt;
&lt;br /&gt;
README: https://github.com/RIOT-OS/RIOT/blob/master/examples/gcoap/README.md&lt;br /&gt;
&lt;br /&gt;
Flash it on e.g. two SAMR21-xpro devices.&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;code&amp;gt;%6&amp;lt;/code&amp;gt;&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
 coap get [fe80::d8b8:65ff:feee:121b%6]:5683 /.well-known/core&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; &amp;lt;code&amp;gt;fe80::d8b8:65ff:feee:121b%6&amp;lt;/code&amp;gt; =&amp;gt; fe80::[..] is the remote link-local address, but &amp;quot;%6&amp;quot; specifies the local interface ID of node where this command is submitted.&lt;br /&gt;
&lt;br /&gt;
The interface ID is stated when you perform &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; on your local node. Normally this interface ID is 6 or 7.&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
e.g. [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|SAMR21-xpro / Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [[Riot-OS_Setup|Wiki: RIOT-OS Setup]]&lt;br /&gt;
* [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|SAMR21-xpro / Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
* [[Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup|Wiki: Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup]]&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
* RIOT-OS gcoap example: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN&amp;diff=12826</id>
		<title>RIOT-OS and IEEE 802.15.4 / 6LoWPAN</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN&amp;diff=12826"/>
		<updated>2023-11-28T14:27:03Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to use/configure RIOT-OS with IEEE 802.15.4 and 6LoWPAN. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
In order to complete these steps, you must have followed [[Riot-OS_Setup|RIOT-OS Setup]] before.&lt;br /&gt;
&lt;br /&gt;
* Default 802.15.4 PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Default 802.15.4 channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure IEEE 802.15.4 PAN/Channel ID in RIOT ==&lt;br /&gt;
&lt;br /&gt;
=== Via RIOT Shell:  ===&lt;br /&gt;
&lt;br /&gt;
 ifconfig 6 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 6 set channel 23&lt;br /&gt;
&lt;br /&gt;
=== Set Channel/PAN ID via Makefile of your application, e.g.: === &lt;br /&gt;
&lt;br /&gt;
 CFLAGS += -DCONFIG_IEEE802154_DEFAULT_CHANNEL=16&lt;br /&gt;
 CFLAGS += -DCONFIG_IEEE802154_DEFAULT_PANID=0xcafe&lt;br /&gt;
&lt;br /&gt;
=== Or for RIOT in general: === &lt;br /&gt;
&lt;br /&gt;
 vim /Path/to/RIOT/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
&lt;br /&gt;
cf. https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
&lt;br /&gt;
* Default 802.15.4 PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Default 802.15.4 channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OPTIONAL: change HW address via RIOT Shell during runtime: ===&lt;br /&gt;
&lt;br /&gt;
 ifconfig 6 set addr_long 02:0:0:0:0:0:0:2&lt;br /&gt;
&lt;br /&gt;
== Test 802.15.4/6LoWPAN with RIOT gcoap example ==&lt;br /&gt;
&lt;br /&gt;
RIOT&#039;s gcoap example can be found here: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap&lt;br /&gt;
&lt;br /&gt;
README: https://github.com/RIOT-OS/RIOT/blob/master/examples/gcoap/README.md&lt;br /&gt;
&lt;br /&gt;
Flash it on e.g. two SAMR21-xpro devices.&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;code&amp;gt;%6&amp;lt;/code&amp;gt;&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
 coap get [fe80::d8b8:65ff:feee:121b%6]:5683 /.well-known/core&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; &amp;lt;code&amp;gt;fe80::d8b8:65ff:feee:121b%6&amp;lt;/code&amp;gt; =&amp;gt; fe80::[..] is the remote link-local address, but &amp;quot;%6&amp;quot; specifies the local interface ID of node where this command is submitted.&lt;br /&gt;
&lt;br /&gt;
The interface ID is stated when you perform &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; on your local node. Normally this interface ID is 6 or 7.&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
e.g. [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|SAMR21-xpro / Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [[Riot-OS_Setup]|Wiki: RIOT-OS Setup]]&lt;br /&gt;
* [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|SAMR21-xpro / Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
* [[Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup|Wiki: Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup]]&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
* RIOT-OS gcoap example: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN&amp;diff=12825</id>
		<title>RIOT-OS and IEEE 802.15.4 / 6LoWPAN</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN&amp;diff=12825"/>
		<updated>2023-11-28T14:26:42Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to use/configure RIOT-OS with IEEE 802.15.4 and 6LoWPAN. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
In order to complete these steps, you must have followed [[Riot-OS_Setup|RIOT-OS Setup]] before.&lt;br /&gt;
&lt;br /&gt;
* Default 802.15.4 PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Default 802.15.4 channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure IEEE 802.15.4 PAN/Channel ID in RIOT ==&lt;br /&gt;
&lt;br /&gt;
=== Via RIOT Shell:  ===&lt;br /&gt;
&lt;br /&gt;
 ifconfig 6 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 6 set channel 23&lt;br /&gt;
&lt;br /&gt;
=== Set Channel/PAN ID via Makefile of your application, e.g.: === &lt;br /&gt;
&lt;br /&gt;
 CFLAGS += -DCONFIG_IEEE802154_DEFAULT_CHANNEL=16&lt;br /&gt;
 CFLAGS += -DCONFIG_IEEE802154_DEFAULT_PANID=0xcafe&lt;br /&gt;
&lt;br /&gt;
=== Or for RIOT in general: === &lt;br /&gt;
&lt;br /&gt;
 vim /Path/to/RIOT/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
&lt;br /&gt;
cf. https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
&lt;br /&gt;
* Default 802.15.4 PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Default 802.15.4 channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OPTIONAL: change HW address via RIOT Shell during runtime: ===&lt;br /&gt;
&lt;br /&gt;
 ifconfig 6 set addr_long 02:0:0:0:0:0:0:2&lt;br /&gt;
&lt;br /&gt;
== Test 802.15.4/6LoWPAN with RIOT gcoap example ==&lt;br /&gt;
&lt;br /&gt;
RIOT&#039;s gcoap example can be found here: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap&lt;br /&gt;
&lt;br /&gt;
README: https://github.com/RIOT-OS/RIOT/blob/master/examples/gcoap/README.md&lt;br /&gt;
&lt;br /&gt;
Flash it on e.g. two SAMR21-xpro devices.&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;code&amp;gt;%6&amp;lt;/code&amp;gt;&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
 coap get [fe80::d8b8:65ff:feee:121b%6]:5683 /.well-known/core&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; &amp;lt;code&amp;gt;fe80::d8b8:65ff:feee:121b%6&amp;lt;/code&amp;gt; =&amp;gt; fe80::[..] is the remote link-local address, but &amp;quot;%6&amp;quot; specifies the local interface ID of node where this command is submitted.&lt;br /&gt;
&lt;br /&gt;
The interface ID is stated when you perform &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; on your local node. Normally this interface ID is 6 or 7.&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
e.g. [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|SAMR21-xpro / Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [[Riot-OS_Setup]|Wiki: RIOT-OS Setup]&lt;br /&gt;
* [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|SAMR21-xpro / Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
* [[Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup|Wiki: Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup]]&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
* RIOT-OS gcoap example: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS:_Setup&amp;diff=12824</id>
		<title>RIOT-OS: Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS:_Setup&amp;diff=12824"/>
		<updated>2023-11-28T14:14:58Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Setting up Riot-OS on a Atmel SAM R21 Xpro Board.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating system: Ubuntu 20.04 &lt;br /&gt;
* Packages: git&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Install the following packages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install git &lt;br /&gt;
                      openocd&lt;br /&gt;
                      gcc-multilib&lt;br /&gt;
                      build-essential&lt;br /&gt;
                      python3-serial&lt;br /&gt;
                      libudev-dev&lt;br /&gt;
                      moserial&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Install the toolchain&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install gcc-arm-none-eabi&lt;br /&gt;
&lt;br /&gt;
If you use a recent version of RIOT-OS (Release-2021.07) you can go on with &#039;&#039;&#039;Step 3&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use an older RIOT-OS version, you will have to do the following steps:&lt;br /&gt;
&lt;br /&gt;
Goto https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm and download&lt;br /&gt;
&lt;br /&gt;
 gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Move it to your home directory.&lt;br /&gt;
&lt;br /&gt;
Uninstall old packages&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi&lt;br /&gt;
&lt;br /&gt;
Unzip the downloaded file&lt;br /&gt;
&lt;br /&gt;
 tar -xjvf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Add the toolchain to your path&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PATH:/home/(your user)/gcc-arm-none-eabi-7-2018-q2-update/bin/&lt;br /&gt;
&lt;br /&gt;
For now: you will have to do this in the bash where you build your application - after each restart.&lt;br /&gt;
&lt;br /&gt;
Add toolchain permanently to PATH (otherwise it&#039;s necessary to do it manually after every restart):&lt;br /&gt;
&lt;br /&gt;
 vim ~/.profile &lt;br /&gt;
&lt;br /&gt;
and/or &lt;br /&gt;
 vim ~/.bashrc &lt;br /&gt;
&lt;br /&gt;
Add the following line to the bottom and save (adapt to your used ARM toolchain!):&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PATH:&amp;lt;path to unzipped folder&amp;gt;/gcc-arm-none-eabi-9-2020-q2-update/bin&lt;br /&gt;
&lt;br /&gt;
Apply changes for current shell:&lt;br /&gt;
&lt;br /&gt;
 source ~/.profile&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Download Riot-OS&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/RIOT-OS/RIOT.git myRIOT&lt;br /&gt;
&lt;br /&gt;
Move to the &amp;quot;Hello World&amp;quot;-Example&lt;br /&gt;
 &lt;br /&gt;
 cd myRIOT/examples/hello-world&lt;br /&gt;
&lt;br /&gt;
Build the application on &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 make all term&lt;br /&gt;
&lt;br /&gt;
Now, you should see this output in your terminal:&lt;br /&gt;
&lt;br /&gt;
 RIOT native interrupts/signals initialized.&lt;br /&gt;
 LED_RED_OFF&lt;br /&gt;
 LED_GREEN_ON&lt;br /&gt;
 RIOT native board initialized.&lt;br /&gt;
 RIOT native hardware initialization complete.&lt;br /&gt;
 &lt;br /&gt;
 main(): This is RIOT! (Version: 2022.01-devel-129-g554d3)&lt;br /&gt;
 Hello World!&lt;br /&gt;
 You are running RIOT on a(n) native board.&lt;br /&gt;
 This board features a(n) native MCU.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Build and run &amp;quot;Hello World&amp;quot; on the SAM R21 Board.&lt;br /&gt;
&lt;br /&gt;
Set the rights for your username to be able to flash the application on the board.&lt;br /&gt;
&lt;br /&gt;
 sudo usermod -a -G dialout &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then reboot your computer.&lt;br /&gt;
&lt;br /&gt;
Connect the board to your computer via micro USB cable (USB EDBG interface).&lt;br /&gt;
&lt;br /&gt;
[[File:samr21EDBGconnect.jpg]]&lt;br /&gt;
&lt;br /&gt;
Connect via Moserial.&lt;br /&gt;
&lt;br /&gt;
[[File:moSerial.jpg]]&lt;br /&gt;
&lt;br /&gt;
Build and flash the application.&lt;br /&gt;
&lt;br /&gt;
 cd myRIOT/examples/hello-world&lt;br /&gt;
 make BOARD=samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro flash&lt;br /&gt;
&lt;br /&gt;
If you do not use a serial terminal like moserial or terraterm use term&lt;br /&gt;
&lt;br /&gt;
 make BOARD=samr21-xpro term&lt;br /&gt;
&lt;br /&gt;
Or via &amp;lt;code&amp;gt;pyterm&amp;lt;/code&amp;gt; (which is shipped with RIOT-OS):&lt;br /&gt;
&lt;br /&gt;
 sudo pip3 install pyserial&lt;br /&gt;
 cd RIOT/dist/tools/pyterm&lt;br /&gt;
 ./pyterm -p /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You may also set the BOARD in the Makefile of the application.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To find out the correct &amp;lt;code&amp;gt;tty&amp;lt;/code&amp;gt; when multiple (SAMR21-xpro) boards are connected to your system:&lt;br /&gt;
&lt;br /&gt;
 $ cd RIOT/examples/hello-world&lt;br /&gt;
 $ make list-ttys&lt;br /&gt;
 /sys/bus/usb/devices/1-3: Atmel Corp. EDBG CMSIS-DAP, serial: &#039;ATMLXXXXXXX80000XXX1&#039;, tty(s): ttyACM0&lt;br /&gt;
 /sys/bus/usb/devices/1-2: Atmel Corp. EDBG CMSIS-DAP, serial: &#039;ATMLXXXXXXX80000XXX2&#039;, tty(s): ttyACM1&lt;br /&gt;
&lt;br /&gt;
If you have multiple boards connected to your computer it is necessary to provide the serial during flashing:&lt;br /&gt;
&lt;br /&gt;
 BOARD=samr21-xpro SERIAL=&amp;quot;ATMLXXXXXXX80000XXX1&amp;quot; make flash&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[Mobile and Embedded Security]] (2019-)&lt;br /&gt;
&lt;br /&gt;
== RIOT More Information/Resources/Links ==&lt;br /&gt;
&lt;br /&gt;
* [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|Wiki: RIOT-OS and IEEE 802.15.4 / 6LoWPAN]]&lt;br /&gt;
* [[Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup|Wiki: Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup]]&lt;br /&gt;
* Paper (optional): Baccelli, Emmanuel, et al. _&amp;quot;RIOT: An open source operating system for low-end embedded devices in the IoT.&amp;quot;_ IEEE Internet of Things Journal 5.6 (2018): 4428-4440.&lt;br /&gt;
* Riot-OS Setup (ELVIS Wiki): https://wiki.elvis.science/index.php?title=Riot-OS_Setup&lt;br /&gt;
** RIOT-OS+SAMR21 Setup (CoMatrix): https://comatrix.eu/setup/samr21_and_RIOT-OS/&lt;br /&gt;
* RIOT-OS Github repository: https://github.com/RIOT-OS/RIOT&lt;br /&gt;
** Examples: https://github.com/RIOT-OS/RIOT/tree/master/examples&lt;br /&gt;
** Tests: https://github.com/RIOT-OS/RIOT/tree/master/tests&lt;br /&gt;
* Getting Started: https://doc.riot-os.org/getting-started.html&lt;br /&gt;
** Introduction: https://github.com/RIOT-OS/RIOT/wiki/Introduction&lt;br /&gt;
** Changelog/Release Notes: https://doc.riot-os.org/changelog.html&lt;br /&gt;
** Use Docker to build RIOT:&lt;br /&gt;
*** https://doc.riot-os.org/getting-started.html#docker&lt;br /&gt;
*** https://doc.riot-os.org/build-in-docker.html&lt;br /&gt;
*** Podman: https://github.com/RIOT-OS/RIOT/pull/18671&lt;br /&gt;
* API documentation: https://doc.riot-os.org/&lt;br /&gt;
* Wiki: https://github.com/RIOT-OS/RIOT/wiki&lt;br /&gt;
** FAQ: https://github.com/RIOT-OS/RIOT/wiki/FAQ&lt;br /&gt;
** Best Practice for RIOT Programming: https://github.com/RIOT-OS/RIOT/wiki/Best-Practice-for-RIOT-Programming&lt;br /&gt;
* Tutorials: https://github.com/RIOT-OS/Tutorials&lt;br /&gt;
** RIOT online course: https://github.com/RIOT-OS/riot-course&lt;br /&gt;
** RIOT Beginner Tutorial - RIOT Summit 2021: https://riot-os.github.io/riot-course/slides/tutorial-summit-networking/&lt;br /&gt;
** Networking in RIOT: https://riot-os.github.io/riot-course/slides/04-networking-in-riot/&lt;br /&gt;
** RIOT Tutorial - IoT Security with Microcontrollers: https://riot-os.github.io/riot-course/slides/tutorial-summit-security&lt;br /&gt;
* Forum: https://forum.riot-os.org/&lt;br /&gt;
** Matrix Channel: https://matrix.to/#/#riot-os:matrix.org&lt;br /&gt;
* ... and slides from Silvie&lt;br /&gt;
* pyterm is an alternative to Moserial&lt;br /&gt;
** i.e. implicit use with &amp;lt;code&amp;gt;make BOARD=samr21-xpro term&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;make list-ttys&amp;lt;/code&amp;gt;: returns the list of serial ports available with information on the board connected (useful when working with multiple boards)&lt;br /&gt;
** afterwards e.g. &amp;lt;code&amp;gt;make term SERIAL=&amp;quot;1232135328821&amp;quot;`&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;make debug&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Remember that the examples directory is very helpful - as well as the test directories :)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki&lt;br /&gt;
* http://riot-os.org/api&lt;br /&gt;
* https://github.com/RIOT-OS/Tutorials&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS:_Setup&amp;diff=12823</id>
		<title>RIOT-OS: Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS:_Setup&amp;diff=12823"/>
		<updated>2023-11-28T14:09:32Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Setting up Riot-OS on a Atmel SAM R21 Xpro Board.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating system: Ubuntu 20.04 &lt;br /&gt;
* Packages: git&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Install the following packages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install git &lt;br /&gt;
                      openocd&lt;br /&gt;
                      gcc-multilib&lt;br /&gt;
                      build-essential&lt;br /&gt;
                      python3-serial&lt;br /&gt;
                      libudev-dev&lt;br /&gt;
                      moserial&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Install the toolchain&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install gcc-arm-none-eabi&lt;br /&gt;
&lt;br /&gt;
If you use a recent version of RIOT-OS (Release-2021.07) you can go on with &#039;&#039;&#039;Step 3&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use an older RIOT-OS version, you will have to do the following steps:&lt;br /&gt;
&lt;br /&gt;
Goto https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm and download&lt;br /&gt;
&lt;br /&gt;
 gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Move it to your home directory.&lt;br /&gt;
&lt;br /&gt;
Uninstall old packages&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi&lt;br /&gt;
&lt;br /&gt;
Unzip the downloaded file&lt;br /&gt;
&lt;br /&gt;
 tar -xjvf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Add the toolchain to your path&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PATH:/home/(your user)/gcc-arm-none-eabi-7-2018-q2-update/bin/&lt;br /&gt;
&lt;br /&gt;
For now: you will have to do this in the bash where you build your application - after each restart.&lt;br /&gt;
&lt;br /&gt;
Add toolchain permanently to PATH (otherwise it&#039;s necessary to do it manually after every restart):&lt;br /&gt;
&lt;br /&gt;
 vim ~/.profile &lt;br /&gt;
&lt;br /&gt;
and/or &lt;br /&gt;
 vim ~/.bashrc &lt;br /&gt;
&lt;br /&gt;
Add the following line to the bottom and save (adapt to your used ARM toolchain!):&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PATH:&amp;lt;path to unzipped folder&amp;gt;/gcc-arm-none-eabi-9-2020-q2-update/bin&lt;br /&gt;
&lt;br /&gt;
Apply changes for current shell:&lt;br /&gt;
&lt;br /&gt;
 source ~/.profile&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Download Riot-OS&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/RIOT-OS/RIOT.git myRIOT&lt;br /&gt;
&lt;br /&gt;
Move to the &amp;quot;Hello World&amp;quot;-Example&lt;br /&gt;
 &lt;br /&gt;
 cd myRIOT/examples/hello-world&lt;br /&gt;
&lt;br /&gt;
Build the application on &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 make all term&lt;br /&gt;
&lt;br /&gt;
Now, you should see this output in your terminal:&lt;br /&gt;
&lt;br /&gt;
 RIOT native interrupts/signals initialized.&lt;br /&gt;
 LED_RED_OFF&lt;br /&gt;
 LED_GREEN_ON&lt;br /&gt;
 RIOT native board initialized.&lt;br /&gt;
 RIOT native hardware initialization complete.&lt;br /&gt;
 &lt;br /&gt;
 main(): This is RIOT! (Version: 2022.01-devel-129-g554d3)&lt;br /&gt;
 Hello World!&lt;br /&gt;
 You are running RIOT on a(n) native board.&lt;br /&gt;
 This board features a(n) native MCU.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Build and run &amp;quot;Hello World&amp;quot; on the SAM R21 Board.&lt;br /&gt;
&lt;br /&gt;
Set the rights for your username to be able to flash the application on the board.&lt;br /&gt;
&lt;br /&gt;
 sudo usermod -a -G dialout &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then reboot your computer.&lt;br /&gt;
&lt;br /&gt;
Connect the board to your computer via micro USB cable (USB EDBG interface).&lt;br /&gt;
&lt;br /&gt;
[[File:samr21EDBGconnect.jpg]]&lt;br /&gt;
&lt;br /&gt;
Connect via Moserial.&lt;br /&gt;
&lt;br /&gt;
[[File:moSerial.jpg]]&lt;br /&gt;
&lt;br /&gt;
Build and flash the application.&lt;br /&gt;
&lt;br /&gt;
 cd myRIOT/examples/hello-world&lt;br /&gt;
 make BOARD=samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro flash&lt;br /&gt;
&lt;br /&gt;
If you do not use a serial terminal like moserial or terraterm use term&lt;br /&gt;
&lt;br /&gt;
 make BOARD=samr21-xpro term&lt;br /&gt;
&lt;br /&gt;
Or via &amp;lt;code&amp;gt;pyterm&amp;lt;/code&amp;gt; (which is shipped with RIOT-OS):&lt;br /&gt;
&lt;br /&gt;
 sudo pip3 install pyserial&lt;br /&gt;
 cd RIOT/dist/tools/pyterm&lt;br /&gt;
 ./pyterm -p /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You may also set the BOARD in the Makefile of the application.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To find out the correct &amp;lt;code&amp;gt;tty&amp;lt;/code&amp;gt; when multiple (SAMR21-xpro) boards are connected to your system:&lt;br /&gt;
&lt;br /&gt;
 $ cd RIOT/examples/hello-world&lt;br /&gt;
 $ make list-ttys&lt;br /&gt;
 /sys/bus/usb/devices/1-3: Atmel Corp. EDBG CMSIS-DAP, serial: &#039;ATMLXXXXXXX80000XXX1&#039;, tty(s): ttyACM0&lt;br /&gt;
 /sys/bus/usb/devices/1-2: Atmel Corp. EDBG CMSIS-DAP, serial: &#039;ATMLXXXXXXX80000XXX2&#039;, tty(s): ttyACM1&lt;br /&gt;
&lt;br /&gt;
If you have multiple boards connected to your computer it is necessary to provide the serial during flashing:&lt;br /&gt;
&lt;br /&gt;
 BOARD=samr21-xpro SERIAL=&amp;quot;ATMLXXXXXXX80000XXX1&amp;quot; make flash&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[Mobile and Embedded Security]] (2019-)&lt;br /&gt;
&lt;br /&gt;
== RIOT More Information/Resources/Links ==&lt;br /&gt;
&lt;br /&gt;
* Paper (optional): Baccelli, Emmanuel, et al. _&amp;quot;RIOT: An open source operating system for low-end embedded devices in the IoT.&amp;quot;_ IEEE Internet of Things Journal 5.6 (2018): 4428-4440.&lt;br /&gt;
* Riot-OS Setup (ELVIS Wiki): https://wiki.elvis.science/index.php?title=Riot-OS_Setup&lt;br /&gt;
** RIOT-OS+SAMR21 Setup (CoMatrix): https://comatrix.eu/setup/samr21_and_RIOT-OS/&lt;br /&gt;
* RIOT-OS Github repository: https://github.com/RIOT-OS/RIOT&lt;br /&gt;
** Examples: https://github.com/RIOT-OS/RIOT/tree/master/examples&lt;br /&gt;
** Tests: https://github.com/RIOT-OS/RIOT/tree/master/tests&lt;br /&gt;
* Getting Started: https://doc.riot-os.org/getting-started.html&lt;br /&gt;
** Introduction: https://github.com/RIOT-OS/RIOT/wiki/Introduction&lt;br /&gt;
** Changelog/Release Notes: https://doc.riot-os.org/changelog.html&lt;br /&gt;
** Use Docker to build RIOT:&lt;br /&gt;
*** https://doc.riot-os.org/getting-started.html#docker&lt;br /&gt;
*** https://doc.riot-os.org/build-in-docker.html&lt;br /&gt;
*** Podman: https://github.com/RIOT-OS/RIOT/pull/18671&lt;br /&gt;
* API documentation: https://doc.riot-os.org/&lt;br /&gt;
* Wiki: https://github.com/RIOT-OS/RIOT/wiki&lt;br /&gt;
** FAQ: https://github.com/RIOT-OS/RIOT/wiki/FAQ&lt;br /&gt;
** Best Practice for RIOT Programming: https://github.com/RIOT-OS/RIOT/wiki/Best-Practice-for-RIOT-Programming&lt;br /&gt;
* Tutorials: https://github.com/RIOT-OS/Tutorials&lt;br /&gt;
** RIOT online course: https://github.com/RIOT-OS/riot-course&lt;br /&gt;
** RIOT Beginner Tutorial - RIOT Summit 2021: https://riot-os.github.io/riot-course/slides/tutorial-summit-networking/&lt;br /&gt;
** Networking in RIOT: https://riot-os.github.io/riot-course/slides/04-networking-in-riot/&lt;br /&gt;
** RIOT Tutorial - IoT Security with Microcontrollers: https://riot-os.github.io/riot-course/slides/tutorial-summit-security&lt;br /&gt;
* Forum: https://forum.riot-os.org/&lt;br /&gt;
** Matrix Channel: https://matrix.to/#/#riot-os:matrix.org&lt;br /&gt;
* ... and slides from Silvie&lt;br /&gt;
* pyterm is an alternative to Moserial&lt;br /&gt;
** i.e. implicit use with &amp;lt;code&amp;gt;make BOARD=samr21-xpro term&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;make list-ttys&amp;lt;/code&amp;gt;: returns the list of serial ports available with information on the board connected (useful when working with multiple boards)&lt;br /&gt;
** afterwards e.g. &amp;lt;code&amp;gt;make term SERIAL=&amp;quot;1232135328821&amp;quot;`&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;make debug&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Remember that the examples directory is very helpful - as well as the test directories :)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki&lt;br /&gt;
* http://riot-os.org/api&lt;br /&gt;
* https://github.com/RIOT-OS/Tutorials&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS:_Setup&amp;diff=12822</id>
		<title>RIOT-OS: Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS:_Setup&amp;diff=12822"/>
		<updated>2023-11-28T14:08:51Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Setting up Riot-OS on a Atmel SAM R21 Xpro Board.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating system: Ubuntu 20.04 &lt;br /&gt;
* Packages: git&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Install the following packages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install git &lt;br /&gt;
                      openocd&lt;br /&gt;
                      gcc-multilib&lt;br /&gt;
                      build-essential&lt;br /&gt;
                      python3-serial&lt;br /&gt;
                      libudev-dev&lt;br /&gt;
                      moserial&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Install the toolchain&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install gcc-arm-none-eabi&lt;br /&gt;
&lt;br /&gt;
If you use a recent version of RIOT-OS (Release-2021.07) you can go on with &#039;&#039;&#039;Step 3&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use an older RIOT-OS version, you will have to do the following steps:&lt;br /&gt;
&lt;br /&gt;
Goto https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm and download&lt;br /&gt;
&lt;br /&gt;
 gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Move it to your home directory.&lt;br /&gt;
&lt;br /&gt;
Uninstall old packages&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi&lt;br /&gt;
&lt;br /&gt;
Unzip the downloaded file&lt;br /&gt;
&lt;br /&gt;
 tar -xjvf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Add the toolchain to your path&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PATH:/home/(your user)/gcc-arm-none-eabi-7-2018-q2-update/bin/&lt;br /&gt;
&lt;br /&gt;
For now: you will have to do this in the bash where you build your application - after each restart.&lt;br /&gt;
&lt;br /&gt;
Add toolchain permanently to PATH (otherwise it&#039;s necessary to do it manually after every restart):&lt;br /&gt;
&lt;br /&gt;
 vim ~/.profile &lt;br /&gt;
&lt;br /&gt;
and/or &lt;br /&gt;
 vim ~/.bashrc &lt;br /&gt;
&lt;br /&gt;
Add the following line to the bottom and save (adapt to your used ARM toolchain!):&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PATH:&amp;lt;path to unzipped folder&amp;gt;/gcc-arm-none-eabi-9-2020-q2-update/bin&lt;br /&gt;
&lt;br /&gt;
Apply changes for current shell:&lt;br /&gt;
&lt;br /&gt;
 source ~/.profile&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Download Riot-OS&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/RIOT-OS/RIOT.git myRIOT&lt;br /&gt;
&lt;br /&gt;
Move to the &amp;quot;Hello World&amp;quot;-Example&lt;br /&gt;
 &lt;br /&gt;
 cd myRIOT/examples/hello-world&lt;br /&gt;
&lt;br /&gt;
Build the application on &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 make all term&lt;br /&gt;
&lt;br /&gt;
Now, you should see this output in your terminal:&lt;br /&gt;
&lt;br /&gt;
 RIOT native interrupts/signals initialized.&lt;br /&gt;
 LED_RED_OFF&lt;br /&gt;
 LED_GREEN_ON&lt;br /&gt;
 RIOT native board initialized.&lt;br /&gt;
 RIOT native hardware initialization complete.&lt;br /&gt;
 &lt;br /&gt;
 main(): This is RIOT! (Version: 2022.01-devel-129-g554d3)&lt;br /&gt;
 Hello World!&lt;br /&gt;
 You are running RIOT on a(n) native board.&lt;br /&gt;
 This board features a(n) native MCU.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Build and run &amp;quot;Hello World&amp;quot; on the SAM R21 Board.&lt;br /&gt;
&lt;br /&gt;
Set the rights for your username to be able to flash the application on the board.&lt;br /&gt;
&lt;br /&gt;
 sudo usermod -a -G dialout &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then reboot your computer.&lt;br /&gt;
&lt;br /&gt;
Connect the board to your computer via micro USB cable (USB EDBG interface).&lt;br /&gt;
&lt;br /&gt;
[[File:samr21EDBGconnect.jpg]]&lt;br /&gt;
&lt;br /&gt;
Connect via Moserial.&lt;br /&gt;
&lt;br /&gt;
[[File:moSerial.jpg]]&lt;br /&gt;
&lt;br /&gt;
Build and flash the application.&lt;br /&gt;
&lt;br /&gt;
 cd myRIOT/examples/hello-world&lt;br /&gt;
 make BOARD=samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro flash&lt;br /&gt;
&lt;br /&gt;
If you do not use a serial terminal like moserial or terraterm use term&lt;br /&gt;
&lt;br /&gt;
 make BOARD=samr21-xpro term&lt;br /&gt;
&lt;br /&gt;
Or via &amp;lt;code&amp;gt;pyterm&amp;lt;/code&amp;gt; (which is shipped with RIOT-OS):&lt;br /&gt;
&lt;br /&gt;
 sudo pip3 install pyserial&lt;br /&gt;
 cd RIOT/dist/tools/pyterm&lt;br /&gt;
 ./pyterm -p /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You may also set the BOARD in the Makefile of the application.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To find out the correct &amp;lt;code&amp;gt;tty&amp;lt;/code&amp;gt; when multiple (SAMR21-xpro) boards are connected to your system:&lt;br /&gt;
&lt;br /&gt;
 $ cd RIOT/examples/hello-world&lt;br /&gt;
 $ make list-ttys&lt;br /&gt;
 /sys/bus/usb/devices/1-3: Atmel Corp. EDBG CMSIS-DAP, serial: &#039;ATMLXXXXXXX80000XXX1&#039;, tty(s): ttyACM0&lt;br /&gt;
 /sys/bus/usb/devices/1-2: Atmel Corp. EDBG CMSIS-DAP, serial: &#039;ATMLXXXXXXX80000XXX2&#039;, tty(s): ttyACM1&lt;br /&gt;
&lt;br /&gt;
If you have multiple boards connected to your computer it is necessary to provide the serial during flashing:&lt;br /&gt;
&lt;br /&gt;
 BOARD=samr21-xpro SERIAL=&amp;quot;ATMLXXXXXXX80000XXX1&amp;quot; make flash&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[Mobile and Embedded Security]] (2019-)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RIOT More Information/Resources/Links ==&lt;br /&gt;
&lt;br /&gt;
* Paper (optional): Baccelli, Emmanuel, et al. _&amp;quot;RIOT: An open source operating system for low-end embedded devices in the IoT.&amp;quot;_ IEEE Internet of Things Journal 5.6 (2018): 4428-4440.&lt;br /&gt;
* Riot-OS Setup (ELVIS Wiki): https://wiki.elvis.science/index.php?title=Riot-OS_Setup&lt;br /&gt;
** RIOT-OS+SAMR21 Setup (CoMatrix): https://comatrix.eu/setup/samr21_and_RIOT-OS/&lt;br /&gt;
* RIOT-OS Github repository: https://github.com/RIOT-OS/RIOT&lt;br /&gt;
** Examples: https://github.com/RIOT-OS/RIOT/tree/master/examples&lt;br /&gt;
** Tests: https://github.com/RIOT-OS/RIOT/tree/master/tests&lt;br /&gt;
* Getting Started: https://doc.riot-os.org/getting-started.html&lt;br /&gt;
** Introduction: https://github.com/RIOT-OS/RIOT/wiki/Introduction&lt;br /&gt;
** Changelog/Release Notes: https://doc.riot-os.org/changelog.html&lt;br /&gt;
** Use Docker to build RIOT:&lt;br /&gt;
*** https://doc.riot-os.org/getting-started.html#docker&lt;br /&gt;
*** https://doc.riot-os.org/build-in-docker.html&lt;br /&gt;
*** Podman: https://github.com/RIOT-OS/RIOT/pull/18671&lt;br /&gt;
* API documentation: https://doc.riot-os.org/&lt;br /&gt;
* Wiki: https://github.com/RIOT-OS/RIOT/wiki&lt;br /&gt;
** FAQ: https://github.com/RIOT-OS/RIOT/wiki/FAQ&lt;br /&gt;
** Best Practice for RIOT Programming: https://github.com/RIOT-OS/RIOT/wiki/Best-Practice-for-RIOT-Programming&lt;br /&gt;
* Tutorials: https://github.com/RIOT-OS/Tutorials&lt;br /&gt;
** RIOT online course: https://github.com/RIOT-OS/riot-course&lt;br /&gt;
** RIOT Beginner Tutorial - RIOT Summit 2021: https://riot-os.github.io/riot-course/slides/tutorial-summit-networking/&lt;br /&gt;
** Networking in RIOT: https://riot-os.github.io/riot-course/slides/04-networking-in-riot/&lt;br /&gt;
** RIOT Tutorial - IoT Security with Microcontrollers: https://riot-os.github.io/riot-course/slides/tutorial-summit-security&lt;br /&gt;
* Forum: https://forum.riot-os.org/&lt;br /&gt;
** Matrix Channel: https://matrix.to/#/#riot-os:matrix.org&lt;br /&gt;
* ... and slides from Silvie&lt;br /&gt;
* pyterm is an alternative to Moserial&lt;br /&gt;
** i.e. implicit use with &amp;lt;code&amp;gt;make BOARD=samr21-xpro term&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;make list-ttys&amp;lt;/code&amp;gt;: returns the list of serial ports available with information on the board connected (useful when working with multiple boards)&lt;br /&gt;
** afterwards e.g. &amp;lt;code&amp;gt;make term SERIAL=&amp;quot;1232135328821&amp;quot;`&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;make debug&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Remember that the examples directory is very helpful - as well as the test directories :)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki&lt;br /&gt;
* http://riot-os.org/api&lt;br /&gt;
* https://github.com/RIOT-OS/Tutorials&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS:_Setup&amp;diff=12821</id>
		<title>RIOT-OS: Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS:_Setup&amp;diff=12821"/>
		<updated>2023-11-28T14:07:41Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Setting up Riot-OS on a Atmel SAM R21 Xpro Board.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating system: Ubuntu 20.04 &lt;br /&gt;
* Packages: git&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Install the following packages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install git &lt;br /&gt;
                      openocd&lt;br /&gt;
                      gcc-multilib&lt;br /&gt;
                      build-essential&lt;br /&gt;
                      python3-serial&lt;br /&gt;
                      libudev-dev&lt;br /&gt;
                      moserial&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Install the toolchain&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install gcc-arm-none-eabi&lt;br /&gt;
&lt;br /&gt;
If you use a recent version of RIOT-OS (Release-2021.07) you can go on with &#039;&#039;&#039;Step 3&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use an older RIOT-OS version, you will have to do the following steps:&lt;br /&gt;
&lt;br /&gt;
Goto https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm and download&lt;br /&gt;
&lt;br /&gt;
 gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Move it to your home directory.&lt;br /&gt;
&lt;br /&gt;
Uninstall old packages&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi&lt;br /&gt;
&lt;br /&gt;
Unzip the downloaded file&lt;br /&gt;
&lt;br /&gt;
 tar -xjvf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Add the toolchain to your path&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PATH:/home/(your user)/gcc-arm-none-eabi-7-2018-q2-update/bin/&lt;br /&gt;
&lt;br /&gt;
For now: you will have to do this in the bash where you build your application - after each restart.&lt;br /&gt;
&lt;br /&gt;
* Add toolchain permanently to PATH (otherwise it&#039;s necessary to do it manually after every restart):&lt;br /&gt;
&lt;br /&gt;
vim ~/.profile &lt;br /&gt;
&lt;br /&gt;
and/or &lt;br /&gt;
 vim ~/.bashrc &lt;br /&gt;
&lt;br /&gt;
* Add the following line to the bottom and save (adapt to your used ARM toolchain!):&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PATH:&amp;lt;path to unzipped folder&amp;gt;/gcc-arm-none-eabi-9-2020-q2-update/bin&lt;br /&gt;
&lt;br /&gt;
* Apply changes for current shell:&lt;br /&gt;
&lt;br /&gt;
 source ~/.profile&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Download Riot-OS&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/RIOT-OS/RIOT.git myRIOT&lt;br /&gt;
&lt;br /&gt;
Move to the &amp;quot;Hello World&amp;quot;-Example&lt;br /&gt;
 &lt;br /&gt;
 cd myRIOT/examples/hello-world&lt;br /&gt;
&lt;br /&gt;
Build the application on &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 make all term&lt;br /&gt;
&lt;br /&gt;
Now, you should see this output in your terminal:&lt;br /&gt;
&lt;br /&gt;
 RIOT native interrupts/signals initialized.&lt;br /&gt;
 LED_RED_OFF&lt;br /&gt;
 LED_GREEN_ON&lt;br /&gt;
 RIOT native board initialized.&lt;br /&gt;
 RIOT native hardware initialization complete.&lt;br /&gt;
 &lt;br /&gt;
 main(): This is RIOT! (Version: 2022.01-devel-129-g554d3)&lt;br /&gt;
 Hello World!&lt;br /&gt;
 You are running RIOT on a(n) native board.&lt;br /&gt;
 This board features a(n) native MCU.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Build and run &amp;quot;Hello World&amp;quot; on the SAM R21 Board.&lt;br /&gt;
&lt;br /&gt;
Set the rights for your username to be able to flash the application on the board.&lt;br /&gt;
&lt;br /&gt;
 sudo usermod -a -G dialout &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then reboot your computer.&lt;br /&gt;
&lt;br /&gt;
Connect the board to your computer via micro USB cable (USB EDBG interface).&lt;br /&gt;
&lt;br /&gt;
[[File:samr21EDBGconnect.jpg]]&lt;br /&gt;
&lt;br /&gt;
Connect via Moserial.&lt;br /&gt;
&lt;br /&gt;
[[File:moSerial.jpg]]&lt;br /&gt;
&lt;br /&gt;
Build and flash the application.&lt;br /&gt;
&lt;br /&gt;
 cd myRIOT/examples/hello-world&lt;br /&gt;
 make BOARD=samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro flash&lt;br /&gt;
&lt;br /&gt;
If you do not use a serial terminal like moserial or terraterm use term&lt;br /&gt;
&lt;br /&gt;
 make BOARD=samr21-xpro term&lt;br /&gt;
&lt;br /&gt;
Or via &amp;lt;code&amp;gt;pyterm&amp;lt;/code&amp;gt; (which is shipped with RIOT-OS):&lt;br /&gt;
&lt;br /&gt;
 sudo pip3 install pyserial&lt;br /&gt;
 cd RIOT/dist/tools/pyterm&lt;br /&gt;
 ./pyterm -p /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You may also set the BOARD in the Makefile of the application.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To find out the correct &amp;lt;code&amp;gt;tty&amp;lt;/code&amp;gt; when multiple (SAMR21-xpro) boards are connected to your system:&lt;br /&gt;
&lt;br /&gt;
 $ cd RIOT/examples/hello-world&lt;br /&gt;
 $ make list-ttys&lt;br /&gt;
 /sys/bus/usb/devices/1-3: Atmel Corp. EDBG CMSIS-DAP, serial: &#039;ATMLXXXXXXX80000XXX1&#039;, tty(s): ttyACM0&lt;br /&gt;
 /sys/bus/usb/devices/1-2: Atmel Corp. EDBG CMSIS-DAP, serial: &#039;ATMLXXXXXXX80000XXX2&#039;, tty(s): ttyACM1&lt;br /&gt;
&lt;br /&gt;
If you have multiple boards connected to your computer it is necessary to provide the serial during flashing:&lt;br /&gt;
&lt;br /&gt;
 BOARD=samr21-xpro SERIAL=&amp;quot;ATMLXXXXXXX80000XXX1&amp;quot; make flash&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[Mobile and Embedded Security]] (2019-)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RIOT More Information/Resources/Links ==&lt;br /&gt;
&lt;br /&gt;
* Paper (optional): Baccelli, Emmanuel, et al. _&amp;quot;RIOT: An open source operating system for low-end embedded devices in the IoT.&amp;quot;_ IEEE Internet of Things Journal 5.6 (2018): 4428-4440.&lt;br /&gt;
* Riot-OS Setup (ELVIS Wiki): https://wiki.elvis.science/index.php?title=Riot-OS_Setup&lt;br /&gt;
** RIOT-OS+SAMR21 Setup (CoMatrix): https://comatrix.eu/setup/samr21_and_RIOT-OS/&lt;br /&gt;
* RIOT-OS Github repository: https://github.com/RIOT-OS/RIOT&lt;br /&gt;
** Examples: https://github.com/RIOT-OS/RIOT/tree/master/examples&lt;br /&gt;
** Tests: https://github.com/RIOT-OS/RIOT/tree/master/tests&lt;br /&gt;
* Getting Started: https://doc.riot-os.org/getting-started.html&lt;br /&gt;
** Introduction: https://github.com/RIOT-OS/RIOT/wiki/Introduction&lt;br /&gt;
** Changelog/Release Notes: https://doc.riot-os.org/changelog.html&lt;br /&gt;
** Use Docker to build RIOT:&lt;br /&gt;
*** https://doc.riot-os.org/getting-started.html#docker&lt;br /&gt;
*** https://doc.riot-os.org/build-in-docker.html&lt;br /&gt;
*** Podman: https://github.com/RIOT-OS/RIOT/pull/18671&lt;br /&gt;
* API documentation: https://doc.riot-os.org/&lt;br /&gt;
* Wiki: https://github.com/RIOT-OS/RIOT/wiki&lt;br /&gt;
** FAQ: https://github.com/RIOT-OS/RIOT/wiki/FAQ&lt;br /&gt;
** Best Practice for RIOT Programming: https://github.com/RIOT-OS/RIOT/wiki/Best-Practice-for-RIOT-Programming&lt;br /&gt;
* Tutorials: https://github.com/RIOT-OS/Tutorials&lt;br /&gt;
** RIOT online course: https://github.com/RIOT-OS/riot-course&lt;br /&gt;
** RIOT Beginner Tutorial - RIOT Summit 2021: https://riot-os.github.io/riot-course/slides/tutorial-summit-networking/&lt;br /&gt;
** Networking in RIOT: https://riot-os.github.io/riot-course/slides/04-networking-in-riot/&lt;br /&gt;
** RIOT Tutorial - IoT Security with Microcontrollers: https://riot-os.github.io/riot-course/slides/tutorial-summit-security&lt;br /&gt;
* Forum: https://forum.riot-os.org/&lt;br /&gt;
** Matrix Channel: https://matrix.to/#/#riot-os:matrix.org&lt;br /&gt;
* ... and slides from Silvie&lt;br /&gt;
* pyterm is an alternative to Moserial&lt;br /&gt;
** i.e. implicit use with &amp;lt;code&amp;gt;make BOARD=samr21-xpro term&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;make list-ttys&amp;lt;/code&amp;gt;: returns the list of serial ports available with information on the board connected (useful when working with multiple boards)&lt;br /&gt;
** afterwards e.g. &amp;lt;code&amp;gt;make term SERIAL=&amp;quot;1232135328821&amp;quot;`&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;make debug&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Remember that the examples directory is very helpful - as well as the test directories :)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki&lt;br /&gt;
* http://riot-os.org/api&lt;br /&gt;
* https://github.com/RIOT-OS/Tutorials&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12820</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12820"/>
		<updated>2023-11-28T14:01:18Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
&lt;br /&gt;
== Setup/Config 802.15.4/6LoWPAN on a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Configure the default PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Configure the default channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ip link set lowpan0 down&lt;br /&gt;
 ip link set wpan0 down&lt;br /&gt;
 iwpan phy phy0 set channel 0 26 # same network ID and channel as RIOT default&lt;br /&gt;
 iwpan dev wpan0 set pan_id 0x23 # same network ID and channel as RIOT default&lt;br /&gt;
 ip link add link wpan0 name lowpan0 type lowpan&lt;br /&gt;
 ip link set wpan0 up&lt;br /&gt;
 ip link set lowpan0 up&lt;br /&gt;
&lt;br /&gt;
* Afterwards the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on Raspberry has a link-local IPv6 address:&lt;br /&gt;
&lt;br /&gt;
 root@raspberrypi:~# ip a&lt;br /&gt;
 1: lo: [...]&lt;br /&gt;
 2: eth0: [...]&lt;br /&gt;
 3: wlan0: [...]&lt;br /&gt;
 4: wpan0: &amp;lt;BROADCAST,NOARP,UP,LOWER_UP&amp;gt; mtu 123 qdisc pfifo_fast state UNKNOWN group default qlen 300&lt;br /&gt;
    link/ieee802.15.4 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
 5: lowpan0@wpan0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1000&lt;br /&gt;
    link/6lowpan 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet6 fe80::343a:7cc:6541:2b31/64 scope link&lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE/CAUTION: Every reboot changes the link-local IPv6 address of the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on the Raspberry!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See [[#PERSISTENT wpan0 and lowpan0 configuration]] to configure a persistent link-local address.&lt;br /&gt;
&lt;br /&gt;
There are also scripts available to create/delete a lowpan interface (or to create/delete a monitor interface): https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
=== PERSISTENT wpan0 and lowpan0 configuration ===&lt;br /&gt;
&lt;br /&gt;
With static long hardware address and static link-local IPv6 address (to avoid a random link-local IPv6 address on each reboot).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Persistent WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Clone riot-makers/wpan-raspbian GitHub repo:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/riot-makers/wpan-raspbian&lt;br /&gt;
 cd wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
* Copy some helper (shell) scripts to a well-known location:&lt;br /&gt;
&lt;br /&gt;
 sudo cp -r usr/local/sbin/* /usr/local/sbin/.&lt;br /&gt;
 sudo chmod +x /usr/local/sbin/*&lt;br /&gt;
&lt;br /&gt;
* Afterwards copy files for systemd integration:&lt;br /&gt;
&lt;br /&gt;
 sudo cp etc/default/lowpan /etc/default/.&lt;br /&gt;
 sudo cp etc/systemd/system/lowpan.service /etc/systemd/system/.&lt;br /&gt;
&lt;br /&gt;
* Modify 802.15.4 channel ID and PAN ID in &amp;lt;code&amp;gt;/etc/default/lowpan&amp;lt;/code&amp;gt; as needed:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/default/lowpan&lt;br /&gt;
 CHN=&amp;quot;13&amp;quot;&lt;br /&gt;
 PAN=&amp;quot;0xbeef&amp;quot;&lt;br /&gt;
 # set MAC to &amp;quot;&amp;quot; for random mac/hw address&lt;br /&gt;
 MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&lt;br /&gt;
 # set IPv6 to &amp;quot;&amp;quot; if not required; note: set a prefix length&lt;br /&gt;
 #IP6=&amp;quot;fdaa:bb:cc:dd::1/64&amp;quot;&lt;br /&gt;
 # Set ACK requests (Only enable if all devices on your PAN support ACKs)&lt;br /&gt;
 ACKREQ=0&lt;br /&gt;
&lt;br /&gt;
Note: &amp;lt;code&amp;gt;MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&amp;lt;/code&amp;gt; was taken from https://jan.newmarch.name/IoT/LinuxJournal/Routing/, this results in a link-local address of &amp;lt;code&amp;gt;fe80::1&amp;lt;/code&amp;gt; for the Raspberry.&lt;br /&gt;
&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;lowpan.service&amp;lt;/code&amp;gt; autostart, start 6LoWPAN service and verification:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl enable lowpan.service&lt;br /&gt;
 sudo systemctl start lowpan.service&lt;br /&gt;
 ifconfig&lt;br /&gt;
 lowpan0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 1280&lt;br /&gt;
    inet6 fe80::1  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;&lt;br /&gt;
    unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)&lt;br /&gt;
    RX packets 0  bytes 0 (0.0 B)&lt;br /&gt;
    RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
    TX packets 19  bytes 2114 (2.0 KiB)&lt;br /&gt;
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
 wpan0: flags=195&amp;lt;UP,BROADCAST,RUNNING,NOARP&amp;gt;  mtu 123&lt;br /&gt;
        unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 300  (UNSPEC)&lt;br /&gt;
        RX packets 72  bytes 2016 (1.9 KiB)&lt;br /&gt;
        RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
        TX packets 74  bytes 5320 (5.1 KiB)&lt;br /&gt;
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
&lt;br /&gt;
== Verification of 6LoWPAN connectivity between a Raspberry and a SAMR21-xpro == &lt;br /&gt;
&lt;br /&gt;
* Use RIOT&#039;s gnrc_networking example and build it for the SAMR21-xpro board, flash the firmware to the SAMR21-xpro and connect via &amp;lt;code&amp;gt;pyterm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 cd RIOT/examples/gnrc_networking&lt;br /&gt;
 make BOARD=samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro flash&lt;br /&gt;
 make BOARD=samr21-xpro term&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; to determine the 802.15.4/6LoWPAN interface ID of SAMR21-xpro (&amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt; in this case):&lt;br /&gt;
&lt;br /&gt;
 ifconfig&lt;br /&gt;
 # Iface  7  HWaddr: 57:98  Channel: 26  Page: 0  NID: 0x23  PHY: O-QPSK&lt;br /&gt;
 [...]&lt;br /&gt;
 #           Long HWaddr: E2:F9:02:0F:36:26:A2:68&lt;br /&gt;
 [...]&lt;br /&gt;
 #           inet6 addr: fe80::e0f9:20f:3626:a268  scope: link  VAL&lt;br /&gt;
&lt;br /&gt;
* Note: All &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; config options can be shown with &amp;lt;code&amp;gt;ifconfig &amp;lt;interface id&amp;gt; set&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* RIOT-OS default 802.15.4 channel is 26 and default  PAN ID 0x23. If you change them, make sure to change them in the SAMR21-xpro configuration aswell:&lt;br /&gt;
** [optional] Change the channel to 13 and the PAN ID to 0xbeef (see [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|RIOT-OS and IEEE 802.15.4 / 6LoWPAN]] for more information):&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 13&lt;br /&gt;
&lt;br /&gt;
=== Ping test from Raspberry to SAMR21-xpro ===&lt;br /&gt;
&lt;br /&gt;
* Multicast ping test through interface &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; to group &amp;lt;code&amp;gt;ff02::1&amp;lt;/code&amp;gt; (all nodes in the link-local):&lt;br /&gt;
&lt;br /&gt;
 ping ff02::1%lowpan0        &lt;br /&gt;
 PING ff02::1%lowpan0(ff02::1%lowpan0) 56 data bytes&lt;br /&gt;
 64 bytes from fe80::1%lowpan0: icmp_seq=1 ttl=64 time=0.195 ms&lt;br /&gt;
 64 bytes from fe80::e0f9:20f:3626:a268%lowpan0: icmp_seq=1 ttl=64 time=10.4 ms (DUP!)&lt;br /&gt;
&lt;br /&gt;
* Unicast ping (change to link-local IPv6 address of your SAMR21-xpro):&lt;br /&gt;
&lt;br /&gt;
 ping fe80::e0f9:20f:3626:a268%lowpan0&lt;br /&gt;
 ping fe80::e0f9:20f:3626:a268%lowpan0&lt;br /&gt;
 PING fe80::e0f9:20f:3626:a268%lowpan0(fe80::e0f9:20f:3626:a268%lowpan0) 56 data bytes&lt;br /&gt;
 64 bytes from fe80::e0f9:20f:3626:a268%lowpan0: icmp_seq=1 ttl=64 time=23.0 ms&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
=== Ping test from SAMR21-xpro to Raspberry ===&lt;br /&gt;
&lt;br /&gt;
* Multicast ping test through interface 7 to group ff02::1:&lt;br /&gt;
&lt;br /&gt;
 # ping6 ff02::1%7&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=0 ttl=64 rssi=-61 dBm time=8.309 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=1 ttl=64 rssi=-61 dBm time=6.124 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=2 ttl=64 rssi=-59 dBm time=6.461 ms&lt;br /&gt;
 #&lt;br /&gt;
 # --- ff02::1 PING statistics ---&lt;br /&gt;
 # 3 packets transmitted, 3 packets received, 0% packet loss&lt;br /&gt;
 # round-trip min/avg/max = 6.124/6.964/8.309 ms&lt;br /&gt;
&lt;br /&gt;
* Unicast ping from SAMR21-xpro to Raspberry 6LoWPAN interface:&lt;br /&gt;
&lt;br /&gt;
 # ping6 fe80::1%7&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=0 ttl=64 rssi=-61 dBm time=8.467 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=1 ttl=64 rssi=-61 dBm time=7.966 ms&lt;br /&gt;
&lt;br /&gt;
== Test CoAP communication between Raspberry and SAMR21-xpro ==&lt;br /&gt;
&lt;br /&gt;
* Install &amp;lt;code&amp;gt;python3-pip&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;aiocoap&amp;lt;/code&amp;gt; on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install python3-pip&lt;br /&gt;
 pip3 install --upgrade &amp;quot;aiocoap[all]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Clone &amp;lt;code&amp;gt;aiocoap&amp;lt;/code&amp;gt; repo and start the included simple CoAP server:&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/chrysn/aiocoap.git&lt;br /&gt;
 cd aiocoap&lt;br /&gt;
 python3 server.py&lt;br /&gt;
&lt;br /&gt;
* Use gcoap example on SAMR21-xpro (RIOT-OS repo already cloned):&lt;br /&gt;
&lt;br /&gt;
 cd ~/RIOT/example/gcoap&lt;br /&gt;
 make BOARD=samr21-xpro         //build gcoap example&lt;br /&gt;
 make BOARD=samr21-xpro flash       //flah gcoap to samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro term     //start pyterm&lt;br /&gt;
&lt;br /&gt;
* [optional] Reset SAMR21-xpro and change 6LoWPAN settings:&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 13&lt;br /&gt;
&lt;br /&gt;
* Send a CoAP request to the CoAP server:&lt;br /&gt;
&lt;br /&gt;
coap put [fe80::1%7] 5683 /send test&lt;br /&gt;
&lt;br /&gt;
== Possible Problems with 6LoWPAN, SAMR21-xpro and Raspberry Pi (with Openlabs 802.15.4 radio) ==&lt;br /&gt;
&lt;br /&gt;
* 6LoWPAN: RIOT does not receive packets from Linux when short_addr is set #11033&lt;br /&gt;
** GitHub issue: https://github.com/RIOT-OS/RIOT/issues/11033&lt;br /&gt;
** By default this is not set (i.e. in RIOT gnrc_networking example!)&lt;br /&gt;
* &#039;&#039;&#039;Do not use Raspberry Pi 4 with OpenLabs 802.15.4 radio module:&#039;&#039;&#039;&lt;br /&gt;
** At least with the newest available Kernel (i.e. 5.10 during our tests) it was &#039;&#039;&#039;only possible to send&#039;&#039;&#039; 802.15.4 packets to SAMR21-xpro and the Raspberry &#039;&#039;&#039;did not receive&#039;&#039;&#039; any packets from SAMR21-xpro.&lt;br /&gt;
** It is better to use a Raspberry Pi 3B(+)&lt;br /&gt;
*** Successfully tested with Raspbian 9 (Stretch), Raspbian 10 (Buster) and Raspbian 11 (Bullseye)&lt;br /&gt;
* Monitoring 802.15.4/6LoWPAN traffic: Correct channel ID must be set (RIOT-OS default: 26)&lt;br /&gt;
* Communication SAMR21-xpro&amp;lt;-&amp;gt;Raspberry: The same channel ID (RIOT-OS default: 26) and PAN ID need to be set (RIOT-OS default: 0x23)&lt;br /&gt;
&lt;br /&gt;
== TODO: Monitoring/Sniffing 802.15.4/6LoWPAN radio with a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
* SAMR21-xpro: [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* Documentation was (mostly) created based on our CoMatrix project: https://comatrix.eu&lt;br /&gt;
* [[Riot-OS_Setup|Wiki: Riot-OS Setup]]&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|Wiki: RIOT-OS and IEEE 802.15.4 / 6LoWPAN]]&lt;br /&gt;
* Linux WPAN Tools: https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
* Python CoAP implementation/library: https://github.com/chrysn/aiocoap&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://linux-wpan.org/documentation.html&lt;br /&gt;
* https://www.linuxjournal.com/content/low-power-wireless-6lowpan-ieee802154-and-raspberry-pi&lt;br /&gt;
* http://morschi.com/2017/04/05/hands-on-riot-6lowpan/&lt;br /&gt;
&lt;br /&gt;
=== Persistent WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
* https://jan.newmarch.name/IoT/LinuxJournal/Routing/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12819</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12819"/>
		<updated>2023-11-28T13:59:07Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
&lt;br /&gt;
== Setup/Config 802.15.4/6LoWPAN on a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Configure the default PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Configure the default channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ip link set lowpan0 down&lt;br /&gt;
 ip link set wpan0 down&lt;br /&gt;
 iwpan phy phy0 set channel 0 26 # same network ID and channel as RIOT default&lt;br /&gt;
 iwpan dev wpan0 set pan_id 0x23 # same network ID and channel as RIOT default&lt;br /&gt;
 ip link add link wpan0 name lowpan0 type lowpan&lt;br /&gt;
 ip link set wpan0 up&lt;br /&gt;
 ip link set lowpan0 up&lt;br /&gt;
&lt;br /&gt;
* Afterwards the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on Raspberry has a link-local IPv6 address:&lt;br /&gt;
&lt;br /&gt;
 root@raspberrypi:~# ip a&lt;br /&gt;
 1: lo: [...]&lt;br /&gt;
 2: eth0: [...]&lt;br /&gt;
 3: wlan0: [...]&lt;br /&gt;
 4: wpan0: &amp;lt;BROADCAST,NOARP,UP,LOWER_UP&amp;gt; mtu 123 qdisc pfifo_fast state UNKNOWN group default qlen 300&lt;br /&gt;
    link/ieee802.15.4 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
 5: lowpan0@wpan0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1000&lt;br /&gt;
    link/6lowpan 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet6 fe80::343a:7cc:6541:2b31/64 scope link&lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE/CAUTION: Every reboot changes the link-local IPv6 address of the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on the Raspberry!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See [[#PERSISTENT wpan0 and lowpan0 configuration]] to configure a persistent link-local address.&lt;br /&gt;
&lt;br /&gt;
There are also scripts available to create/delete a lowpan interface (or to create/delete a monitor interface): https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
=== PERSISTENT wpan0 and lowpan0 configuration ===&lt;br /&gt;
&lt;br /&gt;
With static long hardware address and static link-local IPv6 address (to avoid a random link-local IPv6 address on each reboot).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Persistent WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Clone riot-makers/wpan-raspbian GitHub repo:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/riot-makers/wpan-raspbian&lt;br /&gt;
 cd wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
* Copy some helper (shell) scripts to a well-known location:&lt;br /&gt;
&lt;br /&gt;
 sudo cp -r usr/local/sbin/* /usr/local/sbin/.&lt;br /&gt;
 sudo chmod +x /usr/local/sbin/*&lt;br /&gt;
&lt;br /&gt;
* Afterwards copy files for systemd integration:&lt;br /&gt;
&lt;br /&gt;
 sudo cp etc/default/lowpan /etc/default/.&lt;br /&gt;
 sudo cp etc/systemd/system/lowpan.service /etc/systemd/system/.&lt;br /&gt;
&lt;br /&gt;
* Modify 802.15.4 channel ID and PAN ID in &amp;lt;code&amp;gt;/etc/default/lowpan&amp;lt;/code&amp;gt; as needed:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/default/lowpan&lt;br /&gt;
 CHN=&amp;quot;13&amp;quot;&lt;br /&gt;
 PAN=&amp;quot;0xbeef&amp;quot;&lt;br /&gt;
 # set MAC to &amp;quot;&amp;quot; for random mac/hw address&lt;br /&gt;
 MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&lt;br /&gt;
 # set IPv6 to &amp;quot;&amp;quot; if not required; note: set a prefix length&lt;br /&gt;
 #IP6=&amp;quot;fdaa:bb:cc:dd::1/64&amp;quot;&lt;br /&gt;
 # Set ACK requests (Only enable if all devices on your PAN support ACKs)&lt;br /&gt;
 ACKREQ=0&lt;br /&gt;
&lt;br /&gt;
Note: &amp;lt;code&amp;gt;MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&amp;lt;/code&amp;gt; was taken from https://jan.newmarch.name/IoT/LinuxJournal/Routing/, this results in a link-local address of &amp;lt;code&amp;gt;fe80::1&amp;lt;/code&amp;gt; for the Raspberry.&lt;br /&gt;
&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;lowpan.service&amp;lt;/code&amp;gt; autostart, start 6LoWPAN service and verification:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl enable lowpan.service&lt;br /&gt;
 sudo systemctl start lowpan.service&lt;br /&gt;
 ifconfig&lt;br /&gt;
 lowpan0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 1280&lt;br /&gt;
    inet6 fe80::1  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;&lt;br /&gt;
    unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)&lt;br /&gt;
    RX packets 0  bytes 0 (0.0 B)&lt;br /&gt;
    RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
    TX packets 19  bytes 2114 (2.0 KiB)&lt;br /&gt;
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
 wpan0: flags=195&amp;lt;UP,BROADCAST,RUNNING,NOARP&amp;gt;  mtu 123&lt;br /&gt;
        unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 300  (UNSPEC)&lt;br /&gt;
        RX packets 72  bytes 2016 (1.9 KiB)&lt;br /&gt;
        RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
        TX packets 74  bytes 5320 (5.1 KiB)&lt;br /&gt;
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
&lt;br /&gt;
== Verification of 6LoWPAN connectivity between a Raspberry and a SAMR21-xpro == &lt;br /&gt;
&lt;br /&gt;
* Use RIOT&#039;s gnrc_networking example and build it for the SAMR21-xpro board, flash the firmware to the SAMR21-xpro and connect via &amp;lt;code&amp;gt;pyterm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 cd RIOT/examples/gnrc_networking&lt;br /&gt;
 make BOARD=samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro flash&lt;br /&gt;
 make BOARD=samr21-xpro term&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; to determine the 802.15.4/6LoWPAN interface ID of SAMR21-xpro (&amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt; in this case):&lt;br /&gt;
&lt;br /&gt;
 ifconfig&lt;br /&gt;
 # Iface  7  HWaddr: 57:98  Channel: 26  Page: 0  NID: 0x23  PHY: O-QPSK&lt;br /&gt;
 [...]&lt;br /&gt;
 #           Long HWaddr: E2:F9:02:0F:36:26:A2:68&lt;br /&gt;
 [...]&lt;br /&gt;
 #           inet6 addr: fe80::e0f9:20f:3626:a268  scope: link  VAL&lt;br /&gt;
&lt;br /&gt;
* Note: All &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; config options can be shown with &amp;lt;code&amp;gt;ifconfig &amp;lt;interface id&amp;gt; set&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* RIOT-OS default 802.15.4 channel is 26 and default  PAN ID 0x23. If you change them, make sure to change them in the SAMR21-xpro configuration aswell:&lt;br /&gt;
** [optional] Change the channel to 13 and the PAN ID to 0xbeef (see [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|RIOT-OS and IEEE 802.15.4 / 6LoWPAN]] for more information):&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 13&lt;br /&gt;
&lt;br /&gt;
=== Ping test from Raspberry to SAMR21-xpro ===&lt;br /&gt;
&lt;br /&gt;
* Multicast ping test through interface &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; to group &amp;lt;code&amp;gt;ff02::1&amp;lt;/code&amp;gt; (all nodes in the link-local):&lt;br /&gt;
&lt;br /&gt;
 ping ff02::1%lowpan0        &lt;br /&gt;
 PING ff02::1%lowpan0(ff02::1%lowpan0) 56 data bytes&lt;br /&gt;
 64 bytes from fe80::1%lowpan0: icmp_seq=1 ttl=64 time=0.195 ms&lt;br /&gt;
 64 bytes from fe80::e0f9:20f:3626:a268%lowpan0: icmp_seq=1 ttl=64 time=10.4 ms (DUP!)&lt;br /&gt;
&lt;br /&gt;
* Unicast ping (change to link-local IPv6 address of your SAMR21-xpro):&lt;br /&gt;
&lt;br /&gt;
 ping fe80::e0f9:20f:3626:a268%lowpan0&lt;br /&gt;
 ping fe80::e0f9:20f:3626:a268%lowpan0&lt;br /&gt;
 PING fe80::e0f9:20f:3626:a268%lowpan0(fe80::e0f9:20f:3626:a268%lowpan0) 56 data bytes&lt;br /&gt;
 64 bytes from fe80::e0f9:20f:3626:a268%lowpan0: icmp_seq=1 ttl=64 time=23.0 ms&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
=== Ping test from SAMR21-xpro to Raspberry ===&lt;br /&gt;
&lt;br /&gt;
* Multicast ping test through interface 7 to group ff02::1:&lt;br /&gt;
&lt;br /&gt;
 # ping6 ff02::1%7&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=0 ttl=64 rssi=-61 dBm time=8.309 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=1 ttl=64 rssi=-61 dBm time=6.124 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=2 ttl=64 rssi=-59 dBm time=6.461 ms&lt;br /&gt;
 #&lt;br /&gt;
 # --- ff02::1 PING statistics ---&lt;br /&gt;
 # 3 packets transmitted, 3 packets received, 0% packet loss&lt;br /&gt;
 # round-trip min/avg/max = 6.124/6.964/8.309 ms&lt;br /&gt;
&lt;br /&gt;
* Unicast ping from SAMR21-xpro to Raspberry 6LoWPAN interface:&lt;br /&gt;
&lt;br /&gt;
 # ping6 fe80::1%7&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=0 ttl=64 rssi=-61 dBm time=8.467 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=1 ttl=64 rssi=-61 dBm time=7.966 ms&lt;br /&gt;
&lt;br /&gt;
== Test CoAP communication between Raspberry and SAMR21-xpro ==&lt;br /&gt;
&lt;br /&gt;
* Install &amp;lt;code&amp;gt;python3-pip&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;aiocoap&amp;lt;/code&amp;gt; on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install python3-pip&lt;br /&gt;
 pip3 install --upgrade &amp;quot;aiocoap[all]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Clone &amp;lt;code&amp;gt;aiocoap&amp;lt;/code&amp;gt; repo and start the included simple CoAP server:&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/chrysn/aiocoap.git&lt;br /&gt;
 cd aiocoap&lt;br /&gt;
 python3 server.py&lt;br /&gt;
&lt;br /&gt;
* Use gcoap example on SAMR21-xpro (RIOT-OS repo already cloned):&lt;br /&gt;
&lt;br /&gt;
 cd ~/RIOT/example/gcoap&lt;br /&gt;
 make BOARD=samr21-xpro         //build gcoap example&lt;br /&gt;
 make BOARD=samr21-xpro flash       //flah gcoap to samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro term     //start pyterm&lt;br /&gt;
&lt;br /&gt;
* [optional] Reset SAMR21-xpro and change 6LoWPAN settings:&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 13&lt;br /&gt;
&lt;br /&gt;
* Send a CoAP request to the CoAP server:&lt;br /&gt;
&lt;br /&gt;
coap put [fe80::1%7] 5683 /send test&lt;br /&gt;
&lt;br /&gt;
== Possible Problems with 6LoWPAN, SAMR21-xpro and Raspberry Pi (with Openlabs 802.15.4 radio) ==&lt;br /&gt;
&lt;br /&gt;
* 6LoWPAN: RIOT does not receive packets from Linux when short_addr is set #11033&lt;br /&gt;
** GitHub issue: https://github.com/RIOT-OS/RIOT/issues/11033&lt;br /&gt;
** By default this is not set (i.e. in RIOT gnrc_networking example!)&lt;br /&gt;
* &#039;&#039;&#039;Do not use Raspberry Pi 4 with OpenLabs 802.15.4 radio module:&#039;&#039;&#039;&lt;br /&gt;
** At least with the newest available Kernel (i.e. 5.10 during our tests) it was &#039;&#039;&#039;only possible to send&#039;&#039;&#039; 802.15.4 packets to SAMR21-xpro and the Raspberry &#039;&#039;&#039;did not receive&#039;&#039;&#039; any packets from SAMR21-xpro.&lt;br /&gt;
** It is better to use a Raspberry Pi 3B(+)&lt;br /&gt;
*** Successfully tested with Raspbian 9 (Stretch), Raspbian 10 (Buster) and Raspbian 11 (Bullseye)&lt;br /&gt;
* Monitoring 802.15.4/6LoWPAN traffic: Correct channel ID must be set (RIOT-OS default: 26)&lt;br /&gt;
* Communication SAMR21-xpro&amp;lt;-&amp;gt;Raspberry: The same channel ID (RIOT-OS default: 26) and PAN ID need to be set (RIOT-OS default: 0x23)&lt;br /&gt;
&lt;br /&gt;
== TODO: Monitoring/Sniffing 802.15.4/6LoWPAN radio with a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
* SAMR21-xpro: [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [[Riot-OS_Setup|Wiki: Riot-OS Setup]]&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|Wiki: RIOT-OS and IEEE 802.15.4 / 6LoWPAN]]&lt;br /&gt;
* Linux WPAN Tools: https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
* Python CoAP implementation/library: https://github.com/chrysn/aiocoap&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://linux-wpan.org/documentation.html&lt;br /&gt;
* https://www.linuxjournal.com/content/low-power-wireless-6lowpan-ieee802154-and-raspberry-pi&lt;br /&gt;
* http://morschi.com/2017/04/05/hands-on-riot-6lowpan/&lt;br /&gt;
&lt;br /&gt;
=== Persistent WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
* https://jan.newmarch.name/IoT/LinuxJournal/Routing/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12818</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12818"/>
		<updated>2023-11-28T13:56:37Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
&lt;br /&gt;
== Setup/Config 802.15.4/6LoWPAN on a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Configure the default PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Configure the default channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ip link set lowpan0 down&lt;br /&gt;
 ip link set wpan0 down&lt;br /&gt;
 iwpan phy phy0 set channel 0 26 # same network ID and channel as RIOT default&lt;br /&gt;
 iwpan dev wpan0 set pan_id 0x23 # same network ID and channel as RIOT default&lt;br /&gt;
 ip link add link wpan0 name lowpan0 type lowpan&lt;br /&gt;
 ip link set wpan0 up&lt;br /&gt;
 ip link set lowpan0 up&lt;br /&gt;
&lt;br /&gt;
* Afterwards the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on Raspberry has a link-local IPv6 address:&lt;br /&gt;
&lt;br /&gt;
 root@raspberrypi:~# ip a&lt;br /&gt;
 1: lo: [...]&lt;br /&gt;
 2: eth0: [...]&lt;br /&gt;
 3: wlan0: [...]&lt;br /&gt;
 4: wpan0: &amp;lt;BROADCAST,NOARP,UP,LOWER_UP&amp;gt; mtu 123 qdisc pfifo_fast state UNKNOWN group default qlen 300&lt;br /&gt;
    link/ieee802.15.4 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
 5: lowpan0@wpan0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1000&lt;br /&gt;
    link/6lowpan 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet6 fe80::343a:7cc:6541:2b31/64 scope link&lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE/CAUTION: Every reboot changes the link-local IPv6 address of the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on the Raspberry!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See [[#PERSISTENT wpan0 and lowpan0 configuration]] to configure a persistent link-local address.&lt;br /&gt;
&lt;br /&gt;
There are also scripts available to create/delete a lowpan interface (or to create/delete a monitor interface): https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
=== PERSISTENT wpan0 and lowpan0 configuration ===&lt;br /&gt;
&lt;br /&gt;
With static long hardware address and static link-local IPv6 address (to avoid a random link-local IPv6 address on each reboot).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Persistent WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Clone riot-makers/wpan-raspbian GitHub repo:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/riot-makers/wpan-raspbian&lt;br /&gt;
 cd wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
* Copy some helper (shell) scripts to a well-known location:&lt;br /&gt;
&lt;br /&gt;
 sudo cp -r usr/local/sbin/* /usr/local/sbin/.&lt;br /&gt;
 sudo chmod +x /usr/local/sbin/*&lt;br /&gt;
&lt;br /&gt;
* Afterwards copy files for systemd integration:&lt;br /&gt;
&lt;br /&gt;
 sudo cp etc/default/lowpan /etc/default/.&lt;br /&gt;
 sudo cp etc/systemd/system/lowpan.service /etc/systemd/system/.&lt;br /&gt;
&lt;br /&gt;
* Modify 802.15.4 channel ID and PAN ID in &amp;lt;code&amp;gt;/etc/default/lowpan&amp;lt;/code&amp;gt; as needed:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/default/lowpan&lt;br /&gt;
 CHN=&amp;quot;13&amp;quot;&lt;br /&gt;
 PAN=&amp;quot;0xbeef&amp;quot;&lt;br /&gt;
 # set MAC to &amp;quot;&amp;quot; for random mac/hw address&lt;br /&gt;
 MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&lt;br /&gt;
 # set IPv6 to &amp;quot;&amp;quot; if not required; note: set a prefix length&lt;br /&gt;
 #IP6=&amp;quot;fdaa:bb:cc:dd::1/64&amp;quot;&lt;br /&gt;
 # Set ACK requests (Only enable if all devices on your PAN support ACKs)&lt;br /&gt;
 ACKREQ=0&lt;br /&gt;
&lt;br /&gt;
Note: &amp;lt;code&amp;gt;MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&amp;lt;/code&amp;gt; was taken from https://jan.newmarch.name/IoT/LinuxJournal/Routing/, this results in a link-local address of &amp;lt;code&amp;gt;fe80::1&amp;lt;/code&amp;gt; for the Raspberry.&lt;br /&gt;
&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;lowpan.service&amp;lt;/code&amp;gt; autostart, start 6LoWPAN service and verification:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl enable lowpan.service&lt;br /&gt;
 sudo systemctl start lowpan.service&lt;br /&gt;
 ifconfig&lt;br /&gt;
 lowpan0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 1280&lt;br /&gt;
    inet6 fe80::1  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;&lt;br /&gt;
    unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)&lt;br /&gt;
    RX packets 0  bytes 0 (0.0 B)&lt;br /&gt;
    RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
    TX packets 19  bytes 2114 (2.0 KiB)&lt;br /&gt;
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
 wpan0: flags=195&amp;lt;UP,BROADCAST,RUNNING,NOARP&amp;gt;  mtu 123&lt;br /&gt;
        unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 300  (UNSPEC)&lt;br /&gt;
        RX packets 72  bytes 2016 (1.9 KiB)&lt;br /&gt;
        RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
        TX packets 74  bytes 5320 (5.1 KiB)&lt;br /&gt;
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
&lt;br /&gt;
== Verification of 6LoWPAN connectivity between a Raspberry and a SAMR21-xpro == &lt;br /&gt;
&lt;br /&gt;
* Use RIOT&#039;s gnrc_networking example and build it for the SAMR21-xpro board, flash the firmware to the SAMR21-xpro and connect via &amp;lt;code&amp;gt;pyterm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 cd RIOT/examples/gnrc_networking&lt;br /&gt;
 make BOARD=samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro flash&lt;br /&gt;
 make BOARD=samr21-xpro term&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; to determine the 802.15.4/6LoWPAN interface ID of SAMR21-xpro (&amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt; in this case):&lt;br /&gt;
&lt;br /&gt;
 ifconfig&lt;br /&gt;
 # Iface  7  HWaddr: 57:98  Channel: 26  Page: 0  NID: 0x23  PHY: O-QPSK&lt;br /&gt;
 [...]&lt;br /&gt;
 #           Long HWaddr: E2:F9:02:0F:36:26:A2:68&lt;br /&gt;
 [...]&lt;br /&gt;
 #           inet6 addr: fe80::e0f9:20f:3626:a268  scope: link  VAL&lt;br /&gt;
&lt;br /&gt;
* Note: All &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; config options can be shown with &amp;lt;code&amp;gt;ifconfig &amp;lt;interface id&amp;gt; set&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* RIOT-OS default 802.15.4 channel is 26 and default  PAN ID 0x23. If you change them, make sure to change them in the SAMR21-xpro configuration aswell:&lt;br /&gt;
** [optional] Change the channel to 13 and the PAN ID to 0xbeef (see [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|RIOT-OS and IEEE 802.15.4 / 6LoWPAN]] for more information):&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 13&lt;br /&gt;
&lt;br /&gt;
=== Ping test from Raspberry to SAMR21-xpro ===&lt;br /&gt;
&lt;br /&gt;
* Multicast ping test through interface &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; to group &amp;lt;code&amp;gt;ff02::1&amp;lt;/code&amp;gt; (all nodes in the link-local):&lt;br /&gt;
&lt;br /&gt;
 ping ff02::1%lowpan0        &lt;br /&gt;
 PING ff02::1%lowpan0(ff02::1%lowpan0) 56 data bytes&lt;br /&gt;
 64 bytes from fe80::1%lowpan0: icmp_seq=1 ttl=64 time=0.195 ms&lt;br /&gt;
 64 bytes from fe80::e0f9:20f:3626:a268%lowpan0: icmp_seq=1 ttl=64 time=10.4 ms (DUP!)&lt;br /&gt;
&lt;br /&gt;
* Unicast ping (change to link-local IPv6 address of your SAMR21-xpro):&lt;br /&gt;
&lt;br /&gt;
 ping fe80::e0f9:20f:3626:a268%lowpan0&lt;br /&gt;
 ping fe80::e0f9:20f:3626:a268%lowpan0&lt;br /&gt;
 PING fe80::e0f9:20f:3626:a268%lowpan0(fe80::e0f9:20f:3626:a268%lowpan0) 56 data bytes&lt;br /&gt;
 64 bytes from fe80::e0f9:20f:3626:a268%lowpan0: icmp_seq=1 ttl=64 time=23.0 ms&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
=== Ping test from SAMR21-xpro to Raspberry ===&lt;br /&gt;
&lt;br /&gt;
* Multicast ping test through interface 7 to group ff02::1:&lt;br /&gt;
&lt;br /&gt;
 # ping6 ff02::1%7&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=0 ttl=64 rssi=-61 dBm time=8.309 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=1 ttl=64 rssi=-61 dBm time=6.124 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=2 ttl=64 rssi=-59 dBm time=6.461 ms&lt;br /&gt;
 #&lt;br /&gt;
 # --- ff02::1 PING statistics ---&lt;br /&gt;
 # 3 packets transmitted, 3 packets received, 0% packet loss&lt;br /&gt;
 # round-trip min/avg/max = 6.124/6.964/8.309 ms&lt;br /&gt;
&lt;br /&gt;
* Unicast ping from SAMR21-xpro to Raspberry 6LoWPAN interface:&lt;br /&gt;
&lt;br /&gt;
 # ping6 fe80::1%7&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=0 ttl=64 rssi=-61 dBm time=8.467 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=1 ttl=64 rssi=-61 dBm time=7.966 ms&lt;br /&gt;
&lt;br /&gt;
=== Test CoAP communication between Raspberry and SAMR21-xpro ===&lt;br /&gt;
&lt;br /&gt;
* Install &amp;lt;code&amp;gt;python3-pip&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;aiocoap&amp;lt;/code&amp;gt; on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install python3-pip&lt;br /&gt;
 pip3 install --upgrade &amp;quot;aiocoap[all]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Clone &amp;lt;code&amp;gt;aiocoap&amp;lt;/code&amp;gt; repo and start the included simple CoAP server:&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/chrysn/aiocoap.git&lt;br /&gt;
 cd aiocoap&lt;br /&gt;
 python3 server.py&lt;br /&gt;
&lt;br /&gt;
* Use gcoap example on SAMR21-xpro (RIOT-OS repo already cloned):&lt;br /&gt;
&lt;br /&gt;
 cd ~/RIOT/example/gcoap&lt;br /&gt;
 make BOARD=samr21-xpro         //build gcoap example&lt;br /&gt;
 make BOARD=samr21-xpro flash       //flah gcoap to samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro term     //start pyterm&lt;br /&gt;
&lt;br /&gt;
* [optional] Reset SAMR21-xpro and change 6LoWPAN settings:&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 13&lt;br /&gt;
&lt;br /&gt;
* Send a CoAP request to the CoAP server:&lt;br /&gt;
&lt;br /&gt;
coap put [fe80::1%7] 5683 /send test&lt;br /&gt;
&lt;br /&gt;
=== Possible Problems with 6LoWPAN, SAMR21-xpro and Raspberry Pi (with Openlabs 802.15.4 radio) ===&lt;br /&gt;
&lt;br /&gt;
* 6LoWPAN: RIOT does not receive packets from Linux when short_addr is set #11033&lt;br /&gt;
** GitHub issue: https://github.com/RIOT-OS/RIOT/issues/11033&lt;br /&gt;
** By default this is not set (i.e. in RIOT gnrc_networking example!)&lt;br /&gt;
* &#039;&#039;&#039;Do not use Raspberry Pi 4 with OpenLabs 802.15.4 radio module:&#039;&#039;&#039;&lt;br /&gt;
** At least with the newest available Kernel (i.e. 5.10 during our tests) it was &#039;&#039;&#039;only possible to send&#039;&#039;&#039; 802.15.4 packets to SAMR21-xpro and the Raspberry &#039;&#039;&#039;did not receive&#039;&#039;&#039; any packets from SAMR21-xpro.&lt;br /&gt;
** It is better to use a Raspberry Pi 3B(+)&lt;br /&gt;
*** Successfully tested with Raspbian 9 (Stretch), Raspbian 10 (Buster) and Raspbian 11 (Bullseye)&lt;br /&gt;
* Monitoring 802.15.4/6LoWPAN traffic: Correct channel ID must be set (RIOT-OS default: 26)&lt;br /&gt;
* Communication SAMR21-xpro&amp;lt;-&amp;gt;Raspberry: The same channel ID (RIOT-OS default: 26) and PAN ID need to be set (RIOT-OS default: 0x23)&lt;br /&gt;
&lt;br /&gt;
== TODO: Monitoring/Sniffing 802.15.4/6LoWPAN radio with a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
* SAMR21-xpro: [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|Wiki: RIOT-OS and IEEE 802.15.4 / 6LoWPAN]]&lt;br /&gt;
* https://github.com/chrysn/aiocoap&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://linux-wpan.org/documentation.html&lt;br /&gt;
* https://www.linuxjournal.com/content/low-power-wireless-6lowpan-ieee802154-and-raspberry-pi&lt;br /&gt;
* http://morschi.com/2017/04/05/hands-on-riot-6lowpan/&lt;br /&gt;
&lt;br /&gt;
=== Persistent WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
* https://jan.newmarch.name/IoT/LinuxJournal/Routing/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12817</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12817"/>
		<updated>2023-11-28T13:53:07Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
&lt;br /&gt;
== Setup/Config 802.15.4/6LoWPAN on a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Configure the default PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Configure the default channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ip link set lowpan0 down&lt;br /&gt;
 ip link set wpan0 down&lt;br /&gt;
 iwpan phy phy0 set channel 0 26 # same network ID and channel as RIOT default&lt;br /&gt;
 iwpan dev wpan0 set pan_id 0x23 # same network ID and channel as RIOT default&lt;br /&gt;
 ip link add link wpan0 name lowpan0 type lowpan&lt;br /&gt;
 ip link set wpan0 up&lt;br /&gt;
 ip link set lowpan0 up&lt;br /&gt;
&lt;br /&gt;
* Afterwards the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on Raspberry has a link-local IPv6 address:&lt;br /&gt;
&lt;br /&gt;
 root@raspberrypi:~# ip a&lt;br /&gt;
 1: lo: [...]&lt;br /&gt;
 2: eth0: [...]&lt;br /&gt;
 3: wlan0: [...]&lt;br /&gt;
 4: wpan0: &amp;lt;BROADCAST,NOARP,UP,LOWER_UP&amp;gt; mtu 123 qdisc pfifo_fast state UNKNOWN group default qlen 300&lt;br /&gt;
    link/ieee802.15.4 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
 5: lowpan0@wpan0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1000&lt;br /&gt;
    link/6lowpan 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet6 fe80::343a:7cc:6541:2b31/64 scope link&lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE/CAUTION: Every reboot changes the link-local IPv6 address of the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on the Raspberry!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See [[#PERSISTENT wpan0 and lowpan0 configuration]] to configure a persistent link-local address.&lt;br /&gt;
&lt;br /&gt;
There are also scripts available to create/delete a lowpan interface (or to create/delete a monitor interface): https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
=== PERSISTENT wpan0 and lowpan0 configuration ===&lt;br /&gt;
&lt;br /&gt;
With static long hardware address and static link-local IPv6 address (to avoid a random link-local IPv6 address on each reboot).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Persistent WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Clone riot-makers/wpan-raspbian GitHub repo:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/riot-makers/wpan-raspbian&lt;br /&gt;
 cd wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
* Copy some helper (shell) scripts to a well-known location:&lt;br /&gt;
&lt;br /&gt;
 sudo cp -r usr/local/sbin/* /usr/local/sbin/.&lt;br /&gt;
 sudo chmod +x /usr/local/sbin/*&lt;br /&gt;
&lt;br /&gt;
* Afterwards copy files for systemd integration:&lt;br /&gt;
&lt;br /&gt;
 sudo cp etc/default/lowpan /etc/default/.&lt;br /&gt;
 sudo cp etc/systemd/system/lowpan.service /etc/systemd/system/.&lt;br /&gt;
&lt;br /&gt;
* Modify 802.15.4 channel ID and PAN ID in &amp;lt;code&amp;gt;/etc/default/lowpan&amp;lt;/code&amp;gt; as needed:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/default/lowpan&lt;br /&gt;
 CHN=&amp;quot;13&amp;quot;&lt;br /&gt;
 PAN=&amp;quot;0xbeef&amp;quot;&lt;br /&gt;
 # set MAC to &amp;quot;&amp;quot; for random mac/hw address&lt;br /&gt;
 MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&lt;br /&gt;
 # set IPv6 to &amp;quot;&amp;quot; if not required; note: set a prefix length&lt;br /&gt;
 #IP6=&amp;quot;fdaa:bb:cc:dd::1/64&amp;quot;&lt;br /&gt;
 # Set ACK requests (Only enable if all devices on your PAN support ACKs)&lt;br /&gt;
 ACKREQ=0&lt;br /&gt;
&lt;br /&gt;
Note: &amp;lt;code&amp;gt;MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&amp;lt;/code&amp;gt; was taken from https://jan.newmarch.name/IoT/LinuxJournal/Routing/, this results in a link-local address of &amp;lt;code&amp;gt;fe80::1&amp;lt;/code&amp;gt; for the Raspberry.&lt;br /&gt;
&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;lowpan.service&amp;lt;/code&amp;gt; autostart, start 6LoWPAN service and verification:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl enable lowpan.service&lt;br /&gt;
 sudo systemctl start lowpan.service&lt;br /&gt;
 ifconfig&lt;br /&gt;
 lowpan0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 1280&lt;br /&gt;
    inet6 fe80::1  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;&lt;br /&gt;
    unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)&lt;br /&gt;
    RX packets 0  bytes 0 (0.0 B)&lt;br /&gt;
    RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
    TX packets 19  bytes 2114 (2.0 KiB)&lt;br /&gt;
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
 wpan0: flags=195&amp;lt;UP,BROADCAST,RUNNING,NOARP&amp;gt;  mtu 123&lt;br /&gt;
        unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 300  (UNSPEC)&lt;br /&gt;
        RX packets 72  bytes 2016 (1.9 KiB)&lt;br /&gt;
        RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
        TX packets 74  bytes 5320 (5.1 KiB)&lt;br /&gt;
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
&lt;br /&gt;
== Verification of 6LoWPAN connectivity between a Raspberry and a SAMR21-xpro == &lt;br /&gt;
&lt;br /&gt;
* Use RIOT&#039;s gnrc_networking example and build it for the SAMR21-xpro board, flash the firmware to the SAMR21-xpro and connect via &amp;lt;code&amp;gt;pyterm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 cd RIOT/examples/gnrc_networking&lt;br /&gt;
 make BOARD=samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro flash&lt;br /&gt;
 make BOARD=samr21-xpro term&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; to determine the 802.15.4/6LoWPAN interface ID of SAMR21-xpro (&amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt; in this case):&lt;br /&gt;
&lt;br /&gt;
 ifconfig&lt;br /&gt;
 # Iface  7  HWaddr: 57:98  Channel: 26  Page: 0  NID: 0x23  PHY: O-QPSK&lt;br /&gt;
 [...]&lt;br /&gt;
 #           Long HWaddr: E2:F9:02:0F:36:26:A2:68&lt;br /&gt;
 [...]&lt;br /&gt;
 #           inet6 addr: fe80::e0f9:20f:3626:a268  scope: link  VAL&lt;br /&gt;
&lt;br /&gt;
* Note: All &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; config options can be shown with &amp;lt;code&amp;gt;ifconfig &amp;lt;interface id&amp;gt; set&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* RIOT-OS default 802.15.4 channel is 26 and default  PAN ID 0x23. If you change them, make sure to change them in the SAMR21-xpro configuration aswell:&lt;br /&gt;
** [optional] Change the channel to 13 and the PAN ID to 0xbeef (see [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|RIOT-OS and IEEE 802.15.4 / 6LoWPAN]] for more information):&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 13&lt;br /&gt;
&lt;br /&gt;
=== Ping test from Raspberry to SAMR21-xpro ===&lt;br /&gt;
&lt;br /&gt;
* Multicast ping test through interface &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; to group &amp;lt;code&amp;gt;ff02::1&amp;lt;/code&amp;gt; (all nodes in the link-local):&lt;br /&gt;
&lt;br /&gt;
 ping ff02::1%lowpan0        &lt;br /&gt;
 PING ff02::1%lowpan0(ff02::1%lowpan0) 56 data bytes&lt;br /&gt;
 64 bytes from fe80::1%lowpan0: icmp_seq=1 ttl=64 time=0.195 ms&lt;br /&gt;
 64 bytes from fe80::e0f9:20f:3626:a268%lowpan0: icmp_seq=1 ttl=64 time=10.4 ms (DUP!)&lt;br /&gt;
&lt;br /&gt;
* Unicast ping (change to link-local IPv6 address of your SAMR21-xpro):&lt;br /&gt;
&lt;br /&gt;
 ping fe80::e0f9:20f:3626:a268%lowpan0&lt;br /&gt;
 ping fe80::e0f9:20f:3626:a268%lowpan0&lt;br /&gt;
 PING fe80::e0f9:20f:3626:a268%lowpan0(fe80::e0f9:20f:3626:a268%lowpan0) 56 data bytes&lt;br /&gt;
 64 bytes from fe80::e0f9:20f:3626:a268%lowpan0: icmp_seq=1 ttl=64 time=23.0 ms&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
=== Ping test from SAMR21-xpro to Raspberry ===&lt;br /&gt;
&lt;br /&gt;
* Multicast ping test through interface 7 to group ff02::1:&lt;br /&gt;
&lt;br /&gt;
 # ping6 ff02::1%7&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=0 ttl=64 rssi=-61 dBm time=8.309 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=1 ttl=64 rssi=-61 dBm time=6.124 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=2 ttl=64 rssi=-59 dBm time=6.461 ms&lt;br /&gt;
 #&lt;br /&gt;
 # --- ff02::1 PING statistics ---&lt;br /&gt;
 # 3 packets transmitted, 3 packets received, 0% packet loss&lt;br /&gt;
 # round-trip min/avg/max = 6.124/6.964/8.309 ms&lt;br /&gt;
&lt;br /&gt;
* Unicast ping from SAMR21-xpro to Raspberry 6LoWPAN interface:&lt;br /&gt;
&lt;br /&gt;
 # ping6 fe80::1%7&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=0 ttl=64 rssi=-61 dBm time=8.467 ms&lt;br /&gt;
 # 12 bytes from fe80::1%7: icmp_seq=1 ttl=64 rssi=-61 dBm time=7.966 ms&lt;br /&gt;
&lt;br /&gt;
=== Possible Problems with 6LoWPAN, SAMR21-xpro and Raspberry Pi (with Openlabs 802.15.4 radio) ===&lt;br /&gt;
&lt;br /&gt;
* 6LoWPAN: RIOT does not receive packets from Linux when short_addr is set #11033&lt;br /&gt;
** GitHub issue: https://github.com/RIOT-OS/RIOT/issues/11033&lt;br /&gt;
** By default this is not set (i.e. in RIOT gnrc_networking example!)&lt;br /&gt;
* &#039;&#039;&#039;Do not use Raspberry Pi 4 with OpenLabs 802.15.4 radio module:&#039;&#039;&#039;&lt;br /&gt;
** At least with the newest available Kernel (i.e. 5.10 during our tests) it was &#039;&#039;&#039;only possible to send&#039;&#039;&#039; 802.15.4 packets to SAMR21-xpro and the Raspberry &#039;&#039;&#039;did not receive&#039;&#039;&#039; any packets from SAMR21-xpro.&lt;br /&gt;
** It is better to use a Raspberry Pi 3B(+)&lt;br /&gt;
*** Successfully tested with Raspbian 9 (Stretch), Raspbian 10 (Buster) and Raspbian 11 (Bullseye)&lt;br /&gt;
* Monitoring 802.15.4/6LoWPAN traffic: Correct channel ID must be set (RIOT-OS default: 26)&lt;br /&gt;
* Communication SAMR21-xpro&amp;lt;-&amp;gt;Raspberry: The same channel ID (RIOT-OS default: 26) and PAN ID need to be set (RIOT-OS default: 0x23)&lt;br /&gt;
&lt;br /&gt;
== TODO: Monitoring/Sniffing 802.15.4/6LoWPAN radio with a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
* SAMR21-xpro: [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|Wiki: RIOT-OS and IEEE 802.15.4 / 6LoWPAN]]&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://linux-wpan.org/documentation.html&lt;br /&gt;
* https://www.linuxjournal.com/content/low-power-wireless-6lowpan-ieee802154-and-raspberry-pi&lt;br /&gt;
* http://morschi.com/2017/04/05/hands-on-riot-6lowpan/&lt;br /&gt;
&lt;br /&gt;
=== Persistent WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
* https://jan.newmarch.name/IoT/LinuxJournal/Routing/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12816</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12816"/>
		<updated>2023-11-28T13:44:10Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
&lt;br /&gt;
== Setup/Config 802.15.4/6LoWPAN on a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Configure the default PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Configure the default channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ip link set lowpan0 down&lt;br /&gt;
 ip link set wpan0 down&lt;br /&gt;
 iwpan phy phy0 set channel 0 26 # same network ID and channel as RIOT default&lt;br /&gt;
 iwpan dev wpan0 set pan_id 0x23 # same network ID and channel as RIOT default&lt;br /&gt;
 ip link add link wpan0 name lowpan0 type lowpan&lt;br /&gt;
 ip link set wpan0 up&lt;br /&gt;
 ip link set lowpan0 up&lt;br /&gt;
&lt;br /&gt;
* Afterwards the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on Raspberry has a link-local IPv6 address:&lt;br /&gt;
&lt;br /&gt;
 root@raspberrypi:~# ip a&lt;br /&gt;
 1: lo: [...]&lt;br /&gt;
 2: eth0: [...]&lt;br /&gt;
 3: wlan0: [...]&lt;br /&gt;
 4: wpan0: &amp;lt;BROADCAST,NOARP,UP,LOWER_UP&amp;gt; mtu 123 qdisc pfifo_fast state UNKNOWN group default qlen 300&lt;br /&gt;
    link/ieee802.15.4 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
 5: lowpan0@wpan0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1000&lt;br /&gt;
    link/6lowpan 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet6 fe80::343a:7cc:6541:2b31/64 scope link&lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE/CAUTION: Every reboot changes the link-local IPv6 address of the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on the Raspberry!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See [[#PERSISTENT wpan0 and lowpan0 configuration]] to configure a persistent link-local address.&lt;br /&gt;
&lt;br /&gt;
There are also scripts available to create/delete a lowpan interface (or to create/delete a monitor interface): https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
=== PERSISTENT wpan0 and lowpan0 configuration ===&lt;br /&gt;
&lt;br /&gt;
With static long hardware address and static link-local IPv6 address (to avoid a random link-local IPv6 address on each reboot).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Persistent WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Clone riot-makers/wpan-raspbian GitHub repo:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/riot-makers/wpan-raspbian&lt;br /&gt;
 cd wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
* Copy some helper (shell) scripts to a well-known location:&lt;br /&gt;
&lt;br /&gt;
 sudo cp -r usr/local/sbin/* /usr/local/sbin/.&lt;br /&gt;
 sudo chmod +x /usr/local/sbin/*&lt;br /&gt;
&lt;br /&gt;
* Afterwards copy files for systemd integration:&lt;br /&gt;
&lt;br /&gt;
 sudo cp etc/default/lowpan /etc/default/.&lt;br /&gt;
 sudo cp etc/systemd/system/lowpan.service /etc/systemd/system/.&lt;br /&gt;
&lt;br /&gt;
* Modify 802.15.4 channel ID and PAN ID in &amp;lt;code&amp;gt;/etc/default/lowpan&amp;lt;/code&amp;gt; as needed:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/default/lowpan&lt;br /&gt;
 CHN=&amp;quot;13&amp;quot;&lt;br /&gt;
 PAN=&amp;quot;0xbeef&amp;quot;&lt;br /&gt;
 # set MAC to &amp;quot;&amp;quot; for random mac/hw address&lt;br /&gt;
 MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&lt;br /&gt;
 # set IPv6 to &amp;quot;&amp;quot; if not required; note: set a prefix length&lt;br /&gt;
 #IP6=&amp;quot;fdaa:bb:cc:dd::1/64&amp;quot;&lt;br /&gt;
 # Set ACK requests (Only enable if all devices on your PAN support ACKs)&lt;br /&gt;
 ACKREQ=0&lt;br /&gt;
&lt;br /&gt;
Note: &amp;lt;code&amp;gt;MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&amp;lt;/code&amp;gt; was taken from https://jan.newmarch.name/IoT/LinuxJournal/Routing/, this results in a link-local address of &amp;lt;code&amp;gt;fe80::1&amp;lt;/code&amp;gt; for the Raspberry.&lt;br /&gt;
&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;lowpan.service&amp;lt;/code&amp;gt; autostart, start 6LoWPAN service and verification:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl enable lowpan.service&lt;br /&gt;
 sudo systemctl start lowpan.service&lt;br /&gt;
 ifconfig&lt;br /&gt;
 lowpan0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 1280&lt;br /&gt;
    inet6 fe80::1  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;&lt;br /&gt;
    unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)&lt;br /&gt;
    RX packets 0  bytes 0 (0.0 B)&lt;br /&gt;
    RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
    TX packets 19  bytes 2114 (2.0 KiB)&lt;br /&gt;
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
 wpan0: flags=195&amp;lt;UP,BROADCAST,RUNNING,NOARP&amp;gt;  mtu 123&lt;br /&gt;
        unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 300  (UNSPEC)&lt;br /&gt;
        RX packets 72  bytes 2016 (1.9 KiB)&lt;br /&gt;
        RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
        TX packets 74  bytes 5320 (5.1 KiB)&lt;br /&gt;
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
&lt;br /&gt;
== Verification of 6LoWPAN connectivity between a Raspberry and a SAMR21-xpro == &lt;br /&gt;
&lt;br /&gt;
* Use RIOT&#039;s gnrc_networking example and build it for the SAMR21-xpro board, flash the firmware to the SAMR21-xpro and connect via &amp;lt;code&amp;gt;pyterm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 cd RIOT/examples/gnrc_networking&lt;br /&gt;
 make BOARD=samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro flash&lt;br /&gt;
 make BOARD=samr21-xpro term&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; to determine the 802.15.4/6LoWPAN interface ID of SAMR21-xpro (&amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt; in this case):&lt;br /&gt;
&lt;br /&gt;
 ifconfig&lt;br /&gt;
 # Iface  7  HWaddr: 57:98  Channel: 26  Page: 0  NID: 0x23  PHY: O-QPSK&lt;br /&gt;
 [...]&lt;br /&gt;
 #           Long HWaddr: E2:F9:02:0F:36:26:A2:68&lt;br /&gt;
 [...]&lt;br /&gt;
 #           inet6 addr: fe80::e0f9:20f:3626:a268  scope: link  VAL&lt;br /&gt;
&lt;br /&gt;
* Note: All &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; config options can be shown with &amp;lt;code&amp;gt;ifconfig &amp;lt;interface id&amp;gt; set&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* RIOT-OS default 802.15.4 channel is 26 and default  PAN ID 0x23. If you change them, make sure to change them in the SAMR21-xpro configuration aswell:&lt;br /&gt;
** [optional] Change the channel to 13 and the PAN ID to 0xbeef (see [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|RIOT-OS and IEEE 802.15.4 / 6LoWPAN]] for more information):&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 13&lt;br /&gt;
&lt;br /&gt;
== TODO: Monitoring/Sniffing 802.15.4/6LoWPAN radio with a Raspberry ===&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
* SAMR21-xpro: [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|Wiki: RIOT-OS and IEEE 802.15.4 / 6LoWPAN]]&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://linux-wpan.org/documentation.html&lt;br /&gt;
* https://www.linuxjournal.com/content/low-power-wireless-6lowpan-ieee802154-and-raspberry-pi&lt;br /&gt;
* http://morschi.com/2017/04/05/hands-on-riot-6lowpan/&lt;br /&gt;
&lt;br /&gt;
=== Persistent WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
* https://jan.newmarch.name/IoT/LinuxJournal/Routing/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12815</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12815"/>
		<updated>2023-11-28T13:43:35Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
&lt;br /&gt;
== Setup/Config 802.15.4/6LoWPAN on a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Configure the default PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Configure the default channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ip link set lowpan0 down&lt;br /&gt;
 ip link set wpan0 down&lt;br /&gt;
 iwpan phy phy0 set channel 0 26 # same network ID and channel as RIOT default&lt;br /&gt;
 iwpan dev wpan0 set pan_id 0x23 # same network ID and channel as RIOT default&lt;br /&gt;
 ip link add link wpan0 name lowpan0 type lowpan&lt;br /&gt;
 ip link set wpan0 up&lt;br /&gt;
 ip link set lowpan0 up&lt;br /&gt;
&lt;br /&gt;
* Afterwards the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on Raspberry has a link-local IPv6 address:&lt;br /&gt;
&lt;br /&gt;
 root@raspberrypi:~# ip a&lt;br /&gt;
 1: lo: [...]&lt;br /&gt;
 2: eth0: [...]&lt;br /&gt;
 3: wlan0: [...]&lt;br /&gt;
 4: wpan0: &amp;lt;BROADCAST,NOARP,UP,LOWER_UP&amp;gt; mtu 123 qdisc pfifo_fast state UNKNOWN group default qlen 300&lt;br /&gt;
    link/ieee802.15.4 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
 5: lowpan0@wpan0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1000&lt;br /&gt;
    link/6lowpan 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet6 fe80::343a:7cc:6541:2b31/64 scope link&lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE/CAUTION: Every reboot changes the link-local IPv6 address of the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on the Raspberry!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See [[#PERSISTENT wpan0 and lowpan0 configuration]] to configure a persistent link-local address.&lt;br /&gt;
&lt;br /&gt;
There are also scripts available to create/delete a lowpan interface (or to create/delete a monitor interface): https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
=== PERSISTENT wpan0 and lowpan0 configuration ===&lt;br /&gt;
&lt;br /&gt;
With static long hardware address and static link-local IPv6 address (to avoid a random link-local IPv6 address on each reboot).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Persistent WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Clone riot-makers/wpan-raspbian GitHub repo:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/riot-makers/wpan-raspbian&lt;br /&gt;
 cd wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
* Copy some helper (shell) scripts to a well-known location:&lt;br /&gt;
&lt;br /&gt;
 sudo cp -r usr/local/sbin/* /usr/local/sbin/.&lt;br /&gt;
 sudo chmod +x /usr/local/sbin/*&lt;br /&gt;
&lt;br /&gt;
* Afterwards copy files for systemd integration:&lt;br /&gt;
&lt;br /&gt;
 sudo cp etc/default/lowpan /etc/default/.&lt;br /&gt;
 sudo cp etc/systemd/system/lowpan.service /etc/systemd/system/.&lt;br /&gt;
&lt;br /&gt;
* Modify 802.15.4 channel ID and PAN ID in &amp;lt;code&amp;gt;/etc/default/lowpan&amp;lt;/code&amp;gt; as needed:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/default/lowpan&lt;br /&gt;
 CHN=&amp;quot;13&amp;quot;&lt;br /&gt;
 PAN=&amp;quot;0xbeef&amp;quot;&lt;br /&gt;
 # set MAC to &amp;quot;&amp;quot; for random mac/hw address&lt;br /&gt;
 MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&lt;br /&gt;
 # set IPv6 to &amp;quot;&amp;quot; if not required; note: set a prefix length&lt;br /&gt;
 #IP6=&amp;quot;fdaa:bb:cc:dd::1/64&amp;quot;&lt;br /&gt;
 # Set ACK requests (Only enable if all devices on your PAN support ACKs)&lt;br /&gt;
 ACKREQ=0&lt;br /&gt;
&lt;br /&gt;
Note: &amp;lt;code&amp;gt;MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&amp;lt;/code&amp;gt; was taken from https://jan.newmarch.name/IoT/LinuxJournal/Routing/, this results in a link-local address of &amp;lt;code&amp;gt;fe80::1&amp;lt;/code&amp;gt; for the Raspberry.&lt;br /&gt;
&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;lowpan.service&amp;lt;/code&amp;gt; autostart, start 6LoWPAN service and verification:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl enable lowpan.service&lt;br /&gt;
 sudo systemctl start lowpan.service&lt;br /&gt;
 ifconfig&lt;br /&gt;
 lowpan0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 1280&lt;br /&gt;
    inet6 fe80::1  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;&lt;br /&gt;
    unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)&lt;br /&gt;
    RX packets 0  bytes 0 (0.0 B)&lt;br /&gt;
    RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
    TX packets 19  bytes 2114 (2.0 KiB)&lt;br /&gt;
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
 wpan0: flags=195&amp;lt;UP,BROADCAST,RUNNING,NOARP&amp;gt;  mtu 123&lt;br /&gt;
        unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 300  (UNSPEC)&lt;br /&gt;
        RX packets 72  bytes 2016 (1.9 KiB)&lt;br /&gt;
        RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
        TX packets 74  bytes 5320 (5.1 KiB)&lt;br /&gt;
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
&lt;br /&gt;
== Verification of 6LoWPAN connectivity between a Raspberry and a SAMR21-xpro == &lt;br /&gt;
&lt;br /&gt;
* Use RIOT&#039;s gnrc_networking example and build it for the SAMR21-xpro board, flash the firmware to the SAMR21-xpro and connect via &amp;lt;code&amp;gt;pyterm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 cd RIOT/examples/gnrc_networking&lt;br /&gt;
 make BOARD=samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro flash&lt;br /&gt;
 make BOARD=samr21-xpro term&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; to determine the 802.15.4/6LoWPAN interface ID of SAMR21-xpro (&amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt; in this case):&lt;br /&gt;
&lt;br /&gt;
 ifconfig&lt;br /&gt;
 # Iface  7  HWaddr: 57:98  Channel: 26  Page: 0  NID: 0x23  PHY: O-QPSK&lt;br /&gt;
 [...]&lt;br /&gt;
 #           Long HWaddr: E2:F9:02:0F:36:26:A2:68&lt;br /&gt;
 [...]&lt;br /&gt;
 #           inet6 addr: fe80::e0f9:20f:3626:a268  scope: link  VAL&lt;br /&gt;
&lt;br /&gt;
* Note: All &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; config options can be shown with &amp;lt;code&amp;gt;ifconfig &amp;lt;interface id&amp;gt; set&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* RIOT-OS default 802.15.4 channel is 26 and default  PAN ID 0x23. If you change them, make sure to change them in the SAMR21-xpro configuration aswell:&lt;br /&gt;
** [optional] Change the channel to 13 and the PAN ID to 0xbeef (see [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN|RIOT-OS and IEEE 802.15.4 / 6LoWPAN]] for more information):&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 13&lt;br /&gt;
&lt;br /&gt;
== TODO: Monitoring/Sniffing 802.15.4/6LoWPAN radio with a Raspberry ===&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional/alternatively (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module|Raspberry Pi 6LoWPAN SLIP radio module]]&lt;br /&gt;
* SAMR21-xpro: [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform|Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* [[RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN]]&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://linux-wpan.org/documentation.html&lt;br /&gt;
* https://www.linuxjournal.com/content/low-power-wireless-6lowpan-ieee802154-and-raspberry-pi&lt;br /&gt;
* http://morschi.com/2017/04/05/hands-on-riot-6lowpan/&lt;br /&gt;
&lt;br /&gt;
=== Persistent WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
* https://jan.newmarch.name/IoT/LinuxJournal/Routing/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12813</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12813"/>
		<updated>2023-11-28T13:39:41Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module]]&lt;br /&gt;
&lt;br /&gt;
== Setup/Config 802.15.4/6LoWPAN on a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Configure the default PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Configure the default channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ip link set lowpan0 down&lt;br /&gt;
 ip link set wpan0 down&lt;br /&gt;
 iwpan phy phy0 set channel 0 26 # same network ID and channel as RIOT default&lt;br /&gt;
 iwpan dev wpan0 set pan_id 0x23 # same network ID and channel as RIOT default&lt;br /&gt;
 ip link add link wpan0 name lowpan0 type lowpan&lt;br /&gt;
 ip link set wpan0 up&lt;br /&gt;
 ip link set lowpan0 up&lt;br /&gt;
&lt;br /&gt;
* Afterwards the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on Raspberry has a link-local IPv6 address:&lt;br /&gt;
&lt;br /&gt;
 root@raspberrypi:~# ip a&lt;br /&gt;
 1: lo: [...]&lt;br /&gt;
 2: eth0: [...]&lt;br /&gt;
 3: wlan0: [...]&lt;br /&gt;
 4: wpan0: &amp;lt;BROADCAST,NOARP,UP,LOWER_UP&amp;gt; mtu 123 qdisc pfifo_fast state UNKNOWN group default qlen 300&lt;br /&gt;
    link/ieee802.15.4 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
 5: lowpan0@wpan0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1000&lt;br /&gt;
    link/6lowpan 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet6 fe80::343a:7cc:6541:2b31/64 scope link&lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE/CAUTION: Every reboot changes the link-local IPv6 address of the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on the Raspberry!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See [[#PERSISTENT wpan0 and lowpan0 configuration]] to configure a persistent link-local address.&lt;br /&gt;
&lt;br /&gt;
There are also scripts available to create/delete a lowpan interface (or to create/delete a monitor interface): https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
=== PERSISTENT wpan0 and lowpan0 configuration ===&lt;br /&gt;
&lt;br /&gt;
With static long hardware address and static link-local IPv6 address (to avoid a random link-local IPv6 address on each reboot).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Persistent WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Clone riot-makers/wpan-raspbian GitHub repo:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/riot-makers/wpan-raspbian&lt;br /&gt;
 cd wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
* Copy some helper (shell) scripts to a well-known location:&lt;br /&gt;
&lt;br /&gt;
 sudo cp -r usr/local/sbin/* /usr/local/sbin/.&lt;br /&gt;
 sudo chmod +x /usr/local/sbin/*&lt;br /&gt;
&lt;br /&gt;
* Afterwards copy files for systemd integration:&lt;br /&gt;
&lt;br /&gt;
 sudo cp etc/default/lowpan /etc/default/.&lt;br /&gt;
 sudo cp etc/systemd/system/lowpan.service /etc/systemd/system/.&lt;br /&gt;
&lt;br /&gt;
* Modify 802.15.4 channel ID and PAN ID in &amp;lt;code&amp;gt;/etc/default/lowpan&amp;lt;/code&amp;gt; as needed:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/default/lowpan&lt;br /&gt;
 CHN=&amp;quot;13&amp;quot;&lt;br /&gt;
 PAN=&amp;quot;0xbeef&amp;quot;&lt;br /&gt;
 # set MAC to &amp;quot;&amp;quot; for random mac/hw address&lt;br /&gt;
 MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&lt;br /&gt;
 # set IPv6 to &amp;quot;&amp;quot; if not required; note: set a prefix length&lt;br /&gt;
 #IP6=&amp;quot;fdaa:bb:cc:dd::1/64&amp;quot;&lt;br /&gt;
 # Set ACK requests (Only enable if all devices on your PAN support ACKs)&lt;br /&gt;
 ACKREQ=0&lt;br /&gt;
&lt;br /&gt;
Note: &amp;lt;code&amp;gt;MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&amp;lt;/code&amp;gt; was taken from https://jan.newmarch.name/IoT/LinuxJournal/Routing/, this results in a link-local address of &amp;lt;code&amp;gt;fe80::1&amp;lt;/code&amp;gt; for the Raspberry.&lt;br /&gt;
&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;lowpan.service&amp;lt;/code&amp;gt; autostart, start 6LoWPAN service and verification:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl enable lowpan.service&lt;br /&gt;
 sudo systemctl start lowpan.service&lt;br /&gt;
 ifconfig&lt;br /&gt;
 lowpan0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 1280&lt;br /&gt;
    inet6 fe80::1  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;&lt;br /&gt;
    unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)&lt;br /&gt;
    RX packets 0  bytes 0 (0.0 B)&lt;br /&gt;
    RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
    TX packets 19  bytes 2114 (2.0 KiB)&lt;br /&gt;
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
 wpan0: flags=195&amp;lt;UP,BROADCAST,RUNNING,NOARP&amp;gt;  mtu 123&lt;br /&gt;
        unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 300  (UNSPEC)&lt;br /&gt;
        RX packets 72  bytes 2016 (1.9 KiB)&lt;br /&gt;
        RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
        TX packets 74  bytes 5320 (5.1 KiB)&lt;br /&gt;
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
&lt;br /&gt;
== Verification of 6LoWPAN connectivity between a Raspberry and a SAMR21-xpro == &lt;br /&gt;
&lt;br /&gt;
* Use RIOT&#039;s gnrc_networking example and build it for the SAMR21-xpro board, flash the firmware to the SAMR21-xpro and connect via &amp;lt;code&amp;gt;pyterm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 cd RIOT/examples/gnrc_networking&lt;br /&gt;
 make BOARD=samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro flash&lt;br /&gt;
 make BOARD=samr21-xpro term&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; to determine the 802.15.4/6LoWPAN interface ID of SAMR21-xpro (&amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt; in this case):&lt;br /&gt;
&lt;br /&gt;
 ifconfig&lt;br /&gt;
 # Iface  7  HWaddr: 57:98  Channel: 26  Page: 0  NID: 0x23  PHY: O-QPSK&lt;br /&gt;
 [...]&lt;br /&gt;
 #           Long HWaddr: E2:F9:02:0F:36:26:A2:68&lt;br /&gt;
 [...]&lt;br /&gt;
 #           inet6 addr: fe80::e0f9:20f:3626:a268  scope: link  VAL&lt;br /&gt;
&lt;br /&gt;
* Note: All &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; config options can be shown with &amp;lt;code&amp;gt;ifconfig &amp;lt;interface id&amp;gt; set&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* RIOT-OS default 802.15.4 channel is 26 and default  PAN ID 0x23. If you change them, make sure to change them in the SAMR21-xpro configuration aswell:&lt;br /&gt;
 * [optional] Change the channel to 13 and the PAN ID to 0xbeef:&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 13&lt;br /&gt;
&lt;br /&gt;
== TODO: Monitoring/Sniffing 802.15.4/6LoWPAN radio with a Raspberry ===&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module]]&lt;br /&gt;
* SAMR21-xpro: [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://linux-wpan.org/documentation.html&lt;br /&gt;
* https://www.linuxjournal.com/content/low-power-wireless-6lowpan-ieee802154-and-raspberry-pi&lt;br /&gt;
* http://morschi.com/2017/04/05/hands-on-riot-6lowpan/&lt;br /&gt;
&lt;br /&gt;
=== Persistent WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
* https://jan.newmarch.name/IoT/LinuxJournal/Routing/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12812</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12812"/>
		<updated>2023-11-28T13:38:22Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module]]&lt;br /&gt;
&lt;br /&gt;
== Setup/Config 802.15.4/6LoWPAN on a Raspberry ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Configure the default PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Configure the default channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ip link set lowpan0 down&lt;br /&gt;
 ip link set wpan0 down&lt;br /&gt;
 iwpan phy phy0 set channel 0 26 # same network ID and channel as RIOT default&lt;br /&gt;
 iwpan dev wpan0 set pan_id 0x23 # same network ID and channel as RIOT default&lt;br /&gt;
 ip link add link wpan0 name lowpan0 type lowpan&lt;br /&gt;
 ip link set wpan0 up&lt;br /&gt;
 ip link set lowpan0 up&lt;br /&gt;
&lt;br /&gt;
* Afterwards the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on Raspberry has a link-local IPv6 address:&lt;br /&gt;
&lt;br /&gt;
 root@raspberrypi:~# ip a&lt;br /&gt;
 1: lo: [...]&lt;br /&gt;
 2: eth0: [...]&lt;br /&gt;
 3: wlan0: [...]&lt;br /&gt;
 4: wpan0: &amp;lt;BROADCAST,NOARP,UP,LOWER_UP&amp;gt; mtu 123 qdisc pfifo_fast state UNKNOWN group default qlen 300&lt;br /&gt;
    link/ieee802.15.4 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
 5: lowpan0@wpan0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1000&lt;br /&gt;
    link/6lowpan 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet6 fe80::343a:7cc:6541:2b31/64 scope link&lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE/CAUTION: Every reboot changes the link-local IPv6 address of the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on the Raspberry!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See [[#PERSISTENT wpan0 and lowpan0 configuration]] to configure a persistent link-local address.&lt;br /&gt;
&lt;br /&gt;
There are also scripts available to create/delete a lowpan interface (or to create/delete a monitor interface): https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
=== PERSISTENT wpan0 and lowpan0 configuration ===&lt;br /&gt;
&lt;br /&gt;
With static long hardware address and static link-local IPv6 address (to avoid a random link-local IPv6 address on each reboot).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Persistent WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Clone riot-makers/wpan-raspbian GitHub repo:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/riot-makers/wpan-raspbian&lt;br /&gt;
 cd wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
* Copy some helper (shell) scripts to a well-known location:&lt;br /&gt;
&lt;br /&gt;
 sudo cp -r usr/local/sbin/* /usr/local/sbin/.&lt;br /&gt;
 sudo chmod +x /usr/local/sbin/*&lt;br /&gt;
&lt;br /&gt;
* Afterwards copy files for systemd integration:&lt;br /&gt;
&lt;br /&gt;
 sudo cp etc/default/lowpan /etc/default/.&lt;br /&gt;
 sudo cp etc/systemd/system/lowpan.service /etc/systemd/system/.&lt;br /&gt;
&lt;br /&gt;
* Modify 802.15.4 channel ID and PAN ID in &amp;lt;code&amp;gt;/etc/default/lowpan&amp;lt;/code&amp;gt; as needed:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/default/lowpan&lt;br /&gt;
 CHN=&amp;quot;13&amp;quot;&lt;br /&gt;
 PAN=&amp;quot;0xbeef&amp;quot;&lt;br /&gt;
 # set MAC to &amp;quot;&amp;quot; for random mac/hw address&lt;br /&gt;
 MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&lt;br /&gt;
 # set IPv6 to &amp;quot;&amp;quot; if not required; note: set a prefix length&lt;br /&gt;
 #IP6=&amp;quot;fdaa:bb:cc:dd::1/64&amp;quot;&lt;br /&gt;
 # Set ACK requests (Only enable if all devices on your PAN support ACKs)&lt;br /&gt;
 ACKREQ=0&lt;br /&gt;
&lt;br /&gt;
Note: &amp;lt;code&amp;gt;MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&amp;lt;/code&amp;gt; was taken from https://jan.newmarch.name/IoT/LinuxJournal/Routing/, this results in a link-local address of &amp;lt;code&amp;gt;fe80::1&amp;lt;/code&amp;gt; for the Raspberry.&lt;br /&gt;
&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;lowpan.service&amp;lt;/code&amp;gt; autostart, start 6LoWPAN service and verification:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl enable lowpan.service&lt;br /&gt;
 sudo systemctl start lowpan.service&lt;br /&gt;
 ifconfig&lt;br /&gt;
 lowpan0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 1280&lt;br /&gt;
    inet6 fe80::1  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;&lt;br /&gt;
    unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)&lt;br /&gt;
    RX packets 0  bytes 0 (0.0 B)&lt;br /&gt;
    RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
    TX packets 19  bytes 2114 (2.0 KiB)&lt;br /&gt;
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
 wpan0: flags=195&amp;lt;UP,BROADCAST,RUNNING,NOARP&amp;gt;  mtu 123&lt;br /&gt;
        unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 300  (UNSPEC)&lt;br /&gt;
        RX packets 72  bytes 2016 (1.9 KiB)&lt;br /&gt;
        RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
        TX packets 74  bytes 5320 (5.1 KiB)&lt;br /&gt;
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
&lt;br /&gt;
== Verification of 6LoWPAN connectivity between a Raspberry and a SAMR21-xpro == &lt;br /&gt;
&lt;br /&gt;
* Use RIOT&#039;s gnrc_networking example and build it for the SAMR21-xpro board, flash the firmware to the SAMR21-xpro and connect via &amp;lt;code&amp;gt;pyterm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 cd RIOT/examples/gnrc_networking&lt;br /&gt;
 make BOARD=samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro flash&lt;br /&gt;
 make BOARD=samr21-xpro term&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; to determine the 802.15.4/6LoWPAN interface ID of SAMR21-xpro (&amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt; in this case):&lt;br /&gt;
&lt;br /&gt;
 ifconfig&lt;br /&gt;
 # Iface  7  HWaddr: 57:98  Channel: 26  Page: 0  NID: 0x23  PHY: O-QPSK&lt;br /&gt;
 [...]&lt;br /&gt;
 #           Long HWaddr: E2:F9:02:0F:36:26:A2:68&lt;br /&gt;
 [...]&lt;br /&gt;
 #           inet6 addr: fe80::e0f9:20f:3626:a268  scope: link  VAL&lt;br /&gt;
&lt;br /&gt;
* Note: All &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; config options can be shown with &amp;lt;code&amp;gt;ifconfig &amp;lt;interface id&amp;gt; set&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* RIOT-OS default 802.15.4 channel is 26 and default  PAN ID 0x23. If you change them, make sure to change them in the SAMR21-xpro configuration aswell:&lt;br /&gt;
    * [optional] Change the channel to 13 and the PAN ID to 0xbeef:&lt;br /&gt;
&lt;br /&gt;
 ifconfig 7 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 7 set channel 13&lt;br /&gt;
&lt;br /&gt;
== TODO: Monitoring/Sniffing 802.15.4/6LoWPAN radio with a Raspberry ===&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
* Optional (not tested): [[Raspberry_Pi_6LoWPAN_SLIP_radio_module]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://linux-wpan.org/documentation.html&lt;br /&gt;
* https://www.linuxjournal.com/content/low-power-wireless-6lowpan-ieee802154-and-raspberry-pi&lt;br /&gt;
* http://morschi.com/2017/04/05/hands-on-riot-6lowpan/&lt;br /&gt;
&lt;br /&gt;
=== Persistent WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
* https://jan.newmarch.name/IoT/LinuxJournal/Routing/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN&amp;diff=12811</id>
		<title>RIOT-OS and IEEE 802.15.4 / 6LoWPAN</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN&amp;diff=12811"/>
		<updated>2023-11-28T13:30:53Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to use RIOT-OS with IEEE 802.15.4 and 6LoWPAN. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
In order to complete these steps, you must have followed [[Riot-OS_Setup]] before.&lt;br /&gt;
&lt;br /&gt;
* Default 802.15.4 PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Default 802.15.4 channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configure IEEE 802.15.4 PAN/Channel ID in RIOT ==&lt;br /&gt;
&lt;br /&gt;
=== Via RIOT Shell:  ===&lt;br /&gt;
&lt;br /&gt;
 ifconfig 6 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 6 set channel 23&lt;br /&gt;
&lt;br /&gt;
=== Set Channel/PAN ID via Makefile of your application, e.g.: === &lt;br /&gt;
&lt;br /&gt;
 CFLAGS += -DCONFIG_IEEE802154_DEFAULT_CHANNEL=16&lt;br /&gt;
 CFLAGS += -DCONFIG_IEEE802154_DEFAULT_PANID=0xcafe&lt;br /&gt;
&lt;br /&gt;
=== Or for RIOT in general: === &lt;br /&gt;
&lt;br /&gt;
 /Path/to/RIOT/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
&lt;br /&gt;
cf. https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
&lt;br /&gt;
* Default 802.15.4 PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Default 802.15.4 channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OPTIONAL: change HW address via RIOT Shell: ===&lt;br /&gt;
&lt;br /&gt;
 ifconfig 6 set addr_long 02:0:0:0:0:0:0:2&lt;br /&gt;
&lt;br /&gt;
== Test 802.15.4/6LoWPAN with RIOT gcoap example ==&lt;br /&gt;
&lt;br /&gt;
RIOT&#039;s gcoap example can be found here: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap&lt;br /&gt;
&lt;br /&gt;
README: https://github.com/RIOT-OS/RIOT/blob/master/examples/gcoap/README.md&lt;br /&gt;
&lt;br /&gt;
Flash it on e.g. two SAMR21-xpro devices.&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;code&amp;gt;%6&amp;lt;/code&amp;gt;&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
 coap get [fe80::d8b8:65ff:feee:121b%6]:5683 /.well-known/core&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; &amp;lt;code&amp;gt;fe80::d8b8:65ff:feee:121b%6&amp;lt;/code&amp;gt; =&amp;gt; fe80::[..] is the remote link-local address, but &amp;quot;%6&amp;quot; specifies the local interface ID of node where this command is submitted.&lt;br /&gt;
&lt;br /&gt;
The interface ID is stated when you perform &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; on your local node. Normally this interface ID is 6 or 7.&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
e.g. [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [[Riot-OS_Setup]]&lt;br /&gt;
* [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform]]&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
* RIOT-OS gcoap example: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12810</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12810"/>
		<updated>2023-11-28T13:19:50Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Configure the default PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Configure the default channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ip link set lowpan0 down&lt;br /&gt;
 ip link set wpan0 down&lt;br /&gt;
 iwpan phy phy0 set channel 0 26 # same network ID and channel as RIOT default&lt;br /&gt;
 iwpan dev wpan0 set pan_id 0x23 # same network ID and channel as RIOT default&lt;br /&gt;
 ip link add link wpan0 name lowpan0 type lowpan&lt;br /&gt;
 ip link set wpan0 up&lt;br /&gt;
 ip link set lowpan0 up&lt;br /&gt;
&lt;br /&gt;
* Afterwards the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on Raspberry has a link-local IPv6 address:&lt;br /&gt;
&lt;br /&gt;
 root@raspberrypi:~# ip a&lt;br /&gt;
 1: lo: [...]&lt;br /&gt;
 2: eth0: [...]&lt;br /&gt;
 3: wlan0: [...]&lt;br /&gt;
 4: wpan0: &amp;lt;BROADCAST,NOARP,UP,LOWER_UP&amp;gt; mtu 123 qdisc pfifo_fast state UNKNOWN group default qlen 300&lt;br /&gt;
    link/ieee802.15.4 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
 5: lowpan0@wpan0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1000&lt;br /&gt;
    link/6lowpan 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet6 fe80::343a:7cc:6541:2b31/64 scope link&lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE/CAUTION: Every reboot changes the link-local IPv6 address of the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on the Raspberry!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See [[#PERSISTENT wpan0 and lowpan0 configuration]] to configure a persistent link-local address.&lt;br /&gt;
&lt;br /&gt;
There are also scripts available to create/delete a lowpan interface (or to create/delete a monitor interface): https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
=== PERSISTENT wpan0 and lowpan0 configuration ===&lt;br /&gt;
&lt;br /&gt;
With static long hardware address and static link-local IPv6 address (to avoid a random link-local IPv6 address on each reboot).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Persistent WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Clone riot-makers/wpan-raspbian GitHub repo:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/riot-makers/wpan-raspbian&lt;br /&gt;
 cd wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
* Copy some helper (shell) scripts to a well-known location:&lt;br /&gt;
&lt;br /&gt;
 sudo cp -r usr/local/sbin/* /usr/local/sbin/.&lt;br /&gt;
 sudo chmod +x /usr/local/sbin/*&lt;br /&gt;
&lt;br /&gt;
* Afterwards copy files for systemd integration:&lt;br /&gt;
&lt;br /&gt;
 sudo cp etc/default/lowpan /etc/default/.&lt;br /&gt;
 sudo cp etc/systemd/system/lowpan.service /etc/systemd/system/.&lt;br /&gt;
&lt;br /&gt;
* Modify 802.15.4 channel ID and PAN ID in &amp;lt;code&amp;gt;/etc/default/lowpan&amp;lt;/code&amp;gt; as needed:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/default/lowpan&lt;br /&gt;
 CHN=&amp;quot;13&amp;quot;&lt;br /&gt;
 PAN=&amp;quot;0xbeef&amp;quot;&lt;br /&gt;
 # set MAC to &amp;quot;&amp;quot; for random mac/hw address&lt;br /&gt;
 MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&lt;br /&gt;
 # set IPv6 to &amp;quot;&amp;quot; if not required; note: set a prefix length&lt;br /&gt;
 #IP6=&amp;quot;fdaa:bb:cc:dd::1/64&amp;quot;&lt;br /&gt;
 # Set ACK requests (Only enable if all devices on your PAN support ACKs)&lt;br /&gt;
 ACKREQ=0&lt;br /&gt;
&lt;br /&gt;
Note: &amp;lt;code&amp;gt;MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&amp;lt;/code&amp;gt; was taken from https://jan.newmarch.name/IoT/LinuxJournal/Routing/, this results in a link-local address of &amp;lt;code&amp;gt;fe80::1&amp;lt;/code&amp;gt; for the Raspberry.&lt;br /&gt;
&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;lowpan.service&amp;lt;/code&amp;gt; autostart, start 6LoWPAN service and verification:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl enable lowpan.service&lt;br /&gt;
 sudo systemctl start lowpan.service&lt;br /&gt;
 ifconfig&lt;br /&gt;
 lowpan0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 1280&lt;br /&gt;
    inet6 fe80::1  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;&lt;br /&gt;
    unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)&lt;br /&gt;
    RX packets 0  bytes 0 (0.0 B)&lt;br /&gt;
    RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
    TX packets 19  bytes 2114 (2.0 KiB)&lt;br /&gt;
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
 wpan0: flags=195&amp;lt;UP,BROADCAST,RUNNING,NOARP&amp;gt;  mtu 123&lt;br /&gt;
        unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 300  (UNSPEC)&lt;br /&gt;
        RX packets 72  bytes 2016 (1.9 KiB)&lt;br /&gt;
        RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
        TX packets 74  bytes 5320 (5.1 KiB)&lt;br /&gt;
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://linux-wpan.org/documentation.html&lt;br /&gt;
* https://www.linuxjournal.com/content/low-power-wireless-6lowpan-ieee802154-and-raspberry-pi&lt;br /&gt;
* http://morschi.com/2017/04/05/hands-on-riot-6lowpan/&lt;br /&gt;
&lt;br /&gt;
=== Persistent WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
* https://jan.newmarch.name/IoT/LinuxJournal/Routing/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12809</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12809"/>
		<updated>2023-11-28T13:18:58Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Configure the default PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Configure the default channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ip link set lowpan0 down&lt;br /&gt;
 ip link set wpan0 down&lt;br /&gt;
 iwpan phy phy0 set channel 0 26 # same network ID and channel as RIOT default&lt;br /&gt;
 iwpan dev wpan0 set pan_id 0x23 # same network ID and channel as RIOT default&lt;br /&gt;
 ip link add link wpan0 name lowpan0 type lowpan&lt;br /&gt;
 ip link set wpan0 up&lt;br /&gt;
 ip link set lowpan0 up&lt;br /&gt;
&lt;br /&gt;
* Afterwards the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on Raspberry has a link-local IPv6 address:&lt;br /&gt;
&lt;br /&gt;
 root@raspberrypi:~# ip a&lt;br /&gt;
 1: lo: [...]&lt;br /&gt;
 2: eth0: [...]&lt;br /&gt;
 3: wlan0: [...]&lt;br /&gt;
 4: wpan0: &amp;lt;BROADCAST,NOARP,UP,LOWER_UP&amp;gt; mtu 123 qdisc pfifo_fast state UNKNOWN group default qlen 300&lt;br /&gt;
    link/ieee802.15.4 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
 5: lowpan0@wpan0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1000&lt;br /&gt;
    link/6lowpan 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet6 fe80::343a:7cc:6541:2b31/64 scope link&lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE/CAUTION: Every reboot changes the link-local IPv6 address of the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on the Raspberry!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See [[#PERSISTENT wpan0 and lowpan0 configuration]] to configure a persistent link-local address.&lt;br /&gt;
&lt;br /&gt;
There are also scripts available to create/delete a lowpan interface (or to create/delete a monitor interface): https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
=== PERSISTENT wpan0 and lowpan0 configuration ===&lt;br /&gt;
&lt;br /&gt;
With static long hardware address and static link-local IPv6 address (to avoid a random link-local IPv6 address on each reboot).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Persistent WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Clone riot-makers/wpan-raspbian GitHub repo:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/riot-makers/wpan-raspbian&lt;br /&gt;
 cd wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
* Copy some helper (shell) scripts to a well-known location:&lt;br /&gt;
&lt;br /&gt;
 sudo cp -r usr/local/sbin/* /usr/local/sbin/.&lt;br /&gt;
 sudo chmod +x /usr/local/sbin/*&lt;br /&gt;
&lt;br /&gt;
* Afterwards copy files for systemd integration:&lt;br /&gt;
&lt;br /&gt;
 sudo cp etc/default/lowpan /etc/default/.&lt;br /&gt;
 sudo cp etc/systemd/system/lowpan.service /etc/systemd/system/.&lt;br /&gt;
&lt;br /&gt;
* Modify 802.15.4 channel ID and PAN ID in &amp;lt;code&amp;gt;/etc/default/lowpan&amp;lt;/code&amp;gt; as needed:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/default/lowpan&lt;br /&gt;
 CHN=&amp;quot;13&amp;quot;&lt;br /&gt;
 PAN=&amp;quot;0xbeef&amp;quot;&lt;br /&gt;
 # set MAC to &amp;quot;&amp;quot; for random mac/hw address&lt;br /&gt;
 MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&lt;br /&gt;
 # set IPv6 to &amp;quot;&amp;quot; if not required; note: set a prefix length&lt;br /&gt;
 #IP6=&amp;quot;fdaa:bb:cc:dd::1/64&amp;quot;&lt;br /&gt;
 # Set ACK requests (Only enable if all devices on your PAN support ACKs)&lt;br /&gt;
ACKREQ=0&lt;br /&gt;
&lt;br /&gt;
Note: &amp;lt;code&amp;gt;MAC=&amp;quot;02:0:0:0:0:0:0:1&amp;quot;&amp;lt;/code&amp;gt; was taken from https://jan.newmarch.name/IoT/LinuxJournal/Routing/, this results in a link-local address of &amp;lt;code&amp;gt;fe80::1&amp;lt;/code&amp;gt; for the Raspberry.&lt;br /&gt;
&lt;br /&gt;
* Enable &amp;lt;code&amp;gt;lowpan.service&amp;lt;/code&amp;gt; autostart, start 6LoWPAN service and verification:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl enable lowpan.service&lt;br /&gt;
 sudo systemctl start lowpan.service&lt;br /&gt;
 ifconfig&lt;br /&gt;
 lowpan0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 1280&lt;br /&gt;
    inet6 fe80::1  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;&lt;br /&gt;
    unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)&lt;br /&gt;
    RX packets 0  bytes 0 (0.0 B)&lt;br /&gt;
    RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
    TX packets 19  bytes 2114 (2.0 KiB)&lt;br /&gt;
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
&lt;br /&gt;
 wpan0: flags=195&amp;lt;UP,BROADCAST,RUNNING,NOARP&amp;gt;  mtu 123&lt;br /&gt;
        unspec 02-00-00-00-00-00-00-01-00-00-00-00-00-00-00-00  txqueuelen 300  (UNSPEC)&lt;br /&gt;
        RX packets 72  bytes 2016 (1.9 KiB)&lt;br /&gt;
        RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
        TX packets 74  bytes 5320 (5.1 KiB)&lt;br /&gt;
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://linux-wpan.org/documentation.html&lt;br /&gt;
* https://www.linuxjournal.com/content/low-power-wireless-6lowpan-ieee802154-and-raspberry-pi&lt;br /&gt;
* http://morschi.com/2017/04/05/hands-on-riot-6lowpan/&lt;br /&gt;
&lt;br /&gt;
=== Persistent WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
* https://jan.newmarch.name/IoT/LinuxJournal/Routing/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12808</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12808"/>
		<updated>2023-11-28T13:13:34Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Configure the default PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Configure the default channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ip link set lowpan0 down&lt;br /&gt;
 ip link set wpan0 down&lt;br /&gt;
 iwpan phy phy0 set channel 0 26 # same network ID and channel as RIOT default&lt;br /&gt;
 iwpan dev wpan0 set pan_id 0x23 # same network ID and channel as RIOT default&lt;br /&gt;
 ip link add link wpan0 name lowpan0 type lowpan&lt;br /&gt;
 ip link set wpan0 up&lt;br /&gt;
 ip link set lowpan0 up&lt;br /&gt;
&lt;br /&gt;
* Afterwards the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on Raspberry has a link-local IPv6 address:&lt;br /&gt;
&lt;br /&gt;
 root@raspberrypi:~# ip a&lt;br /&gt;
 1: lo: [...]&lt;br /&gt;
 2: eth0: [...]&lt;br /&gt;
 3: wlan0: [...]&lt;br /&gt;
 4: wpan0: &amp;lt;BROADCAST,NOARP,UP,LOWER_UP&amp;gt; mtu 123 qdisc pfifo_fast state UNKNOWN group default qlen 300&lt;br /&gt;
    link/ieee802.15.4 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
 5: lowpan0@wpan0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1000&lt;br /&gt;
    link/6lowpan 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet6 fe80::343a:7cc:6541:2b31/64 scope link&lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE/CAUTION: Every reboot changes the link-local IPv6 address of the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on the Raspberry!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See [[#PERSISTENT wpan0 and lowpan0 configuration]] to configure a persistent link-local address.&lt;br /&gt;
&lt;br /&gt;
There are also scripts available to create/delete a lowpan interface (or to create/delete a monitor interface): https://github.com/RIOT-Makers/wpan-raspbian&lt;br /&gt;
&lt;br /&gt;
=== PERSISTENT wpan0 and lowpan0 configuration ===&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://linux-wpan.org/documentation.html&lt;br /&gt;
* https://www.linuxjournal.com/content/low-power-wireless-6lowpan-ieee802154-and-raspberry-pi&lt;br /&gt;
* http://morschi.com/2017/04/05/hands-on-riot-6lowpan/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12807</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12807"/>
		<updated>2023-11-28T13:10:17Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[https://wiki.elvis.science/index.php?title=Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Configure the default PAN ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt;&lt;br /&gt;
* Configure the default channel ID of RIOT-OS/SAMR21-xpro: &amp;lt;code&amp;gt;26&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ip link set lowpan0 down&lt;br /&gt;
 ip link set wpan0 down&lt;br /&gt;
 iwpan phy phy0 set channel 0 26 # same network ID and channel as RIOT default&lt;br /&gt;
 iwpan dev wpan0 set pan_id 0x23 # same network ID and channel as RIOT default&lt;br /&gt;
 ip link add link wpan0 name lowpan0 type lowpan&lt;br /&gt;
 ip link set wpan0 up&lt;br /&gt;
 ip link set lowpan0 up&lt;br /&gt;
&lt;br /&gt;
* Afterwards the &amp;lt;code&amp;gt;lowpan0&amp;lt;/code&amp;gt; interface on Raspberry has a link-local IPv6 address:&lt;br /&gt;
&lt;br /&gt;
 root@raspberrypi:~# ip a&lt;br /&gt;
 1: lo: [...]&lt;br /&gt;
 2: eth0: [...]&lt;br /&gt;
 3: wlan0: [...]&lt;br /&gt;
 4: wpan0: &amp;lt;BROADCAST,NOARP,UP,LOWER_UP&amp;gt; mtu 123 qdisc pfifo_fast state UNKNOWN group default qlen 300&lt;br /&gt;
    link/ieee802.15.4 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
 5: lowpan0@wpan0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1000&lt;br /&gt;
    link/6lowpan 36:3a:07:cc:65:41:2b:31 brd ff:ff:ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet6 fe80::343a:7cc:6541:2b31/64 scope link&lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
* https://linux-wpan.org/documentation.html&lt;br /&gt;
* https://www.linuxjournal.com/content/low-power-wireless-6lowpan-ieee802154-and-raspberry-pi&lt;br /&gt;
* http://morschi.com/2017/04/05/hands-on-riot-6lowpan/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12806</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12806"/>
		<updated>2023-11-28T13:06:52Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[https://wiki.elvis.science/index.php?title=Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12805</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12805"/>
		<updated>2023-11-28T13:05:35Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[https://wiki.elvis.science/index.php?title=Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[#Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Linux WPAN tools ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12804</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12804"/>
		<updated>2023-11-28T13:04:55Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[https://wiki.elvis.science/index.php?title=Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
=== MANUAL WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[WPAN interface configuration]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Linux WPAN tools ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
=== WPAN interface configuration ===&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12803</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12803"/>
		<updated>2023-11-28T13:02:18Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[https://wiki.elvis.science/index.php?title=Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see References:[[Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
* Install some required packages before building the wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install dh-autoreconf libnl-3-dev libnl-genl-3-dev&lt;br /&gt;
&lt;br /&gt;
* Configure, build and install wpan-tools:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/src/wpan-tools&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure CFLAGS=&#039;-g -O0&#039; --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
* Verification/test of wpan-tools installation:&lt;br /&gt;
&lt;br /&gt;
 iwpan dev&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Linux WPAN tools ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12800</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12800"/>
		<updated>2023-11-28T12:59:56Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[https://wiki.elvis.science/index.php?title=Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see [[References:Linux WPAN tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* First install &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; and clone the wpan-tools Repository:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install git&lt;br /&gt;
 sudo mkdir /opt/src&lt;br /&gt;
 sudo chown pi /opt/src&lt;br /&gt;
 cd /opt/src&lt;br /&gt;
 git clone https://github.com/linux-wpan/wpan-tools&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12799</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12799"/>
		<updated>2023-11-28T12:55:02Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[https://wiki.elvis.science/index.php?title=Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|220px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|370px]]&lt;br /&gt;
&lt;br /&gt;
* There is an existing overlay for this transceiver shipped with Raspbian, should be in &amp;lt;code&amp;gt;/boot/overlays/at86rf233-overlay.dtb&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/boot/overlays/at86rf233.dtbo&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 ls /boot/overlays/at86rf233.dtbo&lt;br /&gt;
&lt;br /&gt;
* Enable transceiver by modifying the &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt; file and reboot:&lt;br /&gt;
&lt;br /&gt;
=== Installation of Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources/Links: see [[Linux_WPAN_tools]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
=== Linux WPAN tools ===&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki/How-to-install-6LoWPAN-Linux-Kernel-on-Raspberry-Pi&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support&lt;br /&gt;
* https://github.com/RIOT-Makers/wpan-raspbian/wiki/Spice-up-Raspbian-for-the-IoT&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12798</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=12798"/>
		<updated>2023-11-28T12:48:21Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian 10 (Buster) and Raspbian 11 (Bullseye).&#039;&#039;&#039; I assume it is also working on the latest Raspbian 12 (Bookworm).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[https://wiki.elvis.science/index.php?title=Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
* Plug the OpenLabs 802.15.4 radio module directly onto pins 15-26 of the Raspberry&#039;s P1 header (in the middle):&lt;br /&gt;
&lt;br /&gt;
[[File:Raspberry-pi-802.15.4-radio_module.jpg|260px]][[File:Raspberry-pi-802.15.4-radio_connected.jpg|330px]]&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Raspberry-pi-802.15.4-radio_connected.jpg&amp;diff=12797</id>
		<title>File:Raspberry-pi-802.15.4-radio connected.jpg</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Raspberry-pi-802.15.4-radio_connected.jpg&amp;diff=12797"/>
		<updated>2023-11-28T12:47:24Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: Openlabs Raspberry Pi 802.15.4 radio module attached to Raspberry Pi

Image source: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Openlabs Raspberry Pi 802.15.4 radio module attached to Raspberry Pi&lt;br /&gt;
&lt;br /&gt;
Image source: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Raspberry-pi-802.15.4-radio_module.jpg&amp;diff=12796</id>
		<title>File:Raspberry-pi-802.15.4-radio module.jpg</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Raspberry-pi-802.15.4-radio_module.jpg&amp;diff=12796"/>
		<updated>2023-11-28T12:44:21Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: Openlabs Raspberry Pi 802.15.4 radio module

Image source: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Openlabs Raspberry Pi 802.15.4 radio module&lt;br /&gt;
&lt;br /&gt;
Image source: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=11898</id>
		<title>Raspberry Pi 3B+ 802.15.4/6LoWPAN Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Raspberry_Pi_3B%2B_802.15.4/6LoWPAN_Setup&amp;diff=11898"/>
		<updated>2023-11-27T18:26:33Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: Created page with &amp;quot;== Summary ==   Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.  &amp;#039;&amp;#039;&amp;#039;This was tested successfully with Raspbian Buster and Raspbian Bullseye.&amp;#039;&amp;#039;&amp;#039;  == Requirements ==  * Raspberry Pi 3B+ (https://wiki.elvis.science/index.php?title=Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT) * Operating system: Raspberry Pi OS (Raspbian) * Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to setup a Raspberry Pi 3B+ for 802.15.4 radio/6LoWPAN communication by utilizing an Openlabs 802.15.4 radio module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was tested successfully with Raspbian Buster and Raspbian Bullseye.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Raspberry Pi 3B+ ([[https://wiki.elvis.science/index.php?title=Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]])&lt;br /&gt;
* Operating system: Raspberry Pi OS (Raspbian)&lt;br /&gt;
* Openlabs 802.15.4 radio module: https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Install Raspbian on Raspberry Pi 3B+ ===&lt;br /&gt;
&lt;br /&gt;
* Use Raspberry Pi Imager&lt;br /&gt;
* Optional: Download Raspbian/Raspberry Pi OS from https://www.raspberrypi.com/software/operating-systems/&lt;br /&gt;
&lt;br /&gt;
=== Preparation of Raspbian ===&lt;br /&gt;
&lt;br /&gt;
Access the Raspberry Pi by attaching it via HDMI to a monitor. After enabling SSH it is possible to connect via SSH/terminal (default credentials are pi:raspberry).&lt;br /&gt;
&lt;br /&gt;
* (Optionally) Change keyboard setting to &amp;quot;German&amp;quot; and reboot:&lt;br /&gt;
&lt;br /&gt;
 sudo dpkg-reconfigure keyboard-configuration&lt;br /&gt;
&lt;br /&gt;
* Activate and start SSH on Raspberry:&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start ssh&lt;br /&gt;
 sudo systemctl enable ssh&lt;br /&gt;
&lt;br /&gt;
* Upgrade of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;br /&gt;
&lt;br /&gt;
=== Enable support for IEEE 802.15.4/LoWPAN devices ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry_Pi_3,_Model_B%2B,_WLAN,_BT]]&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://comatrix.eu/setup/raspberry_pi_setup/&lt;br /&gt;
* https://openlabs.co/store/Raspberry-Pi-802.15.4-radio&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN&amp;diff=11892</id>
		<title>RIOT-OS and IEEE 802.15.4 / 6LoWPAN</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN&amp;diff=11892"/>
		<updated>2023-11-27T17:52:39Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to use RIOT-OS with IEEE 802.15.4 and 6LoWPAN. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
In order to complete these steps, you must have followed [[Riot-OS_Setup]] before.&lt;br /&gt;
&lt;br /&gt;
== Configure IEEE 802.15.4 PAN/Channel ID in RIOT ==&lt;br /&gt;
&lt;br /&gt;
=== Via RIOT Shell:  ===&lt;br /&gt;
&lt;br /&gt;
 ifconfig 6 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 6 set channel 23&lt;br /&gt;
&lt;br /&gt;
=== Set Channel/PAN ID via Makefile of your application, e.g.: === &lt;br /&gt;
&lt;br /&gt;
 CFLAGS += -DCONFIG_IEEE802154_DEFAULT_CHANNEL=16&lt;br /&gt;
 CFLAGS += -DCONFIG_IEEE802154_DEFAULT_PANID=0xcafe&lt;br /&gt;
&lt;br /&gt;
=== Or for RIOT in general: === &lt;br /&gt;
&lt;br /&gt;
 /Path/to/RIOT/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
&lt;br /&gt;
cf. https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
&lt;br /&gt;
=== OPTIONAL: change HW address via RIOT Shell: ===&lt;br /&gt;
&lt;br /&gt;
 ifconfig 6 set addr_long 02:0:0:0:0:0:0:2&lt;br /&gt;
&lt;br /&gt;
== Test 802.15.4/6LoWPAN with RIOT gcoap example ==&lt;br /&gt;
&lt;br /&gt;
RIOT&#039;s gcoap example can be found here: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap&lt;br /&gt;
&lt;br /&gt;
README: https://github.com/RIOT-OS/RIOT/blob/master/examples/gcoap/README.md&lt;br /&gt;
&lt;br /&gt;
Flash it on e.g. two SAMR21-xpro devices.&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;code&amp;gt;%6&amp;lt;/code&amp;gt;&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
 coap get [fe80::d8b8:65ff:feee:121b%6]:5683 /.well-known/core&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; &amp;lt;code&amp;gt;fe80::d8b8:65ff:feee:121b%6&amp;lt;/code&amp;gt; =&amp;gt; fe80::[..] is the remote link-local address, but &amp;quot;%6&amp;quot; specifies the local interface ID of node where this command is submitted.&lt;br /&gt;
&lt;br /&gt;
The interface ID is stated when you perform &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; on your local node. Normally this interface ID is 6 or 7.&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
e.g. [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [[Riot-OS_Setup]]&lt;br /&gt;
* [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform]]&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/blob/master/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
* RIOT-OS gcoap example: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN&amp;diff=11891</id>
		<title>RIOT-OS and IEEE 802.15.4 / 6LoWPAN</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN&amp;diff=11891"/>
		<updated>2023-11-27T17:51:19Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to use RIOT-OS with IEEE 802.15.4 and 6LoWPAN. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
In order to complete these steps, you must have followed [[Riot-OS_Setup]] before.&lt;br /&gt;
&lt;br /&gt;
== Configure IEEE 802.15.4 PAN/Channel ID in RIOT ==&lt;br /&gt;
&lt;br /&gt;
=== Via RIOT Shell:  ===&lt;br /&gt;
&lt;br /&gt;
 ifconfig 6 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 6 set channel 23&lt;br /&gt;
&lt;br /&gt;
=== Set Channel/PAN ID via Makefile of your application, e.g.: === &lt;br /&gt;
&lt;br /&gt;
 CFLAGS += -DCONFIG_IEEE802154_DEFAULT_CHANNEL=16&lt;br /&gt;
 CFLAGS += -DCONFIG_IEEE802154_DEFAULT_PANID=0xcafe&lt;br /&gt;
&lt;br /&gt;
=== Or for RIOT in general: === &lt;br /&gt;
&lt;br /&gt;
 /Path/to/RIOT/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
&lt;br /&gt;
=== OPTIONAL: change HW address via RIOT Shell: ===&lt;br /&gt;
&lt;br /&gt;
 ifconfig 6 set addr_long 02:0:0:0:0:0:0:2&lt;br /&gt;
&lt;br /&gt;
== Test 802.15.4/6LoWPAN with RIOT gcoap example ==&lt;br /&gt;
&lt;br /&gt;
RIOT&#039;s gcoap example can be found here: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap&lt;br /&gt;
&lt;br /&gt;
README: https://github.com/RIOT-OS/RIOT/blob/master/examples/gcoap/README.md&lt;br /&gt;
&lt;br /&gt;
Flash it on e.g. two SAMR21-xpro devices.&lt;br /&gt;
&lt;br /&gt;
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. &amp;lt;code&amp;gt;%6&amp;lt;/code&amp;gt;&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
 coap get [fe80::d8b8:65ff:feee:121b%6]:5683 /.well-known/core&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; &amp;lt;code&amp;gt;fe80::d8b8:65ff:feee:121b%6&amp;lt;/code&amp;gt; =&amp;gt; fe80::[..] is the remote link-local address, but &amp;quot;%6&amp;quot; specifies the local interface ID of node where this command is submitted.&lt;br /&gt;
&lt;br /&gt;
The interface ID is stated when you perform &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; on your local node. Normally this interface ID is 6 or 7.&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
e.g. [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* IT-Security master&#039;s programme: Mobile and Embedded Security ILV&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [[Riot-OS_Setup]]&lt;br /&gt;
* [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform]]&lt;br /&gt;
* RIOT-OS gcoap example: https://github.com/RIOT-OS/RIOT/tree/master/examples/gcoap&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN&amp;diff=11844</id>
		<title>RIOT-OS and IEEE 802.15.4 / 6LoWPAN</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS_and_IEEE_802.15.4_/_6LoWPAN&amp;diff=11844"/>
		<updated>2023-11-24T15:42:51Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: Created page with &amp;quot;== 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_...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Information on how to use RIOT-OS with IEEE 802.15.4 and 6LoWPAN. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
In order to complete these steps, you must have followed [[Riot-OS_Setup]] before.&lt;br /&gt;
&lt;br /&gt;
== Configure IEEE 802.15.4 PAN/Channel ID==&lt;br /&gt;
&lt;br /&gt;
=== Via RIOT Shell:  ===&lt;br /&gt;
&lt;br /&gt;
 ifconfig 6 set pan_id 0xbeef&lt;br /&gt;
 ifconfig 6 set channel 23&lt;br /&gt;
&lt;br /&gt;
=== Set Channel/PAN ID via Makefile of your application, e.g.: === &lt;br /&gt;
&lt;br /&gt;
 CFLAGS += -DCONFIG_IEEE802154_DEFAULT_CHANNEL=16&lt;br /&gt;
 CFLAGS += -DCONFIG_IEEE802154_DEFAULT_PANID=0xcafe&lt;br /&gt;
&lt;br /&gt;
=== Or for RIOT in general: === &lt;br /&gt;
&lt;br /&gt;
 /Path/to/RIOT/makefiles/default-radio-settings.inc.mk&lt;br /&gt;
&lt;br /&gt;
=== OPTIONAL: change HW address via RIOT Shell: ===&lt;br /&gt;
&lt;br /&gt;
 ifconfig 6 set addr_long 02:0:0:0:0:0:0:2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
e.g. [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
TODO:&lt;br /&gt;
* [[A course where this documentation was used]] (2017, 2018)&lt;br /&gt;
* [[Another one]] (2018)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [[Riot-OS_Setup]]&lt;br /&gt;
* [[Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS:_Setup&amp;diff=11843</id>
		<title>RIOT-OS: Setup</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=RIOT-OS:_Setup&amp;diff=11843"/>
		<updated>2023-11-24T15:22:03Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Setting up Riot-OS on a Atmel SAM R21 Xpro Board.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating system: Ubuntu 20.04 &lt;br /&gt;
* Packages: git&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Install the following packages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install git &lt;br /&gt;
                      openocd&lt;br /&gt;
                      gcc-multilib&lt;br /&gt;
                      build-essential&lt;br /&gt;
                      python3-serial&lt;br /&gt;
                      libudev-dev&lt;br /&gt;
                      moserial&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Install the toolchain&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install gcc-arm-none-eabi&lt;br /&gt;
&lt;br /&gt;
If you use a recent version of RIOT-OS (Release-2021.07) you can go on with &#039;&#039;&#039;Step 3&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use an older RIOT-OS version, you will have to do the following steps:&lt;br /&gt;
&lt;br /&gt;
Goto https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm and download&lt;br /&gt;
&lt;br /&gt;
 gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Move it to your home directory.&lt;br /&gt;
&lt;br /&gt;
Uninstall old packages&lt;br /&gt;
&lt;br /&gt;
 sudo apt remove binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi&lt;br /&gt;
&lt;br /&gt;
Unzip the downloaded file&lt;br /&gt;
&lt;br /&gt;
 tar -xjvf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Add the toolchain to your path&lt;br /&gt;
&lt;br /&gt;
 export PATH=$PATH:/home/(your user)/gcc-arm-none-eabi-7-2018-q2-update/bin/&lt;br /&gt;
&lt;br /&gt;
For now: you will have to do this in the bash where you build your application - after each restart.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Download Riot-OS&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/RIOT-OS/RIOT.git myRIOT&lt;br /&gt;
&lt;br /&gt;
Move to the &amp;quot;Hello World&amp;quot;-Example&lt;br /&gt;
 &lt;br /&gt;
 cd myRIOT/examples/hello-world&lt;br /&gt;
&lt;br /&gt;
Build the application on &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 make all term&lt;br /&gt;
&lt;br /&gt;
Now, you should see this output in your terminal:&lt;br /&gt;
&lt;br /&gt;
 RIOT native interrupts/signals initialized.&lt;br /&gt;
 LED_RED_OFF&lt;br /&gt;
 LED_GREEN_ON&lt;br /&gt;
 RIOT native board initialized.&lt;br /&gt;
 RIOT native hardware initialization complete.&lt;br /&gt;
 &lt;br /&gt;
 main(): This is RIOT! (Version: 2022.01-devel-129-g554d3)&lt;br /&gt;
 Hello World!&lt;br /&gt;
 You are running RIOT on a(n) native board.&lt;br /&gt;
 This board features a(n) native MCU.&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Build and run &amp;quot;Hello World&amp;quot; on the SAM R21 Board.&lt;br /&gt;
&lt;br /&gt;
Set the rights for your username to be able to flash the application on the board.&lt;br /&gt;
&lt;br /&gt;
 sudo usermod -a -G dialout &amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then reboot your computer.&lt;br /&gt;
&lt;br /&gt;
Connect the board to your computer via micro USB cable (USB EDBG interface).&lt;br /&gt;
&lt;br /&gt;
[[File:samr21EDBGconnect.jpg]]&lt;br /&gt;
&lt;br /&gt;
Connect via Moserial.&lt;br /&gt;
&lt;br /&gt;
[[File:moSerial.jpg]]&lt;br /&gt;
&lt;br /&gt;
Build and flash the application.&lt;br /&gt;
&lt;br /&gt;
 cd myRIOT/examples/hello-world&lt;br /&gt;
 make BOARD=samr21-xpro&lt;br /&gt;
 make BOARD=samr21-xpro flash&lt;br /&gt;
&lt;br /&gt;
If you do not use a serial terminal like moserial or terraterm use term&lt;br /&gt;
&lt;br /&gt;
 make BOARD=samr21-xpro term&lt;br /&gt;
&lt;br /&gt;
You may also set the BOARD in the Makefile of the application.&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[Atmel SAM R21 Xplained Pro Evaluation Platform]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[Mobile and Embedded Security]] (2019)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RIOT More Information/Resources/Links ==&lt;br /&gt;
&lt;br /&gt;
* Paper (optional): Baccelli, Emmanuel, et al. _&amp;quot;RIOT: An open source operating system for low-end embedded devices in the IoT.&amp;quot;_ IEEE Internet of Things Journal 5.6 (2018): 4428-4440.&lt;br /&gt;
* Riot-OS Setup (ELVIS Wiki): https://wiki.elvis.science/index.php?title=Riot-OS_Setup&lt;br /&gt;
** RIOT-OS+SAMR21 Setup (CoMatrix): https://comatrix.eu/setup/samr21_and_RIOT-OS/&lt;br /&gt;
* RIOT-OS Github repository: https://github.com/RIOT-OS/RIOT&lt;br /&gt;
** Examples: https://github.com/RIOT-OS/RIOT/tree/master/examples&lt;br /&gt;
** Tests: https://github.com/RIOT-OS/RIOT/tree/master/tests&lt;br /&gt;
* Getting Started: https://doc.riot-os.org/getting-started.html&lt;br /&gt;
** Introduction: https://github.com/RIOT-OS/RIOT/wiki/Introduction&lt;br /&gt;
** Changelog/Release Notes: https://doc.riot-os.org/changelog.html&lt;br /&gt;
** Use Docker to build RIOT:&lt;br /&gt;
*** https://doc.riot-os.org/getting-started.html#docker&lt;br /&gt;
*** https://doc.riot-os.org/build-in-docker.html&lt;br /&gt;
*** Podman: https://github.com/RIOT-OS/RIOT/pull/18671&lt;br /&gt;
* API documentation: https://doc.riot-os.org/&lt;br /&gt;
* Wiki: https://github.com/RIOT-OS/RIOT/wiki&lt;br /&gt;
** FAQ: https://github.com/RIOT-OS/RIOT/wiki/FAQ&lt;br /&gt;
** Best Practice for RIOT Programming: https://github.com/RIOT-OS/RIOT/wiki/Best-Practice-for-RIOT-Programming&lt;br /&gt;
* Tutorials: https://github.com/RIOT-OS/Tutorials&lt;br /&gt;
** RIOT online course: https://github.com/RIOT-OS/riot-course&lt;br /&gt;
** RIOT Beginner Tutorial - RIOT Summit 2021: https://riot-os.github.io/riot-course/slides/tutorial-summit-networking/&lt;br /&gt;
** Networking in RIOT: https://riot-os.github.io/riot-course/slides/04-networking-in-riot/&lt;br /&gt;
** RIOT Tutorial - IoT Security with Microcontrollers: https://riot-os.github.io/riot-course/slides/tutorial-summit-security&lt;br /&gt;
* Forum: https://forum.riot-os.org/&lt;br /&gt;
** Matrix Channel: https://matrix.to/#/#riot-os:matrix.org&lt;br /&gt;
* ... and slides from Silvie&lt;br /&gt;
* pyterm is an alternative to Moserial&lt;br /&gt;
** i.e. implicit use with &amp;lt;code&amp;gt;make BOARD=samr21-xpro term&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;make list-ttys&amp;lt;/code&amp;gt;: returns the list of serial ports available with information on the board connected (useful when working with multiple boards)&lt;br /&gt;
** afterwards e.g. &amp;lt;code&amp;gt;make term SERIAL=&amp;quot;1232135328821&amp;quot;`&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;make debug&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Remember that the examples directory is very helpful - as well as the test directories :)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS/RIOT/wiki&lt;br /&gt;
* http://riot-os.org/api&lt;br /&gt;
* https://github.com/RIOT-OS/Tutorials&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform&amp;diff=11842</id>
		<title>Atmel SAM R21 Xplained Pro Evaluation Platform</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Atmel_SAM_R21_Xplained_Pro_Evaluation_Platform&amp;diff=11842"/>
		<updated>2023-11-24T15:13:08Z</updated>

		<summary type="html">&lt;p&gt;TBuchi: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;SAMR21-xpro:&amp;#039;&amp;#039;&amp;#039;  * is a Class 2 IoT device, i.e. &amp;gt;10kB RAM and &amp;gt;100kB flash ** 48 MHz, 32bits, 32kB RAM, 256kB flash * Available at Iot-Lab ** https://www.iot-lab.info/docs/boards/microchip-samr21/ ** 5x SAMR21-xpro at Lille site ** 15x SAMR21-xpro at Saclay site incl. Sensors *** https://www.iot-lab.info/docs/deployment/saclay/ ** Both sites SAMR21&amp;#039;s include AT86RF233 IEEE 802.15.4 transceiver * SAMR21-xpro user guide: http://ww1.microchip.com/downloads/en/DeviceDoc/...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;SAMR21-xpro:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* is a Class 2 IoT device, i.e. &amp;gt;10kB RAM and &amp;gt;100kB flash&lt;br /&gt;
** 48 MHz, 32bits, 32kB RAM, 256kB flash&lt;br /&gt;
* Available at Iot-Lab&lt;br /&gt;
** https://www.iot-lab.info/docs/boards/microchip-samr21/&lt;br /&gt;
** 5x SAMR21-xpro at Lille site&lt;br /&gt;
** 15x SAMR21-xpro at Saclay site incl. Sensors&lt;br /&gt;
*** https://www.iot-lab.info/docs/deployment/saclay/&lt;br /&gt;
** Both sites SAMR21&#039;s include AT86RF233 IEEE 802.15.4 transceiver&lt;br /&gt;
* SAMR21-xpro user guide: http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42243-SAMR21-Xplained-Pro_User-Guide.pdf&lt;/div&gt;</summary>
		<author><name>TBuchi</name></author>
	</entry>
</feed>