lateralus

command module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2023 License: MIT Imports: 11 Imported by: 0

README

Lateralus API

This is a sensor, servo and camera api for some raspberry pi hardware. Use the pushit daemon to scrape data and push them to the schism API.

Chechout the repository via git clone && cd lateralus.

Config is done via .envrc, you need to install direnv on your dev machine and on the raspberry.

To install dependencies run go mod download.

To easily build the binary and run it on a raspberry you can use bob - install it via go get gitlab.void-ptr.org/go/bob.

Install

Raspberry Pi Zero
1. Install golang
# Create go install script
tee ~/go-install.sh <<-'EOF'
#!/bin/bash
export GOLANG="$(curl https://golang.org/dl/|grep armv6l|grep -v beta|head -1|awk -F\> {'print $3'}|awk -F\< {'print $1'})"
wget https://golang.org/dl/$GOLANG
sudo tar -C /usr/local -xzf $GOLANG
rm $GOLANG
unset GOLANG
EOF

chmod +x ~/go-install.sh
~/go-install.sh
rm -f go-install.sh

echo "export PATH=$PATH:/usr/local/go/bin" >> "~/.bashrc"
2. Build and copy from dev machine

Install direnv (sudo apt install direnv)

# setup your local dev repo
git clone ssh://git@gitlab.void-ptr.org:2222/go/lateralus.git
cd lateralus
go mod download
# install bob
go install gitlab.void-ptr.org/go/bob
# do your modifications
git push
# Build and copy
bob build
bob copy
3. Install on raspberry

Install direnv (sudo apt install direnv)

# Create go module folder and go into it
mkdir -p ~/go/src/gitlab.void-ptr.org/go
cd ~/go/src/gitlab.void-ptr.org/go
# Clone into ~/go/src/gitlab.void-ptr.org/go/lateralus
git clone ssh://git@gitlab.void-ptr.org:2222/go/lateralus.git
cd lateralus
direnv allow .
# install bob
go get gitlab.void-ptr.org/go/bob
# create lateralus config
cp .sample.lateralus.yaml .lateralus.yaml
# run lat-build and lat-copy on your remote machine
bob init

Hardware

RaspiCam

See camera/raspicam.go

Routes:

  • POST /camera/still
  • GET /camera/still/{id}
  • DELETE /camera/still/{id}
BME280

See sensors/bme280.go

Routes:

  • /sensors/bme280
SI1145

See sensors/si1145.go

Routes:

  • /sensors/si1145
NU40C16

See sensors/nu40c16.go

Routes:

  • /sensors/nu40c16
SoilMoisture

See sensors/soilMoisture.go

Routes:

  • /sensors/soil-moisture
AirQuality

See sensors/airQuality.go

Routes:

  • /sensors/air-quality
Servos

See servos/basic.go

Routes:

  • /servos/gpio/23

Build

GOPROXY=proxy.golang.org go list -m gitlab.void-ptr.org/go/lateralus@v0.1.0

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
api

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL