Setup 1-wire Support by adding
/boot/config.txt. You can skip this step if it’s already present.
sudo bash -c 'echo "dtoverlay=w1-gpio" >> /boot/config.txt'
Reboot to take effect.
apt-getto recognise the temperature-machine repository.
sudo bash -c 'echo "deb http://robotooling.com/debian ./" >> /etc/apt/sources.list'
Stop any running versions already built from source (not required for a fresh install)
cd ~/code/temperature-machine ./stop.sh
You might also want to disable any previous automatic startup (for example, if you built from source). Check the contents of
/etc/rc.localand remove the following line if it exists (you might see
su pi -c 'cd /home/pi/code/temperature-machine && ./start-client.sh &'
sudo apt-get update sudo apt-get install temperature-machine
Decide if you will be running the temperature-machine as a server or client.
If you have a single machine, you want a server. If you already have a server running and want to monitor more rooms with more machines, add each of these as clients.
Run the following before you startup the temperature-machine for the first time.
It will ask you to choose and create the configuration file as
If you created a server configuration file above, update the default hosts.
The default configuration will list some default values for
hosts, such as:
hosts = ["garage", "lounge", "study"]
These are the machines you will be using in your final setup. Ensure these match the host names of each machine you plan to add. The values are used to initialise the RRD database on the server. If you need to change this later, you will have to delete the
~/.temperature/temperature.rrdfile, losing historic data. It’s worth adding in some spares.
After setting up the configuration, you can either restart the service manually (run
sudo systemctl restart temperature-machine) or wait about a minute and it will restart automatically.
If you had previously built from source and modified your
start-server.shscript. You can use the values here to populate your configuration. It would have includes the list of hosts after the
Check the logs for activity (to check it’s all running ok)
- Try it out. Goto http://your_hostname:11900 from your favorite browser.
apt-get update command to update your Raspberry Pi’s package lists with the latest versions of software, then upgrade temperature-machine:
sudo apt-get update sudo apt-get install --only-upgrade temperature-machine
Running as a Service
By default, the temperature-machine runs as a service in the background - it should be running as soon as you’ve installed it with
apt-get. It will start on boot and restart if it develops a problem. We use
systemd to achieve this.
You can list all the services with
systemctl list-unit-files and verify temperature-machine is
enabled. If it’s disabled, run
sudo systemctl enable temperature-machine to enable (and start) it.
Check the current status at any time with
systemctl status temperature-machine.
If you want to disable it running as a service, run
sudo systemctl disable temperature-machine and take a look at the section below to start manually.
If there is a problem, the service will attempt to restart after 60 seconds. That means, if it can't start up (for example, becuase there are no sensors attached), it will keep trying until the problem is resolved.
Assuming it isn’t running already (stop it with
sudo systemctl stop temperature-machine), you can start it manually with the following (stopping with ctrl + c).
If you want to check the version you’re running (a good way to check it’s installed), try the following.
temperature-machine -- -v
You can also run
man temperature-machine to read about more options.
The log file can be found in
~/.temperature/temperature-machine.log. The conventional
/var/log/temperature-machine is currently unused.