SPI - spidev

SANKI Easy Install
      Install  : sudo pip install spidev
Test : Detail Install and Test

SPI - spidev

This module defines an object type that allows SPI transactions on hosts running the Linux 
kernel. The host kernel must have SPI support and SPI device interface support. All of these 
can be either built-in to the kernel, or loaded from modules 
Because the SPI device interface is opened R/W, users of this module usually must have root 

Install Python SPI Wrapper

In order to read data from the SPI bus in Python we can install a library called ‘py-spidev’. To install it we first need to install ‘python-dev’ :

sudo apt-get install python2.7-dev 
sudo apt-get install python-dev

Then to finish we can download ‘py-spidev’ and compile it ready for use :

mkdir py-spidev
cd py-spidev
wget https://raw.github.com/doceme/py-spidev/master/setup.py
wget https://raw.github.com/doceme/py-spidev/master/spidev_module.c
sudo python setup.py install