Skip to content

How to send 1 wire readings to the VSCP daemon

Åke Hedman edited this page Aug 19, 2021 · 3 revisions

How to send 1 wire temperature readings to the VSCP daemon

If you want to use Digitemp see the page How to send Digitemp readings to the VSCP daemon

The Raspberry Pi (and other Linux systems, can read sensor data from a 1-wire bus if enabled. Where convenient if you want to collect temperature form a number of locations.

On Raspberry Pi you use raspi-config to enable 1-wire support (Interface Options/p7). This document will use Raspberry Pi as an example. The method to enable the functionality may be different on other platforms. When this is configured (a restart is needed) you can see the connected sensors in the /sys/bus/w1/devices/ folder. An available DS18B20 temperature sensor will as an example be listed as something like 28-000003e75a74. You can see the current temperature by issuing

cat /sys/bus/w1/devices/28-000003e75a74/w1_slave

or on newer systems even

cat /sys/bus/w1/devices/28-000003e75a74/temperature

What you get is a temperature in Celsius times 1000. So dividing this value with 1000 give you the correct temperature.

The script python send_pi_onewire.py will send all the readings from the 1-wire sensor folder with correct formed GUID's to the VSCP daemon. The format to use is

python send_pi_onewire.py 192.168.1.7 admin secret

That is host address, username and password to login with to the tcp/ip interface of that VSCP daemon.

Adding this to a file in /etc/cron.d on the form

https://github.com/grodansparadis/vscp-samples/blob/master/samples/python/send_pi_onewire.py

will give you temperature readings every minute for all the sensor attached to the 1-wire bus.

Clone this wiki locally