Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Steven Seifried 2018-10-03 17:46:48 +02:00
commit 6269aa7e19
No known key found for this signature in database
GPG Key ID: AF634105799A9BDD
98 changed files with 1346 additions and 131 deletions

25
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,25 @@
---
name: Bug report
about: Create a report to help us improve
---
# Submitting Issues
Please only submit reproducible issues and write the instructions on how to reproduce them.
When you are submitting a new issue, please supply the following information:
* **Version info;** Copy the data inside the Info.txt file (`/home/pi/E-Paper-Master/Info.txt`). If there's no such file, you are using an outdated version. Please consider updating.
* **Error output:** Any errors of the Main script can be found in `/home/pi/E-Paper-Master/E-Paper-err.log`. You don't need to copy the entire file (please don't) but rather the latest errors that occured.
* **Changes made:** If you have made any changes (apart from personal information), also include them to help debugging.
* **Description**: Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem.
* **Steps to reproduce:** List the step by step process to reproduce the issue.
* **Results**: Describe what you expected to see and what you actually saw.
* **Additional Notes:** Provide any other relevant notes not previously mentioned. This is optional.

View File

@ -18,7 +18,6 @@ Info: These path contain the bmps that require converting.
1) /home/pi/E-Paper-Master/Calendar/months/
3) /home/pi/E-Paper-Master/Calendar/other/
"""
path = '/home/pi/E-Paper-Master/Calendar/'
#--------------only change the following two lines-----------------#
input_path_1 = path+'other/'

View File

@ -1,8 +0,0 @@
#!/bin/sh
echo -e "\e[1;31m"This is a experimental bash script to add support for 2-colour E-Paper Displays"\e[0m"
cd /home/pi
echo -e "\e[1;36m"Downloading the python converter..."\e[0m"
wget https://raw.githubusercontent.com/aceisace/E-Paper-Calendar-with-iCal-sync-and-live-weather/master/2-Colour-support/beta-converter.py
echo -e "\e[1;36m"Running the python converter"\e[0m"
python3.5 beta-converter.py
echo -e "\e[1;36m"All done. Please reboot to apply changes."\e[0m"

BIN
2-colour/Assistant-Bold.ttf Normal file

Binary file not shown.

BIN
2-colour/OpenSans-Bold.ttf Normal file

Binary file not shown.

Binary file not shown.

31
2-colour/calibration.py Normal file
View File

@ -0,0 +1,31 @@
"""
Calibration module for the 2-Colour E-Paper Calendar display. Running this script
helps to 'flush' all the pixels and retain the colour on the display.
"""
import epd7in5
from PIL import Image, ImageDraw, ImageFont
EPD_WIDTH = 640
EPD_HEIGHT = 384
epd = epd7in5.EPD()
def calibration():
for i in range(2):
epd.init()
black = Image.new('1', (EPD_WIDTH, EPD_HEIGHT), 0)
print('calibrating black...')
ImageDraw.Draw(black)
epd.display_frame(epd.get_frame_buffer(black))
white = Image.new('1', (EPD_WIDTH, EPD_HEIGHT), 255)
ImageDraw.Draw(white)
print('calibrating white...')
epd.display_frame(epd.get_frame_buffer(white))
epd.sleep()
print('Cycle complete!')
def main():
for i in range(1):
calibration()
if __name__ == '__main__':
main()

BIN
2-colour/days/0.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
2-colour/days/1.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/10.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/11.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/12.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/13.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/14.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/15.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/16.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/17.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/18.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/19.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/2.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/20.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/21.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/22.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/23.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/24.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/25.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/26.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/27.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/28.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/29.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/3.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/30.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/31.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/4.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/5.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/6.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/7.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/8.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
2-colour/days/9.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

181
2-colour/epd7in5.py Normal file
View File

@ -0,0 +1,181 @@
import epdif
from PIL import Image
import RPi.GPIO as GPIO
# Display resolution
EPD_WIDTH = 640
EPD_HEIGHT = 384
# EPD7IN5 commands
PANEL_SETTING = 0x00
POWER_SETTING = 0x01
POWER_OFF = 0x02
POWER_OFF_SEQUENCE_SETTING = 0x03
POWER_ON = 0x04
POWER_ON_MEASURE = 0x05
BOOSTER_SOFT_START = 0x06
DEEP_SLEEP = 0x07
DATA_START_TRANSMISSION_1 = 0x10
DATA_STOP = 0x11
DISPLAY_REFRESH = 0x12
IMAGE_PROCESS = 0x13
LUT_FOR_VCOM = 0x20
LUT_BLUE = 0x21
LUT_WHITE = 0x22
LUT_GRAY_1 = 0x23
LUT_GRAY_2 = 0x24
LUT_RED_0 = 0x25
LUT_RED_1 = 0x26
LUT_RED_2 = 0x27
LUT_RED_3 = 0x28
LUT_XON = 0x29
PLL_CONTROL = 0x30
TEMPERATURE_SENSOR_COMMAND = 0x40
TEMPERATURE_CALIBRATION = 0x41
TEMPERATURE_SENSOR_WRITE = 0x42
TEMPERATURE_SENSOR_READ = 0x43
VCOM_AND_DATA_INTERVAL_SETTING = 0x50
LOW_POWER_DETECTION = 0x51
TCON_SETTING = 0x60
TCON_RESOLUTION = 0x61
SPI_FLASH_CONTROL = 0x65
REVISION = 0x70
GET_STATUS = 0x71
AUTO_MEASUREMENT_VCOM = 0x80
READ_VCOM_VALUE = 0x81
VCM_DC_SETTING = 0x82
class EPD:
def __init__(self):
self.reset_pin = epdif.RST_PIN
self.dc_pin = epdif.DC_PIN
self.busy_pin = epdif.BUSY_PIN
self.width = EPD_WIDTH
self.height = EPD_HEIGHT
def digital_write(self, pin, value):
epdif.epd_digital_write(pin, value)
def digital_read(self, pin):
return epdif.epd_digital_read(pin)
def delay_ms(self, delaytime):
epdif.epd_delay_ms(delaytime)
def send_command(self, command):
self.digital_write(self.dc_pin, GPIO.LOW)
# the parameter type is list but not int
# so use [command] instead of command
epdif.spi_transfer([command])
def send_data(self, data):
self.digital_write(self.dc_pin, GPIO.HIGH)
# the parameter type is list but not int
# so use [data] instead of data
epdif.spi_transfer([data])
def init(self):
if (epdif.epd_init() != 0):
return -1
self.reset()
self.send_command(POWER_SETTING)
self.send_data(0x37)
self.send_data(0x00)
self.send_command(PANEL_SETTING)
self.send_data(0xCF)
self.send_data(0x08)
self.send_command(BOOSTER_SOFT_START)
self.send_data(0xc7)
self.send_data(0xcc)
self.send_data(0x28)
self.send_command(POWER_ON)
self.wait_until_idle()
self.send_command(PLL_CONTROL)
self.send_data(0x3c)
self.send_command(TEMPERATURE_CALIBRATION)
self.send_data(0x00)
self.send_command(VCOM_AND_DATA_INTERVAL_SETTING)
self.send_data(0x77)
self.send_command(TCON_SETTING)
self.send_data(0x22)
self.send_command(TCON_RESOLUTION)
self.send_data(0x02) #source 640
self.send_data(0x80)
self.send_data(0x01) #gate 384
self.send_data(0x80)
self.send_command(VCM_DC_SETTING)
self.send_data(0x1E) #decide by LUT file
self.send_command(0xe5) #FLASH MODE
self.send_data(0x03)
def wait_until_idle(self):
while(self.digital_read(self.busy_pin) == 0): # 0: busy, 1: idle
self.delay_ms(100)
def reset(self):
self.digital_write(self.reset_pin, GPIO.LOW) # module reset
self.delay_ms(200)
self.digital_write(self.reset_pin, GPIO.HIGH)
self.delay_ms(200)
def get_frame_buffer(self, image):
buf = [0x00] * int(self.width * self.height / 8)
# Set buffer to value of Python Imaging Library image.
# Image must be in mode 1.
image_monocolor = image.convert('1')
imwidth, imheight = image_monocolor.size
if imwidth != self.width or imheight != self.height:
raise ValueError('Image must be same dimensions as display \
({0}x{1}).' .format(self.width, self.height))
pixels = image_monocolor.load()
for y in range(self.height):
for x in range(self.width):
# Set the bits for the column of pixels at the current position.
if pixels[x, y] != 0:
buf[int((x + y * self.width) / 8)] |= 0x80 >> (x % 8)
return buf
def display_frame(self, frame_buffer):
self.send_command(DATA_START_TRANSMISSION_1)
for i in range(0, 30720):
temp1 = frame_buffer[i]
j = 0
while (j < 8):
if(temp1 & 0x80):
temp2 = 0x03
else:
temp2 = 0x00
temp2 = (temp2 << 4) & 0xFF
temp1 = (temp1 << 1) & 0xFF
j += 1
if(temp1 & 0x80):
temp2 |= 0x03
else:
temp2 |= 0x00
temp1 = (temp1 << 1) & 0xFF
self.send_data(temp2)
j += 1
self.send_command(DISPLAY_REFRESH)
self.delay_ms(100)
self.wait_until_idle()
def sleep(self):
self.send_command(POWER_OFF)
self.wait_until_idle()
self.send_command(DEEP_SLEEP)
self.send_data(0xa5)
### END OF FILE ###

37
2-colour/epdif.py Normal file
View File

@ -0,0 +1,37 @@
import spidev
import RPi.GPIO as GPIO
import time
# Pin definition
RST_PIN = 17
DC_PIN = 25
CS_PIN = 8
BUSY_PIN = 24
# SPI device, bus = 0, device = 0
SPI = spidev.SpiDev(0, 0)
def epd_digital_write(pin, value):
GPIO.output(pin, value)
def epd_digital_read(pin):
return GPIO.input(BUSY_PIN)
def epd_delay_ms(delaytime):
time.sleep(delaytime / 1000.0)
def spi_transfer(data):
SPI.writebytes(data)
def epd_init():
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(RST_PIN, GPIO.OUT)
GPIO.setup(DC_PIN, GPIO.OUT)
GPIO.setup(CS_PIN, GPIO.OUT)
GPIO.setup(BUSY_PIN, GPIO.IN)
SPI.max_speed_hz = 2000000
SPI.mode = 0b00
return 0;
### END OF FILE ###

326
2-colour/license Normal file
View File

@ -0,0 +1,326 @@
## PYOWM
The MIT License (MIT)
Copyright (c) 2013 Claudio Sparpaglione
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## ICS
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
## ASSISTANT FONT
Copyright 2010 The Assistant Project Authors, with Reserved Font Name Source. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
—————————————————————————————-
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
—————————————————————————————-
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
DEFINITIONS
“Font Software” refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
“Reserved Font Name” refers to any names specified as such after the copyright statement(s).
“Original Version” refers to the collection of Font Software components as distributed by the Copyright Holder(s).
“Modified Version” refers to any derivative made by adding to, deleting, or substituting—in part or in whole—any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.
“Author” refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
## Pillow
The Python Imaging Library (PIL) is
Copyright © 1997-2011 by Secret Labs AB
Copyright © 1995-2011 by Fredrik Lundh
Pillow is the friendly PIL fork. It is
Copyright © 2010-2018 by Alex Clark and contributors
Like PIL, Pillow is licensed under the open source PIL Software License:
By obtaining, using, and/or copying this software and/or its associated documentation, you agree that you have read, understood, and will comply with the following terms and conditions:
Permission to use, copy, modify, and distribute this software and its associated documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appears in all copies, and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Secret Labs AB or the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.
SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
## Waveshare E-Paper libary for python
Copyright (C) Waveshare July 10 2017
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documnetation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
## Weather Icons
The SIL Open Font License (OFL) is a free, libre and open source license specifically designed for fonts and related software based on our experience in font design and linguistic software engineering.
The OFL provides a legal framework and infrastructure for worldwide development, sharing and improvement of fonts and related software in a collaborative manner. It enables font authors to release their work under a common license that allows use, bundling, modification and redistribution. It encourages shared value, is not limited to any specific computing platform or environment, and can be used by other organizations or individuals.
The OFL meets the specific needs of typographic design and engineering as well as the gold standards of the FLOSS (Free/Libre and Open Source Software) community, namely the cultural values and guidelines from the FSF 1, the Debian Free Software Guidelines2, as well as the Open Source Definition3. It draws inspiration from concepts and elements found in other licenses, but our improvements in the specific area of fonts have made the licensing model work better than other approaches currently in use.
SIL International serves language communities worldwide, building their capacity for sustainable language development, by means of research, translation, training and materials development. We have been thinking about more open and participative models for a while, for example through our partnerships with UNESCO (Initiative B@bel) and our work on the Gentium typeface. See www.sil.org/resources/software_fonts for a detailed list of free/libre and open source software resources provided by SIL.
We want to:
enable others to participate in our projects
enable others to cater to needs for which we don't have the resources
share our wealth of knowledge and experience in the area of writing systems and pass on our tools
equip the community to meet its font needs
We serve the peoples of the world without regard to their material wealth, so we are grateful to those that do fund our work. Please visit Donate to SIL International for information on supporting our efforts.

BIN
2-colour/months/April.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
2-colour/months/August.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
2-colour/months/January.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
2-colour/months/July.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
2-colour/months/June.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
2-colour/months/March.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
2-colour/months/May.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
2-colour/months/October.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
2-colour/other/bar.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
2-colour/other/event.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 710 B

BIN
2-colour/other/hum-icon.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

BIN
2-colour/other/today.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 710 B

BIN
2-colour/other/week-mon.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
2-colour/other/week-sun.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
2-colour/other/weekday.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

248
2-colour/stable.py Normal file
View File

@ -0,0 +1,248 @@
"""
E-Paper Software (main script) adapted for the 2-colour E-Paper display
A full and detailed breakdown for this code can be found in the wiki.
If you have any questions, feel free to open an issue at Github.
Copyright by Ace-Laboratory
"""
# url refers to the iCal url. It's the link you can copy when you click on
# 'export' Calendar in Google or Yahoo (and many more online) Calendars
# api-key refers to your openweathermap api key. It can be generated for free
# when you sign up for an account and consists of a bunch of numbers and letters
# location refers to the city you live in. You api key will be used to grab live
# weather data for this city. Use the format below (city-name, country code)
# week_starts_on refers to the day on which the week starts on in your country.
# Choose between Monday and Sunday.
""" To quickly get started, fill in the following details:"""
url = "https://calendar.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics"
api_key = ""
location = "California, US"
week_starts_on = "Monday"
"""That's all. The software will do the rest. You don't need to modify anything below this."""
import epd7in5
from PIL import Image, ImageDraw, ImageFont, ImageOps #image operations
import calendar, pyowm #calendar and openweathermap wrapper
from ics import Calendar, Event #icalendar parser
from datetime import datetime #time operations
from time import sleep #more time operations
from urllib.request import urlopen #allows url to be 'read'
import arrow #icalendar parser compatible dates
from calibration import calibration
epd = epd7in5.EPD() #required
if (week_starts_on == "Monday"):
calendar.setfirstweekday(calendar.MONDAY)
if (week_starts_on == "Sunday"):
calendar.setfirstweekday(calendar.Sunday)
c = Calendar(urlopen(url).read().decode('UTF-8'))
e = Event()
open = Image.open
EPD_WIDTH = 640
EPD_HEIGHT = 384
path = '/home/pi/E-Paper-Master/Calendar/'
wpath = path+'weather-icons/'
mpath = path+'months/'
dpath = path+'days/'
font = ImageFont.truetype(path+'Assistant-Bold.ttf', 18)
weekday = open(path+'other/weekday.bmp')
eventicon = open(path+'other/event.bmp')
dateicon = open(path+'other/today.bmp')
tempicon = open(path+'other/temp-icon.bmp')
humicon = open(path+'other/hum-icon.bmp')
weekmon = open(path+'other/week-mon.bmp')
weeksun = open(path+'other/week-sun.bmp')
bar = open(path+'other/bar.bmp')
wiconplace = (570, 219)
tempplace = (605, 310)
humplace = (572, 308)
monthplace = (443, 0)
weekplace = (415,0)
barplace = (555, 0)
weekdaysmon = {'Mon': (416,3), 'Tue': (416,57), 'Wed': (416,111), 'Thu': (416,165), 'Fri': (416,219), 'Sat': (416,273), 'Sun':(416,327)}
weekdayssun = {'Sun': (416,3), 'Mon': (416,57), 'Tue': (416,111), 'Wed': (416,165), 'Thu': (416,219), 'Fri': (416,273), 'Sat':(416,327)}
positions = {'a1': (351, 3), 'a2': (351, 57), 'a3': (351, 111), 'a4': (351, 165), 'a5': (351, 219), 'a6': (351, 273), 'a7': (351, 327),
'b1': (284, 3), 'b2': (284, 57), 'b3': (284, 111), 'b4': (284, 165), 'b5': (284, 219), 'b6': (284, 273), 'b7': (284, 327),
'c1': (217, 3), 'c2': (217, 57), 'c3': (217, 111), 'c4': (217, 165), 'c5': (217, 219), 'c6': (217, 273), 'c7': (217, 327),
'd1': (150, 3), 'd2': (150, 57), 'd3': (150, 111), 'd4': (150, 165), 'd5': (150, 219), 'd6': (150, 273), 'd7': (150, 327),
'e1': (83, 3), 'e2': (83, 57), 'e3': (83, 111), 'e4': (83, 165), 'e5': (83, 219), 'e6': (83, 273), 'e7': (83, 327),
'f1': (16, 3), 'f2': (16, 57), 'f3': (16, 111), 'f4': (16, 165), 'f5': (16, 219), 'f6': (16, 273), 'f7': (16, 327)}
weathericons = {'01d': 'wi-day-sunny', '02d':'wi-day-cloudy', '03d': 'wi-cloudy',
'04d': 'wi-cloudy-windy', '09d': 'wi-showers', '10d':'wi-rain',
'11d':'wi-thunderstorm', '13d':'wi-snow', '50d': 'wi-fog',
'01n': 'wi-night-clear', '02n':'wi-night-cloudy',
'03n': 'wi-night-cloudy', '04n': 'wi-night-cloudy',
'09n': 'wi-night-showers', '10n':'wi-night-rain',
'11n':'wi-night-thunderstorm', '13n':'wi-night-snow',
'50n': 'wi-night-alt-cloudy-windy'}
def main():
while True:
time = datetime.now()
hour = int(time.strftime("%-H"))
for i in range(1):
if hour is 0:
calibration()
if hour is 12:
calibration()
if hour is 18:
calibration()
epd.init()
image = Image.new('1', (EPD_WIDTH, EPD_HEIGHT), 255)
draw = (ImageDraw.Draw(image)).bitmap
#background image
draw(monthplace, Image.open(mpath+str(time.strftime("%B"))+'.bmp'))
if calendar.firstweekday() == 0:
#print('Your week starts on Monday') #->debug
draw(weekplace, weekmon)
if calendar.firstweekday() == 6:
#print('Your week starts on Sunday') #->debug
draw(weekplace, weeksun)
draw(barplace, bar)
cal = calendar.monthcalendar(time.year, time.month)
for i in cal[0]:
draw(positions['a'+str(cal[0].index(i)+1)] ,open(dpath+str(i)+'.bmp'))
for i in cal[1]:
draw(positions['b'+str(cal[1].index(i)+1)] ,open(dpath+str(i)+'.bmp'))
for i in cal[2]:
draw(positions['c'+str(cal[2].index(i)+1)] ,open(dpath+str(i)+'.bmp'))
for i in cal[3]:
draw(positions['d'+str(cal[3].index(i)+1)] ,open(dpath+str(i)+'.bmp'))
for i in cal[4]:
draw(positions['e'+str(cal[4].index(i)+1)] ,open(dpath+str(i)+'.bmp'))
try:
for i in cal[5]:
draw(positions['f'+str(cal[5].index(i)+1)] ,Image.open(dpath+str(i)+'.bmp'))
except IndexError:
pass
# openweathermap api
owm = pyowm.OWM(api_key)
observation = owm.weather_at_place(location)
weather = observation.get_weather()
weathericon = weather.get_weather_icon_name()
Temperature = str(int(weather.get_temperature(unit='celsius')['temp']))
Humidity = str(weather.get_humidity())
#print('temp: '+Temperature +'°C') #->debug
#print('humidity: '+Humidity+'%') #->debug
#print(weathericon) #->debug
#weather icon handler
draw(wiconplace, open(wpath+weathericons[weathericon]+'.bmp'))
# date writing function
space1=Image.new('1', (115,25), color=255)
measure1= ImageDraw.Draw(space1)
date = ImageDraw.Draw(space1)
date.text((2, 3), (time.strftime('%a %-d %b %y')), font=font, fill=0)
rotate1 = space1.rotate(270, expand=1)
image.paste(rotate1, (595,20))
# temperature writing function
space2 = Image.new('1', (50,35), color=255)
measure2= ImageDraw.Draw(space2)
temperature = ImageDraw.Draw(space2)
temperature.text((2, 8), (Temperature + " °C"), fill=0 ,font=font)
rotate2 = space2.rotate(270, expand=1)
image.paste(rotate2, (605,334))
# humidity writing function
space3 = Image.new('1', (50,35), color=255)
measure3= ImageDraw.Draw(space3)
humidity = ImageDraw.Draw(space3)
humidity.text((4, 8), (Humidity +'%'), fill=0 ,font=font)
rotate3 = space3.rotate(270, expand=1)
image.paste(rotate3, (570,334))
# weekday handler
if calendar.firstweekday() == 0:
draw(weekdaysmon[(time.strftime("%a"))], weekday)
if calendar.firstweekday() == 6:
draw(weekdayssun[(time.strftime("%a"))], weekday)
print('It is currently:',time.strftime('%a %-d %b %y')) #--debug
print('The current time is:', time.strftime('%H:%M')) #--debug
elist = []
for events in c.events:
if str(time.year) in str((events.begin).format('YYYY')):
if str(time.month) in str((events.begin).format('M')):
elist.append(int((events.begin).format('D')))
print('In this month, you have',len(elist),'Events')
for x in elist:
if x in cal[0]:
draw(positions['a'+str(cal[0].index(x)+1)] ,eventicon)
if x in cal[1]:
draw(positions['b'+str(cal[1].index(x)+1)] ,eventicon)
if x in cal[2]:
draw(positions['c'+str(cal[2].index(x)+1)] ,eventicon)
if x in cal[3]:
draw(positions['d'+str(cal[3].index(x)+1)] ,eventicon)
if x in cal[4]:
draw(positions['e'+str(cal[4].index(x)+1)] ,eventicon)
try:
if x in cal[5]:
draw(positions['f'+str(cal[5].index(x)+1)] ,eventicon)
except IndexError:
pass
today = time.day
if today in cal[0]:
draw(positions['a'+str(cal[0].index(today)+1)] ,dateicon)
if today in cal[1]:
draw(positions['b'+str(cal[1].index(today)+1)] ,dateicon)
if today in cal[2]:
draw(positions['c'+str(cal[2].index(today)+1)] ,dateicon)
if today in cal[3]:
draw(positions['d'+str(cal[3].index(today)+1)] ,dateicon)
if today in cal[4]:
draw(positions['e'+str(cal[4].index(today)+1)] ,dateicon)
try:
if today in cal[5]:
draw(positions['f'+str(cal[5].index(today)+1)] ,dateicon)
except IndexError:
pass
draw(tempplace, tempicon)
draw(humplace, humicon)
epd.display_frame(epd.get_frame_buffer(image))
# delete the list so deleted events can be removed from the list
del elist[:]
epd.sleep()
for i in range(1):
nexthour = ((60 - int(time.strftime("%-M")))*60) - (int(time.strftime("%-S")))
sleep(nexthour)
if __name__ == '__main__':
main()

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

29
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,29 @@
# Contribution Policy the E-Paper Calendar software
Thanks for contributing to the E-Paper Calendar Software!
If you wish to contribute, please test your suggestion for at least one week on your own E-Paper first. Often, a small change makes a lot
of difference so it's important to check how well your suggestion can perform.
A testing time for 1 week is set as the E-Paper software takes 1 days for a daily cycle, 7 days for a weekly cycle and 1 month for a
montly cycle. Usually, if it works for the daily and weekly cycle, there shouldn't be any issues in the monthly cycle.
# Submitting Issues
Please only submit reproducible issues and write the instructions on how to reproduce them.
When you are submitting a new issue, please supply the following information:
* **Version info;** Copy the data inside the Info.txt file (`/home/pi/E-Paper-Master/Info.txt`). If there's no such file, you are using an outdated version. Please consider updating.
* **Error output:** Any errors of the Main script can be found in `/home/pi/E-Paper-Master/E-Paper-err.log`. You don't need to copy the entire file (please don't) but rather the latest errors that occured.
* **Changes made:** If you have made any changes (apart from personal information), also include them to help debugging.
* **Description**: Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem.
* **Steps to reproduce:** List the step by step process to reproduce the issue.
* **Results**: Describe what you expected to see and what you actually saw.
* **Additional Notes:** Provide any other relevant notes not previously mentioned. This is optional.

View File

@ -4,11 +4,12 @@ from PIL import Image, ImageDraw, ImageFont
EPD_WIDTH = 640
EPD_HEIGHT = 384
epd = epd7in5b.EPD()
def calibration():
for i in range(2):
epd = epd7in5b.EPD()
epd.init()
black = Image.new('L', (EPD_WIDTH, EPD_HEIGHT), 0)
black = Image.new('1', (EPD_WIDTH, EPD_HEIGHT), 0)
print('calibrating black...')
ImageDraw.Draw(black)
epd.display_frame(epd.get_frame_buffer(black))
@ -17,17 +18,14 @@ def calibration():
ImageDraw.Draw(red)
print('calibrating red...')
epd.display_frame(epd.get_frame_buffer(red))
white = Image.new('L', (EPD_WIDTH, EPD_HEIGHT), 255)
white = Image.new('1', (EPD_WIDTH, EPD_HEIGHT), 255)
ImageDraw.Draw(white)
print('calibrating white...')
epd.display_frame(epd.get_frame_buffer(white))
epd.sleep()
print('Cycle complete!')
def main():
epd = epd7in5b.EPD()
epd.init()
for i in range(1):
calibration()

View File

@ -1,6 +1,32 @@
"""
E-Paper Software (main script) adapted for the 3-colour E-Paper display
A full and detailed breakdown for this code can be found in the wiki.
If you have any questions, feel free to open an issue at Github.
Copyright by Ace-Laboratory
"""
# url refers to the iCal url. It's the link you can copy when you click on
# 'export' Calendar in Google or Yahoo (and many more online) Calendars
# api-key refers to your openweathermap api key. It can be generated for free
# when you sign up for an account and consists of a bunch of numbers and letters
# location refers to the city you live in. You api key will be used to grab live
# weather data for this city. Use the format below (city-name, country code)
# week_starts_on refers to the day on which the week starts on in your country.
# Choose between Monday and Sunday.
""" To quickly get started, fill in the following details:"""
url = "https://calendar.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics"
api_key = ""
location = "California, US"
week_starts_on = "Monday"
"""That's all. The software will do the rest. You don't need to modify anything below this."""
import epd7in5b #epd-control
from PIL import Image, ImageDraw, ImageFont, ImageOps #image operations
import calendar, pyowm #calendar and openweathermap wrapper
@ -12,11 +38,12 @@ import arrow #icalendar parser compatible dates
from calibration import calibration
epd = epd7in5b.EPD() #required
epd.init() #required
url = "please past a valid calendar url here" # or use this one for testing:
#url = "https://calendar.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics"
calendar.setfirstweekday(calendar.MONDAY) #mon or sun
if (week_starts_on == "Monday"):
calendar.setfirstweekday(calendar.MONDAY)
if (week_starts_on == "Sunday"):
calendar.setfirstweekday(calendar.Sunday)
c = Calendar(urlopen(url).read().decode('UTF-8'))
e = Event()
@ -76,9 +103,9 @@ def main():
calibration()
if hour is 12:
calibration()
if hour is 18: #change to 18
if hour is 18:
calibration()
epd.init()
image = Image.new('L', (EPD_WIDTH, EPD_HEIGHT), 255)
draw = (ImageDraw.Draw(image)).bitmap
@ -86,9 +113,11 @@ def main():
draw(monthplace, Image.open(mpath+str(time.strftime("%B"))+'.bmp'))
if calendar.firstweekday() == 0:
#print('Your week starts on Monday') #->debug
draw(weekplace, weekmon)
if calendar.firstweekday() == 6:
#print('Your week starts on Sunday') #->debug
draw(weekplace, weeksun)
draw(barplace, bar)
@ -112,12 +141,15 @@ def main():
pass
# openweathermap api
owm = pyowm.OWM('Your Openweathermap API')
observation = owm.weather_at_place('Your City, Your Country Name') # like (New York, US)
owm = pyowm.OWM(api_key)
observation = owm.weather_at_place(location)
weather = observation.get_weather()
weathericon = weather.get_weather_icon_name()
Temperature = str(int(weather.get_temperature(unit='celsius')['temp']))
Humidity = str(weather.get_humidity())
#print('temp: '+Temperature +'°C') #->debug
#print('humidity: '+Humidity+'%') #->debug
#print(weathericon) #->debug
#weather icon handler
draw(wiconplace, open(wpath+weathericons[weathericon]+'.bmp'))
@ -204,6 +236,7 @@ def main():
# delete the list so deleted events can be removed from the list
del elist[:]
epd.sleep()
for i in range(1):
nexthour = ((60 - int(time.strftime("%-M")))*60) - (int(time.strftime("%-S")))

36
Changelog.md Normal file
View File

@ -0,0 +1,36 @@
# E-Paper-Calendar Software Changelog
All significant changes will be documented in this file.
The order is from latest to oldest and structured in the following way:
* Version name with date of publishing
* Sections with either 'added', 'fixed', 'updated' and 'changed'
## [1.2] Early October
### Added
* Added option to choose E-Paper version (2/3-Colour) at beginning of install
* Added a file 'Info.txt' (`home/pi/E-Paper-Master/Info.txt`) which contains some basic info of the install on your system
* Created a new folder in this repo named 'For-developers-only' to give access to developer stuff
* Added an converter (in developers folder) for converting .jpeg, .png and .bmp files to useable .bmp files. (Currently in ALPHA phase!)
* Created a Changelog
* Created contribution guidelines
### Fixed
* Fixed a critical problem to prevent further burn-ins (ghosting) and damage due to over-voltages.
* 2-Colour E-Paper now uses specific (driver) files for the 2-Colour version
### Changed
* Changed the main script slightly (stable.py) to allow easier input of personal variables
* Improved the single-line installers (with and without debug)
## [1.1] End of September
### Added
* Added a command to partially support the 7.5" 2-Colour (Black and White)
* Added support for Raspbian Stretch Lite by installing missing packages
* Created code of Conduct
* Created an issue named 'Improvement ideas' as a place for discussing new features and ideas.
### Fixed
* fixed a bug (reference to Issue #3) where the 'Installer with Debug' was not working due to incorrect url
## [1.0] Mid-September
### Initial Release of the E-Paper-Calendar Software

View File

@ -0,0 +1,104 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import glob, os, errno
from PIL import Image
import PIL.ImageOps
"""
Python converter for converting png, jpeg and bmp to usable .bmp files which
can be used by the E-Paper display. Currently, any image will be converted
to pure white and pure black pixels, without any shades of grey, just as the
displays expects them to be.
Tested and confired to work
Copyright by Ace-Laboratory
"""
#--------------only change the following two lines-----------------#
input_folder = '/home/pi/conversion/input/'
output_folder = '/home/pi/conversion/output/'
#-----------------no need to change anything below----------------#
os.chdir(input_folder)
""" Creating lists with filenames first"""
pngs = []
for files in glob.glob("*.png"):
print('found this png: '+ os.path.splitext(os.path.basename(files))[0])
pngs.append(os.path.splitext(os.path.basename(files))[0])
bmps = []
for files in glob.glob("*.bmp"):
print('found this bmp: ' files)
bmps.append(files)
jpegs= []
for files in glob.glob("*.jpeg"):
print('found this jpeg: '+ os.path.splitext(os.path.basename(files))[0])
jpegs.append(os.path.splitext(os.path.basename(files))[0])
print('converting the images now')
"""Some variables first. It's required for reducing colours"""
thresh = 126 # any value below 127 works.
fn = lambda x : 255 if x > thresh else 0
""" Conversion is done in two steps:
1) Converting the file from .png or .jpeg .bmp to a greyscale .bmp
2) Inverting the colours and rotating the image 90° anticlockwise
"""
""" Step 1 conversion for png files"""
if not os.path.exists(input_folder+'pngs/'):
print('temporary png folder does not exist, creating now...')
os.makedirs(input_folder+'pngs/')
print("attempting to convert pngs now...")
for files in pngs:
png=Image.open(input_folder+files+".png")
png.load()
background = Image.new("RGB", png.size, (255, 255, 255)) #removing alpha channel
background.paste(png, mask=png.split()[3]) #removing alpha channel
background.convert('L').point(fn, mode='1').save((input_folder+'pngs/'+files+'.bmp'), 'BMP', quality=90)
""" Step 2 conversion for png files"""
png_bmp = []
os.chdir(input_folder+'pngs/')
for files in glob.glob("*.bmp"):
png_bmp.append(files)
for files in png_bmp:
(PIL.ImageOps.invert((Image.open(input_folder+'pngs/'+files).rotate(-90, expand=True)).convert('L'))).save(output_folder+files)
print("All png files have been converted.")
os.chdir(input_folder)
""" Step 1 conversion for jpeg files"""
if not os.path.exists(input_folder+'jpegs/'):
print('temporary jpeg folder does not exist, creating now...')
os.makedirs(input_folder+'jpegs/')
print("attempting to convert jpeg now...")
for files in jpegs:
(Image.open(input_folder+files+".jpeg").convert('L').point(fn, mode='1').save((input_folder+'jpegs/'+files+".bmp"), 'BMP', quality=90))
""" Step 2 conversion for jpeg files"""
jpeg_bmp = []
os.chdir(input_folder+'jpegs/')
for files in glob.glob("*.bmp"):
print('These :'+files)
jpeg_bmp.append(files)
for files in jpeg_bmp:
(PIL.ImageOps.invert((Image.open(input_folder+'jpegs/'+files).rotate(-90, expand=True)).convert('L'))).save(output_folder+files)
""" Step 1 & 2 conversion for bmp files"""
for files in bmps:
PIL.ImageOps.invert(Image.open(input_folder+files+".bmp").convert('L').point(fn, mode='1')).rotate(-90, expand=True).save((output_folder+files), 'BMP', quality=90) #(PIL.ImageOps.invert((Image.open(input_folder+files).rotate(-90, expand=True)).convert('L'))).save(output_folder+files)
print('All done')

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

View File

@ -1,9 +1,44 @@
#!/bin/sh
#!/bin/bash
# This script is for automating the install for both displays,
# The 2-colour and 3-colour one.
# Copyright by Ace-Laboratory
# Getting input to see which E-Paper version is currently being used.
echo -e "\e[1mWhich version of the E-Paper display are you using?"
echo -e "\e[97mEnter \e[91m2 \e[97m if you are using the 2-Colour E-Paper"
echo -e "\e[97mEnter \e[91m3 \e[97m if you are using the 3-Colour E-Paper"
echo -e "\e[97mconfirm your selection with [ENTER]"
read -r -p 'Please type in the number now: ' digit
if [ -z "$digit" ]; then
echo "You didn't enter anything."
echo "Aborting now."
exit
fi
if [ "$digit" != 2 ] && [ "$digit" != 3 ]; then
echo "invalid number, only 2 or 3 can be accepted."
echo "Aborting now."
exit
fi
if [ "$digit" = 2 ] || [ "$digit" = 3 ]; then
echo ""
echo -e "\e[1;36m"Your input was accepted"\e[0m"
echo -e "\e[1;36m"The installer will finish the rest now. You can enjoy a break in the meanwhile."\e[0m"
echo ""
fi
# Updating and upgrading the system, without taking too much space
echo -e "\e[1;36m"Running apt-get update and apt-get dist-upgrade for you..."\e[0m"
echo -e "\e[1;36m"This will take a while."\e[0m"
echo -e "\e[1;36m"This will take a while, sometimes up to 30 mins"\e[0m"
sudo apt-get update && sudo apt-get dist-upgrade -y
echo -e "\e[1;36m"System successfully updated and upgraded!"\e[0m"
echo ""
# Installing a few packages which are missing on Raspbian Stretch Lite
echo -e "\e[1;36m"Installing a few packages that are missing on Raspbian Stretch Lite..."\e[0m"
sudo apt-get install python3-pip -y
sudo apt-get install RPi.GPIO -y
@ -13,28 +48,73 @@ pip3 install Pillow
sudo pip3 install Pillow
sudo apt-get install libopenjp2-7-dev -y
sudo apt install libtiff5 -y
echo ""
# Running apt-get clean and apt-get autoremove
echo -e "\e[1;36m"Cleaning a bit of mess to free up some space..."\e[0m"
sudo apt-get clean && sudo apt-get autoremove -y
sudo apt-get clean && sudo apt-get autoremove -y
echo ""
echo -e "\e[1;36m"Installing the E-Paper-Calendar Software"\e[0m"
git clone https://github.com/aceisace/Raspberry-Pi-Google-Calendar-with-E-Paper-display
mkdir E-Paper-Master
cd Raspberry-Pi-Google-Calendar-with-E-Paper-display
cp -r Calendar /home/pi/E-Paper-Master/
cp README.md /home/pi/E-Paper-Master/
cp LICENSE /home/pi/E-Paper-Master/
cp -r .git /home/pi/E-Paper-Master/
cd
rm -r Raspberry-Pi-Google-Calendar-with-E-Paper-display
# Using this part for the 2-colour E-Paper version
if [ "$digit" = 2 ]; then
echo -e "\e[1;36m"Installing the 2-Colour E-Paper-Calendar Software"\e[0m"
git clone https://github.com/aceisace/E-Paper-Calendar-with-iCal-sync-and-live-weather
mkdir E-Paper-Master
cd E-Paper-Calendar-with-iCal-sync-and-live-weather
rm -r Calendar
mv 2-colour Calendar
cp -r Calendar /home/pi/E-Paper-Master/
cp README.md /home/pi/E-Paper-Master/
cp LICENSE /home/pi/E-Paper-Master/
cp -r .git /home/pi/E-Paper-Master/
cd
sudo rm -r E-Paper-Calendar-with-iCal-sync-and-live-weather
# add a short info
cat > /home/pi/E-Paper-Master/Info.txt << EOF
This document contains a short info of the version
Version: 2-Colour E-Paper-version
Installer version: 1.2 (Early October 2018)
If the time was set correctly, you installed this software on:
EOF
echo "$(date)" >> /home/pi/E-Paper-Master/Info.txt
echo ""
fi
# Using this part for the 3-colour E-Paper version
if [ "$digit" = 3 ]; then
echo -e "\e[1;36m"Installing the 3-Colour E-Paper-Calendar Software"\e[0m"
git clone https://github.com/aceisace/E-Paper-Calendar-with-iCal-sync-and-live-weather
mkdir E-Paper-Master
cd E-Paper-Calendar-with-iCal-sync-and-live-weather
cp -r Calendar /home/pi/E-Paper-Master/
cp README.md /home/pi/E-Paper-Master/
cp LICENSE /home/pi/E-Paper-Master/
cp -r .git /home/pi/E-Paper-Master/
cd
sudo rm -r E-Paper-Calendar-with-iCal-sync-and-live-weather
# add a short info
cat > /home/pi/E-Paper-Master/Info.txt << EOF
This document contains a short info of the version
Version: 3-Colour E-Paper-version
Installer version: 1.2 (Early October 2018)
If the time was set correctly, you installed this software on:
EOF
echo "$(date)" >> /home/pi/E-Paper-Master/Info.txt
echo ""
fi
# Installing packages required by the main script
echo -e "\e[1;36m"Installing a few required packages for the E-Paper Software"\e[0m"
sudo pip3 install pyowm
sudo pip3 install ics
pip3 install pyowm
pip3 install ics
echo ""
echo -e "\e[1;36m"Setting up the script to start at boot..."\e[0m"
# Setting up supervisor
echo -e "\e[1;36m"Setting up the script to start at boot..."\e[0m"
sudo apt-get install supervisor -y
sudo bash -c 'cat > /etc/supervisor/conf.d/E-Paper.conf' << EOF
@ -45,8 +125,14 @@ stderr_logfile = /home/pi/E-Paper-Master/E-Paper-err.log
EOF
sudo service supervisor start E-Paper
echo ""
# Final words
echo -e "\e[1;36m"The install was successful"\e[0m"
echo -e "\e[1;36m"The script will now start at every boot."\e[0m"
echo -e "\e[1;31m"Do not forget to add your iCal url and openweathermap API in the main script."\e[0m"
echo -e "\e[1;36m"The programm will now start at every boot."\e[0m"
echo -e "\e[1;31m"Please enter your details in the main script."\e[0m"
echo -e "\e[1;31m"If the file is not modified, the programm will not start"\e[0m"
echo -e "\e[1;36m"To modify the main file, enter:"\e[0m"
echo -e "\e[1;36m"nano /home/pi/E-Paper-Master/Calendar/stable.py"\e[0m"

144
Installer-without-debug Normal file
View File

@ -0,0 +1,144 @@
#!/bin/bash
# This script is for automating the install for both displays,
# The 2-colour and 3-colour one.
# Version: 1.2 (early October)
# Well tested and confirmed
# Copyright by Ace-Laboratory
# Getting input to see which E-Paper version is currently being used.
echo -e "\e[1mWhich version of the E-Paper display are you using?"
echo -e "\e[97mEnter \e[91m2 \e[97m if you are using the 2-Colour E-Paper"
echo -e "\e[97mEnter \e[91m3 \e[97m if you are using the 3-Colour E-Paper"
echo -e "\e[97mconfirm your selection with [ENTER]"
read -r -p 'Please type in the number now: ' digit
if [ -z "$digit" ]; then
echo "You didn't enter anything."
echo "Aborting now."
exit
fi
if [ "$digit" != 2 ] && [ "$digit" != 3 ]; then
echo "invalid number, only 2 or 3 can be accepted."
echo "Aborting now."
exit
fi
if [ "$digit" = 2 ] || [ "$digit" = 3 ]; then
echo ""
echo -e "\e[1;36m"Your input was accepted"\e[0m"
echo -e "\e[1;36m"The installer will finish the rest now. You can enjoy a break in the meanwhile."\e[0m"
echo ""
fi
# Updating and upgrading the system, without taking too much space
echo -e "\e[1;36m"Running apt-get update and apt-get dist-upgrade for you..."\e[0m"
echo -e "\e[1;36m"This will take a while, sometimes up to 30 mins"\e[0m"
sudo apt-get update > /dev/null && sudo apt-get dist-upgrade -y > /dev/null
echo -e "\e[1;36m"System successfully updated and upgraded!"\e[0m"
echo ""
# Installing a few packages which are missing on Raspbian Stretch Lite
echo -e "\e[1;36m"Installing a few packages that are missing on Raspbian Stretch Lite..."\e[0m"
{
sudo apt-get install python3-pip -y
sudo apt-get install RPi.GPIO -y
sudo apt-get install python3-spidev -y
sudo apt-get install git -y
pip3 install Pillow
sudo pip3 install Pillow
sudo apt-get install libopenjp2-7-dev -y
sudo apt install libtiff5 -y
} > /dev/null
echo ""
# Running apt-get clean and apt-get autoremove
echo -e "\e[1;36m"Cleaning a bit of mess to free up some space..."\e[0m"
sudo apt-get clean > /dev/null && sudo apt-get autoremove -y > /dev/null
echo ""
# Using this part for the 2-colour E-Paper version
if [ "$digit" = 2 ]; then
echo -e "\e[1;36m"Installing the 2-Colour E-Paper-Calendar Software"\e[0m"
git clone https://github.com/aceisace/E-Paper-Calendar-with-iCal-sync-and-live-weather
mkdir E-Paper-Master
cd E-Paper-Calendar-with-iCal-sync-and-live-weather
rm -r Calendar
mv 2-colour Calendar
cp -r Calendar /home/pi/E-Paper-Master/
cp README.md /home/pi/E-Paper-Master/
cp LICENSE /home/pi/E-Paper-Master/
cp -r .git /home/pi/E-Paper-Master/
cd
sudo rm -r E-Paper-Calendar-with-iCal-sync-and-live-weather
# add a short info
cat > /home/pi/E-Paper-Master/Info.txt << EOF
This document contains a short info of the version
Version: 2-Colour E-Paper-version
Installer version: 1.2 (Early October 2018)
If the time was set correctly, you installed this software on:
EOF
echo "$(date)" >> /home/pi/E-Paper-Master/Info.txt
echo ""
fi
# Using this part for the 3-colour E-Paper version
if [ "$digit" = 3 ]; then
echo -e "\e[1;36m"Installing the 3-Colour E-Paper-Calendar Software"\e[0m"
git clone https://github.com/aceisace/E-Paper-Calendar-with-iCal-sync-and-live-weather
mkdir E-Paper-Master
cd E-Paper-Calendar-with-iCal-sync-and-live-weather
cp -r Calendar /home/pi/E-Paper-Master/
cp README.md /home/pi/E-Paper-Master/
cp LICENSE /home/pi/E-Paper-Master/
cp -r .git /home/pi/E-Paper-Master/
cd
sudo rm -r E-Paper-Calendar-with-iCal-sync-and-live-weather
# add a short info
cat > /home/pi/E-Paper-Master/Info.txt << EOF
This document contains a short info of the version
Version: 3-Colour E-Paper-version
Installer version: 1.2 (Early October 2018)
If the time was set correctly, you installed this software on:
EOF
echo "$(date)" >> /home/pi/E-Paper-Master/Info.txt
echo ""
fi
# Installing packages required by the main script
echo -e "\e[1;36m"Installing a few required packages for the E-Paper Software"\e[0m"
{
sudo pip3 install pyowm
sudo pip3 install ics
pip3 install pyowm
pip3 install ics
} > /dev/null
echo ""
# Setting up supervisor
echo -e "\e[1;36m"Setting up the script to start at boot..."\e[0m"
sudo apt-get install supervisor -y > /dev/null
sudo bash -c 'cat > /etc/supervisor/conf.d/E-Paper.conf' << EOF
[program:E-Paper]
command = sudo /usr/bin/python3.5 /home/pi/E-Paper-Master/Calendar/stable.py
stdout_logfile = /home/pi/E-Paper-Master/E-Paper.log
stderr_logfile = /home/pi/E-Paper-Master/E-Paper-err.log
EOF
sudo service supervisor start E-Paper
echo ""
# Final words
echo -e "\e[1;36m"The install was successful"\e[0m"
echo -e "\e[1;36m"The programm will now start at every boot."\e[0m"
echo -e "\e[1;31m"Please enter your details in the main script."\e[0m"
echo -e "\e[1;31m"If the file is not modified, the programm will not start"\e[0m"
echo -e "\e[1;36m"To modify the main file, enter:"\e[0m"
echo -e "\e[1;36m"nano /home/pi/E-Paper-Master/Calendar/stable.py"\e[0m"

View File

@ -1,55 +0,0 @@
#!/bin/sh
echo -e "\e[1;36m"Running apt-get update and apt-get dist-upgrade for you..."\e[0m"
echo -e "\e[1;36m"This will take a while."\e[0m"
sudo apt-get update > /dev/null && sudo apt-get dist-upgrade -y > /dev/null
echo -e "\e[1;36m"System successfully updated and upgraded!"\e[0m"
echo -e "\e[1;36m"Installing a few packages that are missing on Raspbian Stretch Lite..."\e[0m"
{
sudo apt-get install python3-pip -y
sudo apt-get install RPi.GPIO -y
sudo apt-get install python3-spidev -y
sudo apt-get install git -y
pip3 install Pillow
sudo pip3 install Pillow
sudo apt-get install libopenjp2-7-dev -y
sudo apt install libtiff5 -y
} > /dev/null
echo -e "\e[1;36m"Cleaning a bit of mess to free up some space..."\e[0m"
sudo apt-get clean > /dev/null && sudo apt-get autoremove -y > /dev/null
echo -e "\e[1;36m"Installing the E-Paper-Calendar Software"\e[0m"
git clone https://github.com/aceisace/Raspberry-Pi-Google-Calendar-with-E-Paper-display
mkdir E-Paper-Master
cd Raspberry-Pi-Google-Calendar-with-E-Paper-display
cp -r Calendar /home/pi/E-Paper-Master/
cp README.md /home/pi/E-Paper-Master/
cp LICENSE /home/pi/E-Paper-Master/
cp -r .git /home/pi/E-Paper-Master/
cd
rm -r Raspberry-Pi-Google-Calendar-with-E-Paper-display
echo -e "\e[1;36m"Installing a few required packages for the E-Paper Software"\e[0m"
{
sudo pip3 install pyowm
sudo pip3 install ics
pip3 install pyowm
pip3 install ics
} > /dev/null
echo -e "\e[1;36m"Setting up the script to start at boot..."\e[0m"
sudo apt-get install supervisor -y > /dev/null
sudo bash -c 'cat > /etc/supervisor/conf.d/E-Paper.conf' << EOF
[program:E-Paper]
command = sudo /usr/bin/python3.5 /home/pi/E-Paper-Master/Calendar/stable.py
stdout_logfile = /home/pi/E-Paper-Master/E-Paper.log
stderr_logfile = /home/pi/E-Paper-Master/E-Paper-err.log
EOF
sudo service supervisor start E-Paper
echo -e "\e[1;36m"The install was successful"\e[0m"
echo -e "\e[1;36m"The script will now start at every boot."\e[0m"
echo -e "\e[1;31m"Do not forget to add your iCal url and openweathermap API in the main script."\e[0m"

View File

@ -1,10 +1,15 @@
# Raspberry-Pi-Google-Calendar-with-E-Paper-display
A python script for the rpi zero w to sync events from any online calendar to a beautiful E-Paper Display, get live weather data and much more.
This is a software written in python3 that allows you to transform an E-Paper display (like the kindle) into an information display. It fetches live data from Openweathermap (a weather info provider) and your Online Calendar (Google/Yahoo Calendar) and displays them on a large, beautiful and ultra-low power E-Paper display. It's ideal for staying organised and keeping track of important details without having to check them up online.
## News:
* **Added Support for Raspbian Stretch lite. To get this up and running on raspbian stretch lite, follow the instructions just below.**
Altough mainly intended for the Raspberry Pi Zero W, mainly since it only requires 1W per hour, it works on the Rapsberry Pi 2/3 as well. To get started, follow the instructions below.
* **2-Colour E-Paper support coming soon! See the section 'Experimental' for the current status.**
## News:
* **Version 1.2 released (early October 2018) with lots of improvements, especially for the 2-Colour version!**
**If you were using any previous versions, please update as this version contains a critical update. See below section regarding updating**
* **Added Support for the 2-Colour E-Paper Display as well!** (End of September)
* **Added Support for Raspbian Stretch lite.** (End of September)
<img src="https://github.com/aceisace/Raspberry-Pi-Google-Calendar-with-E-Paper-display/blob/master/Gallery/Front-view.JPG" width="500">
## Main features
@ -13,13 +18,14 @@ A python script for the rpi zero w to sync events from any online calendar to a
* Get live weather data (including temperature, humidity, etc.) using openweathermap api
## Hardware required
* 7.5" E-Paper Display (Black, White, Red) with driver hat from waveshare (https://www.waveshare.com/product/7.5inch-e-paper-hat-b.htm)
* Raspberry Pi Zero W (without headers)
* 90° angled 2x20 Pin GPIO headers
* 7.5" 3-Colour E-Paper Display (Black, White, Red/Yellow) with driver hat from [waveshare](https://www.waveshare.com/product/7.5inch-e-paper-hat-b.htm)
**or**
* 7.5" 2-Colour E-Paper Display (Black, White) with driver hat from [waveshare](https://www.waveshare.com/product/7.5inch-e-paper-hat.htm)
* Raspberry Pi Zero WH (with headers) (no soldering iron required)
* Or: Raspberry Pi Zero W. In this case, you'll need to solder 2x20 pin GPIO headers yourself
* MicroSD card (min. 4GB)
* MicroUSB cable
* 3d-printer (you can also appoint any 3d-printing service) for printing a case
* Soldering iron (for soldering the headers)
* MicroUSB cable (for power)
* Something to be used as a case (e.g. a picture frame or a 3D-printed case)
# Setup
@ -30,21 +36,25 @@ A python script for the rpi zero w to sync events from any online calendar to a
4. Enable SPI by entering **`sudo sed -i s/#dtparam=spi=on/dtparam=spi=on/ /boot/config.txt`** in the Terminal
5. Set the correct timezone with **`sudo dpkg-reconfigure tzdata`**, selecting the correct continent and then the capital of your country.
6. Reboot to apply changes
7. Optional: If you want to disable the on-board leds of the Raspberry, follow these instructions:
**[Disable on-board-led](https://www.jeffgeerling.com/blogs/jeff-geerling/controlling-pwr-act-leds-raspberry-pi)**
## Installing required packages for python 3.5
Execute the following command in the Terminal to install all required packages. This will work on both, Raspbian Stretch with Desktop and Raspbian Stretch lite.
**`curl -sSL https://raw.githubusercontent.com/aceisace/Raspberry-Pi-Google-Calendar-with-E-Paper-display/master/Packages-installer | bash`**
**`bash -c "$(curl -sL https://raw.githubusercontent.com/aceisace/E-Paper-Calendar-with-iCal-sync-and-live-weather/master/Installer-without-debug)"`**
Should you encounter any problems during the install, try using the Installer with output, like this:
`curl -sSL https://raw.githubusercontent.com/aceisace/E-Paper-Calendar-with-iCal-sync-and-live-weather/master/Installer-with-debug |bash`
`bash -c "$(curl -sL https://raw.githubusercontent.com/aceisace/E-Paper-Calendar-with-iCal-sync-and-live-weather/master/Installer-with-debug)"`
If the Installer should fail for any reason, kindly open an issue and paste the error. Thanks.
This is how the installer will run:
<img src="https://github.com/aceisace/E-Paper-Calendar-with-iCal-sync-and-live-weather/blob/master/Gallery/pi-zero-install-successful.png" width="700">
<img src="https://github.com/aceisace/E-Paper-Calendar-with-iCal-sync-and-live-weather/blob/master/Gallery/Installer-v1.2-screenshot.png" width="700">
## Customising the main script
## Adding details to the programm
Once the packages are installed, navigate to the home directory, open 'E-Paper-Master' and open the file 'stable.py' inside the Calendar folder.
3 Main Details are needed to get running:
@ -55,17 +65,16 @@ Once the packages are installed, navigate to the home directory, open 'E-Paper-M
## Demo
Once you have setup everything, the E-Paper Calendar will refresh the screen in the following way:
<img src="https://github.com/aceisace/E-Paper-Calendar-with-iCal-sync-and-live-weather/blob/master/Gallery/GIF.gif" width="320">
## (Experimental) Support for 2-Colour E-Paper-versions
Although this software was not originally intended to be used with the 2-Colour E-Paper Display from waveshare, there probably are a few folks which have the 2-colour version and yet would want to use this software.
Currently, there is a 'quick' fix to get this to work on the 2-Colour E-Paper display. It works by converting the 3-colour bmps used by the E-Paper display to 2-colour (black and white) bmps. To add support for the 2-colour version, follow the steps above as you would with the 3-Colour version. Then, execute:
## Updating
If you were using a previous version and want to update, do the following:
**`curl -sSL https://raw.githubusercontent.com/aceisace/E-Paper-Calendar-with-iCal-sync-and-live-weather/master/2-Colour-support/setup | bash`**
* Save your personal details from the main script, located in `/home/pi/E-Paper-Master/Calendar/stable.py` in a different location.
For example you can create a text file which contains your openweathermap-api-key and iCal-url in `/home/pi/personal.txt`
<img src="https://user-images.githubusercontent.com/29558518/46045487-25134680-c11e-11e8-96de-ee7ed57ac766.png" width="400">
* Remove the E-Paper-Master folder from the home directory with `sudo rm -r /home/pi/E-Paper-Master/`
The _experimental_ is there as I don't actually have the 2-Colour version of the E-Paper. I can only _assume_ that it will work. It's strongly recommended to create a backup of the 'E-Paper-Master' folder in case something doesn't work right. If that is the case, please open up an issue to let me know.
* Re-run the (updated) installer and insert your details again in stable.py. Reboot to apply changes.
## Don't forget to check out the Wiki. It contains all the information to customising, understanding and setting up the script.

View File

@ -1,8 +0,0 @@
sudo apt-get install python3-pip -y
sudo apt-get install RPi.GPIO -y
sudo apt-get install python3-spidev -y
sudo apt-get install git -y
pip3 install Pillow
sudo pip3 install Pillow
sudo apt-get install libopenjp2-7-dev
sudo apt install libtiff5

1
To-Do
View File

@ -1,6 +1,7 @@
# TO DO:
## Add support for the 2-colour 7.5" E-Paper version (black and white only).
## Notify waveshare that this Software now also works for the 2-colour version
## Create a Dashboard page as an addition/ alternative to the current 'Calendar' page with the following features:
1. Sunrise and Sunset times from Openweathermap

1
folder
View File

@ -1 +0,0 @@

View File

@ -1,6 +0,0 @@
#!/bin/sh
# This file is of no use except for testing purposes. It is meant to make the installer more user-friendly by hiding the output, adding colour etc.
echo -e "\e[1;36m"Running apt-get update and apt-get dist-upgrade for you..."\e[0m"
sudo apt-get update > /dev/null && sudo apt-get dist-upgrade -y > /dev/null
echo -e "\e[1;36m"System successfully updated and upgraded!"\e[0m"

1
translations/de/test Normal file
View File

@ -0,0 +1 @@
test

View File

@ -0,0 +1,5 @@
# All supported languages are shown below. This list will be updated when new translations are available.
## English
## Coming soon: German