Preparing the Raspberry Pi for launch
In this section we are going to briefly discuss how to prepare the Raspberry Pi for the first launch and which programs we should install before proceeding to the next step: change into a Wi-FI router.
How to prepare the Raspberry Pi
Since there are already plenty of manuals and tutorials how to prepare the Raspberry Pi for its first launch on the internet, there is no point of presenting another one here.
An illustrative and comprehensible manual can be found on the official homepage of the Raspberry Pi foundation. Skilled users can use this compact quick guide in pdf(also taken from the official homepage).
Thanks to the abundance in manuals, let us point out only the three steps which are essential for the Blue Seal Project:
- installing the Raspbian on the SD card,
- allow the camera module,
- allow SSH server.
Later for the Blue Seal Robot, it is much more efficient to use the Raspbian only in the basic terminal interface so do not choose the option to boot into the graphical interface directly. This is due to the fact that the graphical interface (available at any time by command startx) consumes a lot of processor's power in vain.
We need to allow the camera module and the SSH server in order to use them. This can be done in menu accessed from terminal by a command sudo raspi-config(see more details here).
Note that it is very important to allow the SSH server if we want to use access the Robot through a Wi-Fi with an arbitrary SSH-client and carry out changes without the need to connect the Raspberry Pi computer to a screen and a keyboard.
Installing vital programs
Before we convert our Raspberry Pi into a Wi-Fi router, we need to install few essentials programs. In order to do so, we have to connect our Raspberry to the internet(manual can be found here) first.
For this purpose, we can use any USB Wi-Fi module which will not be truth for the conversion of the Raspberry into the router.
date
echo COPY - new sources to /etc/apt/
sudo cp ./sources.list /etc/apt/sources.list
echo UPDATE
sudo apt-get update
echo Installing - Gstreamer
sudo apt-get install gstreamer1.0
echo Installing - VLC
sudo apt-get install vlc
echo Installing - dos2unix
sudo apt-get install dos2unix
echo Installing - vim
sudo apt-get install vim-runtime
sudo apt-get install vim
echo Installing - Python-dev
sudo apt-get install python-dev
echo Installing - Python-GPIO
sudo apt-get install python-rpi.gpio
echo Installing - I2C-tools
sudo apt-get install i2c-tools
echo Installing - python-smbus
sudo apt-get install python-smbus
echo Installing - HOSTAPD
sudo apt-get install hostapd
echo Installing - isc-dhcp-server
sudo apt-get install isc-dhcp-server
echo Installation - Done
echo For proper functionality you have to manualy:
echo 1. add following lines into the file /etc/modules
echo a: i2c-bcm2708
echo b: i2c-dev
echo
echo 2. remove following files from the black list /etc/modprobe.d/raspi-blacklist.conf
echo a: spi-bcm2708
echo b: i2c-bcm2708
First lines of the script add new sites with resources. The data file with sources sources.list:
deb http://vontaene.de/raspbian-updates/ . main
This script installs all programs indispensable for the Blue Seal Robot.
We will discuss all the programs in the following table:
Program | Description |
---|---|
GStreamer | GStreamer is a versatile video framework. It can be used to play video on the Raspberry Pi or to stream video over the Wi-FI. |
VLC | The VLC player can be used to play video files or to stream video over Wi-Fi. |
dos2unix | This useful program converts dos text files into the unix formatted text files (main application for the different symbol for the end of line). |
vim | Vim is an advanced text editor. |
Python-dev | This package obtains header files, a static library and development tools for building Python modules, extending the Python interpreter or embedding Python in applications. It is a dependency package, which depends on Raspbian's default Python version (currently v2.7). |
Python-GPIO | This package obtains library for Python allowing the usage of GPIO ports. |
I2C-tools | This package contains an heterogeneous set of I²C tools for the Linux kernel as well as an I²C library. The tools were originally part of the lm-sensors project but were finally split into their own package for convenience. The library is used by some of the tools, but can also be used by third-party applications. |
python-smbus | This Python module allows SMBus access through the I2C /dev interface on Linux hosts. |
HOSTAPD | The hostapd is a user space daemon for wireless access point and authentication servers. |
isc-dhcp-server | The Dynamic Host Configuration Protocol (DHCP) allows clients such as desktop, laptop, and mobile devices to request and obtain an IP address and many other parameters from a server. |
In the end, we have to manually modify two files in order to allow the Python to use the I²C bus.
Namely, we have to add the following lines:- i2c-bcm2708
- i2c-dev
- spi-bcm2708
- i2c-bcm2708
As the very last thing, we need to reboot the Raspberry Pi with command sudo reboot.
Conclusion
In this article we have shown how to prepare our Raspberry Pi for the Blue Seal Project. Especially, we installed all the basic programs and discussed all the necessary settings in order to make the Raspberry Pi able to use the camera module, run SSH server, use the GPIO and I²C by Python and stream video.
Share this page with friends via