-
-
Notifications
You must be signed in to change notification settings - Fork 20
How to send 1 wire 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. This is very convenient if you want to collect temperature data 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 under the /sys/bus/w1/devices/ folder. A 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 supply the host address for the VSCP daemon, 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.
note If your VSCP Daemon has a version greater or equal to 15.0.0 you need to install the tcp/ip server driver (vscpl2drv-tcpipsrv)to get a tcp/ip interface. This was built into the server in earlier versions.
An alternative method is to use a VSCP driver to do this work. Check the vscpl2drv-lmsensors it can take the content of any file and report it as a VSCP event.
The VSCP Project (https://www.vscp.org) - Copyright © 2000-2024 Åke Hedman, the VSCP Project