element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum SPI-DEV-Problems
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 5 replies
  • Answers 1 answer
  • Subscribers 665 subscribers
  • Views 2419 views
  • Users 0 members are here
  • raspberry
  • python
  • spi
  • raspberry_pi
  • raspberrypi
  • gertboard
Related

SPI-DEV-Problems

Former Member
Former Member over 10 years ago

Hello community,

 

I want to use the ADC on the Gertboard. I use the raspberry pi 2 b and have the kerneversionl 3.18.11. Raspian is installed and update and upgrade are already done.

No my problem:

The example code crashed at the very beginning. The Problem ist about the command "import spidev". I tryed this tutorial: http://www.raspython.org/de/installation-des-serial-peripheral-interface-bus-spi-auf-einem-raspberry-pi/ and many others, but i can't solve the problem.

I always get the message: IMPORTError no module named spidev!

 

Is there anyone who got the same problem and already solved it?

 

Thank you very much

  • Sign in to reply
  • Cancel
  • johnbeetem
    0 johnbeetem over 10 years ago

    Getting SPI enabled changed with RasPi 2.  I found out how to do it from this 'blog by johan825: http://www.element14.com/community/community/raspberry-pi/raspberrypi2/blog/2015/04/07/raspberry-pi-2-gpio-usage-with-nrf24l01-arduino

     

    Here's the line I needed:

    By default SPI is not enabled on Raspbian to load it during the boot process execute sudo raspi-config then select Advanced and then enable the SPI kernel module.

    Might as well enable I2C as well.  They’ll be enabled next time you reboot.

     

    After doing this, if you give the command “ls -l /dev/spi*” you should see that spidev0.0 and spidev0.1 are in

    group spi. Make sure you are also in that group. Give the command “groups”: this will tell you which

    groups you are in. If you’re not in spi, add yourself to that group with the command “sudo adduser

    <userid> spi” where <userid> is your user ID. You may need to log out and back in after making the

    change.

     

    Hope this helps!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 10 years ago in reply to johnbeetem

    John is absolutly correct as to enabling the SPI functionality

     

    I have never needed to worry about the group membership in all the PIs I have worked with though so I doubt you should need to do this but at least you have the info incase you do

     

    I have a few videos on using the Raspberry PI, SPI etc with various devices

    see here:

    Raspberry PI 2 - Configuring for IO - GPIO, I2C, SPI and One Wire.

    Raspberry PI 2, Fun with I2C DACs and ADC's

    Raspberry PI 2 and Windows 10... SPI, ADC and GUI Display

     

    Hope you find it helpful

     

    Peter

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to johnbeetem

    hello John,

     

    thanks for your help! I already did those steps, but when i check with the command “ls -l /dev/spi*”, there is only /dev/spidev0.1 shown.

    Any ideas wh the spidev0.0 is missing?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to Robert Peter Oakes

    Hello Peter,

     

    i followed the videos and everything is fine, but i am not able to use the spidev libiary.
    Is there an other way using the Gertboard SPI?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to Robert Peter Oakes

    Thank you for your help

     

    I completly reinstalled the pi, and reinstalled it like Peter's first video.
    Than i installed spidev 3.0.

    And it works!!!
    I guess my problem was about an old spidev version which wasn't compatible anymore. Installing a new version didn't bring an improvment because the old one was still installed.

    For spidev 3.0 installation i used this tutorial http://www.raspython.org/de/installation-des-serial-peripheral-interface-bus-spi-auf-einem-raspberry-pi/

     

    Thank you!!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube