Decaf is the Mugsy JSON API. And at least for now, that stands for Does Every Coffee Action, Friend.
Current Requirements:
Install on Raspberry Pi: (instructions in progress)
python3 -m db
for creating sqlite dbAccess end point by pointing your browser or a curl request to:
http://192.168.1.183:5000/brewSettings/1
http://192.168.1.183:5000/coffeeInfo/2
etc...
dont forget to change the ip to your Pi's IP, or local host if your are browsing from the pi itself.
It currently requires 5 arguments:
pin
(int) GPIO Pin Numberchannel
(int) Relay ChanneltimeOn
(float) Total running timerepeat
(int) Number of times to repeatrepeatDelay
(float) Delay between repeat timesExample:
POST http://192.168.1.183:5000/relayControl/grinder HTTP/1.1
Content-Type: application/json
{"pin":23,"channel":1,"timeOn":1.0,"repeat":3,"repeatDelay":2.0}
This turns on pin 23 which is connected to relay channel 1 for 2 seconds, it repeats 2 times with a delay of 4 seconds between repeats and is connected to the grinder.
Access pinInfo by pointing your browser or a curl request to: http://192.168.1.183:5000/pinInfo/grinder
git clone https://github.com/margyle/decaf.git && cd decaf
docker build -t heymugsy .
docker run -p 5000:5000 heymugsy