DGTCentaurMods icon indicating copy to clipboard operation
DGTCentaurMods copied to clipboard

Cannot find sysfs_software_spi.so

Open harry88pl opened this issue 1 year ago • 11 comments

Traceback (most recent call last): File "/opt/DGTCentaurMods/game/menu.py", line 40, in from DGTCentaurMods.board import * File "/usr/lib/python3/dist-packages/DGTCentaurMods/board/board.py", line 27, in from DGTCentaurMods.display import epd2in9d, epaper File "/usr/lib/python3/dist-packages/DGTCentaurMods/display/epd2in9d.py", line 34, in from DGTCentaurMods.display import epdconfig File "/usr/lib/python3/dist-packages/DGTCentaurMods/display/epdconfig.py", line 153, in implementation = JetsonNano() File "/usr/lib/python3/dist-packages/DGTCentaurMods/display/epdconfig.py", line 112, in init raise RuntimeError('Cannot find sysfs_software_spi.so') RuntimeError: Cannot find sysfs_software_spi.so

harry88pl avatar Oct 07 '23 20:10 harry88pl

You get this when the pi cannot communicate with the epaper. Which version of the centaur board do you have? 1 or 2. Also which version of DGTCentaurMods are you trying to run?

EdNekebno avatar Oct 07 '23 20:10 EdNekebno

I'm trying to run the Crystal Edition version 1. I succeeded once, but after updating the Raspberry PI OS to the latest version, I've been encountering this error. I've also tried versions 1.3.2 and 1.3.3, but the issue persists.

It worked with this version:

Raspberry Pi OS Lite (Legacy) Release date: May 3rd, 2023 System: 32-bit Kernel version: 5.10 Debian version: 10 (buster)

I just couldn't get Bluetooth to work, so I updated to Debian 11.

The file indeed doesn't exist:

harry88pl@harry:/usr/lib/python3/dist-packages/DGTCentaurMods/display $ dir -l total 96 -rw-r--r-- 1 pi pi 1749 Oct 5 16:10 cchandler.py -rw-r--r-- 1 pi pi 4868 Oct 5 16:10 chromecast.py -rw-r--r-- 1 pi pi 3864 Oct 5 16:10 epaper_driver.py -rwxr-xr-x 1 pi pi 22620 Oct 5 16:10 epaperDriver.so -rw-r--r-- 1 pi pi 22607 Oct 5 16:10 epaper.py -rw-r--r-- 1 pi pi 12538 Oct 5 16:10 epd2in9d.py -rw-r--r-- 1 pi pi 4987 Oct 5 16:10 epdconfig.py -rw-r--r-- 1 pi pi 61 Oct 5 16:10 init.py drwxr-xr-x 2 root root 4096 Oct 7 22:32 _

However, I'm not 100% certain if I have version 1, as the only information I can find on the PCB is that it's from December 2019, and there's no further detail.

I found that file here:

https://github.com/waveshareteam/e-Paper/blob/master/RaspberryPi_JetsonNano/python/lib/waveshare_epd/sysfs_software_spi.so

But simply adding it to the directory causes different errors because it's a 64-bit file.

harry88pl avatar Oct 07 '23 20:10 harry88pl

Okay, that makes sense already. Debian doesn't have the right drivers in it. We haven't yet found a way for it not to be Raspbian 32 bit. What was wrong with the bluetooth?

EdNekebno avatar Oct 07 '23 20:10 EdNekebno

Everything was working, you could play on Lichess and run DGT Centaur. However, the bluetoothctl command didn't display anything; it just got stuck, and the only thing that worked was pressing CTRL+C to cancel it.

Here's proof that it worked because the display still shows the last image:

https://imageupload.io/QaAs3fDX8PIaMzp

harry88pl avatar Oct 07 '23 21:10 harry88pl

With raspbian 32 bit? Did you have wifi?

EdNekebno avatar Oct 07 '23 21:10 EdNekebno

Yes, it worked on this Debian version:

Raspberry Pi OS Lite (Legacy) Release date: May 3rd, 2023 System: 32-bit Kernel version: 5.10 Debian version: 10 (Buster)

And the Wi-Fi was also functioning. I installed everything through SSH, including DGTMods.

harry88pl avatar Oct 07 '23 22:10 harry88pl

Did you apt upgrade and apt update?

EdNekebno avatar Oct 07 '23 22:10 EdNekebno

I performed the updates as outlined in this guide:

https://www.tomshardware.com/how-to/upgrade-raspberry-pi-os-to-bullseye-from-buster

Now, I will be reinstalling Debian 10, at least to have Bluetooth working again. Previously, before deciding to go for Debian 11, I tried everything to get Bluetooth running on Debian 10, but unfortunately, nothing seemed to help. However, I'll give it another try.

I only don't understand what the different DGT version has to do with this file. I understand if there was a connection problem, but in this case, the file is definitely missing, as can be seen in the error message. Perhaps it depends on the firmware version of the Raspberry Pi itself? Because I also updated the firmware. Is there any way to obtain this "epaper" from the original image of DGTCentaur?

harry88pl avatar Oct 07 '23 22:10 harry88pl

Perhaps could try: sudo systemctl disable hciuart.service sudo systemctl enable bluetooth.service

possibly check it isn't disabled in /boot/config.txt .

For the error - the waveshare file used falls back to assuming you have a raspberry pi in specific circumstances. Then the message can be somewhat deceptive because it's looking for that for a jetson nano. let me check...

EdNekebno avatar Oct 07 '23 22:10 EdNekebno

It uses the existence of /sys/bus/platform/drivers/gpiomem-bcm2835 to determine if it's a raspberry pi or not. You won't get the same error message on 1.3.2 though as it's a different driver. But it indicates where the problem is I guess.

EdNekebno avatar Oct 07 '23 22:10 EdNekebno

That driver is apparently only in Raspbian OS.

EdNekebno avatar Oct 07 '23 23:10 EdNekebno