Skip to content

Too busy to make a phone call, now we just push a button

License

Notifications You must be signed in to change notification settings

Zenika/coffee-button

Repository files navigation

Welcome to Coffee Button 👋

License: GPL 3

Order your coffee in one click or everything else
Click the button, the raspberry boot, call your webhook then shutdown

Prototype

Prototype

Install

What you need to run the project

  • 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

LED Resistor

How to build

  • 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).

Breadboard

How to setup

  • 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 to true 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 ⚠️ Doing this last action will prevent you to access the pi via keyboard or SSH as it will shut it down immediatly after request is sent and will then force you to mount the SD card on your computer again!. Be sure that everything is in order before that or comment the last line of the init.sh script

Usage

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.

Author

👤 Jérémy Lejeune

👤 Lucas Dupuy

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2019 Jérémy Lejeune, Lucas Dupuy.
This project is GPL 3 licensed.


This README was generated with ❤️ by readme-md-generator

About

Too busy to make a phone call, now we just push a button

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •