Skip to content

IOT and HelloDrinkBot

tlujan0001 edited this page Apr 12, 2020 · 6 revisions

Connecting HelloDrinkBot to the Internet of Things

Sending commands to the HelloDrinkBot API:

Visiting the correct url will send a 'make drink' request to the DrinkBot.
Example Request:http://10.0.0.1/ws/drink/12?booze1=120&booze79=120

In the above URL:

  • http://10.0.0.1/ws/drink/ contains the Pi's local IP address and the start of the API endpoint
  • 12? contains the drink number (found in the bartendro drinks table)
  • booze1=120&booze79=120 tells the Pi which booze to pour and how much (in mL)

IFTTT and connecting to the Internet

Using If This Then That is a quick and simple way to connect your Pi with other services. Since we have an API endpoint (above) that we can use to mix drinks, it's possible to connect DrinkBot to external devices, like a switch or an Echo.

Local vs Global Projects

HelloDrinkBot operates locally right out of the box. This means it can interact with any computer that is logged in on your home wifi. You can do a lot with this, like make your own wireless drink dispensing remote.. Working within your home network is secure and can only be accessed behind your router's firewall.

To connect to the web, or to allow cloud-based services to send commands to your Pi, you'll need to find a way to securely allow the commands to come through. Some options include:

  1. Port Forwarding & Dynamic DNS --(less secure)
  2. Creating a 'tunnel' using NGROK -(more secure)
  3. Use an online service like Webhook Relay or Dweet.io to subscribe to the request. (most secure)

Some very useful related tutorials:

Share your project with us! Join the HelloDrinkBot Facebook page to share your projects.