Libraries Installation for RPi

From Seednew_WiKi
Jump to: navigation, search

Instruction

Most of codes of Raspberry Pi are based on BCM2835, wiringPi and Python.

Install BCM2835 Libraries

  • Download the latest version of BCM2835 Libraries from the BCM2835 website.
  • You can also get the detailed information of the bcm2835 on the website
  • Download the libraries to your Raspberry Pi. Or you can download it to PC, and copy to the root of TF card.
  • Unzip the libraries (Which is included in tar.gz) and install it
# If the files is downloaded or copied at other path, please add the path in front of the name of the tar.gz, and please complete the name of tar.gz
# for example: tar zxvf /boot/bcm2835-1.55.tar.gz

tar zxvf bcm2835-1.xx.tar.gz

# Enter the folder which you unzip, complete the name of folder as well.

cd bcm2835-1.xx

#Installing

./configure
make
sudo make check
sudo make install

Install WiringPi Libraries

  • To download the WiringPi Libaries, you can download the package from the WiringPi website or download it using GIT
  • Download the tar.gz file, you can unzip it to your Pi using tar command.
#Complete the name of tar.gz with its exact name 

tar zxvf wiringPi-xx.tar.gz
cd wiringPi-xx
./build
  • Using GIT
git clone git://git.drogon.net/wiringPi
cd ~/wiringPi
./build

Install Python Libraries

If you use the latest version of Raspbian, some of Python Libraries are re-installed. Otherwise you can download them manually from the related website.

1 Update your software list

sudo apt-get update

2. Install the package python-dev

sudo apt-get install python-dev

3. Install the RPi.GPIO. Download it from the link above and unzip it on your Pi, than enter the related folder and execute the command below to install it

sudo python setup.py install

4 Install library smbus (I2C interface functions)

sudo apt-get install python-smbus

5 Install library serial (Contain UART interface functions)

sudo apt-get install python-serial

6 Install spidev. Download it from the link above and unzip it on your Pi, than enter the related folder and execute the command below to install it

sudo python setup.py install

7. Install the python imaging library

sudo apt-get install python-imaging