Chipotherm is a electronic thermostat for the Pocket C.H.I.P. computer.
It supports automatic temperature monitoring, a temperature graph of past measurements, and a cool futuristic UI.
You can also control it remotely, either via a TCP socket or by installing the Chipotherm Server.
Make sure to build with clang for C++14 support.
(Ensure default c++ compiler with update-alternatives --config c++
)
mkdir build && cmake .. && make
- Run
build_device.sh
- The built product will be extracted to
build_device
The best way to build for the Pocket C.H.I.P. is via a QEMU root using Debian Jessie (the distribution the CHIP is using).
Here's how to set that up:
- Make sure you're building on a 32-bit Debian-based system (in a VM for instance)
mkdir /var/jessie_armhf
- Bootstrap an ARM Debian Jessie instance using
qemu-debootstrap
qemu-debootstrap --arch armhf jessie /var/jessie_armhf http://deb.debian.org/debian/
- Copy the qemu interpreter to the new root
cp /usr/bin/qemu-arm-static /var/jessie_armhf/usr/bin
chroot
to the newly created debian root and install build dependencies in there. (See "Requirements" section)
- Copy the
chipotherm
executable to the Pocket C.H.I.P. - Setup a
systemd
job so chipotherm runs when the CHIP boots up [optional]
- Attach a electronic relay (such as this one) to the CHIP.
- Connect +3.3V to the VIN pin on the relay
- Connect ground to ground on the CHIP
- Connect
S
or whatever the signal pin is to the CHIP'sGPIO 1
pin
- Attach the "hot" and "neutral" wires to the relay, such that when the relay is closed it completes the circuit between the two wires. It might be a good idea to test with a multi-meter before installing. A correct installation would be +240V (in the US) from the hot wire and +0V from the neutral wire. It is important that you do not connect these directly to the Pocket CHIP! You must use a relay!
Chipotherm can be controlled remotely, either via messaging the UNIX socket it creates (located in /run/user/[your uid]/chipotherm/socket) or by running a command-and-control server such as Chipotherm Server.
To have Chipotherm connect to a command-and-control server, start the server on another box (such as a VPS), and start chipotherm providing the command-and-control server as the first argument. For example:
chipotherm 'http://myserver.local:43001'
In the future, I'd like to provide a nicer interface for doing this, but for now you can message the socket using the socat
command on Linux:
echo "set_enabled 1" | socat - UNIX-CONNECT:/var/run/user/1000/chipotherm/socket
Sounds make using this a lot more fun. Unfortunately the Pocker CHIP's sound driver does this annoying power-saving thing that makes it so all the sounds are super delayed. To fix this, I had to make a systemd unit to play silence continuously so the sound card doesn't go to sleep.
[Unit]
Description=Continuous silence
[Service]
ExecStart=/usr/bin/play -qn
[Install]
WantedBy=default.target
Requires sox
package for play
. Even worse than that, ALSA is so old it doesn't do software mixing by default. You have to enable that by editing /etc/asound.conf. This configuration file is located in this project under utils/asound.conf.
bubbles is used for the user interface for this project.
libtempered bubbles boost hidapi-hidraw libsoup-2.4 pangocairo threads