-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebIOPi using piFace and raspios-bullseye does not start; spi init fails #4
Comments
Confirmed: raspberrypi/linux@bdfc988 |
The same is true for I2C: While the module is still available, it is deprecated in favour of |
spi-bcm2708 has been removed with RPi kernel v4.3: raspberrypi/linux@bdfc988 i2c-bcm2708 has been deprecated a long time ago: https://forums.raspberrypi.com/viewtopic.php?t=133024 The respective bcm2835 modules are available and compatible with all RPi models. Solves: Freenove#4 Signed-off-by: MichaIng <[email protected]>
PR up to fix this: #5 |
I think the loadModule and unloadModule Functions, calling modprobe, should be removed, because it's outdated. The Kernel uses device tree. |
About the failing assert... SPI_CS_HIGH Flag is always set when reading the SPI mode...though the assertion fails. According to raspberrypi/linux#3745 _CS_HIGH handling has changed between 4.19 and 5.4 - the SPI framework forces CS_HIGH then leaves it up to the GPIO layer to handle the ACTIVE_LOW semantics. I don't like the change because it is (ab)using user-facing flags - CS_HIGH no longer means what you think it means. The attitude upstream (and I may be missing some nuance here) seems to be that CS_HIGH is a bus property rather than a device property - if you have to wait until an application starts to reverse the polarity of one of the CS pins then the device has possibly already been responding to and interfering with devices on other CS lines from the same In short - dropping the device.cshigh = False line not only makes it work but is the right thing to do. Under other circumstances this kernel change might have broken other aspects of the py-spidev library, but I think the fact that it reads the initial value of the mode from spidev means that everything is fine unless you try to clear cshigh._ raspberrypi/linux#4018 Tried the C Version with the same result...SPI_CS_HIGH is set. wget https://raw.githubusercontent.com/torvalds/linux/master/tools/spi/spidev_test.c
gcc -o spidev_test spidev_test.c
./spidev_test -D /dev/spidev0.0 sudo nano /usr/local/lib/python3.9/dist-packages/WebIOPi-0.7.1-py3.9-linux-armv6l.egg/webiopi/devices/spi.py
|
Setup
uname -a Linux piface 5.15.32+ #1538 Thu Mar 31 19:37:58 BST 2022 armv6l GNU/Linux
WebIOPi Config
Startup log
Errors
modprobe: FATAL: Module spi-bcm2708 not found in directory /lib/modules/5.15.32+
from https://forums.raspberrypi.com/viewtopic.php?p=675658#p675658
Conclusion: so no module load required
Workaround
sudo nano /usr/local/lib/python3.9/dist-packages/WebIOPi-0.7.1-py3.9-linux-armv6l.egg/webiopi/devices/bus.py
replace spi-bcm2708 with spi-bcm2835
BUSLIST = {
"I2C": {"enabled": False, "gpio": {0:"SDA", 1:"SCL", 2:"SDA", 3:"SCL"}, "modules": ["i2c-bcm2708", "i2c-dev"]},
"SPI": {"enabled": False, "gpio": {7:"CE1", 8:"CE0", 9:"MISO", 10:"MOSI", 11:"SCLK"}, "modules": ["spi-bcm2835", "spidev"]>
"UART": {"enabled": False, "gpio": {14:"TX", 15:"RX"}},
"ONEWIRE": {"enabled": False, "gpio": {4:"DATA"}, "modules": ["w1-gpio"], "wait": 2}
}
SPI.init(self, toint(chip), 0, 8, 10000000) File "/usr/local/lib/python3.9/dist-packages/WebIOPi-0.7.1-py3.9-linux-armv6l.egg/webiopi/devices/spi.py", line 98, in init assert(self.mode == mode)
Workaround
The text was updated successfully, but these errors were encountered: