Send a measurement value received from standard input to a VSCP daemon as a Level II string measurement event.
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. |
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)