Anzapfen von Messgeräten und senden der Werte an einen Server
Project description
======================================
Quick reference of messgeraet_anzapfen
======================================
The command :program:`anzapfen` is used to collect a sensor value and post it
to the `logserver <https://gitlab.com/messgeraet/logserver>`_.
Sensors can be loaded as plugins.
Installation
============
The program is designed to run primarily on a Raspberry Pi with raspbian jesse.
It is assumed that you use the standard user `pi` and your current directory
is the home of this user.
Required packages
-----------------
You need to install the following linux packages: ::
sudo apt-get update
sudo apt-get install python3-rpi.gpio python3-virtualenv
Create the virtual environment
------------------------------
To create a virtual environment for the program, the following command must be
used: ::
virtualenv -p python3 --system-site-packages venv
The virtualenv :file:`venv` was populated in the current directory. Now you
have to activate it: ::
source ~pi/venv/bin/activate
Your prompt should now be prepended by `(venv)`.
Install the program :program:`anzapfen`
---------------------------------------
The program is available vi PyPi and is called `messgerat-anzapfen`: ::
pip install messgeraet-anzapfen
Usage of :program:`anzapfen`
============================
To use the program you first have to activate the virtual environment: ::
source ~pi/venv/bin/activate
Further more you need a config file to tell the program which sensor should be
queried and where the logserver is. Fortunately there are some helpful command
line arguments for :program:`anzapfen` which come in handy.
Check the installed plugins
---------------------------
The :option:`--print-known-sensors` of the program :program:`anzapfen`. This
option displays all installed sensors with a short description. If the sensor,
you want to use is not listed here then install it (instructions are included
with the sensor plugin).
Create a config file
--------------------
The next option is the :option:`--print-config-file`. Use this option to
create a new config file by redirecting the output to a file: ::
anzapfen --print-config-file > configfile.ini
.. note::
The name of the config file can be any valid filename for linux. It is
recomended to use the suffix `.ini` and don't use spaces and umlauts in the
name.
The config file
---------------
In the `Default` section you can choose which sensor will be use by setting
`sensor_type` to the name of the sensor (identical to the section caption of
the sensor). The default value is the dummy sensor `Constant` that always send
the entry of its variable `value` to the logserver.
The `sensor_id` is the key in the database of logserver where the measured
value is stored with a timestamp. The name can include the letters **a-z**,
**A-Z**, the numbers **0-9** and the underscore. Further more it should not
exceed 255 characters.
.. tip::
Best practise for a sensor name is the combination of the name of the sensor
plugin and the location of the measurement.
In the `Server` section you can set the url of the logserver.
The variables `endpoint` and `sensor_id` should remain untouched!
The settings for the sensor will be described within the plugin repository of
the sensor.
Quick reference of messgeraet_anzapfen
======================================
The command :program:`anzapfen` is used to collect a sensor value and post it
to the `logserver <https://gitlab.com/messgeraet/logserver>`_.
Sensors can be loaded as plugins.
Installation
============
The program is designed to run primarily on a Raspberry Pi with raspbian jesse.
It is assumed that you use the standard user `pi` and your current directory
is the home of this user.
Required packages
-----------------
You need to install the following linux packages: ::
sudo apt-get update
sudo apt-get install python3-rpi.gpio python3-virtualenv
Create the virtual environment
------------------------------
To create a virtual environment for the program, the following command must be
used: ::
virtualenv -p python3 --system-site-packages venv
The virtualenv :file:`venv` was populated in the current directory. Now you
have to activate it: ::
source ~pi/venv/bin/activate
Your prompt should now be prepended by `(venv)`.
Install the program :program:`anzapfen`
---------------------------------------
The program is available vi PyPi and is called `messgerat-anzapfen`: ::
pip install messgeraet-anzapfen
Usage of :program:`anzapfen`
============================
To use the program you first have to activate the virtual environment: ::
source ~pi/venv/bin/activate
Further more you need a config file to tell the program which sensor should be
queried and where the logserver is. Fortunately there are some helpful command
line arguments for :program:`anzapfen` which come in handy.
Check the installed plugins
---------------------------
The :option:`--print-known-sensors` of the program :program:`anzapfen`. This
option displays all installed sensors with a short description. If the sensor,
you want to use is not listed here then install it (instructions are included
with the sensor plugin).
Create a config file
--------------------
The next option is the :option:`--print-config-file`. Use this option to
create a new config file by redirecting the output to a file: ::
anzapfen --print-config-file > configfile.ini
.. note::
The name of the config file can be any valid filename for linux. It is
recomended to use the suffix `.ini` and don't use spaces and umlauts in the
name.
The config file
---------------
In the `Default` section you can choose which sensor will be use by setting
`sensor_type` to the name of the sensor (identical to the section caption of
the sensor). The default value is the dummy sensor `Constant` that always send
the entry of its variable `value` to the logserver.
The `sensor_id` is the key in the database of logserver where the measured
value is stored with a timestamp. The name can include the letters **a-z**,
**A-Z**, the numbers **0-9** and the underscore. Further more it should not
exceed 255 characters.
.. tip::
Best practise for a sensor name is the combination of the name of the sensor
plugin and the location of the measurement.
In the `Server` section you can set the url of the logserver.
The variables `endpoint` and `sensor_id` should remain untouched!
The settings for the sensor will be described within the plugin repository of
the sensor.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
messgeraet_anzapfen-0.5.2.tar.gz
(21.7 kB
view details)
Built Distribution
File details
Details for the file messgeraet_anzapfen-0.5.2.tar.gz
.
File metadata
- Download URL: messgeraet_anzapfen-0.5.2.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ae67d02a93705509567999eb5216f8f2e3a22f5d2a0b74f55d61bf5c500fe21 |
|
MD5 | 86af97189da88bca42780d282ff366d0 |
|
BLAKE2b-256 | 76f94dc7cf0cd4147149b95264759ff01f8ead2095db852d6c7c2a8652e21b4e |
File details
Details for the file messgeraet_anzapfen-0.5.2-py2.py3-none-any.whl
.
File metadata
- Download URL: messgeraet_anzapfen-0.5.2-py2.py3-none-any.whl
- Upload date:
- Size: 24.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 754c34e2bfbacfe0b49c767209585a7fa9a6eec35274e7310449af1215bc0da2 |
|
MD5 | 329b296f240237cfb8535b2606357352 |
|
BLAKE2b-256 | 2d2f9428318d05f3953e954c2251e914422d724e0cf68fc1a785644c98f252e9 |