{ "info": { "author": "Wirepas Ltd", "author_email": "opensource@wirepas.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries" ], "description": "# Backend-client\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/wirepas/backend-client)\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/bf0c23237cf04ea6ac48e98cf10b6a7b)](https://www.codacy.com/manual/wirepas/backend-client?utm_source=github.com&utm_medium=referral&utm_content=wirepas/backend-client&utm_campaign=Badge_Grade) [![Build Status](https://travis-ci.com/wirepas/backend-apis.svg?branch=master)](https://travis-ci.com/wirepas/backend-apis) [![Documentation Status](https://readthedocs.org/projects/backend-client/badge/?version=latest)](https://backend-client.readthedocs.io/en/latest/?badge=latest) [![PyPi](https://img.shields.io/pypi/v/wirepas-backend-client.svg)](https://pypi.org/project/wirepas-backend-client/)\n\n\n\n1. [Introduction](#introduction)\n1. [Installation](#installation)\n 1. [Host dependencies](#host-dependencies)\n 1. [Setting up a Python virtual environment](#setting-up-a-python-virtual-environment)\n 1. [Installing from PyPi](#installing-from-pypi)\n 1. [Installing from Github](#installing-from-github)\n1. [Entrypoints](#entrypoints)\n 1. [Gateway command line interface](#gateway-command-line-interface)\n 1. [Connecting to the MQTT broker](#connecting-to-the-mqtt-broker)\n 1. [Commands](#commands)\n 1. [Viewing connected devices](#viewing-connected-devices)\n 1. [Device settings](#device-settings)\n 1. [Selecting the target gateway and sink](#selecting-the-target-gateway-and-sink)\n 1. [Set app config](#set-app-config)\n 1. [Viewing gateway configuration](#viewing-gateway-configuration)\n 1. [Upload and process a scratchpad](#upload-and-process-a-scratchpad)\n 1. [WPE Viewer](#wpe-viewer)\n 1. [WNT Viewer](#wnt-viewer)\n1. [Framework](#framework)\n 1. [Structure](#structure)\n 1. [API submodule](#api-submodule)\n 1. [Management submodule](#management-submodule)\n 1. [Mesh submodule](#mesh-submodule)\n 1. [Messages submodule](#messages-submodule)\n 1. [Test submodule](#test-submodule)\n 1. [Tools submodule](#tools-submodule)\n 1. [Cli submodule](#cli-submodule)\n 1. [Examples](#examples)\n1. [Logging to fluentd](#logging-to-fluentd)\n1. [Building and running over Docker](#building-and-running-over-docker)\n 1. [Dockerhub](#dockerhub)\n 1. [Running with docker](#running-with-docker)\n 1. [Running with compose](#running-with-compose)\n 1. [Building the image locally](#building-the-image-locally)\n1. [Source documentation](#source-documentation)\n1. [Contributing](#contributing)\n1. [License](#license)\n\n\n\n## Introduction\n\nThe Backend Client is a tool to, primarily, interact with\na [gateway][wirepas_gateway] compliant with the Wirepas Backend to Gateway API.\n\nIn addition to the interaction with the Backend to Gateway Public API,\nthe Backend Client has also support for Wirepas Positioning Engine and Wirepas\nNetwork Tool. Support for these tools is still work in progress\n(see [milestones][backend_client_gh_milestones] and [projects][backend_client_gh_projects]).\nHowever, you can already benefit from existing\nentrypoints to help you capture data and debug your\nintegration (see [entrypoints](#entrypoints)).\n\nFigure 1 illustrates the horizon where Backend Client is located.\n\n![Architecture overview][here_img_overview]\n\n**Figure 1** - Backend Client role in the Wirepas ecosystem.\n\n## Installation\n\nThe Backend Client is written in python and it requires a valid MQTT\nbroker target to connect to, WNT or WPE credentials.\n\nIf you need help installing a MQTT broker or auxiliary software please\nrefer to our tutorials repository.\n\n### Host dependencies\n\nThe main requirements of Backend Client are:\n\n- Python 3.7\n- Pip (we recommend the latest available)\n- Linux system\n\nCertain Backend Client's dependencies must be\ncompiled locally upon installation,\nthus require the installation of specific development headers.\n\nUnder Debian, the extra requirements are:\n\n- gcc\n- python3-dev\n- default-libmysqlclient-dev\n\nPlease be advised that the name of such packages might change depending on your\nLinux system. Please refer to the Dockerfiles\nunder the [container folder][here_container] for more detailed information.\n\nWindows native environments are not supported. For help running the tool\nin Windows, please use the Linux subsystem, Docker or a virtual machine.\n\n### Setting up a Python virtual environment\n\nAs a recommendation, it is good practice to install and run the\napplication on a virtual python environment. Such approach avoids\npossible issues with conflicting package versions.\n\nWe recommend you use either [virtualenv][virtualenv] or [pipenv][pipenv]:\n\n```shell\n pip3 install virtualenv\n pip3 install pipenv\n```\n\nIf you choose to install and run the Backend Client inside a virtual\nenvironment, please activate the environment before moving with the next\nsteps.\n\nA virtual environment with virtualenv is created and activated\nwith:\n\n```shell\n virtualenv wm_bcli_env\n source wm_bcli_env/bin/activate\n```\n\nFor pipenv, a virtual environment is created and activated by:\n\n```shell\n pipenv --three\n pipenv shell\n```\n\nOnce you activate your environment your can safely install the python\npackage under it.\n\nFor more information please refer to the tool's webpage.\n\n### Installing from PyPi\n\nThe Backend Client is available from\n[PyPi][backend_client_pypi] and you can install the latest stable version\nwith:\n\n\n```shell\n pip install wirepas-backend-client\n```\n\nIf you wish to install a particular version please see the release history\nfrom PyPi.\n\n### Installing from Github\n\nFirst of all, make sure to clone the repository using the https address.\n\nCheckout the\n[git tag that corresponds to the release version][backend_client_gh_releases]\nyou want to install and install the package with:\n\n```shell\n pip3 install .\n```\n\nIf you leave your branch checked out to the top of master, it is likely that\nyou might run into a few issues. If you find them, please be so kind to\nraise them to us through an [issue or bug report][backend_client_gh_issues].\n\nIf you want to develop or patch a bug under your local environment,\nyou can install the package in development mode through:\n\n```shell\n pip3 install -e .\n```\n\nWhen installed in development mode, changes to the source files will be\nimmediately visible.\n\n## Entrypoints\n\nAfter installation, the Backend Client exposes several\n[shell entrypoints][here_setup_entrypoints] that\ncan be run from any location in your system. This section describes their\nusage in more detail.\n\n### Gateway command line interface\n\nThe Backend Client exposes an interactive gateway command line which is\nmeant to interact with a gateway and sink pair connected to a given\nMQTT broker.\n\nTo start an interactive command line to interact with a broker located\nin your *localhost* environment type:\n\n```shell\n wm-gw-cli\n```\n\nConnecting to a remote server requires you to specify the values as an\nargument or by reading from a yaml settings file. To view all the\narguments, please issue the command:\n\n```shell\n wm-gw-cli --help\n```\n\n#### Connecting to the MQTT broker\n\nFor the gateway client to function properly, it needs to establish a\nconnection to the same MQTT broker where one or multiple gateways\nare connected to.\n\nTo do so, let's assume the following MQTT credentials are saved in\n./.settings.yml:\n\n```yaml\n # .settings.yml\n # Example on how to set the MQTT credentials towards a local broker\n # with basic authentication\n --\n mqtt_hostname: 127.0.0.1\n mqtt_password: password\n mqtt_username: username\n mqtt_port: 1883 # defaults to 8883 (secure port)\n mqtt_force_unsecure: True # defaults to False (secure)\n```\n\nTo start the gateway against the MQTT broker specified in\n./.settings.yml, issue the following command:\n\n```shell\n wm-gw-cli --settings ./.settings.yml\n```\n\nOnce the client launches, you will be greeted with:\n\n```shell\n Welcome to the Wirepas Gateway Client cli!\n Connecting to mosquittouser@127.0.0.1:1883 (unsecure: True)\n\n Type help or ? to list commands\n\n Type ! to escape shell commands\n Use Arrow Up/Down to navigate your command history\n Use CTRL-D or bye to exit\n\n 09:50.17 | wm-gw-cli >\n\n```\n\n#### Commands\n\nThe gateway client has a set of commands which you can view by typing ?\nin the client's shell:\n\n```shell\n 09:50.17 | wm-gw-cli > ?\n\n Documented commands (type help ):\n ========================================\n EOF playback set_loop_iterations\n bye q set_loop_timeout\n clear_offline_gateways record set_reply_greeting\n eof scratchpad_status set_sink\n gateway_configuration scratchpad_update settings\n gateways scratchpad_upload shell\n help selection sinks\n list send_data toggle_byte_print\n ls set_app_config toggle_pretty_print\n networks set_config track_devices\n nodes set_gateway track_data_packets\n```\n\nFor each available command you can get more help if you type\n**?command** for example, to view how to send a datagram,\ntype in the shell:\n\n```shell\n wm-gw-cli > ?send_data\n```\n\nWhen typing commands, you can use the up and down arrows to browse your\nshell history. There is also support for running host shell commands, by\nprefacing the command with **!**.\n\n#### Viewing connected devices\n\nUpon a MQTT connection, the Backend Client will start populating an\ninternal structure based on any incoming message. The topic is parsed\nand the information about the network devices are constructed.\n\nThe operation happens as messages are published from the network. It\nwill take time to build a full map of the network, which will be faster\ndepending on your network's packets per second.\n\nTo browse the devices, please type:\n\n```shell\n wm-gw-cli > ls\n```\n\nThe output will show the devices that have been currently found. In case\nyou wish to view periodically which devices you have on your network,\ntype in the following command:\n\n```shell\n wm-gw-cli > ?track_devices\n```\n\nTo exit the tracking loop, give a new line feed to the input stream and\nit will go back to the main command shell.\n\n#### Device settings\n\nWhen sending a downstream datagram, it is necessary to obey the\nBackend to Gateway API (WM-RM-128).\nFor that reason, it is mandatory to know what is the target\ngateway identifier and in most cases the sink id as well.\n\n##### Selecting the target gateway and sink\n\nThe wm-gw-cli provides an easy way to select the target gateway and sink. To\nmake your choice, please type the following commands:\n\n```shell\n wm-gw-cli > set_gateway\n 0 : 2485378023427 : GatewayState.ONLINE\n 1 : 2485378023426 : GatewayState.OFFLINE\n Please enter your gateway selection [0]: 0\n wm-gw-cli > set_sink\n 0 : 3806491:2485378023427:sink0\n Please enter your sink selection [0]: 0\n```\n\nWhen setting the gateway, the wm-gw-cli shows you the following information\n*object index : gateway id : state.* Similarly, for the sink, the wm-gw-cli\npresents the object *index : network : gateway id: sink id*.\n\nTo make your selection, type the desired object index and press enter.\n\nOnce your selection is done, your commands will target that gateway id\nand sink id. If you wish to view what your current selection is, use the\ncommand:\n\n```shell\n wm-gw-cli > selection\n```\n\n:warning: **WARNING** :warning:\n\nThe wm-gw-cli prompt will update itself with the current gateway and sink id.\nThroughout this document, that information has been edited out of the\nprompt.\n\n##### Set app config\n\nSetting the app config requires that your gateway and sink are selected.\nIn case you have not done the selection prior to this command, the wm-gw-cli\nwill ask for them.\n\nWhen setting the app config, you are setting three values on the target\nsink:\n\n- Diagnostic interval: the interval of network diagnostics (0, 30, 60,\n 300, 600, 1800)\n\n- App config: A payload of a given size distributed to all associated\n devices on the network;\n\n- App config sequence: The sequence of the new app config (must be\n higher than the current one - otherwise the app config won't take\n effect, please refer to WM-RM-100).\n\nThe app config payload is given either as a set of binary data without\ntrailing 0x or as a utf8 data. For example, to send the\nbinary *0x10x40x5* you should type *010405*.\nIf you simply want to have a text string on\nyour app config, you can for example type \"sink by the window\".\n\nAs an example, on the wm-gw-cli you would type:\n\n```shell\n # Remember! no white spaces allowing in the payload!\n # If you want to toggle byte string to hex string in the\n # app_config_data, please see toggle_byte_print\n\n wm-gw-cli > set_app_config 10 sink_by_the_window 30\n answer <<\n gw_id: 2485378023427\n sink_id: sink0\n req_id: 12079559850249952277\n res: GatewayResultCode.GW_RES_OK\n sink_id: sink0\n current_ac_range_min: 2000\n current_ac_range_max: 8000\n min_ac: 2000\n max_ac: 8000\n max_mtu: 102\n min_ch: 1\n max_ch: 27\n hw_magic: 3\n stack_profile: 1\n app_config_max_size: 80\n are_keys_set: False\n firmware_version: [3, 4, 37, 0]\n node_role: 17\n node_address: 4193520\n network_address: 3806491\n network_channel: 22\n app_config_diag: 30\n app_config_seq: 10\n app_config_data:\n b'sink_by_the_window\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\n \\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\n \\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\n \\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\n \\x00\\x00\\x00'\n channel_map: 286331153\n started: True\n```\n\nThe answer will carry the gateway result and present you the new app\nconfig.\n\n##### Viewing gateway configuration\n\nThe wm-gw-cli allows you to see the current gateway configuration by typing:\n\n```shell\n Wm-gw-cli gateway_configuration\n requesting configuration for 2485378023427\n answer <<\n gw_id: 2485378023427\n sink_id: None\n req_ gw_id: 2485378023427\n sink_id: sink0\n req_id: 12079559850249952277\n res: GatewayResultCode.GW_RES_OK\n sink_id: sink0\n current_ac_range_min: 2000\n current_ac_range_max: 8000\n min_ac: 2000\n max_ac: 8000\n max_mtu: 102\n min_ch: 1\n max_ch: 27\n hw_magic: 3\n stack_profile: 1\n app_config_max_size: 80\n are_keys_set: False\n firmware_version: [3, 4, 37, 0]\n node_role: 17\n node_address: 4193520\n network_address: 3806491\n network_channel: 22\n app_config_diag: 30\n app_config_seq: 10\n app_config_data:\n b git'sink_by_the_window\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\n \\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\n \\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\n \\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\n \\x00\\x00\\x00\\x00'\n channel_map: 286331153\n started: Trueid: 13018941017451207243\n res: GatewayResultCode.GW_RES_OK\n sink_id: sink0\n node_role: 17\n node_address: 4193520\n network_address: 3806491\n network_channel: 22\n app_config_diag: 30\n app_config_seq: 10\n app_config_data:\n b'sink_by_the_window\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\n \\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\n \\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\n \\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\n \\x00\\x00\\x00'\n channel_map: 286331153\n started: True\n current_ac_range_min: 2000\n current_ac_range_max: 8000\n min_ac: 2000\n max_ac: 8000\n max_mtu: 102\n min_ch: 1\n max_ch: 27\n hw_magic: 3\n stack_profile: 1\n app_config_max_size: 80\n are_keys_set: False\n firmware_version: [3, 4, 37, 0]\n```\n\n##### Upload and process a scratchpad\n\nThe wm-gw-cli supports uploading a new scratchpad and asking the sink to take\nit into use. *A full network OTAP is not currently supported with the\nwm-gw-cli.* To initiate a network OTAP, you will have to send the\ncorresponding datagrams as mentioned in the remote API documentation.\n\nThe scratchpad commands are available as:\n\n- scratchpad_status\n- scratchpad_update\n- scratchpad_upload\n\n:warning: **WARNING** :warning:\n\nAn incorrect scratchpad or an incorrect OTAP can damage your network\npermanently. Please use these commands with care.\n\n### WPE Viewer\n\nThe WPE viewer, *wm-wpe-viewer*, provides a simple way to check\nif a WPE service and consume location updates for a given network.\n\nThe WPE viewer entrypoint requires correct population of the following\nsettings:\n\n```yaml\n #.settings.yml\n wpe_service_definition: ./mywpesettings.json\n wpe_network: 1092 #optional\n```\n\nThe *mywpesettings.json* consists of a standard WPE client configuration\nfile. Please refer to WPE's official documentation for more details\non how to obtain and configure such file.\n\nThe wpe network is the network identifier on which your devices operate.\nIf you leave the parameter unset, the entrypoint will only perform a\nping to the backend specified under the json file.\n\n### WNT Viewer\n\nThe WNT viewer, *wm-wnt-viewer*, provides a simple way to check\nif a WNT service is reachable and to consume messages streamed by WNT on\nits realtime metadata websocket. These message contain network and node\ndiagnostic information. Please refer to WNT's public API documentation\nfor further information.\n\nThe WNT viewer entrypoint requires correct population of the following\nsettings:\n\n```yaml\n #.settings.yml\n wnt_username: \"wntuser\"\n wnt_password: \"98asuyd907171ehjmasd\"\n wnt_hostname: \"wnthost.com\"\n```\n\n## Framework\n\nBesides the useful entrypoints to interact with Wirepas services, the goal of\nthe Backend Client is to provide you a framework around which you can\nbuild test cases to help you during your integration, research and\ndevelopment phases.\n\n### Structure\n\nThe framework or package is organized in several submodules:\n\n1. [api][bcli_api]\n 1. [api/influx][bcli_api_influx]\n 2. [api/mqtt][bcli_api_mqtt]\n 3. [api/mysql][bcli_api_mysql]\n 4. [api/wnt][bcli_api_wnt]\n 5. [api/wpe][bcli_api_wpe]\n2. [management][bcli_management]\n3. [mesh][bcli_mesh]\n 1. [mesh/interfaces][bcli_mesh_interfaces]\n 2. [mesh/interfaces/mqtt][bcli_mesh_interfaces_mqtt]\n 3. [mesh/interfaces/remote_api][bcli_mesh_interfaces_remote_api]\n 4. [mesh/interfaces/beacon_api][bcli_mesh_interfaces_beacon_api]\n4. [messages][bcli_messages]\n5. [test][bcli_test]\n6. [tools][bcli_tools]\n7. [cli][bcli_cli]\n\n#### API submodule\n\nThe [api submodule][bcli_api] contains the interfaces to connect\nand handle data coming in and out of Wirepas' services and other\n3rd party services such as databases\nand message brokers.\n\nEach API or interface folder is organized with connectors, handlers and\nsettings. The connectors file contains classes to establish a connection to\nthe target interface. The handlers contain classes to process streams of input\nand output data. The settings file allows for handling parameter\ntranslation from input to class arguments (if needed).\n\n#### Management submodule\n\nThe [management submodule][bcli_management] contains files regarding\nthe runtime management of the framework.\nIn particular the daemon which simplifies the multiprocess aspect\nof the Backend Client.\n\n#### Mesh submodule\n\nThe [mesh submodule][bcli_mesh] contains files related to how\ndevices are mapped within the Backend Client.\nIn addition to those, the submodule contains an interfaces\nfolder which contains specializations on how to handle specific Wirepas's\nAPIs, such as the [Gateway to Backend API][bcli_mesh_interfaces_mqtt].\n\n:pencil2: **NOTE** :pencil2:\n\nIn our redesign effort we are targeting to improve the device\nclasses and implement remote API support. Please follow the\nframework development for more up to date information.\n\n#### Messages submodule\n\nThe [messages submodule][bcli_messages] consists of a collection of\nmessage handler or decoders that handle translation of known APDUS,\nbased on the endpoint they are associated to.\n\n:pencil2: **NOTE** :pencil2:\n\nWe are considering moving the message handlers into the overarching Wirepas\nBackend APIs project. Please follow the framework development for more up to\ndate information.\n\n#### Test submodule\n\nThe [test submodule][bcli_test] contains classes to handle internal task\nscheduling and scripts to address particular mesh use cases.\n\n#### Tools submodule\n\nThe [tools submodule][bcli_tools] contains a collection of files\nwith classes that handle the acquisition of user\ninput, setup of the logging interface and general\npurpose utility methods and classes.\n\n#### Cli submodule\n\nCurrently still a [single file][wm_gw_cli], this upcoming submodule\nwill contain a re-factor of the gateway client to allow easier\ncustomization and construction of custom command line interfaces.\n\n### Examples\n\nTo better understand the framework inner-working and how you can extend it,\nwe recommend that you take a look at the examples\nwe have available in the [examples folder][examples]:\n\n- [mqtt_viewer.py][examples_mqtt_viewer]: connects to a MQTT broker and\ndecodes on the fly any message that is known to the\nframework (see [cookbook][wirepas_cookbook_viz] for usage example)\n\n- [find_all_nodes.py][examples_find_all_nodes]: simple interaction with\nthe Gateway to Backend API that enumerates and prints outs discovered devices\n\n- [influx_viewer.py][examples_influx_viewer]: run custom queries or\nexport date ranges from an influx database where WNT is storing data\n\n- [settings.yml][example_settings]: an example of a yaml file that with\ncommented out settings\n\nBackend Client's entrypoints also act as a good way to guide your development:\n\n- [wm-gw-cli][wm_gw_cli]: code behind the gateway command line\ninterface that exemplifies how to build requests to the sink,\nreceive and send data packets\n\n- [wm-wnt-viewer][wm_wnt]: example on how to consume data streamed\nby a WNT backend\n\n- [wm-wpe-viewer][wm_wpe]: example on how to consume data streamed\nby a WPE backend\n\nFor an example on how to build use case test cases, please refer to\nthe [kpi_adv.py][kpi_adv] script.\n\n## Logging to fluentd\n\nThe Backend Client has integrated logging with fluentd through Python's\nlogging facility.\n\nRouting data to a fluentd host requires that you define the target host\nwhen executing a Backend Client script.\n\nTo configure the target host, tag and record for the stream, ensure that\nyou configure the .settings.yml file with\n\n```yaml\n # tags stream with app.mesh\n fluentd_hostname: \"myfluenthost\"\n fluentd_record: mesh\n fluentd_tag: app\n```\n\n## Building and running over Docker\n\nDocker allows application to run on a sandbox containing\nall the dependencies needed to run and execute them.\nIf you are not familiar with Docker, please refer to the\nofficial documentation at [docker.com][docker].\n\n### Dockerhub\n\nBackend Client builds are available\nfrom dockerhub under the [Backend Client registry][backend_client_dockerhub].\n\nThe latest tag points to the current stable release,\nwhereas the edge tag points to the top of master.\n\nThe latest tag is built automatically at dockerhub whenever this repository\nis tagged.\n\nThe edge tag is built after each single merge into master.\n\nTo pull the Backend Client image from dockerhub use:\n\n```shell\n docker pull wirepas/backend-client:latest\n docker pull wirepas/backend-client:\n```\n\n### Running with docker\n\nAs the container will have no access to your local environment, you will have\nto propagate the input parameters by mounting a local file inside the\ncontainer,eg, *.settings.yml*.\n\nThe default image command will launch the gateway client with the settings\npresent under */home/wirepas/vars/settings.yml* (container path).\n\nTo run it with docker type\n\n```shell\n docker run -it \\\n -v $(pwd)/.settings.yml:/home/wirepas/vars/settings.yml \\\n wirepas/backend-client\n```\n\n:warning: **WARNING** :warning:\n\nIf you want to run against a MQTT running in your host (localhost),\nyou must overlay the container over your host's network.\nTo do so, you must set the docker run parameter *--net=host.*\n\n### Running with compose\n\nTo run the Backend Client using docker compose, drop or move the settings\nfile in **container/.settings.yml** and start the service with:\n\n```shell\n docker-compose container/slim/docker-compose.yml up\n```\n\nBy default this will start the [MQTT viewer example][examples_mqtt_viewer].\n\nIf you wish to run the gateway command client you can do so with:\n\n```shell\n docker-compose -f container/docker-compose.yml \\\n run \\\n backend-client wm-gw-cli \\\n --settings /home/wirepas/vars/settings.yml\n```\n\nIf you prefer alpine based images, please change *slim* to *alpine*.\n\n### Building the image locally\n\nTo build the image locally in the root of the repo type:\n\n```shell\n docker build -f container/slim/Dockerfile -t backend-client .\n```\n\nAlternatively you can also build using the docker-compose.yml present in\nthe root of the directory:\n\n```shell\n docker-compose -f container/slim/docker-compose.yml build\n```\n\n## Source documentation\n\nThe source documentation is found from\n[read the docs.][backend_client_rtd]\n\n## Contributing\n\nWe welcome your contributions!\n\nPlease read the [instructions on how to do it][here_contribution]\nand please review our [code of conduct][here_code_of_conduct].\n\n## License\n\nCopyright 2019 Wirepas Ltd licensed under Apache License,\nVersion 2.0 See file [LICENSE][here_license] for full license details.\n\n\n\n[bcli_api]: https://github.com/wirepas/backend-client/tree/master/wirepas_backend_client/api\n\n[bcli_management]: https://github.com/wirepas/backend-client/tree/master/wirepas_backend_client/management\n\n[bcli_mesh]: https://github.com/wirepas/backend-client/tree/master/wirepas_backend_client/mesh\n\n[bcli_messages]: https://github.com/wirepas/backend-client/tree/master/wirepas_backend_client/messages\n\n[bcli_test]: https://github.com/wirepas/backend-client/tree/master/wirepas_backend_client/test\n\n[bcli_tools]: https://github.com/wirepas/backend-client/tree/master/wirepas_backend_client/tools\n\n[bcli_cli]: https://github.com/wirepas/backend-client/tree/master/wirepas_backend_client/cli.py\n\n[bcli_api_influx]: https://github.com/wirepas/backend-client/tree/master/wirepas_backend_client/api/influx\n\n[bcli_api_mqtt]: https://github.com/wirepas/backend-client/tree/master/wirepas_backend_client/api/mqtt\n\n[bcli_api_mysql]: https://github.com/wirepas/backend-client/tree/master/wirepas_backend_client/api/mysql\n\n[bcli_api_wnt]: https://github.com/wirepas/backend-client/tree/master/wirepas_backend_client/api/wnt\n\n[bcli_api_wpe]: https://github.com/wirepas/backend-client/tree/master/wirepas_backend_client/api/wpe\n\n[bcli_mesh_interfaces]: https://github.com/wirepas/backend-client/tree/master/wirepas_backend_client/mesh/interfaces\n\n[bcli_mesh_interfaces_mqtt]: https://github.com/wirepas/backend-client/tree/master/wirepas_backend_client/mesh/interfaces/mqtt.py\n\n[bcli_mesh_interfaces_remote_api]: https://github.com/wirepas/backend-client/tree/master/wirepas_backend_client/mesh/interfaces/remote_api.py\n\n[bcli_mesh_interfaces_beacon_api]: https://github.com/wirepas/backend-client/tree/master/wirepas_backend_client/mesh/interfaces/beacon_api.py\n\n[examples]: https://github.com/wirepas/backend-client/tree/master/examples\n\n[examples_mqtt_viewer]: https://github.com/wirepas/backend-client/blob/master/examples/mqtt_viewer.py\n\n[examples_find_all_nodes]: https://github.com/wirepas/backend-client/blob/master/examples/find_all_nodes.py\n\n[examples_influx_viewer]: https://github.com/wirepas/backend-client/blob/master/examples/influx_viewer.py\n\n[example_settings]: https://github.com/wirepas/backend-client/blob/master/examples/settings.yml\n\n[kpi_adv]: https://github.com/wirepas/backend-client/blob/master/wirepas_backend_client/test/kpi_adv.py\n\n[wm_gw_cli]: https://github.com/wirepas/backend-client/blob/master/wirepas_backend_client/cli.py\n\n[wm_wnt]: https://github.com/wirepas/backend-client/blob/master/wirepas_backend_client/api/wnt/__main__.py\n\n[wm_wpe]: https://github.com/wirepas/backend-client/blob/master/wirepas_backend_client/api/wpe/__main__.py\n\n[backend_client_dockerhub]: https://hub.docker.com/r/wirepas/backend-client\n\n[backend_client_pypi]: https://pypi.org/project/wirepas-backend-client/\n\n[backend_client_rtd]: https://backend-client.readthedocs.io/en/latest/\n\n[backend_client_gh_issues]: https://github.com/wirepas/backend-client/issues\n\n[backend_client_gh_releases]: https://github.com/wirepas/backend-client/releases\n\n[backend_client_gh_milestones]: https://github.com/wirepas/backend-client/milestones\n\n[backend_client_gh_projects]: https://github.com/wirepas/backend-client/projects\n\n[here_img_overview]: https://github.com/wirepas/backend-client/blob/master/img/wm-backend-client-overview.png?raw=true\n\n[here_container]: https://github.com/wirepas/backend-client/tree/master/container\n\n[here_contribution]: https://github.com/wirepas/backend-client/blob/master/CONTRIBUTING.md\n\n[here_code_of_conduct]: https://github.com/wirepas/backend-client/blob/master/CODE_OF_CONDUCT.md\n\n[here_license]: https://github.com/wirepas/backend-client/blob/master/LICENSE\n\n[here_setup_entrypoints]: https://github.com/wirepas/backend-client/blob/d18adb2e7927f1d19bee1d739964072fcb737889/setup.py#L84\n\n[wirepas_cookbook_viz]: https://github.com/wirepas/tutorials/blob/master/cookbook/visualizations.md\n\n[wirepas_gateway]: https://github.com/wirepas/gateway\n\n[pipenv]: https://docs.pipenv.org/en/latest/\n\n[virtualenv]: https://virtualenv.pypa.io/en/latest/\n\n[docker]: https://www.docker.com\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/wirepas/backend-client", "keywords": "wirepas connectivity iot mesh", "license": "Apache-2", "maintainer": "", "maintainer_email": "", "name": "wirepas-backend-client", "package_url": "https://pypi.org/project/wirepas-backend-client/", "platform": "", "project_url": "https://pypi.org/project/wirepas-backend-client/", "project_urls": { "Homepage": "https://github.com/wirepas/backend-client" }, "release_url": "https://pypi.org/project/wirepas-backend-client/1.2.1/", "requires_dist": [ "PyYAML (==5.1.2)", "cbor2 (==4.1.2)", "fluent-logger (==0.9.3)", "influxdb (==5.2.3)", "mysqlclient (==1.4.4)", "paho-mqtt (==1.4.0)", "pandas (==0.25.1)", "websocket-client (==0.48.0)", "wirepas-messaging (==1.2.0)" ], "requires_python": "", "summary": "Interfaces to interact with Wirepas backend services.", "version": "1.2.1" }, "last_serial": 5911106, "releases": { "1.1.0": [ { "comment_text": "", "digests": { "md5": "767c9e33e73fcfeb4e1c9babbc5f2f52", "sha256": "fc9e9f699071090d80a7b18c4fa6b3c6d8343fde91977d13653f76a0ad76ae9c" }, "downloads": -1, "filename": "wirepas_backend_client-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "767c9e33e73fcfeb4e1c9babbc5f2f52", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 94661, "upload_time": "2019-03-27T11:50:48", "url": "https://files.pythonhosted.org/packages/71/b0/53951e6c800b6a129f49c53feb266ee215cbe7a0d9d4234ea4c3bba48e5b/wirepas_backend_client-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3871c943f4c28480419b9d272e6b5f75", "sha256": "14afc0524aa1c8897641ca22c8dc29ccca2bfae06c50a38567ff95c950789d5f" }, "downloads": -1, "filename": "wirepas_backend_client-1.1.0.tar.gz", "has_sig": false, "md5_digest": "3871c943f4c28480419b9d272e6b5f75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 64355, "upload_time": "2019-03-27T11:50:51", "url": "https://files.pythonhosted.org/packages/ae/27/8a7298efa9daf575349c54812969eff6b3707dc36e1d44f8aac4bc53cd50/wirepas_backend_client-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "e84a1df1af3e7c8f0ed17e7de09754bc", "sha256": "3613a17dbaca16823d5940229202b4de0b8396abc0770c8565980a23f777ad31" }, "downloads": -1, "filename": "wirepas_backend_client-1.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e84a1df1af3e7c8f0ed17e7de09754bc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 140817, "upload_time": "2019-09-20T07:14:32", "url": "https://files.pythonhosted.org/packages/68/3c/b4ce741df929c7cc0b2d0be71fe4927db231ac9b9862776647dfd1289c60/wirepas_backend_client-1.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d2565513cb035dbdfc747faaf8fbe1af", "sha256": "b1493bb784120610e73c84c407c6c0b4b10230b7afdb461e79495335448b6fe5" }, "downloads": -1, "filename": "wirepas_backend_client-1.2.0.tar.gz", "has_sig": false, "md5_digest": "d2565513cb035dbdfc747faaf8fbe1af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 103709, "upload_time": "2019-09-20T07:14:34", "url": "https://files.pythonhosted.org/packages/df/29/0e4d41af7f177d69fe341655133279831aa02b7974dba4acca921c90dfcf/wirepas_backend_client-1.2.0.tar.gz" } ], "1.2.0rc2": [ { "comment_text": "", "digests": { "md5": "3af139e5e68df313483ef74b25fb1965", "sha256": "f34f52d1d97d8a6f0d6c92c39c5afd72e9c89680bb583930afb7c0942794d4b4" }, "downloads": -1, "filename": "wirepas_backend_client-1.2.0rc2-py3-none-any.whl", "has_sig": false, "md5_digest": "3af139e5e68df313483ef74b25fb1965", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 126781, "upload_time": "2019-09-12T11:02:30", "url": "https://files.pythonhosted.org/packages/f5/44/50b3a9c580c06776c497ff32ce83d7dd12bfb2deaad63e321ed54fdbe77e/wirepas_backend_client-1.2.0rc2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2810ceff7747479d0bfcb336d062d851", "sha256": "8c19f03dfc179914da63d00e045a62357934ff4622ecdd0d02945bfe6a56b8ba" }, "downloads": -1, "filename": "wirepas_backend_client-1.2.0rc2.tar.gz", "has_sig": false, "md5_digest": "2810ceff7747479d0bfcb336d062d851", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 81868, "upload_time": "2019-09-12T11:02:32", "url": "https://files.pythonhosted.org/packages/77/df/e4467d5dbdeb155fc56a4f63c1698cc7709bd6ac16387bc3f7ddd3d94c4c/wirepas_backend_client-1.2.0rc2.tar.gz" } ], "1.2.0rc3": [ { "comment_text": "", "digests": { "md5": "d8e65bfe8a7477e890472aebb9bfce7c", "sha256": "e7821f74e4af21ad4528582c747b19d70bf4d387bcacfba747f0a4d13c7e9402" }, "downloads": -1, "filename": "wirepas_backend_client-1.2.0rc3-py3-none-any.whl", "has_sig": false, "md5_digest": "d8e65bfe8a7477e890472aebb9bfce7c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 127740, "upload_time": "2019-09-17T09:41:16", "url": "https://files.pythonhosted.org/packages/e8/34/9c2846434bf1266cf9ab750af57ff51f7ae240ee64f5c0a239ae746ee3df/wirepas_backend_client-1.2.0rc3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a0e838df28ca3e41e90846fe3018f08b", "sha256": "706bfaa0bf5e58fc40af61c8f4c694bfde530ed45470422f4a7e151d6078d113" }, "downloads": -1, "filename": "wirepas_backend_client-1.2.0rc3.tar.gz", "has_sig": false, "md5_digest": "a0e838df28ca3e41e90846fe3018f08b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 82984, "upload_time": "2019-09-17T09:41:18", "url": "https://files.pythonhosted.org/packages/a7/26/c480d0ce37ce853a71668eb633868131e1baaeaa52f8aba29acea0cfe085/wirepas_backend_client-1.2.0rc3.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "23c8e535dfdcef08ac50f3adaff4f1fc", "sha256": "fe600c0ef73f601bf274efd8372e308494a1fbbbbe565b3ef283d8c1047d4482" }, "downloads": -1, "filename": "wirepas_backend_client-1.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "23c8e535dfdcef08ac50f3adaff4f1fc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 140862, "upload_time": "2019-10-01T08:31:17", "url": "https://files.pythonhosted.org/packages/3e/0f/28fedbea0a790861a863035328d513fe4e0928de48b16aeb986631c5ad9e/wirepas_backend_client-1.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "17acd29467f6423e77e2405c7cb2568a", "sha256": "64e1986a953c6905390b0f8f197dc75547e0780d346ad1f857ebc10c329bdd9d" }, "downloads": -1, "filename": "wirepas_backend_client-1.2.1.tar.gz", "has_sig": false, "md5_digest": "17acd29467f6423e77e2405c7cb2568a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 103756, "upload_time": "2019-10-01T08:31:20", "url": "https://files.pythonhosted.org/packages/e1/40/bd62e30e3dec99b84e66e69c8bc6a941bd7a00e21940530a8a93c073246c/wirepas_backend_client-1.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "23c8e535dfdcef08ac50f3adaff4f1fc", "sha256": "fe600c0ef73f601bf274efd8372e308494a1fbbbbe565b3ef283d8c1047d4482" }, "downloads": -1, "filename": "wirepas_backend_client-1.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "23c8e535dfdcef08ac50f3adaff4f1fc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 140862, "upload_time": "2019-10-01T08:31:17", "url": "https://files.pythonhosted.org/packages/3e/0f/28fedbea0a790861a863035328d513fe4e0928de48b16aeb986631c5ad9e/wirepas_backend_client-1.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "17acd29467f6423e77e2405c7cb2568a", "sha256": "64e1986a953c6905390b0f8f197dc75547e0780d346ad1f857ebc10c329bdd9d" }, "downloads": -1, "filename": "wirepas_backend_client-1.2.1.tar.gz", "has_sig": false, "md5_digest": "17acd29467f6423e77e2405c7cb2568a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 103756, "upload_time": "2019-10-01T08:31:20", "url": "https://files.pythonhosted.org/packages/e1/40/bd62e30e3dec99b84e66e69c8bc6a941bd7a00e21940530a8a93c073246c/wirepas_backend_client-1.2.1.tar.gz" } ] }