This project is an e-paper-based calendar display that integrates with Google Calendar to fetch and display daily events. It uses the ESP32-S3 microcontroller, the EPDiy library for e-paper control, and the Google Calendar API to retrieve event data. The device connects to WiFi for API calls and keeps track of local time for accurate scheduling and updates.
- 9.7-inch Black and White E-Paper Display: Displays a monthly calendar and upcoming events using the EPDiy library.
- WiFi Connectivity: Required for API calls to fetch Google Calendar events.
- Local Time Management: Synchronizes and maintains local time for accurate scheduling.
- Google Calendar Integration: Fetches events using Google Calendar API in JSON format.
- Automatic Daily Updates: Refreshes the display at 00:10 every day.
- Deep Sleep Mode: Saves power by putting the ESP32 into deep sleep between updates.
- Robust Retry Mechanism: Handles API call failures with a retry mechanism and enters indefinite deep sleep after repeated failures.
- Hardware Requirements
- Software Requirements
- Installation
- Usage
- Configuration
- System Workflow
- Troubleshooting
- License
- ESP32-S3 Based, Epdiy V7 board
- Support for high-resolution displays with 16 data lines
- Much faster updates thanks to the ESP32S3 SOC and the LCD peripheral
- An on-board RTC, LiPo charging
- 9.7-inch black and white e-paper display(ED097TC2) compatible with the EPDiy library
- Power supply (battery or USB)
- ESP-IDF: ESP32 development framework (v5.3.1)
- EPDiy library: For e-paper control
- nlohmann/json: For JSON parsing
- Google Calendar API key and OAuth credentials
git clone https://github.com/0015/Fridge-Calendar.git
cd Fridge-Calendar
Inside your project directory, create a components
folder:
mkdir components
Clone the EPDiy library into the components
folder:
cd components
git clone https://github.com/vroland/epdiy.git
Install the nlohmann-json
library using the ESP-IDF dependency manager:
idf.py add-dependency "johboh/nlohmann-json^3.11.3"
Set your WiFi credentials, Google API credentials, and other configurations in app_config.h
:
#define WIFI_SSID "your_wifi_ssid"
#define WIFI_PASS "your_wifi_password"
#define CLIENT_ID "your_client_id"
#define CLIENT_SECRET "your_client_secret"
#define ACCESS_TOKEN "your_access_token"
#define REFRESH_TOKEN "your_refresh_token"
#define CALENDAR_IDS "<multiple_calendar_ids>"
#define TIMEZONE "your_time_zone"
idf.py build
idf.py flash
- Upon powering up, the device connects to WiFi, synchronizes local time, and fetches Google Calendar events.
- Displays a monthly calendar and a list of upcoming events.
- Automatically updates at 00:30 every day or after a successful fetch of calendar events.
- If the API call fails twice in a row, the device enters indefinite deep sleep.
- Go to the Google Cloud Console.
- Create a new project and enable the Google Calendar API.
- Create OAuth credentials for your project.
- Obtain the API key(Access Token), Refresh Token, client ID, and client secret.
- Add the credentials to your
app_config.h
file.
- Update the WiFi SSID and password in the
app_config.h
file.
- Initialize Non-Volatile Storage (NVS) to store state information.
- Display a splash screen and progress bar if this is the first run.
- Connect to WiFi and synchronize local time.
- Fetch events from Google Calendar using the REST API.
- Parse JSON data into a usable format.
- Display the calendar and events on the e-paper screen.
- On a failed API call:
- Increment a retry counter stored in NVS.
- Reboot and retry the operation.
- After two failed attempts:
- Enter deep sleep indefinitely to save power.
- On success:
- Reset the retry counter and schedule a wakeup for 00:30 the next day.
-
WiFi Connection Fails:
- Check your WiFi SSID and password in
app_config.h
. - Ensure the ESP32 is within range of the WiFi router.
- Check your WiFi SSID and password in
-
Google API Fails:
- Verify your Access Token, Refresh Token and OAuth credentials.
- Check if the Google Calendar API is enabled in your Google Cloud Console.
-
NVS Errors:
- Ensure NVS is initialized properly during startup.
- Erase NVS if necessary using
idf.py erase_flash
.
-
E-paper Display Issues:
- Verify the connection between the ESP32 and e-paper display.
- Check if the EPDiy library is installed correctly.
This project is licensed under the MIT License. See the LICENSE file for details.