Setup: Drivers - AymenB98/Bird-Cafe GitHub Wiki
Drivers
The drivers are the software interface for the hardware devices - they are the code that lets the camera and the ultrasonic sensor work. Setting these up will require the user to install a few packages and then build the code as detailed in this Wiki.
Required Packages
-
WiringPi - Found at: http://wiringpi.com/download-and-install/
-
CMake - Found at: https://cmake.org/download/
-
Raspicam - Found at: https://github.com/cedricve/raspicam
Instructions
If you have WiringPi, CMake, and Raspicam packages already installed on your Raspberry Pi then you can skip to step 12, otherwise follow through the relevant steps below.
Installing WiringPi
- To begin, first check that WiringPi is not already installed by running:
gpio -v
in your terminal. If it tells you gpio: command not found then you do not have it already installed.
- To begin installation type:
cd
git clone git://git.drogon.net/wiringPi
- To then build the library type the following into the terminal:
cd ~/wiringPi
./build
- When this is finished, run
gpio -v
again in your terminal and this time it should show that you have the latest version of WiringPi installed.
Installing CMake
- You can check if you already haev CMake installed by running:
cmake --version
if you do not, then move on to step 6.
- To install CMake, add the following to your terminal.
sudo apt-get install cmake
- CMake should now be installed on your Pi, check using:
cmake --version
Installing Raspicam
- To install raspicam, run:
git clone https://github.com/cedricve/raspicam.git
- Then move to the raspicam directory and create a new directory, 'build':
cd raspicam
mkdir build
- Now move into your newly created build directory and run CMake:
cd build
cmake ..
- Finally compile ,install, and update the ldconfig
make
sudo make install
sudo ldconfig
and raspicam should now be installed.
Drivers Setup
- Now that you have all the necessary packages installed it's time to build the drivers, to do this navigate to the Bird-Cafe directory and create a 'Photos' directory, this is where any images you capture with the Bird Cafe will be saved to.
cd Bird-Cafe
mkdir Photos
Note: It is important that 'Photos' is spelled with a capital P or images will not be saved correctly.
- Now navigate inside the 'Drivers' directory and create another new directory, named 'build':
cd drivers
mkdir build
- Navigate inside this 'build' directory, run CMake and then make:
cd build
cmake ..
make
The drivers are now built and ready to run.
Instructions based on:
https://github.com/cedricve/raspicam/blob/master/README.md
https://cgold.readthedocs.io/en/latest/first-step/installation.html