Package: wirepas-provisioning
Wirepas Provisioning ServerIntroductionThis is the reference implemantation of the Wirepas provisioning server. It provides an example of the server side of Wirepas
Provisioning Protocol. It must be used with theprovisioning_joining_nodeapplication of the SDK. Please refer to the
provisioning reference manual for further information.InstallationHost dependenciesThe main requirements of Provisioning Server are:Python 3.7Pip3 (we recommend the latest available)Installing from PyPiThe Provisioning Server is available fromPyPiand you can install the
latest stable version with:pip3installwirepas-provisioningIf you wish to install a particular version please see the release history from PyPi.Installing from GithubFirst of all, make sure to clone the repository using the https address.Checkout thegit tag that corresponds to the release versionyou want
to install and install the package with:pip3install.If you want to develop or patch a bug under your local environment, you can install the package in development mode through:pip3install-e.When installed in development mode, changes to the source files will be immediately visible.UsageOnce installed, the Provisioning Server will be accessible through wm-prov-srv.
It requires few parameters to run:The Mqtt broker credentials the server will connect to.A configuration file containing a list of nodes authorized to provision and their associated data. An example is availableherewm-prov-srv--hostmy_server.com\--port8883\--usernamemy_username\--passwordmy_password\--configexamples/provisioning_config.ymlBuilding and running over DockerDocker allows application to run on a sandbox containing all the dependencies needed to run and execute them.
If you are not familiar with Docker, please refer to the official documentation atdocker.com.DockerhubProvisioning server builds are available from dockerhub under theProvisioning server registry.The latest tag points to the current stable release, whereas the edge tag points to the top of master. The latest tag is built
automatically at dockerhub whenever this repository is tagged. The edge tag is built after each single merge into master.To pull the Provisioning server image from dockerhub use:dockerpullwirepas/provisioning-server:latestdockerpullwirepas/provisioning-server:<tag>Running with dockerAs the container will have no access to your local environment, you will have o propagate the input parameters through env
variables and by mounting theprovisioning_config.ymlfile inside the container.To run it with docker type:dockerrun-v$(pwd)/examples/provisioning_config.yml:/home/wirepas/wm-provisioning/vars/settings.yml\-eWM_SERVICES_MQTT_HOSTNAME=my_server.com\-eWM_SERVICES_MQTT_PORT=8883\-eWM_SERVICES_MQTT_USERNAME=username\-eWM_SERVICES_MQTT_PASSWORD=password\wirepas/provisioning-serverRunning with composeTo run the Provisioning Server using docker compose, you will have to modify thetemplatefile to fit your environment.
Environment must be customized to fit your mqtt broker parameters:environment:
  WM_SERVICES_MQTT_HOSTNAME: "my_server.com"
  WM_SERVICES_MQTT_PORT: "8883"
  WM_SERVICES_MQTT_USERNAME: "username"
  WM_SERVICES_MQTT_PASSWORD: "password"And the path of the configuration file path must be specified. Example if your config is located in /home/user/provisioning_config.ymlvolumes:
    - /home/user/provisioning_config.yml:/home/wirepas/wm-provisioning/vars/settings.ymlIn the folder where you stored the customized file, please run:docker-composeup-dYou can see the logs with:docker-composelogsAnd stop the gateway with:docker-composedownThe tag to use for the provisioning server images can be chosen when invoking the docker-compose (by default it is latest tag).PROV_SRV_TAG=edgedocker-composeup-dBuilding the image locallyTo build the image locally in the root of the repo type:dockerbuild-fdocker/Dockerfile-tprovisioning-server.Alternatively you can also build using the docker-compose.yml present in
the root of the directory:docker-compose-fdocker/docker-compose.ymlbuildLicenseLicensed under the Apache License, Version 2.0.