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.
-
Set and get your Node MCU board going here
-
Install Arduino IDE and open
ESP8266-Coffee-Pot.ino
-
Install the board manager using this helpful guide
- Hint: The url to add is
http://arduino.esp8266.com/stable/package_esp8266com_index.json
- Hint: The url to add is
-
Install Arduino_JSON by Arduino
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.
All additional configuration values are located in definitions.h
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
.
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.
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 |
- Aaron Renner http://github.com/Aman7123