2024-11-06 13:29:36 +01:00
# Examples
RIOT provides a wide range of examples to demonstrate the capabilities of the OS and its modules.
Each example contains a `README.md` that provides information and instructions how to run it.
Here is a quick overview of the examples available in the RIOT:
2024-11-12 10:01:55 +01:00
## The Essentials
2024-11-06 13:29:36 +01:00
2024-11-12 10:01:55 +01:00
- [default ](./default/README.md )
2024-11-06 13:29:36 +01:00
- This application is a showcase for RIOT's hardware support. Using it
for your board, you should be able to interactively use any hardware
that is supported.
2024-11-12 10:01:55 +01:00
- [hello-world ](./hello-world/README.md )
2024-11-06 13:29:36 +01:00
- A simple "Hello World" that shows the basic structure of a RIOT application.
2024-11-12 10:01:55 +01:00
- [blinky ](./blinky/README.md )
2024-11-06 13:29:36 +01:00
- The classic "Hello World" example for embedded systems: blinking an LED (or printing "Blink!" via stdio when none are available).
2024-11-12 10:01:55 +01:00
- [leds_shell ](./leds_shell/README.md )
2024-11-06 13:29:36 +01:00
- The application `leds_shell` is a basic example, which allows easy, interactive
control of internal board LEDs, and basic GPIO for externally connected simple
devices (for e.g. additional LEDs, relay, motors - via dedicated drivers, etc.)
via the shell.
2024-11-12 10:01:55 +01:00
- [saul ](./saul/README.md )
- This example demonstrates the usage of the SAUL (Sensor Actuator Uber Layer) module.
- [timer_periodic_wakeup ](./timer_periodic_wakeup/README.md )
2024-11-06 13:29:36 +01:00
- How to set up a periodic wakeup timer using the RIOT operating system.
2024-11-12 10:01:55 +01:00
- [ipc_pingpong ](./ipc_pingpong/README.md )
2024-11-06 13:29:36 +01:00
- This example is to illustrate the usage of RIOTs IPC messaging system.
2024-11-12 10:01:55 +01:00
- [filesystem ](./filesystem/README.md )
2024-11-06 13:29:36 +01:00
- This example showcases ways to interact/manage the filesystem in RIOT.
2024-11-12 10:01:55 +01:00
### RIOT Language Bindings
2024-11-06 13:29:36 +01:00
2024-11-12 10:01:55 +01:00
#### Officially Supported/Targeted
2024-11-06 13:29:36 +01:00
2024-11-12 10:01:55 +01:00
##### _Rust_
2024-11-06 13:29:36 +01:00
2024-11-12 10:01:55 +01:00
- [rust-hello-world ](./rust-hello-world/README.md )
2024-11-06 13:29:36 +01:00
- This example demonstrates how to write a simple RIOT application in Rust.
2024-11-12 10:01:55 +01:00
- [rust-gcoap ](./rust-gcoap/README.md )
2024-11-06 13:29:36 +01:00
- This example demonstrates how to write a coap server application in Rust using the RIOTs gcoap module.
2024-11-12 10:01:55 +01:00
- [rust-async ](./rust-async/README.md )
2024-11-06 13:29:36 +01:00
- This example demonstrates how to use Rusts async/await syntax in a RIOT application.
2024-11-12 10:01:55 +01:00
##### _C++_
2024-11-06 13:29:36 +01:00
2024-11-12 10:01:55 +01:00
- [riot_and_cpp ](./riot_and_cpp/README.md )
2024-11-06 13:29:36 +01:00
- Example of using C++ in RIOT applications.
2024-11-12 10:01:55 +01:00
#### Community Supported
2024-11-06 13:29:36 +01:00
2024-11-12 10:01:55 +01:00
- [javascript ](./javascript/README.md )
2024-11-06 13:29:36 +01:00
- How to write IoT applications using javascript using JerryScript.
2024-11-12 10:01:55 +01:00
- [lua_basic ](./lua_basic/README.md )
2024-11-06 13:29:36 +01:00
- How to write IoT applications using Lua.
2024-11-12 10:01:55 +01:00
- [lua_REPL ](./lua_REPL/README.md )
2024-11-06 13:29:36 +01:00
- This example demonstrates how to use the Lua Read-Eval-Print Loop (REPL) in RIOT.
2024-11-12 10:01:55 +01:00
- [micropython ](./micropython/README.md )
2024-11-06 13:29:36 +01:00
- How to use the MicroPython port for RIOT.
2024-11-12 10:01:55 +01:00
- [wasm ](./wasm/README.md )
2024-11-06 13:29:36 +01:00
- How to use WebAssembly in RIOT.
2024-11-12 10:01:55 +01:00
- [arduino_hello-world ](./arduino_hello-world/README.md )
- This application demonstrates the usage of Arduino sketches in RIOT.
2024-11-06 13:29:36 +01:00
2024-11-12 10:01:55 +01:00
## Networking
2024-11-06 13:29:36 +01:00
2024-11-12 10:01:55 +01:00
### Constraint Application Protocol (CoAP)
2024-11-06 13:29:36 +01:00
2024-11-12 10:01:55 +01:00
- [gcoap ](./gcoap/README.md )
2024-11-06 13:29:36 +01:00
- This example demonstrates the usage of the `gcoap` module, a high-level API for CoAP (Constrained Application Protocol) messaging.
2024-11-12 10:01:55 +01:00
- [gcoap_block_server ](./gcoap_block_server/README.md )
2024-11-06 13:29:36 +01:00
- CoAP server handling for Block requests, build with gcoap using nanocoap block handling functions.
2024-11-12 10:01:55 +01:00
- [gcoap_fileserver ](./gcoap_fileserver/README.md )
2024-11-06 13:29:36 +01:00
- This example demonstrates the usage of the `gcoap`
module to serve files over CoAP.
2024-11-12 10:01:55 +01:00
- [nanocoap_server ](./nanocoap_server/README.md )
- This example demonstrates the usage of the `nanocoap` module, a high-level API for CoAP (Constrained Application Protocol) messaging.
### Bluetooth Low Energy (BLE)
2024-11-06 13:29:36 +01:00
2024-11-12 10:01:55 +01:00
#### NimBLE
2024-11-06 13:29:36 +01:00
2024-11-12 10:01:55 +01:00
- [nimble_scanner ](./nimble_scanner/README.md )
2024-11-06 13:29:36 +01:00
- This example showcases the usage of the `NimBLE` BLE stack as a scanner.
2024-11-12 10:01:55 +01:00
- [nimble_gatt ](./nimble_gatt/README.md )
2024-11-06 13:29:36 +01:00
- This example application configures and runs the NimBLE BLE stack as simple GATT
server.
2024-11-12 10:01:55 +01:00
- [nimble_heart_rate_sensor ](./nimble_heart_rate_sensor/README.md )
- This example demonstrates how to implement asynchronous data transfer using GATT
notifications by implementing a mock-up BLE heart rate sensor.
- [nimble_heart_rate_sensor ](./nimble_heart_rate_sensor/README.md )
2024-11-06 13:29:36 +01:00
- This example demonstrates how to implement asynchronous data transfer using GATT
notifications by implementing a mock-up BLE heart rate sensor.
2024-11-12 10:01:55 +01:00
#### Misc BLE Examples
2024-11-06 13:29:36 +01:00
2024-11-12 10:01:55 +01:00
- [skald_eddystone ](./skald_eddystone/README.md )
- This example demonstrates the usage of `Skald` for creating an Google `Eddystone` beacon.
- [skald_ibeacon ](./skald_ibeacon/README.md )
- This example demonstrates the usage of `Skald` for creating an Apple `iBeacon` .
### MQTT
- [asymcute_mqttsn ](./asymcute_mqttsn/README.md )
2024-11-06 13:29:36 +01:00
- This application demonstrates the usage of the Asymcute (MQTT-SN) module in RIOT.
2024-11-12 10:01:55 +01:00
- [emcute_mqttsn ](./emcute_mqttsn/README.md )
2024-11-06 13:29:36 +01:00
- This application demonstrates the usage of the emCute (MQTT-SN) module in RIOT.
2024-11-12 10:01:55 +01:00
- [paho-mqtt ](./paho-mqtt/README.md )
2024-11-06 13:29:36 +01:00
- This example demonstrates the usage of the Paho MQTT client library in RIOT.
2024-11-12 10:01:55 +01:00
### CoRE Resource Directory
2024-11-06 13:29:36 +01:00
2024-11-12 10:01:55 +01:00
- [cord_ep ](./cord_ep/README.md )
2024-11-06 13:29:36 +01:00
- Example of RIOT's Resource Directory (RD) endpoint module, called `cord_ep`
2024-11-12 10:01:55 +01:00
- [cord_lc ](./cord_lc/README.md )
2024-11-06 13:29:36 +01:00
- Example of RIOT's Resource Directory (RD) lookup module, called `cord_lc`
2024-11-12 10:01:55 +01:00
- [cord_epsim ](./cord_epsim/README.md )
2024-11-06 13:29:36 +01:00
- This example shows how a node can register with a CoRE resource directory
2024-11-12 10:01:55 +01:00
### GNRC Networking
2024-11-06 13:29:36 +01:00
2024-11-12 10:01:55 +01:00
- [gnrc_minimal ](./gnrc_minimal/README.md )
2024-11-06 13:29:36 +01:00
- This is a minimalistic example for RIOT's gnrc network stack.
2024-11-12 10:01:55 +01:00
- [gnrc_networking ](./gnrc_networking/README.md )
2024-11-06 13:29:36 +01:00
- This example demonstrates the usage of the GNRC network stack in RIOT.
2024-11-12 10:01:55 +01:00
- [gnrc_networking_subnets ](./gnrc_networking_subnets/README.md )
2024-11-06 13:29:36 +01:00
- This example demonstrates IPv6 subnet auto-configuration for networks on
a tree topology.
2024-11-12 10:01:55 +01:00
- [gnrc_border_router ](./gnrc_border_router/README.md )
2024-11-06 13:29:36 +01:00
- Example of `gnrc_border_router` using automatic configuration
2024-11-12 10:01:55 +01:00
- [gnrc_lorawan ](./gnrc_lorawan/README.md )
2024-11-06 13:29:36 +01:00
- Send and receive LoRaWAN packets and perform basic LoRaWAN commands
2024-11-12 10:01:55 +01:00
- [gnrc_networking_mac ](./gnrc_networking_mac/README.md )
2024-11-06 13:29:36 +01:00
- This example shows you how to try out communications between RIOT instances with duty-cycled MAC layer protocols
2024-11-12 10:01:55 +01:00
### DTLS
2024-11-06 13:29:36 +01:00
2024-11-12 10:01:55 +01:00
- [dtls-sock ](./dtls-sock/README.md )
- This example shows how to use DTLS sock `sock_dtls_t`
- [dtls-echo ](./dtls-echo/README.md )
- This example shows how to use TinyDTLS with sock_udp.
- [dtls-wolfssl ](./dtls-wolfssl/README.md )
- This example demonstrates the usage of the DTLS module with the wolfSSL library.^
### Misc
- [lorawan ](./lorawan/README.md )
2024-11-06 13:29:36 +01:00
- This application shows a basic LoRaWAN use-case with RIOT.
2024-11-12 10:01:55 +01:00
- [openthread ](./openthread/README.md )
2024-11-06 13:29:36 +01:00
- This example demonstrates the usage of the OpenThread stack in RIOT.
2024-11-12 10:01:55 +01:00
- [lwm2m ](./lwm2m/README.md )
2024-11-06 13:29:36 +01:00
- Example of a LWM2M client on RIOT
2024-11-12 10:01:55 +01:00
- [ccn-lite-relay ](./ccn-lite-relay/README.md )
2024-11-06 13:29:36 +01:00
- This application demonstrates how to use the Content-Centric Networking stack
from [CCN-Lite ](http://www.ccn-lite.net/ ) on RIOT
2024-11-12 10:01:55 +01:00
- [telnet_server ](./telnet_server/README.md )
2024-11-06 13:29:36 +01:00
- Simple telnet server that listens on port 23 over IPv6.
2024-11-12 10:01:55 +01:00
- [posix_sockets ](./posix_sockets/README.md )
2024-11-06 13:29:36 +01:00
- Showcase for RIOT's POSIX socket support
2024-11-12 10:01:55 +01:00
- [spectrum-scanner ](./spectrum-scanner/README.md )
2024-11-06 13:29:36 +01:00
- This example demonstrates how to monitor energy levels on all available wireless channels
2024-11-12 10:01:55 +01:00
- [sniffer ](./sniffer/README.md )
2024-11-06 13:29:36 +01:00
- This application is built to run together with the script `./tools/sniffer.py`
as a sniffer for (wireless) data traffic.
2024-11-12 10:01:55 +01:00
## Advanced Examples
2024-11-06 13:29:36 +01:00
2024-11-12 10:01:55 +01:00
- [bindist ](./bindist/README.md )
2024-11-06 13:29:36 +01:00
- RIOT allows for creating a "binary distribution", which can be used to ship
proprietary, compiled objects in a way that makes it possible to re-link them
against a freshly compiled RIOT. This application serves as a simple example.
2024-11-12 10:01:55 +01:00
- [usbus_minimal ](./usbus_minimal/README.md )
2024-11-06 13:29:36 +01:00
- This is a minimalistic example for RIOT's USB stack.
2024-11-12 10:01:55 +01:00
- [suit_update ](./suit_update/README.md )
2024-11-06 13:29:36 +01:00
- This example shows how to integrate SUIT-compliant firmware updates into a
RIOT application.
2024-11-12 10:01:55 +01:00
- [thread_duel ](./thread_duel/README.md )
2024-11-06 13:29:36 +01:00
- This is a thread duel application to show RIOTs abilities to run multiple-threads
concurrently, even if they are neither cooperative nor dividable into different scheduler priorities, by using the optional round-robin scheduler module.
2024-11-12 10:01:55 +01:00
- [posix_select ](./posix_select/README.md )
2024-11-06 13:29:36 +01:00
- This example is a showcase for RIOT's POSIX select support
- [psa_crypto ](./psa_crypto )
2024-11-12 10:01:55 +01:00
- Basic functions of the PSA Crypto API
- [pio_blink ](./pio_blink/README.md )
2024-11-06 13:29:36 +01:00
- How to use the PIO peripheral on the RaspberryPi Pico to blink an LED.
2024-11-12 10:01:55 +01:00
- [twr_aloha ](./twr_aloha/README.md )
2024-11-06 13:29:36 +01:00
- This example allows testing different two-way ranging algorithms between
two boards supporting a dw1000 device. This makes use of the uwb-core
pkg.