TempServer is a Client/Server application that can grab temperature from many remote sensors on the same network and present them in an easy to read format.
> ./c
Attic: 15.35
Garage: 19.67
- Compile the server on a raspberry pi
- Install go
> apt-get install golang
- Compile
# Assuming a functional $GOPATH > go get -u github.com/maxrenaud/tempserver/server # For the server > go get -u github.com/maxrenaud/tempserver/server # For the client
- Configure
- Copy the sample json config from github.com/maxrenaud/tempserver/server.json.sample to an accessible location like /etc/tempserver.json. For the client.json.sample, I recommend puttint it in your home directory
- Edit the copied file to match your desired configuration
- Test
- Launch the server
> server -config="/etc/tempserver.json"
- In a different terminal, try the client
> client -config="~/client.json" # -config not required if client.json is in the current directory
- Configure the server to start at launch (Systemd)
- Copy the tempserver.service file to /etc/systemd/system
> sudo cp tempserver.service /etc/systemd/system
- Edit the file and change the ExecStart variable to match where you installed the server
- Configure the service to come up at boot time
> sudo systemctl enable tempserver
- Reboot the Pi. Alternatively, you can manually start the service
> sudo systemctl start tempserver
In server.json, the sensor and sensor_params are currently as follow:
-
sensor
- "tempAlert" for the TempAlert.
- "ds18b20" for the ds18b20 chip
- "fake_temp" for a fake module that always reports the same temperature.
-
sensor_param. There are the string parameters to pass on to the sensor module
- "tempAlert" takes one parameter, the location of the tempAlert. E.g: /dev/ttyUSB0
- "ds18b20" does not have any parameters
- "fake_temp" takes one parameter, the desired temperature output