Skip to content

Target Raspberry installation

Andreas Drollinger edited this page Feb 16, 2023 · 21 revisions

THC installation on a Raspberry PI

These are the instruction about the the THC installation on a Raspberry PI running with the Raspbian/Debian Wheezy operating system.

THC installation

Install Tcl

Run the following command to install Tcl 8.5 without graphical extension (Tk)

 sudo apt-get install tcl8.5

Optionally you can also install the graphical extension/toolkit Tk by running the following command

 sudo apt-get install tk

Install TLS/HTTPS support

 sudo apt-get install tcl-tls

Install the RRDTool library for Tcl

Run the following command to install the RRDTool library for Tcl

 sudo apt-get install rrdtool-tcl

You can also install the standalone RRDTools. This provides tools to manipulate the RRD databases:

 sudo apt-get install rrdtool

Install mail send support

For details see https://raspberry-projects.com/pi/software_utilities/email/ssmtp-to-send-emails.

Run the following command

 sudo apt-get install ssmtp
 sudo apt-get install mailutils

Configure the SMTP settings inside /etc/ssmtp/ssmtp.conf, and if necessary, define mail aliases

 sudo nano /etc/ssmtp/ssmtp.conf
 sudo nano /etc/ssmtp/revaliases

Check with the command 'mail' that the mail settings are correct

 echo <your_message> | mail -s <subject> <destination_address> --debug-level=all

Or, if a more detailed log is required to identify a problem with the mail transmission, use the command 'ssmtp'

 echo <your_message> | ssmtp -v <destination_address>

Install THC

Download a fresh THC package copy from GitHub, unzip and copy it into /opt/thc and make the main THC program file executable :

 wget -q -O /tmp/thc-master.zip https://github.com/Drolla/thc/archive/master.zip
 sudo unzip -d /opt /tmp/thc-master.zip
 sudo mv /opt/thc-master /opt/thc
 sudo chmod 775 /opt/thc/bin/thc.tcl

Edit the configuration file config.tcl in the THC home directory. See Configuring THC.

 sudo nano /opt/thc/config.tcl

Create the log directory if necessary (default log directory is /var/thc).

 sudo mkdir -p /var/thc

Setup THC as a service

Copy the THC service start/stop script from the Razberry target into /etc/init.d, make it executable, and register it:

 cd /etc/init.d
 sudo cp /opt/thc/targets/Raspberry/thc.sh .
 sudo chmod 775 ./thc.sh
 sudo update-rc.d thc.sh defaults 98 02

z-Way/Razberry installation

To download the latest Z-Way version for your RaZberry, execute the following line:

 wget -q -O - razberry.z-wave.me/install | sudo bash

Avoid using z-Way version 1.7; performance issues have been observed with this version. THC has been successfully tested with z-Way v1.5.0, 1.5.1, 2.0.1, 2.1.1, 2.2.0, 2.3.8, 3.01

Install the THC extension for z-Way

 sudo cp /opt/thc/modules/thc_zWay/thc_zWay.js /opt/z-way-server/automation

See also thc_zWay for more details regarding the THC setup for z-Way/Razberry.