mirror of
https://github.com/H0llyW00dzZ/ESP8266-TOTP.git
synced 2025-02-06 09:28:22 +00:00
- [+] docs(README.md): fix typo in title, add OLED display feature, hardware requirements, wiring diagram, and required libraries
ESP8266 Arduino TOTP (Experimental)
Warning
This is experimental and might not work as expected.
Overview
This project demonstrates how to implement a Time-based One-Time Password (TOTP) generator using an ESP8266 board with Arduino. The system connects to Wi-Fi, synchronizes time using an NTP client, and generates OTPs based on a shared secret. Additionally, it supports displaying the generated OTP on an OLED display.
Features
- Connects to Wi-Fi and synchronizes with an NTP server.
- Decodes a Base32 encoded secret for TOTP generation.
- Generates and displays a TOTP every 30 seconds.
- Displays the TOTP on an OLED screen for easy viewing.
Hardware Requirements
- ESP8266 board (e.g., NodeMCU, Wemos D1 Mini)
- OLED display (e.g., SSD1306)
- Jumper wires for connections
Wiring Diagram
- Connect the OLED display to the ESP8266 as follows:
- VCC to 3V3
- GND to GND
- SDA to D2 (or any other GPIO pin)
- SCL to D1 (or any other GPIO pin)
Usage
-
Configure Wi-Fi Credentials:
- Open the sketch and replace
your_SSID
andyour_PASSWORD
with your Wi-Fi credentials.
- Open the sketch and replace
-
Set Base32 Secret:
- Replace
BASE32EncodedSecret
with your actual Base32 encoded secret.
- Replace
-
Upload Code:
- Connect your ESP8266 board to your computer.
- Select the correct board and port in the Arduino IDE.
- Upload the code to the board.
-
Monitor Output:
- Open the Serial Monitor in Arduino IDE to view the generated OTPs.
- The generated OTP will also be displayed on the OLED screen.
Libraries Required
Make sure to install the following libraries via the Arduino Library Manager:
- Adafruit GFX Library
- Adafruit SSD1306
- ESP8266WiFi
- NTPClient
- Hash
- TOTP
- Base32-Decode
License
This project is licensed under the BSD 3-Clause License.
Acknowledgments
- Based on libraries and examples from the Arduino community.
Description
Languages
C++
100%