Bug in the spi-tool?
-
I think there's a bug in the
spi-tool
. I followed the instructions to set up SPI connection to my logic analyzer, and then went ahead to write some test data:root@Omega:~# spi-tool -b 32766 -d 1 write 0x12 0x42 > SPI Write to addr 0x12: 0x42 ERROR: could not open sysfs device '/dev/spidev1.32766'
Since the device name under
/dev
is/dev/spidev32766.1
, it appears that thespi-tool
swaps the parameter values for bus and device. And, sure enough, if I doroot@Omega:~# spi-tool -b 1 -d 32766 write 0x12 0x42 > SPI Write to addr 0x12: 0x42
..then the data get sent out properly.
-
@Pavils-Jurjans the
spi-tool
is out-dated and deprecated at this point. We'll move it out of the package repo.
I strongly recommend usingpython-spidev
instead: https://github.com/OnionIoT/python-spidev
-
Ok, well, I just followed the advice from the official Omega2 documentation. There is no mention of
spi-tool
being deprecated.I understand you suggest to use python module instead of command-line tool, does that mean that there is no command-line tool for SPI writing and reading?
-
@Pavils-Jurjans Well you can continue to use spi-tool, just remember to switch the bus and device number