drogue-device
drogue-device copied to clipboard
A distribution of tools and examples for building embedded IoT applications in Rust
Drogue Device
Drogue device is a distribution of tools and examples for building embedded applications in Rust.
- Built using rust, an efficient, memory safe and thread safe programming language.
- Based on embassy, the embedded async project.
- IoT examples for BLE, BLE Mesh, WiFi and LoRaWAN.
- Async programming model for writing safe and efficient applications.
- All software is licensed under the Apache 2.0 open source license.
See the documentation for more information and an overview of the examples.
Go to our homepage to learn more about the Drogue IoT project.
Example application
An overview of the examples can be found in the documentation.
Drogue device runs on any hardware supported by embassy, which at the time of writing includes:
- nRF52
- STM32
- Raspberry Pi Pico
- Linux, Mac OS X or Windows
- WASM (WebAssembly)
Once you've found an example you like, you can run cargo xtask clone <example_dir> <target_dir> to create a copy with the correct dependencies and project files set up.
A basic blinky application
#[embassy::main]
async fn main(_spawner: Spawner, p: Peripherals) {
let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard);
loop {
led.set_high();
Timer::after(Duration::from_millis(300)).await;
led.set_low();
Timer::after(Duration::from_millis(300)).await;
}
}
Building
To build drogue-device, you must install the nightly rust toolchain. Once installed, you can build and test the framework by running
cargo build
To do a full build of everything including examples:
cargo xtask ci
This might require you do install additional toolchains for the examples to build. Recent versions
of cargo should automatically install the toolchain from looking at the rust-toolchain.toml file.
To update dependencies, run:
cargo xtask update
Directory layout
device- the source of the drogue-device frameworkdevice/src/traits- traits provided by drogue that can be used in async code, such as TCP, WiFi or LoRadevice/src/drivers- async drivers that implement traits for a one or more peripheralsdevice/src/network- network connectivity, common network implementations, HTTP clients,device/src/actors- common actors that can be used in applicationsdevice/src/bsp- board support packages for boards commonly used in drogue device
macros- macros used by drogue-device and application codeexamples- examples for different platforms and boards
Contributing
See the document CONTRIBUTING.md.
Community
- Drogue IoT Matrix Chat Room
- We have bi-weekly calls at 9:00 AM (GMT). Check the calendar to see which week we are having the next call, and feel free to join!
- Drogue IoT Forum
- Drogue IoT YouTube channel
- Follow us on Twitter!