rusty-things

0.1.0 • Public • Published

MMM-rusty-things

MagicMirror module to access your todo-entries from Things and display them in MM. It was a learning project for me where I learnt about how to interact between Rust and Node.

Screenshot

The module looks like this:

Example of MMM-rusty-things publishing todos

Installation

git clone https://github.com/piceaTech/MMM-rusty-things.git
cd MMM-rusty-things.git
npm install
mv example.env .env

Edit the .env and insert your hist_id.

After that either compile the native module locally on the pi or cross-compile from your desktop.

No cross-compilation

In the folder rust-things execute: neon build --release

(This runs for approximately 30 minutes.)

Cross-compilation (e.g. from x64 to arm)

  1. Build the build-Container
  2. git clone https://github.com/piceaTech/rust-on-raspberry-docker
  3. cd rust-on-raspberry-docker
  4. git checkout neon
  5. If you need another node version than the current LTS-Version: Edit the Dockerfile and switch to correct BaseImage.
  6. docker build --tag "neon-pi-cross:latest" .
  7. Copy the following dependencies as .debs into native/pi_deps
  8. ssl: http://ftp.debian.org/debian/pool/main/o/openssl1.0/libssl1.0-dev_1.0.2r-1~deb9u1_armhf.deb
  9. sqlite: http://ftp.debian.org/debian/pool/main/s/sqlite3/libsqlite3-dev_3.16.2-5+deb9u1_armhf.deb
  10. Inside your neon-folder run native/build.sh. This should create a native/index.node which should be compatible with arm.
  • Currently there is an error in neon-serde which requires that the following patch be applied manually inside https://github.com/GabrielCastro/neon-serde/pull/29 inside your ~/.cargo/registry
  • Currently neon does not support cross-compilation. it requires you add the following patch in the node_modules folder youreself: https://github.com/neon-bindings/neon/pull/411
    • Best insert it into the js code in the lib folder and not the Typescript code as then you would need to recompile the code
  1. Deploy this artifact to the pi!
  2. Done

Readme

Keywords

none

Package Sidebar

Install

npm i rusty-things

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

136 kB

Total Files

22

Last publish

Collaborators

  • spruce