Configuring Sink via CLI on Gateway

This guide provides instructions for configuring the sink on the gateway via the CLI.

Prerequisites

This guide assumes you have already:

  1. Connected to the gateway.

  2. Installed the Wirepas gateway services on the gateway.

  3. Connected the sink to the gateway.

If these prerequisites are met, you can proceed with the configuration.

Getting the Docker Volume Name

First, identify the Docker volume name associated with the Dbus service:

$ docker volume ls | grep "dbus"
docker volume ls | grep "dbus"
local                       docker-compose_dbus-volume

The output (e.g., docker-compose_dbus-volume) will be used in subsequent commands.

Command for setting the parameters

Use the volume name in the below command, replacing <name_of_the_volume> , in the example case the name is “docker- compose_dbus-volume” and replace the <command-extension> with the any of the arguments shown below in the screenshot, and -h is used as <command-extension> here to list all available commands.

$ docker run --rm -v <name_of_the_volume>:/var/run/dbus wirepas/gateway_transport_service wm-node-conf {list,set} <command-extension>

Listing the sinks on the gateway

The sinks that are connected to the gateway and their configurations can be listed by executed by the command:

$  docker run --rm -v single_transport_dbus-volume:/var/run/dbus wirepas/gateway_transport_service wm-node-conf list
docker run --rm -v single_transport_dbus-volume:/var/run/dbus wirepas/gateway_transport_service wm-node-conf list
List of sinks:
============== [sink1] ===============
[sink_id]: sink1
[started]: True
[node_address]: 1
[node_role]: SINK, CSMA_CA
[network_address]: 1001
[network_channel]: 1
[max_ac]: 8000
[min_ac]: 2000
[max_ac_cur]: 8000
[min_ac_cur]: 2000
[max_ch]: 40
[min_ch]: 1
[max_mtu]: 102
[hw_magic]: 6
[stack_profile]: 1
[firmware_version]: [5, 3, 0, 89]
[app_config_max_size]: 80
[are_keys_set]: False
[app_config_seq]: 0
[app_config_diag]: 0
[app_config_data]: b'0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
[stored_status]: ScratchpadStatus.SCRATCHPAD_STATUS_SUCCESS
[stored_type]: ScratchpadType.SCRATCHPAD_TYPE_BLANK
[stored_scratchpad]: {'seq': 0, 'crc': 0, 'len': 0}
[processed_scratchpad]: {'seq': 255, 'crc': 65535, 'len': 16}
[firmware_area_id]: 262
[target_and_action]: {'action': <ScratchpadAction.ACTION_NO_OTAP: 1>, 'target_sequence': 0, 'target_crc': 0, 'param': 0}
[cost]: 0
===================================

It is important to run this command before the user starts configuration because the user know the sink_id, and should be used in the commands for configuring the sink, so that the system will know which sink the user wants to talk to when there are 1 or more sink(s) on a gateway.

Warning

Please make sure that you stop the sink services before starting to re-configure the parameters. However, if the user is configuring the sink for the first time, the stack on the sink is already stopped.

Setting the Node address

This command will help you to set the address of the node. <name_of_the_volume> - Replace with the name of the volume <node_address> - Replace with integer number for the address of the node you want to configure. <sink_id> - Replace with id of the sink that is to be configured.

$ docker run --rm -v <name_of_the_volume>:/var/run/dbus wirepas/gateway_transport_service wm-node-conf set -n <node_address> -s <sink_id>
Configuration done with result = GatewayResultCode.GW_RES_OK

Setting the Network address

This command will help you set the address of the network.

$ docker run --rm -v dual_transport_dbus-volume:/var/run/dbus wirepas/gateway_transport_service wm-node-conf set -N 2bbba2 -c 10 -s sink1

<name_of_the_volume> - Replace with the name of the volume.

<network_address> - Network address as an int. Ex: -N 0xA1B2C3 or -N 123456

<sink_id> - Replace with id of the sink that is to be configured.

After a successful configuration the message with text like below pops up

Configuration done with result = GatewayResultCode.GW_RES_OK

Setting the Network channel

$ docker run --rm -v <name_of_the_volume>:/var/run/dbus wirepas/gateway_transport_service wm-node-conf set -c <network_channel> -s <sink_id>

<name_of_the_volume> - Replace with the name of the volume.

<network_channel> - Network channel as an int. Ex: -c 5

<sink_id> - Replace with id of the sink that is to be configured.

After a successful configuration the message with text like below pops up

Configuration done with result = GatewayResultCode.GW_RES_OK

Setting the Authentication key

$ docker run --rm -v <name_of_the_volume>:/var/run/dbus wirepas/gateway_transport_service wm-node-conf set -ak <authentication_key> -s <sink_id>

<name_of_the_volume> - Replace with the name of the volume.

<authentication_key> - Network wide 128 bytes authentication key. Ex: -ak 112233445566778899AABBCCDDEEFF11 or -ak 11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,11

<sink_id> - Replace with id of the sink that is to be configured.

After a successful configuration the message with text like below pops up

Configuration done with result = GatewayResultCode.GW_RES_OK

Setting the Cipher key

$ docker run --rm -v <name_of_the_volume>:/var/run/dbus wirepas/gateway_transport_service wm-node-conf set -ck <cipher_key> -s <sink_id>

<name_of_the_volume> - Replace with the name of the volume.

<cipher_key> - Network wide cipher key. Ex: -ck 112233445566778899AABBCCDDEEFF11 or -ck 11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,11

<sink_id> - Replace with id of the sink that is to be configured.

After a successful configuration the message with text like below pops up

Configuration done with result = GatewayResultCode.GW_RES_OK

Starting/Stopping the sink

$ docker run --rm -v <name_of_the_volume>:/var/run/dbus wirepas/gateway_transport_service wm-node-conf set -S <bool> -s <sink_id>

<name_of_the_volume> - Replace with the name of the volume.

<bool> - True/False to start/stop sink. Ex: -S true

<sink_id> - Replace with id of the sink that is to be configured.

After a successful configuration the message with text like below pops up

Configuration done with result = GatewayResultCode.GW_RES_OK