Giter VIP home page Giter VIP logo

golioth-rs's Introduction

golioth-rs

An experimental project for using Golioth (currently just) on the nRF9160.

This project is currently in a holding pattern until the Embedded Rust ecosystem has caught up to the necessary networking support.

What's needed before resurrection?

Before this project can be revived, two things are necessary:

  1. Rust Embedded needs better networking support. This means that the AsyncRead and AsyncWrite traits should be either accessible on #![no_std] in a widely-used crate or that they should be stabilized in core.

    1.1. This also means that the nrfxlib crate should be accessible with AsyncRead and AsyncWrite.

  2. There should be a Rust DTLS implementation that supports #![no_std] and PSK authentication usable through AsyncRead and AsyncWrite. This could be written in Rust (e.g. drogue-iot) or bound (e.g. mbedtls).

When these critera are met, the Golioth struct in this crate should be modified to be generic on an AsyncRead + AsyncWrite type, which should be passed into the Golioth::new function. The issue here is that we can't confirm that the tunnel is being sent over DTLS: maybe there's a different design that's better?

Setup

Bootloader

You will need to flash spm onto the nRF9160 you use. This will jump to 0x50000 on boot, which is where the rust binary will be located.

Config

Insert your device's Golioth PSK ID and PSK into the consts in the src/config.rs file.

Dependencies

1. flip-link:

$ cargo install flip-link

2. probe-run:

Install the git version of probe-run

$ cargo install --git https://github.com/knurling-rs/probe-run --branch main

4. Install the correct target

$ rustup target add thumbv8m.main-none-eabi --toolchain nightly 

4. Run!

$ cargo +nightly run

or

$ cargo +nightly run --release

Nightly is required in order to setup an alloc error handler.

(4. Set rust-analyzer.linkedProjects)

If you are using rust-analyzer with VS Code for IDE-like features you can add following configuration to your .vscode/settings.json to make it work transparently across workspaces. Find the details of this option in the RA docs.

{
    "rust-analyzer.linkedProjects": [
        "Cargo.toml",
        "firmware/Cargo.toml",
    ]
} 

License

Licensed under either of

at your option.

golioth-rs's People

Contributors

lachlansneff avatar alvarowolfx avatar macthestack avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.