Upgraded firmware for Simone Giertz's Every Day Calendar that links an ATProto-powered ESP32, for sync with goals.garden 🌱
C++ 51.7%
C 40.1%
Python 0.2%
Other 8.0%
32 1 0

Clone this repository

https://tangled.org/byjp.me/every-day-calendar https://tangled.org/did:plc:ephkzpinhaqcabtkugtbzrwu/every-day-calendar
git@knot.tangled.wizardry.systems:byjp.me/every-day-calendar git@knot.tangled.wizardry.systems:did:plc:ephkzpinhaqcabtkugtbzrwu/every-day-calendar

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

Every Day Calendar (Fork)#

This fork adds WiFi sync with goals.garden via an ESP32 co-processor.

Features#

  • WiFi sync with goals.garden - Your completions sync bidirectionally with your goals.garden account
  • Real-time updates - Changes on goals.garden appear appear in just a few seconds, via Jetstream WebSocket
  • Web UI for goal selection - Visit http://everydaycalendar.local to choose which goal to track
  • Offline support - Keep using the calendar when WiFi is unavailable; changes sync when reconnected
  • Light wave animation - Satisfying ripple effect when you mark a day complete

What you'll need#

Good WiFi needed

These tiny devices have tiny WiFi antennas. You'll need good signal wherever you hang your calendar. There are variants with antennas you may want to try, but I've not been able to get these working with the firmware just yet!

Don't have a QT Py ESP32-S3? Considering other boards?

If you don't have or can't find a QT Py ESP32-S3 many other devices will work here! There's no need to buy new stuff if you have existing stuff that'll work lying around!

Things to consider when picking another device:

  • Naturally, it'll need WiFi
  • This code has been built for ESP32 hardware, you'll likely need to make significant changes if you want to use a different platform
  • Watch for space: the height between the rear & front boards of the calendar isn't much, and the width between the foam padding and the wooden edge of the calendar is small too
  • my QT Py gives off a fair amount of heat (it holds a constant WiFi connection), don't use a board that can't cope with that
  • You don't need a Qwiic connector, you can hardwire I2C lines if that's easier
  • The esp32's program/sketch is quite large (~1MB for my esp32-s3), don't skimp on program space!
  • I've struggled to get the QT Py ESP32-S2 working — but I'm working on it, as teh u.FL antenna for WiFi is very handy!

You'll need to change the board in platformio.ini to match whatever you go for.

Hardware hacking#

Backup your data!

I've tried to ensure your calendar data is never lost, but don't risk it! Take a photo of your calendar with its lights on before you start, just in case things go wrong.

  1. Cut the Stemma QT cable in half

    You'll need about 8cm of cable with the connector on one end.

  2. Strip and tin the wires

    Strip about 3mm of insulation from each wire and add a small amount of solder to the exposed copper (this helps it 'stick' to the pads when we connect them).

  3. Open the calendar

    Remove the screws from the back panel. Carefully lift off the front panel - it separates easily but can crack if flexed too much.

  4. Locate the two front-panel jumper holes

    Find the two 8-pin jumper headers near the top of the rear PCB; these are the holes the long prongs from the front panel go into.

  5. Solder the wires to the right pads

    Wire Color Connection Location
    Black (GND) Ground Top-right pad of LEFT jumper
    Red (3.3V) Power Bottom-right pad of LEFT jumper
    Blue (SDA) Data Middle-top right pad of RIGHT jumper
    Yellow (SCL) Clock Middle-bottom right pad of RIGHT jumper

    A photo of the four wires above going to the right places

  6. Connect the ESP32

    Plug the Stemma QT connector into the ESP32's Stemma QT port. It'll only go all the way in one way up, so don't push too hard if it isn't working.

  7. Mount the ESP32

    You may want to use double-sided tape to secure it inside the calendar housing, but be careful, this little board gets warm, so don't enclose it entirely.

  8. Flash the firmware

    Physical work done! See below for how to handle the software/firmware…

Software setup#

Install PlatformIO#

PlatformIO is used to build and flash both firmware images.

# macOS (Homebrew)
brew install platformio

# Or via pip
pip install platformio

Configuration#

  1. Copy the config template

    cp firmware/esp32/GoalsGardenSync/config.local.h.example \
       firmware/esp32/GoalsGardenSync/config.local.h
    
  2. Edit your new config.local.h

    It'll need your WiFi credentials, ATProto username & app-password (so it can stay connected indefinitely); you can also add some preferences for how it should operate (eg. your timezone, and what happens when your internet connection is down).

Flash firmware#

Use the power supply

Before starting, make sure to plug your calendar in with the usual 5V power supply. (We don't want to power all those LEDs directly from your computer's USB!)

  1. Flash the calendar (ATmega328P)

    Connect the calendar via USB Type-B cable,then flash & monitor its output:

    pio run -e calendar -t upload && pio device monitor -e calendar
    

    You can exit the monitor when you're happy by pressing Ctrl-c, any time.

  2. Flash the new ESP32

    Similarly for the ESP32 via USB-C cable:

    pio run -e esp32sync -t upload && pio device monitor -e esp32sync
    
NOTE

At this point things should already be fully working, but naturally you'll not be able to press any buttons.

To make sure things are all set up correctly you may want to:

  • Visit http://everydaycalendar.local to see if the website loads (it'll be slow, be patient)
  • Choose which online goal you want to track with your calendar
  • Visit goals.garden, swao to the relevant goal, and check that adding a new day online turns on the relevant LED
Slight update delay

Updates between the site and the physical calendar may take a moment (hopefully not more than 5 seconds).

Troubleshooting#

  • Can't find everydaycalendar.local

    Try the IP address instead (it should be in the serial monitor output, while the ESP32 is connected to your computer).

  • Sync not working

    Check the serial monitor (pio device monitor -e esp32sync) for error messages. If it works at your desk, but not on your wall, your WiFi may also not be strong enough for this little device at that location. There are QT Py ESP32 devices with external antennas that may help here?

  • Four corners flashing

    If the four corner days (Jan & Dec 1st & 31st) are flashing alternately once per second, then the ESP32 hasn't been able to connect to the internet.

    As soon as the connection is established, you'll see a 'raindrop' pattern ripple across the LEDs. (This happens on boot, and after being disconnected from the internet for over 1 minute).

    If you don't see a raindrop animation after boot and the corners aren't flashing, then calendar can't find the ESP32 to communicate with. Try reflashing the ESP32, and checking the connections are sturdy & not connected to more than one pad.

Built on top of The Every Day Calendar#

edc

This repository contains firmware and schematics for the Every Day Calendar by Simone Giertz. Thank you for making this beautiful piece of hardware!

It also incorporates improvements made by Momin Khan on Github — I love the starburst animation!

License#