Code Monkey home page Code Monkey logo

hyperion.rs's Introduction

Build Docs GitHub

hyperion.rs is a rewrite of hyperion.ng in the Rust Programming Language. This version features:

  • Very low resource requirements (can be run on a single thread, useful for the Raspberry Pi Zero for example)
  • No memory leaks (most allocations are static anyways)
  • Easy to compile and cross-compile

Disclaimer: this is an early work-in-progress:

  • A lot of internals may still change, in case you would like to contribute please contact me beforehand.
  • Only a small subset of the original project's features are currently supported. This means that unless you're using it in the exact same context as I am (Android TV Grabber + Raspberry Pi Zero W + WS2815 LED strip), this might not be for you.

Compatibility

Currently implemented features:

  • Loading settings from the hyperion.ng database
  • File, WS2812SPI devices
  • JSON, Protobuf, Flatbuffers and Boblight server
  • Black border detector, color channel adjustments, smoothing
  • Basic effect support (only setColor and setImage, no custom smoothing, no per-instance effect directory). Can be disabled if Python is not available for the target platform (see the python feature).

Extra features not available in hyperion.ng:

  • Hooks (global start, stop, and instance start, stop, activate, deactivate)
  • RGB color temperature adjustment

Configuration

Migrating your settings

This rewrite uses the same database format for storing settings. In order to load your existing hyperion.ng settings, assuming you are in your home directory:

# Create config directory for hyperion.rs
$ mkdir -p .config/hyperion.rs/

# Copy the existing hyperion.ng database to the new location for hyperion.rs
$ cp .hyperion/db/hyperion.db .config/hyperion.rs/

Using a TOML file

You may also configure hyperion.rs using a TOML representation of the configuration. To generate the initial file, you can use the --dump-config option:

$ hyperiond-rs --dump-config >config.toml

Then, you can start the daemon using this config file:

$ hyperiond-rs --config config.toml

The minimal configuration required is as follows:

[instances.0.instance]
friendlyName = 'Test instance'
enabled = true

[instances.0.device]
type = 'dummy'

Running hyperion.rs

Once your settings database has been migrated, you can run hyperion.rs using cargo:

$ cargo run

If running from a release archive, invoke the hyperiond-rs binary directly.

Cross-compiling

Cross-compiling is done using cross. Let's say we are building for the Raspberry Pi Zero, which corresponds to the Rust target arm-unknown-linux-gnueabihf.

$ export TARGET=arm-unknown-linux-gnueabihf
$ export ENABLE_PYO3=1

# (if not done already) Install cross
$ cargo install --force cross

# Build the project
$ cross build --release --target $TARGET

# The resulting binaries will be in target/$TARGET/release

License

This work is licensed under the MIT License.

Author

Vincent Tavernier [email protected]. Original project and protocol source files by hyperion-project.

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.