Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 2.36 KB

README.md

File metadata and controls

45 lines (31 loc) · 2.36 KB
# This project is a ESP8266 version project from:

Wake on Lan 🤖 ESP8266 Telegram Bot

An embedded telegram bot for ESP8266 to send a WOL packet on the local network.
Blog post with more info: https://dan.salvagni.io/b/embedded-telegram-bot-for-wake-on-lan-pc/

Wake-on-Lan Telegram Bot

📄 Description

This is a sketch for the NodeMCU ESP8266-12E with CH340G board. A telegram bot is hosted on the board and listens for messages, when the /wol command is received a Wake-on-Lan magic packet is broadcasted on the local network in order to turn on a target device.

🪙 You can keep it running for about 1$ in electricity per year, the power consumption is less than half a watt.

My ESP8266 board with CH340G: image-20230613142712453

⚙️ Installation

  • Install the following libraries from the Library Manager of the Arduino IDE:
    • WakeOnLan: for sending the magic packet
    • UniversalTelegramBot: for using the Telegram API
    • Add NodeMCU board in BoardManager with this guide (only install ESP8266 2.7.4). image-20230613141847766
  • Create a new Telegram bot and configure your BOT_TOKEN and ALLOWED_ID
    You can use @Botfather to create a new bot and @userinfobot to get your ID
  • Fill your WiFi configuration and the MAC address of the PC you want to power on.
  • Compile and flash

🔎 Usage

  • Use /start to get a list of the available commands
  • Use the /wol command or press the physical button to turn on your PC
  • Use the /ping command to check if the bot is online

✅ TODO List

  • Refactor code
  • Store network configuration in EEPROM
  • Add configuration commands to Telegram bot