Making Displayotron hat work RPI3+ latest Buster OS

Hi All, I’m hoping there maybe an easy solution I’m missing? Basically I’m trying to use the Displayotron HAT on a RPI3B having installed the latest Bullseye (11) Raspberry Lite OS but none of the examples work. This is more or less a vanilla install and both I2C and SPI are enabled (using raspi-config).

pi@raspberrypi:~ $ cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 1
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 2
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 3
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

Hardware        : BCM2835
Revision        : a02082
Serial          : <removed>
Model           : Raspberry Pi 3 Model B Rev 1.2

pi@raspberrypi:~/Pimoroni/displayotron/examples/dothat/basic $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- 2c -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

If I try to run any of the examples I get this:

pi@raspberrypi:~/Pimoroni/displayotron/examples/dothat/basic $ ./hello_world.py
Traceback (most recent call last):
  File "/home/pi/Pimoroni/displayotron/examples/dothat/basic/./hello_world.py", line 3, in <module>
    import dothat.lcd as lcd
  File "/usr/local/lib/python3.9/dist-packages/dothat/lcd.py", line 6, in <module>
    lcd = st7036.st7036(register_select_pin=25, reset_pin=12)
  File "/usr/local/lib/python3.9/dist-packages/st7036.py", line 42, in __init__
    self.spi.open(0, spi_chip_select)
FileNotFoundError: [Errno 2] No such file or directory

I had the same problem with Buster (vanilla lite os install) and I’m unsure what to do next? There were suggestions of running a older Raspbian like Jessie but I want to avoid this and being no longer supported, will no doubt cause other problems like apt-index updates etc.

Help :)

Double check that SPI is enabled. I’ve gotten similar errors when it wasn’t.
There should be a
dtparam=spi=on
entry in config.txt.

Thanks @alphanumeric but I’ve checked this:

cat /boot/config.txt|grep spi
dtparam=spi=on

Please could someone confirm whether they have this HAT working with the latest Raspbian OS 32 or 64 bit? This was working for the last project (albeit at least a couple of years ago) and just wiped card w/out thinking to test first.
Definitely have 40 pin header connected correctly, although having just removed the HAT the solder to the display certainly looks like it would benefit from a reflow. Could this be causing the issue? The I2C detect seems to find the device ok, although using ls /dev/spi* with the HAT connected only seems to list spidev0.1 and NOT spidev0.0 but not sure if this is expected?

The pinout (Display-o-Tron HAT at Raspberry Pi GPIO Pinout) suggests it has 2 I2C addresses (the touch and the backlight), so even your i2cdetect looks a little thin on the ground.

How bad does the solder look?

Oof, that does look a little beaten up!

Oof for sure ,mine came soldered , loooks like someone for some reason tryied to remove it ?.. I would resolder and try again . if i get a chance tomorrow i’ll try mine ,haven’t used it in a year or more …

I dont have a Pi3b with a working OS on it and Google is giving me a hard time trying to install display-o-tron from Github…

Just came here to say the same thing. Upgraded to bullseye last night on one of my 3bs.

When I run some (originally working code) I now see the error:

  File "touch.py", line 5, in <module>
    import dothat.backlight as backlight
  File "/usr/local/lib/python2.7/dist-packages/dothat/backlight.py", line 1, in <module>
    import sn3218, colorsys, math
ImportError: No module named sn3218

When I try and do a reinstall of DisplayOTron (curl -sS get.pimoroni.com/displayotron | bash) I get the following errors:

Checking packages required by SPI interface...
package python3-spidev can't be found, fetching from alternative location...
Selecting previously unselected package python3-spidev.
(Reading database ... 45053 files and directories currently installed.)
Preparing to unpack .../python3-spidev_2.0~git20150907_armhf.deb ...
Unpacking python3-spidev (2.0~git20150907) ...
dpkg: dependency problems prevent configuration of python3-spidev:
 python3-spidev depends on python3 (<< 3.5); however:
  Version of python3 on system is 3.9.2-3.

Installing python3-st7036...
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Apt failed to install python3-st7036!

I do have spi enabled. Trying to figure out a fix but not found anything as yet.

Thanks to all replies. This was purchased brand new in the UK fully assembled and was attached to an RPI3 more or less from day one. It has been lightly used and then stored in a cupboard (last working fine) for the last few years. It saw daylight for the first time a week ago and this is what it looks like! Unfortunately, the working project on the card was formatted and the latest RPI OS installed and the rest is history.
Was just typing this reply when @mmm replied (thank you) and perhaps this points back to the OS/config. Hopefully we’ll find a solution between us all as time permits.
Hopefully someone from Pimoroni might shed some light on this or offer a solution at some point but thought this was a good place to start.

Its clearly an OS issue, looks like on bullseye Python has been updated to 3.9 whereas the displayotron and its libraries expect python version 3.5 or lower.

For the time being I’m going to roll back to buster as I do use this pi daily so I do need it to work.

python3-spidev depends on python3 (<< 3.5); however:
  Version of python3 on system is 3.9.2-3.

I’ve also raised an issue on the DisplayOTron github page…

That first error code mentions python2, which probably explains the module error.

OK, so followed issue raised by @mmm on GitHub which has just been replied to by Gadgetoid but this didn’t seem to work or at least update anything. However, I’ve now just powered the system up and refitted the display (having run the commands suggested but presumably not applicable) and the examples now work.

pi@raspberrypi:~ $ sudo apt install python3-spidev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-spidev is already the newest version (20200602~200721-1).
0 upgraded, 0 newly installed, 0 to remove and 31 not upgraded.
pi@raspberrypi:~ $ python3 -m pip install dot3k
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: dot3k in /usr/local/lib/python3.9/dist-packages (2.0.1)
Requirement already satisfied: cap1xxx in /usr/local/lib/python3.9/dist-packages (from dot3k) (0.1.4)
Requirement already satisfied: st7036 in /usr/local/lib/python3.9/dist-packages (from dot3k) (1.4.4)
Requirement already satisfied: sn3218 in /usr/lib/python3/dist-packages (from dot3k) (1.2.7)
Requirement already satisfied: RPi.GPIO in /usr/lib/python3/dist-packages (from cap1xxx->dot3k) (0.7.0)
Requirement already satisfied: spidev in /usr/lib/python3/dist-packages (from st7036->dot3k) (3.5)

BINGO. I know it’s not good practice but I’ve just realised what fixes the issue. If the system is cleanly booted with the display not attached but is then carefully attached before running the examples everything works fine. Even if the display is not plugged in the examples (well hello_world at least) will run without any error. If the display is left plugged in and the system is shutdown, powered off and then restarted (probably just restarted) then the problem occurs.

Running ls /dev/spi* when it works (i.e. display attached after power on) also now shows up /dev/spidev0.0 as well as 0.1, compared to just the latter when there is a problem.

Would be good to know what the next diagnostic steps should be from someone better informed?

FYI, even when it’s working i2cdetect just returns the following, which is presumably correct.

pi@raspberrypi:~/Pimoroni/displayotron/examples/dothat/basic $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- 2c -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

There should be two i2c entries?

  • 0x2c: cap1166
  • 0x54: sn3218

Hi, a quick update. I did a fresh install of Bullseye rather than attemping to upgrade my previous buster install and thats resolved the Python library issues I was having.

Hope you get your issue resolved soon :)

I’ve just double-checked and the examples all seem to be working, text, backlight, led bars, touch buttons but the i2cdetect command just returns what I’ve listed above. @alphanumeric if you run this command do you get 54 displayed as well or are you running a different command?
That’s good @mmm glad you’re sorted.

OK, I’ve traced the fault (I think) comparing working and non-working boot log to these 3 entries and will now research. Does anyone have any idea how to resolve this chipselect problem at boot with display installed and using buster or bullseye?

These entries only appear when the display is installed but if it is plugged in after boot everything works correctly. To someone, there is probably an obvious solution ;)

spi-bcm2835 3f204000.spi: chipselect 0 already in use
spi_master spi0: spi_device register error /soc/spi@7e204000/spidev@0
spi_master spi0: Failed to create SPI device for /soc/spi@7e204000/spidev@0