tony2guo / ESP8266-Wake-on-LAN

ESP8266 Wake-on-LAN and relay control with Google Sheets and Google Apps Script

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ESP8266-Wake-on-LAN

ESP8266 Wake-on-LAN and relay control with Google Sheets and Google Apps Script

ESP8266 (the bot) will check the time and commands in the Google Sheet and choose to send multiple Wake-on-LAN magic packets and/or control LC-Relay-ESP01-2R-5V relay module. Users can edit "MAC address" and "on time" in the Google Sheet. If the value of "on time" is NOW(), it will be updated whenever the sheet is edited or when someone goes to the App URL.

Dependencies

Usage

Google Sheets

  1. Create a copy of the example Google Sheets.
  2. Edit MAC address and time zone.
  3. Deploy Google Apps Script and get your App ID and URL. Should look like this: https://script.google.com/macros/s/YOUR-APP-ID/exec
  4. Go to your App URL to update NOW(), so the bot will know the link is clicked. example user link
  5. Go to your App URL with ?client=bot added to the end, to see what the bot will get. example bot link

ESP8266

  1. Edit YOUR-WIFI-SSID, YOUR-WIFI-PASSWORD, and YOUR-APP-ID in main.cpp
  2. Build and upload. (PlatformIO recommended)
  3. The built-in LED will blink at a perid of 0.05 seconds at startup, or when sending Wake-on-LAN magic packet/controlling relay, 0.1 seconds when connecting to WiFi, 0.5 seconds when updating time with NTP, and 1 second when waiting for changes in Google Sheets.
  4. Open serial monitor to see more information.

About

ESP8266 Wake-on-LAN and relay control with Google Sheets and Google Apps Script

License:MIT License


Languages

Language:C++ 82.6%Language:JavaScript 16.2%Language:C 1.2%