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:
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)
- Build the build-Container
git clone https://github.com/piceaTech/rust-on-raspberry-docker
cd rust-on-raspberry-docker
git checkout neon
- If you need another node version than the current LTS-Version: Edit the Dockerfile and switch to correct BaseImage.
docker build --tag "neon-pi-cross:latest" .
- Copy the following dependencies as
.deb
s intonative/pi_deps
- ssl: http://ftp.debian.org/debian/pool/main/o/openssl1.0/libssl1.0-dev_1.0.2r-1~deb9u1_armhf.deb
- sqlite: http://ftp.debian.org/debian/pool/main/s/sqlite3/libsqlite3-dev_3.16.2-5+deb9u1_armhf.deb
- Inside your neon-folder run
native/build.sh
. This should create anative/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
- Deploy this artifact to the pi!
- Done