Raspberry Pi – Tinkerforge

- Getting Started
  - Primer
  - Tutorials
  - FAQ
- Hardware
  - Bricks
  - Bricklets
  - Master Extensions
  - Power Supplies
  - Accessories
  - Timeline
- Software
  - Brick Daemon (brickd)
  - Brick Viewer (brickv)
  - API Bindings
  - Firmwares and Plugins
  - Device Identifier
  - Source Code and Bug Tracking
  - Programming Interface
- Starter Kits
  - Weather Station
  - Hardware Hacking
  - Server Room Monitoring
  - Blinkenlights
  - Internet of Things
  - Camera Slider
- Embedded Boards
  - Raspberry Pi
    - Prepare SD Card
    - Start Raspberry Pi
    - Install Brick Daemon
      - Raspbian (armhf)
      - Soft-Float Debian (armel)
    - Install Brick Viewer
    - Access from outside
    - Reported Problems
- Specifications
  - Technical Data
  - TCP/IP Protocol
  - Modbus Protocol
  - Wireshark Dissector

# Raspberry Pi

This section describes how to use Bricks and Bricklets with a Raspberry Pi together with Debian.

## Prepare SD Card

In the first step you have to set up Debian on a SD card. There are two ways to do this.

There is the recommended New Out of Box Software (NOOBS) approach. You just download the NOOBS ZIP file unpack it to an SD card and boot your Raspberry Pi from it. Then follow the steps in the graphical installer and select "Raspbian" to be installed.

If you don't want to use NOOBS there is also the old and more manual way to download one of the different Debian images. There is one called "Raspbian" (armhf) and the other one called "Soft-Float Debian" (armel). Raspbian uses the hardware floating point unit (FPU) of the board and is the recommended one. Download the latest Raspbian image and follow the necessary steps of this SD card setup tutorial.

## Start Raspberry Pi

Connect a keyboard, a monitor and a power supply to your Raspberry Pi. After connecting the power supply the Raspberry Pi should start booting.

At the end of the boot process you should see the a login prompt. Enter as user name `pi` and as password `raspberry`. You should be logged in.

## Install Brick Daemon

How to set up Brick Daemon depends on the Debian image you're using.

### Raspbian (armhf)

If you have installed an Debian with hardware floating point unit support (Raspbian) you can simply install the Brick Daemon package by executing (if `libudev0` isn't available install `libudev1` instead):

    sudo apt-get install libusb-1.0-0 libudev0 pm-utils
    wget http://download.tinkerforge.com/tools/brickd/linux/brickd_linux_latest_armhf.deb
    sudo dpkg -i brickd_linux_latest_armhf.deb

The Brick Daemon will be started after the installation and at startup automatically.

Updates can be installed by repeating the last two commands:

    wget http://download.tinkerforge.com/tools/brickd/linux/brickd_linux_latest_armhf.deb
    sudo dpkg -i brickd_linux_latest_armhf.deb

### Soft-Float Debian (armel)

If you have installed an Debian without hardware floating point unit support, you have to compile Brick Daemon from source.

First you have to download the source code from the download page and put it under the `home` directory.

After this you have to execute the following steps:

    sudo apt-get install build-essential pkg-config libusb-1.0-0-dev libudev-dev pm-utils
    unzip Tinkerforge-brickd-vX.Y.Z-W-***.zip (modify filename)
    cd Tinkerforge-brickd-vX.Y.Z-W-*** (modify folder name)
    cd src/brickd
    make
    sudo make install
    sudo update-rc.d brickd defaults
    sudo /etc/init.d/brickd start

## Install Brick Viewer

To install the Brick Viewer software execute the following commands:

    sudo apt-get install python python-qt4 python-qt4-gl python-opengl python-serial
    wget http://download.tinkerforge.com/tools/brickv/linux/brickv_linux_latest.deb
    sudo dpkg -i brickv_linux_latest.deb

`apt-get` might complain about dependencies that are not going to be installed. If this happens `apt-get` suggest to run `sudo apt-get -f install` which should resolve this problem and install re required dependencies.

Ensure that you have Python 2 installed (this is the default in Raspbian anyway), because Brick Viewer doesn't work with Python 3 yet.

Updates can be installed by repeating the last two commands:

    wget http://download.tinkerforge.com/tools/brickv/linux/brickv_linux_latest.deb
    sudo dpkg -i brickv_linux_latest.deb

## Access from outside

You can use the Raspberry Pi to run the Brick Daemon and control the attached devices from the outside. For example you can use this to control stuff from your mobile phone.

To do this you have to change the host the IP Connection is connecting to in your code from "localhost" to the IP address of the Raspberry Pi.

## Reported Problems

The USB port of the Raspberry Pi may not be able to handle the power that is needed by a big stack of Bricks and Bricklets. In this case you should use a Step-Down Power Supply.

The content of this page is licensed under Creative Commons Attribution 3.0 Unported License.