Order your coffee in one click or everything else
Click the button, the raspberry boot, call your webhook then shutdown
- a Raspberry Pi with Wifi, or ethernet connection if you like cables
- an SD card (2GB should do)
- 2 leds (red & green, or anything you see fit) with 330Ω resitors and cables
- a push button with cables
- optionnaly a breadboard, to check the connections before soldering the elements
- Connect the push button on pins 5 & 6 (SCL & Ground), so the click will wake it.
- Connect the green led and a resistor on pins 32 & 34 (PWM0 & Ground).
- Connect the red led and the other resistor on pins 12 & 14 (PWM0 & Ground).
- Get a Raspbian lite image from the official page
- Burn it on the SD card: ex. on Linux/BSD ->
sudo dd bs=1M conv=noerror,sync status=progress if=<path_to_your_img/name.img> of=<path_to_mounted_SDcard>
- Start the pi with screen and keyboard to configure Wifi, using the
sudo raspi-config
command - Get sources. Either with git or by hand :
- Git :
apt install -y git
git clone https://github.com/Zenika/coffee-button
- copy source code to
/home/pi/coffee-button
on the pi - Make a copy of
.env.example
to.env
and add the webhook and token you created. We used Zapier to handle the request and filter the Authorization header then send the email and Slack notification. You also need to set the number of days between orders (integer required) - Setting the
DRY_RUN
variable totrue
will setup an empty run of the script for the next time it will be plugged - Test the script on pi by running
/home/pi/coffee-button/init.sh
- Add
init.sh
to the boot process : edit/etc/rc.local
and add a line/home/pi/coffee-button/init.sh
Warning init.sh
script
Push the button ! Leds will flashes after a few seconds (if nothing happens don't panic and wait longer) then green if the request was sent or already sent in the previous 48h, red if something went wrong.
👤 Jérémy Lejeune
- Github: @yodur2potassium
👤 Lucas Dupuy
- Github: @louckousse
Give a ⭐️ if this project helped you!
Copyright © 2019 Jérémy Lejeune, Lucas Dupuy.
This project is GPL 3 licensed.
This README was generated with ❤️ by readme-md-generator