Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple changes #5

Open
wants to merge 98 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
f7c5d7c
fixing unsupported operand type
oxivanisher Dec 15, 2019
fd4abd7
fixing unsupported operand type
oxivanisher Dec 15, 2019
3cb2cad
fixing unsupported operand type
oxivanisher Dec 15, 2019
df43c92
fixing unsupported operand type
oxivanisher Dec 15, 2019
08152b8
removing one function call
oxivanisher Dec 15, 2019
e281bff
fixing oauth flow
oxivanisher Dec 15, 2019
e7e322a
ignoring rendered screens
oxivanisher Dec 15, 2019
50acde6
if no api key is configure, don't fail
oxivanisher Dec 15, 2019
e5c2b98
remove unused import
oxivanisher Dec 15, 2019
10a8d5d
force python2 since the project is not python3 ready (yet)
oxivanisher Dec 15, 2019
7a7fad0
remove unused import
oxivanisher Dec 15, 2019
c98d04a
documenting how to add google secrets (to use the google APIs)
oxivanisher Dec 15, 2019
c0f3610
fixing indentation
oxivanisher Dec 15, 2019
cd474be
making PEP8 linter happy
oxivanisher Dec 15, 2019
7b030cd
more text on error handling
oxivanisher Dec 15, 2019
b5166a0
format error output
oxivanisher Dec 15, 2019
c516cb4
fixing unicode errors
oxivanisher Dec 15, 2019
f7d4903
fixing unicode error in debug message
oxivanisher Dec 15, 2019
b539482
implement "metric" time
oxivanisher Dec 15, 2019
167d637
testing if tasklist is hardcoded
oxivanisher Dec 15, 2019
1b01cf4
removed hardcoded task list and display all tasks where "todo" is in …
oxivanisher Dec 15, 2019
734468a
use google todo module
oxivanisher Dec 15, 2019
23f9a6c
only work if there are tasks in list
oxivanisher Dec 15, 2019
3e0aea2
working on utf-8 problems
oxivanisher Dec 16, 2019
2062622
working on utf-8 problems
oxivanisher Dec 16, 2019
b571824
unicoding
oxivanisher Dec 16, 2019
c8eb1d9
unicoding
oxivanisher Dec 16, 2019
d0c7d57
more internationalization
oxivanisher Dec 16, 2019
ecbc343
fixing import
oxivanisher Dec 16, 2019
a31b898
fixing import
oxivanisher Dec 16, 2019
adcfbeb
working on character encodings/charsets
oxivanisher Dec 16, 2019
9ffd9a7
implementing multiple google calendar support
oxivanisher Dec 16, 2019
35a58ce
implementing multiple google calendar support
oxivanisher Dec 16, 2019
19adf26
implementing multiple google calendar support
oxivanisher Dec 16, 2019
2437af5
implementing ignored entries
oxivanisher Dec 16, 2019
255a81a
redo usless fix
oxivanisher Dec 16, 2019
c15073e
Documenting SPI
oxivanisher Dec 17, 2019
719c3a7
only updating the screen if new information is available
oxivanisher Dec 19, 2019
2b53c2a
Merge remote-tracking branch 'origin/master'
oxivanisher Dec 19, 2019
d874357
adding screensaver script
oxivanisher Jan 30, 2020
2d03afb
adding screensaver script
oxivanisher Jan 30, 2020
549385c
adding screensaver script
oxivanisher Jan 30, 2020
f5eac4b
disable debug output
oxivanisher Jan 30, 2020
0195402
documenting screen saver
oxivanisher Jan 30, 2020
4eea813
fixing documentation
oxivanisher Jan 30, 2020
04bc8bf
adding sleep after update to prevent e-ink damage
oxivanisher Jan 30, 2020
dffc6f1
also adding clear() on screen saver
oxivanisher Jan 30, 2020
d41e2a5
removing clear, since it is not available in this driver
oxivanisher Jan 30, 2020
50bd9e5
marking today for calendar events and using more space for text
oxivanisher May 22, 2020
62ccec2
* more space for event text due to the use of colors to mark today ev…
oxivanisher May 23, 2020
249847f
* dynamically calculating calendar event text length
oxivanisher May 25, 2020
47de99e
calculating max char width more intelligently
oxivanisher May 25, 2020
d35e9e0
* supporting more than two events with the same start date
oxivanisher Jun 2, 2020
22a651c
* events started in the past are now also "active"
oxivanisher Jun 2, 2020
a7189dd
Including birthdays calendar
oxivanisher Oct 31, 2020
36defd4
* events today are now red
oxivanisher Jul 2, 2021
b22c158
converting to python3
oxivanisher Dec 3, 2021
deb3119
ignoring pycharm
oxivanisher Dec 3, 2021
fefd2cd
only showing tasks with a due-date in the next two days
oxivanisher Dec 4, 2021
bb3c75f
sorting of tasks is now way more intelligent
oxivanisher Dec 4, 2021
bf5785a
adding reference to "bug" for google tasks not showing up
oxivanisher Mar 10, 2022
091f556
changes to support waveshare 7.5 inch 3 color display v2 with the hig…
oxivanisher Jul 2, 2022
0114535
improve readability and rewrite image creation
oxivanisher Jul 3, 2022
b02fae5
Merge pull request #2 from oxivanisher/feature/support_e-ink_screen_v2
oxivanisher Oct 18, 2022
8816b26
updating the readme
oxivanisher Mar 22, 2023
a40c4f7
* improve date/time readability
oxivanisher May 6, 2023
7e40531
implement "weeks_away" red line
oxivanisher May 7, 2023
14e4b78
increase "weeks_away" red line thickness
oxivanisher May 8, 2023
212519b
increase "weeks_away" red line thickness
oxivanisher May 8, 2023
8dae153
fetch more events since we now have 2 columns
oxivanisher Sep 18, 2023
4b3057c
fetch more cal items since we now have 2 columns
oxivanisher Sep 18, 2023
63e491e
Merge remote-tracking branch 'origin/master'
oxivanisher Sep 18, 2023
ad3b88b
add more divider line styles for calendar
oxivanisher Nov 3, 2023
6d2d218
add more divider line styles for calendar
oxivanisher Nov 3, 2023
5dfd839
add more divider line styles for calendar
oxivanisher Nov 3, 2023
1397c06
add more divider line styles for calendar
oxivanisher Nov 3, 2023
8e9154a
add more divider line styles for calendar
oxivanisher Nov 3, 2023
121bc2f
add more divider line styles for calendar
oxivanisher Nov 3, 2023
e5e7e98
add more divider line styles for calendar
oxivanisher Nov 3, 2023
3441e72
add more divider line styles for calendar
oxivanisher Nov 3, 2023
bc7721d
add more divider line styles for calendar
oxivanisher Nov 3, 2023
25ac0f1
add more divider line styles for calendar
oxivanisher Nov 3, 2023
2ddef76
add more divider line styles for calendar
oxivanisher Nov 5, 2023
0f65cf4
add more divider line styles for calendar
oxivanisher Nov 5, 2023
f9a8fbe
add more divider line styles for calendar
oxivanisher Nov 5, 2023
97b6343
add more divider line styles for calendar
oxivanisher Nov 5, 2023
d5cb5cb
add more divider line styles for calendar
oxivanisher Nov 5, 2023
1ed278d
add more divider line styles for calendar
oxivanisher Nov 5, 2023
6c5f5fa
add more divider line styles for calendar
oxivanisher Nov 5, 2023
ada1bfa
add more divider line styles for calendar
oxivanisher Nov 5, 2023
854f44c
add more divider line styles for calendar
oxivanisher Nov 5, 2023
4c11a8f
add more divider line styles for calendar
oxivanisher Nov 5, 2023
c6f4f04
Working on deprecation stuff
oxivanisher Dec 11, 2023
23bc1f9
Also ignore the driver directory
oxivanisher Dec 11, 2023
2ba6601
Also ignore the driver directory
oxivanisher Dec 11, 2023
0b5c5fb
Working on Pillow 10
oxivanisher Dec 11, 2023
1e16d5c
Pillow deprication cleanup
oxivanisher Dec 11, 2023
6ba233c
Fixing a typo. Merci Michi ;)
oxivanisher Mar 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ google_secret.json
icons/*.png
test.py
config.json

infowindow.jpg
venv/
.idea/
driver
97 changes: 84 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@


# Infowindow
Rapsberry pi powered e-ink display for displaying information in an always on state. There are several other iterations of this project online, but they didnt do quite what I wanted them to. This is my version. Also keeping up my python skills as they dont get used as much as they used to!
Rapsberry pi powered e-ink display for displaying information in an always on state. There are several other iterations
of this project online, but they didnt do quite what I wanted them to. This is my version. Also keeping up my python
skills as they dont get used as much as they used to!
*Please be aware that this version is built for the v2 version of the e-ink screen!*

The functionality is not meant to be an "end all solution for calendaring and Todo lists" The intent is to provide an *always on* display to show me what is coming up next. I can then check in browser, phone, etc for details and updates to the data. In your face reminder.
The functionality is not meant to be an "end all solution for calendaring and Todo lists" The intent is to provide an
*always on* display to show me what is coming up next. I can then check in browser, phone, etc for details and updates
to the data. In your face reminder.
<div align="center">
<a href="#features">Features</a> |
<a href="#installation">Installation</a> |
<a href="#configuration">Configuration</a> |
<a href="#running">Running</a> |
<a href="#running">Running</a>
</div>

## Features
Expand All @@ -22,34 +27,100 @@ The functionality is not meant to be an "end all solution for calendaring and To
* Open Weather Map current data only. Future plan for forecast data.

## Installation
### Raspberry Pi setup
Activate SPI on your Raspberry Pi by using the `raspi-config` tool under Interface Options and reboot.

Also for some RaspiOS versions, you have to install the `libopenjp2-7` package:
```bash
sudo apt-get install libopenjp2-7
```

### Get software
Clone this repo onto your raspberry pi. Does not really matter where it is, but good option is in the `pi` users home directory: `/home/pi/InfoWindow`
Clone this repo onto your raspberry pi. Does not really matter where it is, but good option is in the `pi` users home
directory: `/home/pi/InfoWindow`

### Clone the e-Paper driver from waveshare
Waveshare sometimes changes things in their driver. So this part might need some changes, be aware!
```bash
git clone https://github.com/waveshareteam/e-Paper.git /home/pi/e-Paper
ln -s /home/pi/e-Paper/RaspberryPi_JetsonNano/python/lib/waveshare_epd/ /home/pi/InfoWindow/driver
```

### Setup python modules
Run `pip install -r requirements.txt`. This should install all required modules. I stuck to basic standard modules for ease of installation.
Run the following commands to install the requirements. I stuck to basic standard modules for
ease of installation.
```bash
cd /home/pi/InfoWindow
export CFLAGS=-fcommon
sudo apt install python3-dev
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
```

## Configuration
You will need to configure a few things such as API Keys and location. Copy config.json-sample to config.json. Edit config.json to add your api keys and other information.
You will need to configure a few things such as API Keys and location. Copy config.json-sample to config.json. Edit
config.json to add your api keys and other information.

## Optional: Increase lifetime of your SD-Card
If you want to increase the lifetime of the SD-Card, add the following line to `/etc/fstab` and reboot:

`tmpfs /tmp tmpfs defaults,noatime,nosuid,size=100m 0 0`

With this line, the `/tmp` folder will be held in RAM and will not be written to the SD-Card.

## Optional: Screen saver
Always displaying the same colors at the same spots might have some negative effect on your E-Ink screen. To remedy
this, there is a simple additional script, which displays all three colors on the whole screen: I recommend to let
this run once every night, i.e. at 1 minute past 5 with:
* Run `crontab -e`
* insert `1 5 * * * /home/pi/InfoWindow/venv/bin/python3 /home/pi/InfoWindow/screensaver.py > /dev/null 2>&1`

### General
* rotation: 0 - This is the rotation of the display in degrees. Leave at zero if you use it as a desktop display. Change to 180 if you have it mounted and hanging from a shelf.
* rotation: 0 - This is the rotation of the display in degrees. Leave at zero if you use it as a desktop display. Change
to 180 if you have it mounted and hanging from a shelf.
* timeformat: 12h / 24h

### Todo
Todoist is the current active module in this code. It only requires `api_key`. Teamwork also requires a 'site' key. If using google tasks, leave this as null `todo: null`
### Todo (Module)
Todoist is the current active module in this code. It only requires `api_key`. Teamwork also requires a 'site' key. If
using google tasks, leave this as null `todo: null`
* api_key: Enter your todoist API key.

### Weather
There is a bug in the Google API which will prevent to show repeated Tasks once one is marked as completed. See (and
upvote):
* https://support.google.com/calendar/thread/3706294
* https://support.google.com/calendar/thread/4113489
* https://support.google.com/calendar/thread/111623199
* https://support.google.com/calendar/thread/113398139

### Weather (Module)
Open Weather Map is where the data is coming from in the default module. This requires a few keys.
* api_key: Get your api key from OWM website.
* city: Look at OWM docs to figure what your city name is. Mine is "Sacramento,US"
* units: This can either be `imperial` or `metric`

### Google calendar and ToDo list (Modules)
To use the google APIs, you first have to login to the [google cloud console](https://console.cloud.google.com/apis/).
In the google cloud console, do the following things:
1) Create a project and give it a name, i.e. `infowindow` and switch to the context of this project if not already
active.
2) Create a [new oauth consent screen](https://console.cloud.google.com/apis/credentials/consent) (just enter a name
should be enough).
3) Create a [new oauth 2.0 client id](https://console.cloud.google.com/apis/credentials). Choosing type `other` should
work just fine. Finally, download the json file provided by the google cloud console and store it in the repo
directory (i.e. `/home/pi/InfoWindow/google_secret.json`) on the Raspberry Pi.

#### Calendar
There are are additional sections in the config for this module:
* additional: A list of additional calendar names (summary) to fetch. To use i.e. birthdays, add "Contacts" (also if
you use google in german.
* ignored: A list of events to be removed from the calendar display.

## Running
### First Run
You should run the script manually the first time so that Googles auth modules can run interactivly. Once that has completed you will want to add this to CRON so it runs every few minutes automatically.
You should run the script manually the first time so that Googles auth modules can run interactivly. Once that has
completed you will want to add this to CRON so it runs every few minutes automatically.

### Cron Run (Normal use)
* Run `crontab -e`
* insert `*/6 * * * * /usr/bin/python /home/pi/InfoWindow/infowindow.py --cron`

* insert `*/6 * * * * /home/pi/InfoWindow/venv/bin/python3 /home/pi/InfoWindow/infowindow.py --cron > /dev/null 2>&1`
36 changes: 22 additions & 14 deletions config.json-sample
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
{
"general": {
"rotation": 180
},
"todo": {
"api_key": "1234"
},
"calendar": null,
"weather": {
"api_key": "1234",
"city": "Sacramento,US",
"units": "imperial"
}
}
{
"general": {
"rotation": 180,
"timeformat": "12h",
"sunday_first_dow": false,
"cell_spacing": 2
},
"todo": {
"api_key": "1234"
},
"calendar": {
"additional": ["Contacts", "Birthdays"],
"ignored": ["Buy ticket!"],
"today_text_color": "red",
"today_background_color": "white"
},
"weather": {
"api_key": "1234",
"city": "Sacramento,US",
"units": "imperial"
}
}
Empty file removed driver/__init__.py
Empty file.
212 changes: 0 additions & 212 deletions driver/epd7in5b.py

This file was deleted.

Loading