Wirepas backend client
Project description
Backend client
Backend client is a tool to interface with Wirepas’ WM-RM-128 API. The API consists of a set of MQTT topic to interact with a Wirepas Mesh network.
For successfuly communicating with a Wirepas network you will need to have a complaint gateway which publishes and subscribes to a MQTT broker.
The backend client tool allows you too consume data from such API as well as interacting with other Wirepas’ services, such as Wirepas Network Tool and the Wirepas Positioning Engine.
Installation
To install this package in development mode, please run
pip install -e .
To build the source distribution and wheel file, make sure you have the wheel package installed
pip install <path_to_wheel>
and then run
py3clean . python3 setup.py clean --all python3 setup.py sdist bdist_wheel
Parameters
Parameters are given as input arguments or through a configuration file written in yaml.
An example on how to write the configuration file to connect to the mqtt broker at mqttbroker.com:
mqtt_hostname: "mqttbroker.com" mqtt_username: "mqttuser" mqtt_password: "mqttpassword" mqtt_port: 8883
WNT parameters
When talking to a WNT target, you must set the following settings with the backend client
wnt_username: "wntuser" wnt_password: "98asuyd907171ehjmasd" wnt_hostname: "wnthost.com"
WPE parameters
When talking to a WPE target, you must set the following settings with the backend client
wpe_service_definition: ./mywpesettings.json wpe_network: 1092
Fluentd parameters
The backend client has integrated logging with fluentd through Python’s logging facility.
Routing data to a fluentd host requires that you define the target host when executing a backend client script.
To configure the target host, tag and record for the stream, ensure that you configure the settingd.yml file with
# tags stream with app.mesh fluentd_hostname: "myfluenthost" fluentd_record: mesh fluentd_tag: app
The same commands can be provided as input arguments.
Influx parameters
The backend client can talk to an influx database and it requires the following parameters to be defined.
influx_hostname: "wnthost.com" influx_port: "wntinfluxport" influx_username: "someuser" influx_password: "somepassword" influx_database: "somedatabase"
Shell entrypoints
The backend client provides the following entry points:
wm-gw-cli: interacts with a MQTT broker to view details about the gateways and its networks
Examples
This section contains a brief description of the available examples.
To execute them, install the backend client and change into the examples folder.
Once inside the folder execute the example you wish with
python3 example_file.py --settings ./settings.yml
where
example_file.py: is one of the examples given below
settings.yml: contains all the connection details and program arguments
Logging & decoding MQTT traffic
The mqtt viewer subscribes and decodes incoming MQTT data on the fly.
This example is ideal if you want to pass through WM data to fluentd and kibana.
Find all nodes
The find all nodes prints the nodes present in the network as it observes data packets from them.
Influx viewer
The influx viewer allows you to query the WNT influx datastore and transform the coded column names to human readable names.
License
Licensed under the Apache License, Version 2.0. See LICENSE for the full license text.
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
Built Distribution
Hashes for wirepas_backend_client-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14afc0524aa1c8897641ca22c8dc29ccca2bfae06c50a38567ff95c950789d5f |
|
MD5 | 3871c943f4c28480419b9d272e6b5f75 |
|
BLAKE2b-256 | ae278a7298efa9daf575349c54812969eff6b3707dc36e1d44f8aac4bc53cd50 |
Hashes for wirepas_backend_client-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc9e9f699071090d80a7b18c4fa6b3c6d8343fde91977d13653f76a0ad76ae9c |
|
MD5 | 767c9e33e73fcfeb4e1c9babbc5f2f52 |
|
BLAKE2b-256 | 71b053951e6c800b6a129f49c53feb266ee215cbe7a0d9d4234ea4c3bba48e5b |