Skip to content

A small desk-calendar, portal-themend. It display the current date, the next few events in your calendar and whether a person in your contact list has a birthday

License

Notifications You must be signed in to change notification settings

joaocolaco/eInkCalendar

 
 

Repository files navigation

Portal eInk Calendar

A small battery powered desk-calenda with the theme of a portal chamber info.
It displays the current date, the next few events from one or more calendars, the current weather, a rotating quote and whether a person in your contact list has a birthday (inc. their name).

Table of Contents
  1. About The Project
  2. Getting Started
  3. Frame
  4. Questions
  5. Contact
  6. Acknowledgments

About The Project

The finished project on my desk:

The pie is displayed when a person in your contacts has a birthday (along with the name below it). The other three icons are currently displayed randomly.

(back to top)

Battery

The device will power itself on regularly (by default 6/6h but this can be changed on the file ~/wittypi/schedule.wpi) to update the screen and then shutdown, preserving battery life.

When battery is near depleting it will display a red empty battery icon on the upper left corner. On that state it will still power-up for a good number of cycles, but could be a good idea to charge the battery to preserve its health.

(back to top)

Components

This repo includes the software (100% python) and the STLs of the frame.

I used the following hardware:

(back to top)

Getting Started

Prerequisites

The prerequisites are based on this waveshare instruction to get your rapi ready for the display:

  • Enable the SPI interface on your raspi

    sudo raspi-config
    # Choose Interfacing Options -> SPI -> Yes  to enable SPI interface
  • Install BCM2835 libraries

    wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.75.tar.gz
    tar zxvf bcm2835-1.75.tar.gz 
    cd bcm2835-1.75/
    sudo ./configure
    sudo make
    sudo make check
    sudo make install
  • sudo apt-get install openssl

  • Install Witty Pi software

    See instructions on the product description or in the manual, also available in the hardware section of this repository.

    wget https://www.uugear.com/repo/WittyPi4/install.sh
    sudo sh install.sh

    This script will also install wiring pi so you can skip the next step.

    To update this software repeat these steps.

    Note: When assembling the hardware, the Raspberry pi would only boot, when both the Witty Pi and the e-Paper driver HAT are connected, after installing this software.

  • Install wiringPi libraries They will allow the use of the gpio command, used all over the place by witty. The most current version can be found in the github repo in the releases folder. Download:

    cd /tmp
    wget [insert link to arm.deb file here eg: https://github.com/WiringPi/WiringPi/releases/download/3.8/wiringpi_3.8_arm64.deb]
    sudo dpkg -i wiringpi-[insert file version here].deb
  • Install the locales

sudo dpkg-reconfigure locales

Make sure that later in settings the locale is one of the selected here (and include the .utf8 if is in the name).

Installation

  1. Clone the repo
    git clone https://github.com/13Bytes/eInkCalendar
    cd eInkCalendar
  2. Install requirements
    sudo apt-get update
    # requirements by waveshare
    sudo apt-get install python3-pip python3-pil python3-numpy RPi.GPIO python3-spidev
    # requirements by this repo
    python3 -m venv venv
    source venv/bin/activate
    python3 -m pip install -r requirements.txt
    #old: sudo python3 -m pip install -r requirements.txt
  3. Create a config-file
    cp settings.py.sample settings.py
    Now edit settings.py and set all your settings:
  • LOCALE: "en_US" (or e.g. en-GB.UTF-8) Select your desired format and language. It needs to be installed on your device (which 95% of time is already the case - as it's you system-language). You can list all installed local-packages with locale -a. If the desired one is missing, add it in this menu sudo dpkg-reconfigure locales (for Raspberry Pis) or take a look at the general Debian Wiki). Used for generate the text for the interface but also for selecting the holidays.

  • `WEBDAV_CALENDAR_URLS The calendars to be displayed:

     WEBDAV_CALENDAR_URLS = [
     {
     "url": "webcal://...",
     "calendar_name": "a name",
     "is_apple": True,
     "pattern_fill": "DIAGONALSTRIPESUPPERRIGHT",
     "pattern_red_stripes": False
     },
     {
     "url": "webcal://...2",
     "calendar_name": "a name2",
     "is_apple": True,
     "pattern_fill": "VERTICALSTRIPES",
     "pattern_red_stripes": False
     },
      ]

    Is a list of dicts, at least one must be filled, where the keys are:

    • URL is the URL for the calendar (should be public)
    • calendar_name is the name for displaying the calendar on the screen and
    • is_apple is to indicate that Apple iCal is the provider of the url (solves some issues).
    • pattern_fill can be BLACK, RED, VERTICALSTRIPES, HORIZONTALSTRIPES, DIAGONALSTRIPESLOWERRIGHT, DIAGONALSTRIPESUPPERRIGHT and will fill rectangle near the calendar appointments
    • pattern_red_stripes when true a red color will be used in the striped patterns instead of white
  • CALDAV_CONTACT_USER = "louis" Username for logging into your CALDAV contact-list.

  • CALDAV_CONTACT_PWD = "secret" Password for logging into your CALDAV contact-list.

  • APERTURE_DECORATIONS = True Will show the aperture science decorations and logo. If false will hide them (and gain some space).

  • SHOW_QUOTES = True Will show a random quote from quotable.io.

  • ROTATE_IMAGE = True This will rotate the image 180° before printing it to the calendar. True is required if you use my STL, as the dipay is mounted upside-down.

  • FIRST_WEEKDAY_IS_SUNDAY = True Will start the week in sunday on the calendar if true. Otherwise it will be Monday.

  • `TOMORROWIO_API_KEY = "[insert api key here]" For accessing the weather please go to (tomorrow.io)[https://tomorrow.io/] register for a free account and insert the key here. When empty or commented will make not show the weather.

  • WEATHER_LOCATION = "53.551086,9.993682" Location for weather forecast. Empty or commented so to not showing the weather. A latitude-longitude pair of numbers according to ISO 6709, separated by , in query parameters. See also tomorrow.io api formats. Note: This example is for Hamburg DE.

  • TEMPERATURE_UNIT = "C" Temperature Units (can be C for Celsius or F for Fahrenheit)

  • RECHARGE_VOlTAGE = 3.5 Voltage when the device will notify for a recharge in Volts. 3.5V is about 25% of charge for the battery that I'm using (samsung inr18650-35e), but this will change. Please see your battery datasheet.

  1. Configure Witty Pi enviroment (settings and scripts). Use the wittyPi.sh:

    1. Configure the white blink light to disabled (to strong and repetitive).

    2. Configure the Witty Pi so it won't boot when charging with Auto-On when USB 5V is connected to No. The default state of this device is off and it don't need to be power on to charge the battery:

    3. Also on these settings choose Synchronize with network timeand Write RTC time to system.

    4. The software installs a webserver for configuring the Witty (the script ./wittyPi.sh seems to have the same functionality). The configuration for the server assumes that is installed in /home/pi/uwi, if not please change ~/uwi/uwi.conf.

    Note that if you don't want a "public" webserver without user access control you can remove it by running this command and restarting your device:

    sudo update-rc.d -f uwi remove
  2. In the startup the witty pi script afterStartup.sh should run the /home/<insert user here>/eInkCalendar/run_calendar_witty.sh on the background with this line:

/home/<insert user here>/eInkCalendar/run_calendar_witty.sh &

This will run the run_calendar.sh script and wait to shutdown the computer.

Please make sure that the commands on all those scripts have the correct paths. The PATH environment is not defined when they run so the full path must be used. Check the paths on your system with whereis <command>.

  1. Add the line /home/pi<or other username>/eInkCalendar/run_calendar_witty.sh & to ~/wittypi/afterStartup.sh. Note the use of the amperstand in the end of the line to not block the startup process.

  2. The script ~/wittypi/runScript.sh has a bug described here, that can crash the system when shutting down on some slower systems. The fiz is described on the post. Also a fixed script is in the Witty Pi folder.

  3. Create or change the ~/wittypi/schedule.wpi and run ~/wittypi/runScript.sh. This will create the schedule of startup and shutdown for screen refreshing. Use the file in schedule.wpi in the Witty Pi folder or copy this:

BEGIN 2024-09-01 07:00:00
# Will not end (or at least in the following 40 years)
END   2064-09-01 07:15:00
#Will stay on 20 minutes (the displayRun.py has a timeout of 10 minutes for a network connection retry)
ON    M20
#Will startup in about 6 hours (H6) in production.
OFF   H5 M40
# For testing, allowing less time between boots, you can use the following line (after commenting the previous)
#OFF	M15

(back to top)

Frame

The STLs of the frame can be found in hardware. It's designed for 3D-printing. The two parts can be screwed together in three of the four corners.

The raspi is held in place by threaded heat set inserts (M2.5).

(back to top)

Questions

The battery was dead and now the screen doesn't refresh, what can I do?

The clock is out of sync. Run the wittyPi.shscript, Synchronize with network time, and Write RTC time to system`.

It doens't boot?

Witty Pi sometimes can crash on shutdown, especially after a RTC reset. You must try to disconnect it from its power sources: the USB cable and the battery. Then try to restart the pi.

Stuck somewhere?
You can contact me, or create a issue.

(back to top)

Contact

Original Idea and Design: Louis - @Louis_D_ - [email protected]

Original Idea and Design: João - @joao - [email protected]

(back to top)

Acknowledgments

(back to top)

About

A small desk-calendar, portal-themend. It display the current date, the next few events in your calendar and whether a person in your contact list has a birthday

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 82.8%
  • Shell 17.2%