Introduction: Google Photo Clock
This instructables show how to use a ESP32 and a LCD to make a digital clock with randomize photo display in the background every minute. The photos are come from you shared Google Photo Album, simply input the share link ESP32 will do the job ;>
Step 1: Hardware Preparation
REUSE PREVIOUS PROJECT HARDWARE
If you have done previous instructables, you can reuse the hardware for this project and can skip the hardware assembly:
ESP8266/ESP32 Dev Board
Any ESP8266/ESP32 Dev Board should be ok.
Any Arduino_GFX supported LCD is ok, you may find currently supported display at GitHub readme: https://github.com/moononournation/Arduino_GFX
Any breadboard that can fit for the ESP Dev Board and LCD Display.
Some Jumper Wires, depends on the dev board and LCD pins layout. In most case 6-9 male to female jumper wires are enough.
Step 2: Hardware Assembly
Push the ESP32 Dev Board on the breadboard and connect LCD with jumper wires.
Here are the sample connection summary:
ESP8266 -> LCD
Vcc -> Vcc GND -> GND GPIO 15 -> CS GPIO 4 -> DC (if available) RST -> RST GPIO 14 -> SCK GPIO 12 -> MISO (optional) GPIO 4 -> LED (if available) GPIO 13 -> MOSI / SDA
ESP32 -> LCD
Vcc -> Vcc GND -> GND GPIO 5 -> CS GPIO 16 -> DC (if available) GPIO 17 -> RST GPIO 18 -> SCK GPIO 19 -> MISO (optional) GPIO 22 -> LED (if available) GPIO 23 -> MOSI / SDA
Step 3: Software Preparation
Download and install Arduino IDE if you are not yet do it:
Follow the Installation Instructions to add ESP8266 support if you are not yet do it:
Arduino ESP8266 filesystem uploader
Follow the Installation Instructions to add uploader plugin if you are not yet do it:
Follow the Installation Instructions to add ESP32 support if you are not yet do it:
Download latest Arduino_GFX libraries: (press "Clone or Download" -> "Download ZIP")
Import libraries in Arduino IDE. (Arduino IDE "Sketch" Menu -> "Include Library" -> "Add .ZIP Library" -> select downloaded ZIP file)
Step 4: Setting & Upload
- Download the program at GitHub: (press "Clone or Download" -> "Download ZIP") https://github.com/moononournation/GooglePhotoClo...
- Open GooglePhotoClock.ino with Arduino IDE
- Fill your WiFi AP settings into SSID_NAME and SSID_PASSWORD
- Fill local timezone information to GMT_OFFSET_SEC, DAYLIGHT_OFFSET_SEC and TZ
- Prepare a shared album in Google Photo, create a share link and fill the GOOGLE_PHOTO_SHARE_LINK
- If you are not using ILI9341 LCD, comment out line 133 and uncomment the correct LCD class declaration
- Connect ESP Dev Board to computer
- Press Upload button to compile and upload the program to the ESP Dev Board
Step 5: ESP8266 BearSSL CertStore
Google Photo require all connection in HTTPS. ESP8266 latest version using BearSSL implementation and it requires some preprocessing on CertStore data.
I have generated a CertStore data at 2020 Apr 18, you make regeneration it by running:
If you are using ESP8266, follow the steps to upload CertStore data:
- Open Arduino IDE
- Connect ESP8266 dev board to computer
- Select Tools menu
- Select ESP8266 Sketch Data Upload
- Wait upload finish
Step 6: How Does It Works?
- Connect to predefined WiFi AP
- Get current time from NTP server
- Make the Google Photo shared link HTTPS request
- HTTPS response code 302 and included a redirect location in the response header
- Make the redirect location HTTPS request
- For every minitues, random select a photo in photo list
- For ESP8266 only, try to find cached photo file in SPIFFS first
- Make a photo link HTTPS request
- For ESP8266 only, cache the photo file to SPIFFS
- Display the photo
- Print current time on the photo
Step 7: Enjoy!
It's time to add more favor photos to the shared Photo Album and place this Google Photo Clock on your desk.
Participated in the