Skip to content

mrjackwills/belugasnooze_pi

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

belugasnooze pi client

A pi based wake up light sunrise alarm clock

The backend pi client that executes instructions from belugasnooze.com, powered by staticPi.com
See the frontend Vue & Typescript site source here

Built in Rust, using SQLite
See typescript branch for original, now not maintained, typescript version

Required Hardware

  1. Raspberry pi - designed for, tested, and fully working, a Raspberry pi zero w
  2. Pimoroni Blinkt! led strip

Required services

  1. staticPi - the simple and secure messaging service

Suggested software

  1. Docker - container runner

Suggested locations for directories required by belugasnooze

directory reason
~/belugasnooze/ Location of the node app
/ramdrive tmpfs ramdrive
# addition to /etc/fstab
ramdrive /ramdrive tmpfs defaults,noatime,size=128K     0       0

Files that are required by belugasnooze

file reason
./.env environmental variables
ip.addr ip address for private network
alarms.db database location

suggested crontab

@reboot ip addr show wlan0 | grep -Po 'inet \K[\d.]+' > /ramdrive/ip.addr
* * * * * ip addr show wlan0 | grep -Po 'inet \K[\d.]+' > /ramdrive/ip.addr

ip address gets updated every 5 minutes, so write to a ramdrive rather than causing repetitive, eventually damaging, writes to the pi's SD card

Download

See releases

download (armv6 one-liner)

wget https://www.github.com/mrjackwills/belugasnooze_pi/releases/latest/download/belugasnooze_linux_armv6.tar.gz &&
tar xzvf belugasnooze_linux_armv6.tar.gz belugasnooze

Run

use ./run.sh in order to start, stop, or rebuild, the docker container - requires dialog to be installed on your system

Build step

Raspberry pi

requires docker & cross-rs

32bit pi (pi zero w)

Designed for, tested, fully working, and originally built for pi zero w, running Raspberry Pi OS 32 bit

cross build --target arm-unknown-linux-musleabihf --release

Untested on other platforms

Tests

Some test coverage, needs work

run all;

cargo test -- --test-threads=1 --nocapture

Watch for test that start some_prefix;

cargo watch -q -c -w src/ -x 'test some_prefix_ -- --test-threads=1 --nocapture'

Cargo watch

cargo watch -q -c -w src/ -x 'run'