1
0
Fork 0
mirror of https://github.com/shouptech/tempgopher.git synced 2026-02-03 08:39:43 +00:00
No description
Find a file
2018-10-03 08:40:59 -06:00
tests Add test for duplicates 2018-10-02 13:25:00 -06:00
.gitignore Add more ignore things 2018-09-30 19:44:45 -06:00
config.go Add check for dupliate ID or alias 2018-10-02 13:17:03 -06:00
config_test.go Add tests 2018-10-02 15:29:00 -06:00
main.go Add config endpoint 2018-10-02 13:10:41 -06:00
README.md Add more documentation 2018-10-03 08:40:59 -06:00
thermostat.go Use static future date 2018-10-03 08:25:52 -06:00
thermostat_test.go Rename files 2018-09-30 09:00:51 -06:00
web.go Add config endpoint 2018-10-02 13:10:41 -06:00

Temp Gopher

Temp Gopher is a thermostat application written in Go. It is written and tested using a Raspberry Pi, but any hardware platform meeting the requirements will probably work.

Requirements

You will need a computer (e.g., Raspberry Pi) with the following components:

  • A network connection
  • DS18B120, 1-wire temperature sensors
  • GPIO pins
  • Relays for powering on/off your equipment hooked up to the GPIO pins

Installation

You can build on a Raspberry Pi, however, it can take a long time! I recommend building on a separate computer with a bit more processing power.

go get gitea.shoup.io/mike/temp-gopher
cd $GOPATH/src/gitea.shoup.io/mike/temp-gopher
GOOS=linux GOARCH=arm GOARM=6 go build -a -ldflags '-w -s -extldflags "-static"'
scp temp-gopher <raspberrypi>:~/somepath

Configuration

Create a config.yml file like this:

sensors:
- id: 28-000008083108 # Id of the DS18b120 sensor
  alias: fermenter # An alias for the sensor
  hightemp: 8 # Maximum temperature you want the sensor to read
  lowtemp: 4 # Minimum tempearture you want the sensor to read
  heatgpio: 5 # GPIO pin the heater is hooked into
  heatinvert: false # Probably false. If true, will set pin to High to turn the heater off
  heatminutes: 1 # Number of minutes below the minimum before the heater turns on
  coolgpio: 17 # GPIO pin the cooler is hooked into
  coolinvert: false # Probably false. If true, will set pin to High to turn the cooler off
  coolminutes: 10 # Number of minutes below the minimum before the cooler turns on
  verbose: false # If true, outputs the current status at every read, approx once per second

Running

You can run it directly in the comment line like:

./temp-gopher -c config.yml run

You can run it in the background using nohup:

nohup ./temp-gopher -c config.yml run &

Or use systemctl or some other process supervisor to run it.