adafruit / adafruit/Adafruit_CircuitPython_PCD8544

Function PCD8544.pixel is four times slower than the old Adafruit-Nokia-LCD

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
26
Forks
9
PR merge metrics
No merged PRs in 30d

Description

I rewrote an old Python script that is running on the **Raspberry Pi model B** attached to a Nokia 5110-3310 LCD screen.
The refactoring required the switching from Python2 to **Python3** and switching from the old **Adafruit_Nokia_LCD** library to the new **Adafruit_CircuitPython_PCD8544** one. Now I get a severe performance problem with **very high CPU load**: the old system was running with a load average of **0.20**, the new system is running with a load average of **0.90**.

Using the yappi Python profiler I recorded the time spent in each funcion call; it turned out that the most time consuming is
PCD8544.image calling **PCD8544.pixel**.

Do you think that the Adafruit_CircuitPython_PCD8544 is suitable for the old Raspberry Pi model B? I need an **LCD image refresh > 1 Hz**, because I want to display a clock (including seconds), plus some other data varying at the same rate.

Should I stay with the old Adafruit-Nokia-LCD library? Is it compatibile with Python 3.9?

The system differences are:

* Old system
* Raspbian based on Debian 8.0
* Linux Kernel 4.9.35
* Python 2.7.9
* Python libraries:
* Adafruit-Nokia-LCD (0.2.0)
* Adafruit-PureIO (0.2.1)
* Adafruit-GPIO (1.0.4)
* RPi.GPIO (0.6.3)

* New system
* Raspbian based on Debian 11.2
* Linux Kernel 5.10.63
* Python 3.9.2
* Python libraries:
* adafruit-circuitpython-pcd8544 (1.2.6)
* adafruit-circuitpython-busdevice (5.1.1)
* adafruit-circuitpython-framebuf (1.4.8)
* Adafruit-PureIO (1.1.9)
* RPi.GPIO (0.7.0)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by profiling PCD8544.image and its PCD8544.pixel calls on the Raspberry Pi model B with the listed Python 3.9 environment, comparing refresh time and CPU load with the old setup. Done means the library's suitability for refreshes above 1 Hz is established and the Python 3 compatibility question is answered.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, raspberry-pi
Domain
embedded-iot, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.