Skip to content

vadian/SensESP-rs

Repository files navigation

SensESP-rs

Sensor library in Rust designed for use with SignalK and the Sailor Hat ESP32. Built with heavy inspiration from SensESP. While this library will strive to eventually reach feature parity with the C SensESP implementation, it will not necessarily follow the same patterns.

Getting Started

Lots of starter information can be found in The Rust on ESP Book. You will need to install a toolchain for the xtensa-esp32-none-elf target. This is a std project, not no-std, so the full standard library is at your disposal.

Installing the Espressif Rust Ecosystem

cargo install espup
espup install

Installing the flash utils (standalone and cargo bindings)

cargo install espflash
cargo install cargo-espflash

WSL

To expose the serial port to WSL, usbipd must be used to forward the port. See this guide. There is also a vscode extension, USBIP Connect.

You may also need to deal with permissions on the device, which is likely /dev/ttyUSB0 after attaching with usbipd. This can be accomplished by using udev to add the device to the dialout group, adding the user to this group as well, and setting permissions to 660.

See: (Enabling udev)[microsoft/WSL#8502] (Adding udev rule for virtual USB device)[https://askubuntu.com/questions/1048870/permission-denied-to-non-root-user-for-usb-device]

Build and Run

Build all targets: cargo build

Run the example on an ESP32: cargo run --bin example

Run the I2C scanner: cargo run --bin scanner

Eventually, cargo test will also do something. Today is not that day.

About

SignalK Sensors Platform for ESP32 in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages