Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wirepas_backend_client-1.1.0.tar.gz (64.4 kB view hashes)

Uploaded Source

Built Distribution

wirepas_backend_client-1.1.0-py3-none-any.whl (94.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page