Setting speed of /dev/spidev0.0
Posted: Thu Mar 28, 2019 9:23 am
(reposting from "Troubleshooting" forum)
Basically: How do I set the speed of the "/dev/spidev0.0" interface when writing data to it?
I have Java and Python programs that control WS2801 lights by just writing to /dev/spidev0.0 as if it were a normal file.
This is convenient, because I don't need extra python or Java libraries, and USED to work fine on an old version of raspian. I've wiped the SD card to install the latest version of raspbian, so not quite sure what version it was, but probably about 2016 or earlier.
Anyway, now the same programs don't work, the LEDs flicker a bit but not controlled.
What DOES work is the adafruit examples: https://github.com/adafruit/Adafruit_Python_WS2801.git
I've read quite a lot about changes to SPI modules (and got a bit lost in it all) and suspect the bus speed might now be wrong for my lights?
Mainly from this thread: https://github.com/raspberrypi/linux/issues/2165
Is there anyway to set the old bus speed back just from the OS? i.e. a boot parameter somewhere? All the examples I've read are using the Python spidev library to set this, but nearly all my code is (a) in Java, and (b) already used to work...!
The docs (https://www.raspberrypi.org/documentati ... /README.md) talk about setting the bus speed, but don't explain how to do it.
Any advice would be great thanks!
Basically: How do I set the speed of the "/dev/spidev0.0" interface when writing data to it?
I have Java and Python programs that control WS2801 lights by just writing to /dev/spidev0.0 as if it were a normal file.
This is convenient, because I don't need extra python or Java libraries, and USED to work fine on an old version of raspian. I've wiped the SD card to install the latest version of raspbian, so not quite sure what version it was, but probably about 2016 or earlier.
Anyway, now the same programs don't work, the LEDs flicker a bit but not controlled.
What DOES work is the adafruit examples: https://github.com/adafruit/Adafruit_Python_WS2801.git
I've read quite a lot about changes to SPI modules (and got a bit lost in it all) and suspect the bus speed might now be wrong for my lights?
Mainly from this thread: https://github.com/raspberrypi/linux/issues/2165
Is there anyway to set the old bus speed back just from the OS? i.e. a boot parameter somewhere? All the examples I've read are using the Python spidev library to set this, but nearly all my code is (a) in Java, and (b) already used to work...!
The docs (https://www.raspberrypi.org/documentati ... /README.md) talk about setting the bus speed, but don't explain how to do it.
Any advice would be great thanks!