1

Cannot get working SPI. Have checked on wheezy and it works perfectly. On jessie /dev see only spi0.1, have tried both pins, but no result. Where is the problem?

grep spi /boot/config.txt:

#dtparam=spi=on
#dtparam=spi=on
dtparam=spi=on
dtoverlay=spi-bcm2835-overlay

pi@raspberrypi:~ $ lsmod|grep spi  
    spi_bcm2835             7868  0 


pi@raspberrypi:~ $ ls -l /dev/spi*  
crw-rw---- 1 root spi 153, 0 Mar  5 20:32 /dev/spidev0.1


pi@raspberrypi:~ $ uname -a  
Linux raspberrypi 4.1.18+ #848 Mon Feb 29 13:55:31 GMT 2016 armv6l GNU/Linux
7
  • Please edit your question and give the output of "grep spi /boot/config.txt", "lsmod|grep spi", "ls -l /dev/spi/*", and "uname -a". – joan Mar 5 '16 at 21:31
  • Have you got any other overlays set up in /boot/config.txt? Any which use SPI to communicate like a screen? – joan Mar 5 '16 at 22:23
  • No, its only one. When Im trying to turn on spi through raspi-config I get error modprobe: ERROR: could not insert 'spi_bcm2708': No such device – Kvach Mar 5 '16 at 22:35
  • spi_bcm2708 is the old SPI driver, spi_bcm2853 is new. I'd be tempted to remove the spi dtoverlay line. It shouldn't be needed. – joan Mar 5 '16 at 22:48
  • dtoverlay=spi-bcm2835-overlay dtoverlay=mcp2515-can0-overlay,oscillator=8000000,interrupt=25, not familiar with dtoverlay funcion, but I need to get working my spi can controller which has dtoverlay in boot config, but I have tried anyway to remove dtoverlay, no success. – Kvach Mar 5 '16 at 22:54
1

check your config.txt, you also need to disable Device-Tree if you run a recent kernel, adding this line:

device_tree=

(yes, empty parameter) or use raspi-config to do it for you

0

Did you ever find the answer to your problem? I recently switched an old project on Wheezy to Jessie Lite. When I tried to run the python script, it gave me "ImportError: No module named 'spidev'"

After I spent most of a day trying to figure this out, I ran across an old blog with a list of python libraries. Unfortunately, the blog was written in Japanese and I don't read Japanese but lo and behold, the list contained an entry "python-spidev"

So just for grins, I tried "sudo apt-get install python3-spidev" AND IT WORKED!

Just to see what is actually needed, I back-tracked to a much earlier (pre- SPI) version of my SD card that I was working on and simply enabled SPI via raspi-config and then installed python3-spidev. That's all it took!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.