Torc  0.1
Torc on the Raspberry Pi

Introduction

Torc was originally written for installation on a Model B Raspberry Pi but will work on any version of the hardware. It has been tested on the Model B and Zero.

A full desktop installation is not required but a network connection is highly recommended (Torc is accessed through a web interface).

Note
While Torc will run on the compute module, GPIO will not currently work as the pin numbering scheme is different.
The following instructions are not exhaustive and additional steps may be required for distributions other than Raspbian Stretch.

Installing on the Raspberry Pi.

Download and install linux.

Download the latest version of your favourite Raspberry Pi linux image (the following instructions assume Raspbian Stretch Lite - but any recent distribution should work). Torc does not require a desktop interface so a minimal (headless) version is fine. Install that image on a suitable SD card and insert the card into your device.

Boot device and log in.

Boot your device and log in. If you are running a full desktop insallation, open a command terminal - the following assumes you are installing from the command line.

Update your installation.

Update your distribution for all of the latest fixes and releases by typing the following commands (depending on the number of updates, this may take a few minutes):

sudo apt-get update
sudo apt-get upgrade

Change your Raspberry Pi configuration.

From the command line, run:

sudo raspi-config

You can change a number of Raspberry Pi specific behaviours from this utility. You will probably want to 'Expand filesystem' (to make sure the entire SD card is available to you), 'Change user password', set the timezone (IMPORTANT) and from the 'Advanced options' screen, 'Set the hostname', 'Enable SSH' and 'Enable I2C'. The last option is dependant on the hardware you intend to attach to your device. If you have no intention of attaching a screen or monitor to your device, you can also allocate zero memory to the GPU.

Install software dependencies.

From the command line run:

sudo apt-get install graphviz libavahi-compat-libdnssd-dev qt5-default git-core upower libxml2-dev consolekit libssl-dev libavformat-dev

Install wiringPi.

Torc uses wiringPi to access the Raspberry Pi's GPIO pins and help with I2C communications. It is highly unlikely that you'll want to use Torc on a Pi without wiringPi. Full wiringPi instructions are available at the wiringPi project page.

cd ~
git clone git://git.drogon.net/wiringPi
cd wiringPi
./build

Download and install Torc.

Note
This will take some time. Make a few cups of coffee...
cd ~
git clone https://github.com/mark-kendall/torc.git
cd torc
TORC_PI=true qmake
make -j2
sudo make install

Enable 1Wire interface.

The 1Wire interface is primarily used for communicating with MAXIM DS18B20 1Wire digital thermometers - which are also available as a waterproof module.

Add the following line to the end of '/boot/config.txt' file (sudo nano /boot/config.txt) N.B. It may already be present if you enabled I2C from raspi-config.

dtoverlay=w1-gpio

and these 2 lines to /etc/modules (sudo nano /etc/modules)

w1-gpio
w1-therm
Note
If you enable w1-gpio support without adding the appropriate external hardware (i.e. a pull up resister), you may find the kernel tries to recognise a number of phantom 1Wire devices. Don't panic - but add the resistor.

Enable I2C bus.

Set time and timezone.

Run Torc at startup.

The 'misc' directory in the source contains a script to run Torc as a service. Details are included in the file.

user permissions