Skip to content

wblakecaldwell/sump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sump: Raspberry Pi-based Sump Monitor Build Status

TLDR: Raspberry Pi + custom circuitry + Go service in Google AppEngine = http://sump.blakecaldwell.net

Details

This is the code for my DIY sump water level monitoring system. I have a Raspberry Pi A+ in my basement with some custom circuitry to monitor the water level in my sump pit. Every 2 seconds, the Raspberry Pi posts the current status to my server, which is hosted in Google App Engine. The server keeps track of the levels, and displays them in a pretty chart, here: http://sump.blakecaldwell.net. If the level gets above a certain threshold (the pump died), the server will email me.

Client

The client code is written in Python, running on a Raspberry Pi A+.

It reads values from an analog-to-digital converter, estimates the water level, and sends it to my server. At some point, I'll post the schematics of my custom circuitry.

Server

The server is written in Go, and hosted in Google App Engine.

The server hosts the following endpoints:

At this point, the server just keeps all of the readings in memory, in an ever-expanding slice. I never intended to keep that around outside of testing, but after launching this to test it out, it seemed "fine". From time to time, I noticed that Google restarted my service. Maybe this is the reason. No big deal. I'll update it at some point.

Building

I can't imagine anyone out there is going to replicate this project, but if you do, you'll need to create your own server/config_values.go from server/config_values.go.template. This is the best way I found to get settings into a Go service that's hosted in AppEngine. I would have preferred using environment variables, listed in app.yaml, but Google doesn't support this for Go services.

About

Sump: Raspberry Pi-based Sump Monitor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published