This repository contains all of the code for interfacing with a 16x2 Character I2C LCD Display. This accompanies my YouTube tutorial here: https://www.youtube.com/watch?v=fR5XhHYzUK0
Issues #41 and #42 (#43, #44) are diagnostic of a growing compatibility issue, namely, the almost complete lack of Python 2.7 support--and of its modules, such as smbus--via the official package managers (either apt or pip) starting with Raspberry Pi OSbullseye. Moving forward, there are a couple of alternatives to deal with this:
The RPi Foundation is still maintaining a Raspberry Pi OS Legacy version, namely buster, which is fully compatible with the current LCD driver. Users can be encouraged to use it instead.
Build smbus from https://github.com/pimoroni/py-smbus. I think they are the current maintainers of the smbus pkg and it seems that there hasn't been any update in more than 5 years. I've tried to build it using the latest buster Raspberry Pi OS but ran into issues (build requirements seem outdated as well).
We could change reliance from the old smbus to smbus2 (https://pypi.org/project/smbus2/) which is fully compatible with the LCD driver (just change import smbus to import smbus2) and it doesn't seem to break any demos. This module can be built from source (tested it installs just fine and the module is picked up by pip afterwards). The install from source procedure would be appended to setup.sh.
Edit setup.sh to try to install both python-smbus and python3-smbus via apt and then add a note to README.md that users running the latest distro (bullseye and above) should use python3 with the LCD driver if they run into issue with python, which seems to be linked to Python 2.7 even in bullseye.
Anyway, these are the options that I can think of right now. They are not all mutually exclusive. In any case, the growing compatibility issue needs to be addressed asap. If anyone wants to chime in, please do so before Jan 14th. Otherwise, I'll merge the changes that I think are the most reasonable ones.
Issues #41 and #42 (#43, #44) are diagnostic of a growing compatibility issue, namely, the almost complete lack of Python 2.7 support--and of its modules, such as
smbus
--via the official package managers (eitherapt
orpip
) starting with Raspberry Pi OSbullseye
. Moving forward, there are a couple of alternatives to deal with this:buster
, which is fully compatible with the current LCD driver. Users can be encouraged to use it instead.smbus
from https://github.com/pimoroni/py-smbus. I think they are the current maintainers of thesmbus
pkg and it seems that there hasn't been any update in more than 5 years. I've tried to build it using the latestbuster
Raspberry Pi OS but ran into issues (build requirements seem outdated as well).smbus
tosmbus2
(https://pypi.org/project/smbus2/) which is fully compatible with the LCD driver (just changeimport smbus
toimport smbus2
) and it doesn't seem to break any demos. This module can be built from source (tested it installs just fine and the module is picked up bypip
afterwards). The install from source procedure would be appended tosetup.sh
.setup.sh
to try to install bothpython-smbus
andpython3-smbus
viaapt
and then add a note toREADME.md
that users running the latest distro (bullseye
and above) should usepython3
with the LCD driver if they run into issue withpython
, which seems to be linked to Python 2.7 even inbullseye
.Anyway, these are the options that I can think of right now. They are not all mutually exclusive. In any case, the growing compatibility issue needs to be addressed asap. If anyone wants to chime in, please do so before Jan 14th. Otherwise, I'll merge the changes that I think are the most reasonable ones.