From 203c92536e307be1c171ba8daac2101d0d71fa1f Mon Sep 17 00:00:00 2001 From: mendhak Date: Wed, 29 Dec 2021 10:39:44 +0000 Subject: [PATCH 1/4] Updated and simplified instructions for Raspberry Pi OS. Issue #27 --- README.md | 15 ++++++++++----- run.sh | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ed69f011..220feed6 100644 --- a/README.md +++ b/README.md @@ -45,14 +45,16 @@ Connect the ribbon from the epaper display to the extension. To do this you wil ## Setup dependencies - sudo apt install git ttf-wqy-zenhei ttf-wqy-microhei python3 python3-pip python-imaging libopenjp2-7-dev libjpeg8-dev inkscape figlet wiringpi - sudo pip3 install python-dateutil astral spidev RPi.GPIO Pillow # Pillow took multiple attempts to install as it's always missing dependencies + sudo apt update && sudo apt upgrade + sudo apt install git fonts-wqy-zenhei fonts-wqy-microhei python3 python3-pip inkscape figlet pigpio python3-pigpio + sudo pip3 install python-dateutil astral spidev RPi.GPIO Pillow sudo pip3 install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib msal sudo sed -i s/#dtparam=spi=on/dtparam=spi=on/ /boot/config.txt #This enables SPI sudo reboot ### Get the BCM2835 driver + cd ~ wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.58.tar.gz sudo tar zxvf bcm2835-1.58.tar.gz cd bcm2835-1.58/ @@ -67,7 +69,7 @@ Connect the ribbon from the epaper display to the extension. To do this you wil git clone this repository in the `/home/pi` directory. - cd /home/pi + cd ~ git clone --recursive https://github.com/mendhak/waveshare-epaper-display.git This should create a `/home/pi/waveshare-epaper-display` directory. @@ -165,9 +167,12 @@ export GOOGLE_CALENDAR_ID=xyz12345@group.calendar.google.com #### Google Calendar token The Oauth process needs to complete once manually in order to allow the Python code to then continuously query Google Calendar for information. -Go to the [Python Quickstart](https://developers.google.com/calendar/quickstart/python) page and enable Google Calendar API. When presented, download or copy the `credentials.json` file and add it to this directory. -Next, SSH to the Raspberry Pi and run +Go to the [Google Cloud Platform library page](https://console.cloud.google.com/apis/library), search for and enable the [Calendar API](https://console.cloud.google.com/apis/api/calendar-json.googleapis.com/overview). + +Next, head over to the [API Dashboard Credentials page](https://console.cloud.google.com/apis/credentials), and create new credentials of type "OAuth Client ID". For application type, choose "Desktop app" and give it a name such as "Epaper Display". When presented, download or copy the `credentials.json` file and add it to this directory. + +You can now kick off the authentication process. On the Raspberry Pi, run: python3 screen-calendar-get.py diff --git a/run.sh b/run.sh index e1805e2e..8f4343d1 100755 --- a/run.sh +++ b/run.sh @@ -23,7 +23,7 @@ else WAVESHARE_HEIGHT=480 fi -inkscape screen-output-weather.svg --without-gui -e screen-output.png -w$WAVESHARE_WIDTH -h$WAVESHARE_HEIGHT --export-dpi=300 +inkscape screen-output-weather.svg --export-type="png" --export-filename="screen-output.png" --export-width=$WAVESHARE_WIDTH --export-height=$WAVESHARE_HEIGHT --export-dpi=300 log "Display on epaper" python3 display.py screen-output.png From 2d06f49fbb56ddc8ac55d8e562058c6139bf51c0 Mon Sep 17 00:00:00 2001 From: mendhak Date: Wed, 29 Dec 2021 12:49:50 +0000 Subject: [PATCH 2/4] Use cairosvg instead of inkscape --- run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.sh b/run.sh index 8f4343d1..a1f41214 100755 --- a/run.sh +++ b/run.sh @@ -23,7 +23,7 @@ else WAVESHARE_HEIGHT=480 fi -inkscape screen-output-weather.svg --export-type="png" --export-filename="screen-output.png" --export-width=$WAVESHARE_WIDTH --export-height=$WAVESHARE_HEIGHT --export-dpi=300 +cairosvg -o screen-output.png -f png --dpi 300 --output-width $WAVESHARE_WIDTH --output-height $WAVESHARE_HEIGHT screen-output-weather.svg log "Display on epaper" python3 display.py screen-output.png From 6eb7fe3be26fc65629b34e383d36d0b3761f4374 Mon Sep 17 00:00:00 2001 From: mendhak Date: Wed, 29 Dec 2021 12:52:42 +0000 Subject: [PATCH 3/4] Greatly simplified setup for Raspberry Pi OS --- CHANGELOG.md | 7 +++++++ README.md | 16 ++-------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 770c8281..469997e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 2021-12-29 + +* Updated instructions for Raspberry Pi OS Bullseye +* Removed some dependencies that aren't needed anymore! +* Replace Inkscape with CairoSVG +* Updated Google Calendar instructions + ## 2021-10-29 * Bug fix - Outlook calendar entries will now show in local time, instead of UTC. diff --git a/README.md b/README.md index 220feed6..f8a874d9 100644 --- a/README.md +++ b/README.md @@ -46,23 +46,11 @@ Connect the ribbon from the epaper display to the extension. To do this you wil ## Setup dependencies sudo apt update && sudo apt upgrade - sudo apt install git fonts-wqy-zenhei fonts-wqy-microhei python3 python3-pip inkscape figlet pigpio python3-pigpio - sudo pip3 install python-dateutil astral spidev RPi.GPIO Pillow - sudo pip3 install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib msal + sudo apt install git python3 python3-pip cairosvg pigpio python3-pigpio + sudo pip3 install python-dateutil astral spidev RPi.GPIO Pillow google-api-python-client google-auth-httplib2 google-auth-oauthlib msal sudo sed -i s/#dtparam=spi=on/dtparam=spi=on/ /boot/config.txt #This enables SPI sudo reboot -### Get the BCM2835 driver - - cd ~ - wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.58.tar.gz - sudo tar zxvf bcm2835-1.58.tar.gz - cd bcm2835-1.58/ - sudo ./configure - sudo make - sudo make check - sudo make install - ## Using this application ### Clone it From f6f30c946cc3d8c30fcd32cf1099177690ca7fd6 Mon Sep 17 00:00:00 2001 From: mendhak Date: Wed, 29 Dec 2021 13:01:01 +0000 Subject: [PATCH 4/4] Clearer changelog --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 469997e4..73e55c31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ ## 2021-12-29 -* Updated instructions for Raspberry Pi OS Bullseye -* Removed some dependencies that aren't needed anymore! -* Replace Inkscape with CairoSVG -* Updated Google Calendar instructions +* Updated instructions for Raspberry Pi OS Bullseye. Many dependencies stopped working, fixed it now. +* Removed some dependencies that aren't needed anymore! BCM not needed. WiringPi is deprecated. LibJpeg doesn't look needed. +* Replace Inkscape with CairoSVG. Inkscape broke some commandline args, and CairoSVG seems better suited for commandline anyway. +* Updated Google Calendar instructions, it's simpler for now, until Google break their URLs again. ## 2021-10-29