Skip to content

Install From Source

Andrew Lee edited this page Jan 8, 2018 · 2 revisions

Installing from source requires a few more dependencies.

Golang and golang packages

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 uses go-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.

Pull and Build Prometheus

git clone https://github.com/gilgameshskytrooper/prometheus.git
cd prometheus/
go build

Automatically Run in Background

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.