Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.
/ goccupied-server Public archive

Golang based brightness tester for Raspberry Pi

License

Notifications You must be signed in to change notification settings

evodicka/goccupied-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goccupied

This is a simple webserver written in golang. It is designed to run on a Raspberry Pi and access its GPIO pins.

The server periodically checks GPIO14 for input. The input is expected to come from a brightness sensor that sends a Low signal when light is above a certain threshold and a high signal otherwise.

The state can be queried by a http request to http://<hostname>:8000/api/v1/occupied which also returns the duration of the current state in seconds. The sensor can be queried directly by calling http://<hostname>:8000/api/v1/light

Compile this code with GOOS=linux and GOARCH=arm

About

Golang based brightness tester for Raspberry Pi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages