Skip to content

Commit

Permalink
Merge pull request #336 from aceinnolab/hotfix/#335
Browse files Browse the repository at this point in the history
fix issue with 12.48" rendering
  • Loading branch information
aceisace authored Apr 29, 2024
2 parents a1edade + 0ba210a commit 6ade114
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 28 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/test-on-rpi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Raspberry Pi build
name: Test on Raspberry Pi OS

on:
push:
Expand Down Expand Up @@ -29,7 +29,7 @@ jobs:
TINDIE_USERNAME: ${{ secrets.TINDIE_USERNAME }}
with:
# Set the base_image to the desired Raspberry Pi OS version
base_image: https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2023-12-11/2023-12-11-raspios-bookworm-armhf-lite.img.xz
base_image: https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2024-03-15/2024-03-15-raspios-bookworm-armhf-lite.img.xz
image_additional_mb: 3072 # enlarge free space to 3GB
optimize_image: true
# user: inky --> not supported?
Expand All @@ -42,10 +42,9 @@ jobs:
whoami
cd /home/inky
sudo apt-get update -y
sudo apt-get install zlib1g libjpeg-dev libatlas-base-dev rustc libopenjp2-7 python3-dev scons libssl-dev python3-venv python3-pip git libfreetype6-dev wkhtmltopdf libopenblas-dev -y
sudo apt-get install git zlib1g libjpeg-dev libatlas-base-dev rustc libopenjp2-7 python3-dev scons libssl-dev python3-venv python3-pip git libfreetype6-dev wkhtmltopdf libopenblas-dev -y
echo $PWD && ls
git clone --branch main --single-branch https://github.com/aceinnolab/Inkycal
git clone https://github.com/aceinnolab/Inkycal
cd Inkycal
python3.11 -m venv venv
. venv/bin/activate
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/update-os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
TINDIE_USERNAME: ${{ secrets.TINDIE_USERNAME }}
with:
# Set the base_image to the desired Raspberry Pi OS version
base_image: https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2023-12-11/2023-12-11-raspios-bookworm-armhf-lite.img.xz
base_image: https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2024-03-15/2024-03-15-raspios-bookworm-armhf-lite.img.xz
image_additional_mb: 3072 # enlarge free space to 3 GB
optimize_image: true
commands: |
Expand All @@ -40,7 +40,13 @@ jobs:
sudo apt-get dist-upgrade -y
sudo apt-get install -y python3-pip
sudo apt-get install zlib1g libjpeg-dev libatlas-base-dev rustc libopenjp2-7 python3-dev scons libssl-dev python3-venv python3-pip git libfreetype6-dev wkhtmltopdf libopenblas-dev libxml2-dev libxslt-dev python-dev-is-python3 -y
sudo apt-get install git zlib1g libjpeg-dev libatlas-base-dev rustc libopenjp2-7 python3-dev scons libssl-dev python3-venv python3-pip git libfreetype6-dev wkhtmltopdf libopenblas-dev libxml2-dev libxslt-dev python-dev-is-python3 -y
# #334 & #335
git clone https://github.com/WiringPi/WiringPi
cd WiringPi
./build
cd ..
echo $PWD && ls
git clone https://github.com/aceinnolab/Inkycal
cd Inkycal
Expand All @@ -59,10 +65,6 @@ jobs:
tar -xf bcm2835-1.71.tar
cd bcm2835-1.71/
sudo ./configure && sudo make && sudo make check && sudo make install
cd ..
echo $CWD
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
cd ..
echo $CWD
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

Inkycal is a software written in python for selected E-Paper displays. It converts these displays into useful
information dashboards. It's open-source, free for personal use, fully modular and user-friendly. Despite all this,
Inkycal can run well even on the Raspberry Pi Zero. Oh, and it's open for third-party modules! Hooray!
Inkycal can run well even on the Raspberry Pi Zero W. Oh, and it's open for third-party modules! Hooray!

## ⚠️ Warning: long installation time expected!

Expand Down Expand Up @@ -56,7 +56,7 @@ Watch the one-minute video on getting started with Inkycal:
## Hardware guide

Before you can start, please ensure you have one of the supported displays and of the supported Raspberry
Pi: `|4|3A|3B|3B+|2B|0W|0WH|02W|`. We personally recommend the Raspberry Pi Zero W as this is relatively cheaper, uses
Pi: `|4|3A|3B|3B+|2B|ZeroW|ZeroWH|Zero2W|`. We personally recommend the Raspberry Pi Zero W as this is relatively cheaper, uses
less power and is perfect to fit in a small photo frame once you have assembled everything.

**Serial** displays are usually cheaper, but slower. Their main advantage is ease of use, like being able to communicate
Expand Down Expand Up @@ -92,11 +92,6 @@ display!**
| MicroSD card | Sandisk |  Search for `MicroSD card 8GB` on amazon or similar |

## Configuring the Raspberry Pi

⚠️ Warning: You cannot use the latest version of Raspberry Pi OS as a kernel upgrade has caused many projects to fail.
Please only use the version mentioned below.
Download this specific version
of [Raspberry Pi OS (11-12-2023)](https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2023-12-11/2023-12-11-raspios-bookworm-armhf-lite.img.xz)
Flash Raspberry Pi OS on your microSD card (min. 4GB) with [Raspberry Pi Imager](https://rptl.io/imager).
Use the following settings:

Expand Down Expand Up @@ -138,8 +133,6 @@ wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz
tar zxvf bcm2835-1.71.tar.gz
cd bcm2835-1.71/
sudo ./configure && sudo make && sudo make check && sudo make install
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb

# If you are using the Raspberry Pi Zero models, you may need to increase the swapfile size to be able to install Inkycal:
sudo dphys-swapfile swapoff
Expand Down Expand Up @@ -175,18 +168,25 @@ This will help keep this project growing and cover the ongoing expenses too! Win
Run the following steps to install Inkycal. Do **not** use sudo for this, except where explicitly specified.

```bash
# the next line is for the Raspberry Pi only
sudo apt-get install zlib1g libjpeg-dev libatlas-base-dev rustc libopenjp2-7 python-dev-is-python3 scons libssl-dev python3-venv python3-pip git libfreetype6-dev wkhtmltopdf libopenblas-dev
# Raspberry Pi specific section start
sudo apt-get install git zlib1g libjpeg-dev libatlas-base-dev rustc libopenjp2-7 python-dev-is-python3 scons libssl-dev python3-venv python3-pip git libfreetype6-dev wkhtmltopdf libopenblas-dev
git clone https://github.com/WiringPi/WiringPi
cd WiringPi
./build
cd ..
# Raspberry Pi specific section end

cd $HOME
git clone --branch main --single-branch https://github.com/aceinnolab/Inkycal
git clone https://github.com/aceinnolab/Inkycal
cd Inkycal
python3 -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
pip install wheel
pip install -e ./

# If you are running on the Raspberry Pi, please install the following too to allow rendering on the display

# only for Raspberry Pi:
pip install RPi.GPIO==0.7.1 spidev==3.5 gpiozero==2.0
```

Expand Down
Binary file modified inkycal/display/drivers/epd_12_in_48_lib_32bit.so
Binary file not shown.
Binary file modified inkycal/display/drivers/epd_12_in_48_lib_64bit.so
Binary file not shown.
63 changes: 59 additions & 4 deletions inkycal/display/drivers/epdconfig_12_in_48.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import time
from ctypes import *

import RPi.GPIO as GPIO

EPD_SCK_PIN = 11
EPD_MOSI_PIN = 10

Expand Down Expand Up @@ -71,11 +73,11 @@


def digital_write(pin, value):
spi.DEV_Digital_Write(pin, value)
GPIO.output(pin, value)


def digital_read(pin):
return spi.DEV_Digital_Read(pin)
return GPIO.input(pin)


def spi_writebyte(value):
Expand All @@ -87,15 +89,68 @@ def delay_ms(delaytime):


def module_init():
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(EPD_SCK_PIN, GPIO.OUT)
GPIO.setup(EPD_MOSI_PIN, GPIO.OUT)

logging.debug("python call bcm2835 Lib")

GPIO.setup(EPD_M2S2_RST_PIN, GPIO.OUT)
GPIO.setup(EPD_M1S1_RST_PIN, GPIO.OUT)
GPIO.setup(EPD_M2S2_DC_PIN, GPIO.OUT)
GPIO.setup(EPD_M1S1_DC_PIN, GPIO.OUT)
GPIO.setup(EPD_S1_CS_PIN, GPIO.OUT)
GPIO.setup(EPD_S2_CS_PIN, GPIO.OUT)
GPIO.setup(EPD_M1_CS_PIN, GPIO.OUT)
GPIO.setup(EPD_M2_CS_PIN, GPIO.OUT)

GPIO.setup(EPD_S1_BUSY_PIN, GPIO.IN)
GPIO.setup(EPD_S2_BUSY_PIN, GPIO.IN)
GPIO.setup(EPD_M1_BUSY_PIN, GPIO.IN)
GPIO.setup(EPD_M2_BUSY_PIN, GPIO.IN)

digital_write(EPD_M1_CS_PIN, 1)
digital_write(EPD_S1_CS_PIN, 1)
digital_write(EPD_M2_CS_PIN, 1)
digital_write(EPD_S2_CS_PIN, 1)

digital_write(EPD_M2S2_RST_PIN, 0)
digital_write(EPD_M1S1_RST_PIN, 0)
digital_write(EPD_M2S2_DC_PIN, 1)
digital_write(EPD_M1S1_DC_PIN, 1)

spi.DEV_ModuleInit()


def module_exit():
spi.DEV_ModuleExit()
digital_write(EPD_M2S2_RST_PIN, 0)
digital_write(EPD_M1S1_RST_PIN, 0)
digital_write(EPD_M2S2_DC_PIN, 0)
digital_write(EPD_M1S1_DC_PIN, 0)
digital_write(EPD_S1_CS_PIN, 1)
digital_write(EPD_S2_CS_PIN, 1)
digital_write(EPD_M1_CS_PIN, 1)
digital_write(EPD_M2_CS_PIN, 1)


def spi_readbyte(Reg):
return spi.DEV_SPI_ReadByte(Reg)
GPIO.setup(EPD_MOSI_PIN, GPIO.IN)
j = 0
# time.sleep(0.01)
for i in range(0, 8):
GPIO.output(EPD_SCK_PIN, GPIO.LOW)
# time.sleep(0.01)
j = j << 1
if (GPIO.input(EPD_MOSI_PIN) == GPIO.HIGH):
j |= 0x01
else:
j &= 0xfe
# time.sleep(0.01)
GPIO.output(EPD_SCK_PIN, GPIO.HIGH)
# time.sleep(0.01)
GPIO.setup(EPD_MOSI_PIN, GPIO.OUT)
return j


def delay_ms(delaytime):
Expand Down

0 comments on commit 6ade114

Please sign in to comment.