Skip to content

An @esp8266 NodeMCU board running an API microservice for controlling a relay switch

Notifications You must be signed in to change notification settings

Aman7123/ESP8266-Coffee-Pot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP8266 Micro service Coffee Pot

Description

This code is to be loaded onto any Arduino board which supports Wi-Fi. This guide is written for my ESP8266 LiLon Node MCU V3.


Installation

  1. Set and get your Node MCU board going here

  2. Install Arduino IDE and open ESP8266-Coffee-Pot.ino

  3. Install the board manager using this helpful guide

    • Hint: The url to add is http://arduino.esp8266.com/stable/package_esp8266com_index.json
  4. Install Arduino_JSON by Arduino


Configuration

Wi-Fi - Required

The code needs to be configured to your Wi-Fi network. secrets.h need to contain your Wi-Fi ssid and password.

NOTE: The ESP8266 chip does not have Wi-Fi 5Ghz capabilities.

Customization - Optional

All additional configuration values are located in definitions.h


Connecting to the board

If you start the board while wired into your Arduino IDE within the build and upload screen you will find the board MAC Address which can be used to assign a static IP within your routers configurations.

If you check the serial output tab of the Arduino IDE the board will print its MAC and IP address on startup, set the baud rate to 115200.

ESP8266 board serial monitor output showing mac and IP address


How To Brew Coffee

Brewing coffee is as simple as interacting with the embedded micro service how on your Wi-Fi network. This board comes equipped with these endpoints on the default configuration:

Method Endpoint Decription
GET /coffee Get information related to variables and coffee status
POST /coffee Set a new time and some other control values for brewing coffee
PATCH /coffee Update time and other variables
DELETE /coffee Cancels the coffee brewing

The request body for the POST and PATCH methods is:

All vales optional

Request Body Option Description
reoccurringStart Provide to set up a permanent consistent brew pattern, must load hopper by sending hopperLoaded to true
hopperLoaded Used to inform the system that there is sufficient water and coffee grounds loaded
instantBrew Can be used in combination with hopperLoaded to start an immediate brew

Even if the start time is set, hopperLoaded is required to be set before time kicks off.

The reoccurringStart value is increased for 24 hours in seconds as brewing starts for convince.


Practical Implementation

Please see the Coffee.shortcut which can be imported into an iPhone or iPad for use with the Shortcuts app.

You can use this table below in combination with the data in a GET to build infinite apps.

State Description
Waiting This state occurs on the boards first boot
Pending Once any successful POST or PATCH this state, coffee pot is holding instruction
Brewing While the relay is triggered allowing electricity into the coffee pot circuits
Cancelled After a DELETE request, a POST or PATCH will overwrite this

Credits

About

An @esp8266 NodeMCU board running an API microservice for controlling a relay switch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published