-
Notifications
You must be signed in to change notification settings - Fork 0
Install From Source
Installing from source requires a few more dependencies.
sudo apt install golang
Then you need to add a GOPATH in ~/.profile
(or ~/.bashrc
if you prefer)
Add the following lines to
~/.profile
export GOPATH=/home/pi/go
export PATH=$PATH:$(go env GOPATH)/bin
Then, you need to add those environments to bash. *You only have to do this once. ~/.profile
is sourced every time you start a new instance of the bash shell.
source ~/.profile
Now that you have a Golang environment set up, get the packages Prometheus depends on.
go get github.com/robfig/cron
go get github.com/stianeikeland/go-rpio
go get github.com/jacobsa/go-serial/serial
robfig/cron
is a library that provides an easy to use cron task interface (which Prometheus uses to run the alarm logic exactly once a minute (as well as the 1 second interval to send the time signal via serial USB to the Nixie Clock Arduino board).
stianeikeland/go-rpio
is a library that lets you work with the GPIO pins using golang. The code that directly usesgo-rpio
is located in gpio/gpio.go.
jacobsa/go-serial/serial
is a library used send the time + LED color strings to the Arduino display logic board.
git clone https://github.com/gilgameshskytrooper/prometheus.git
cd prometheus/
go build
To run prometheus automatically in the background for every reboot, you will want to add it to rc.local
.
In
/etc/rc.local
, add the following line at the end:
/[path_to_prometheus]/prometheus &
When you restart the Pi, prometheus will automatically run. The &
at the end is to ensure that bash runs prometheus, then sends it to a background in order to finish other boot processes.