Skip to content

Send a measurement value received from standard input to a VSCP daemon.

License

Notifications You must be signed in to change notification settings

grodansparadis/vscp-python-send-file-measurement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vscp-python-send-file-measurement

Send a measurement value received from standard input to a VSCP daemon as a Level II string measurement event.

Syntax

echo "1.23" | ./vscp-python-send-file-measurement host user password guid type sensorindex zone subzone
Parameter Description
host The hostname or IP address of the VSCP daemon.
user The username to use for authentication.
password The password to use for authentication.
guid The GUID to use for the measurement event.
type The type of the measurement event.
sensorindex The sensor index to use for the measurement event. OPtional. Defaults to 0.
zone The zone to use for the measurement event. OPtional. Defaults to 0.
subzone The subzone to use for the measurement event. Optional. Default to 0.

Usage

Typical usage is to send a measurement stored in a file bye some other program. This is common in many sensor networks. For example, a sensor network that uses a temperature sensor can store the temperature in a file and send it to the VSCP daemon.

For example a one wire temperature sensor on a Raspberry Pi can be read from

/sys/bus/w1/devices/28-000004d9b8ff/temperature

The problem is that you can't send it directly to the server as th erea dtemperatur is 1000 time stha actual value. So we use some bash arithmetic and execute in place to get the correct value.

printf %.3f "$((10**3 * `cat /sys/bus/w1/devices/28-000004d9b8ff/temperature`/1000))e-3"

so

printf %.3f "$((10**3 * `cat /sys/bus/w1/devices/28-000004d9b8ff/temperature`/1000))e-3" | ./sendfile_measurement.py 192.167.1.7 admin secret 6 1

will send a temperature measurement event to the VSCP daemon at address 192.168.1.7.

typically used in a cron job.

Read more about bash arithmetic's here.


This file is part of the VSCP project (https://www.vscp.org)

About

Send a measurement value received from standard input to a VSCP daemon.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published