Caution! Article for developers

Information on this page is intended particularly for users with advanced technical knowledge.

Change the Wirepas Network Parameters

Jul 30, 2024 · 5 minutes to read

Treon Gateway Treon Gateway 2 Treon Gateway in Protective Enclosure

Introduction

Please note: This article is for Treon Gateways with a Treon Aito release version of 6.0 or higher and a Wirepas network release version 5.x.

Please note: Make sure you know what network you are changing your devices to. There is no possible way to hardware reset the Nodes to undo the changes afterwards!

First you will have to connect to the Treon Gateway via SSH. You need root user rights which you can acquire by typing ‘sudo -i’ in the command interface. This example shows you how to move your Treon Gateway and the connected nodes to another Wirepas network.

First you should check that all the nodes are currently connected to the Treon Gateway. (See How to check the Node data flow) Only then should you change the network, channel, keys etc. of your nodes. As the last step, move the Treon Gateway to the same network as the nodes.

 

Configuring the nodes

To configure the nodes, the script located in “python3 /opt/nodeconfig/remote_command.py -h” needs to be used.

Example:

Command to read the network address:

python3 /opt/nodeconfig/remote_command.py -r 2

Command to change the node with the id ‘1234abcd’ to network ‘12345678’ in channel ‘26’ with the encryption key disabled:

python3 /opt/nodeconfig/remote_command.py -w 2=12345678,3=26,13=ffffffffffffffffffffffffffffffff, 14=ffffffffffffffffffffffffffffffff -i 1234abcd

 

Configuring Treon Gateway

Use the command configure_sink, which requires sudo as first step to make changes to the Treon Gateway. The main commands to use are r- to read the current configuration and -r –json if you want it in JSON format.

You can use -h for help and explanations.

Apply a new configuration with -c FILE.JSON. There is an example configuration in /usr/treon/wirepas/node_config.json, this file can be copied to a different folder and edit there. Any field missing in the json should be left as it was.

The most important fields needed are:

{
“network_address”: “12345678”,
“network_channel”: “26”,
“cipher_key”:“ffffffffffffffffffffffffffffffff”,
“authentication_key”:“ffffffffffffffffffffffffffffffff”
}

For the cipher_key and the authentification_key, if 32 times the letter f is used, the result is equivalent to disabling the encryption key.

CommandDescription
-hHelp
-rRead the values
-wWrite
-iSpecify a target

 

The most likely values to be used here are:

FieldValue
network_address2
network_channel3
cipher_key13
authentication_key14

 

Routing nodes & Non-routing nodes

A Treon Industrial Node can be either routing, meaning it forwards data from other nodes within the mesh network, or non-routing.

By default, all Treon Industrial Nodes are routing.

To set a node to non-routing, the node role attribute needs to be changed. By default, the attribute has a value of 130 (0x82). To set a node to non-routing, it needs to be changed to 0x03.

After connecting to the Treon Gateway via SSH, enter the following command to read the current value of the attribute:

sudo /opt/nodeconfig/remote_command.py -r 4 -i BROADCAST

In order to changes the value of the attribute, type:

sudo /opt/nodeconfig/remote_command.py -w 4=3 -a WIREPAS_ADDRESS

To figure out the Wirepas address from the previous broadcast, use to specifically request it:
sudo /opt/nodeconfig/remote_command.py -r 1 -i BROADCAST

Please note: It is recommended not to use broadcast when writing but it can be done.

 

Remove the Encryption Keys

In case is needed to remove the Wirepas encryption keys on the Industrial Nodes, first you need to log into the Treon Gateway with SSH.

Then you need to confirm that the iotgw service is on, you can use the following command:

systemctl start iotgw

After waiting at least 30 seconds, you need to verify that the Industrial Nodes are connected to the Gateway with:

sudo python3 /opt/nodeconfig/remote_command.py -r 1 -t 60 -i BROADCAST

If all the nodes you were expecting reported back, proceed. Otherwise increase the timer (-t 60) or verify all the nodes are turned on.

NOTE: if you didn’t find all nodes before proceeding can change only some of the nodes. If you had to increase the timer for a big network, you will need to increase the timer (-t 120) and the delay (-d 60) by the same amount!

The command to remove the encryption keys from the Industrial Nodes is:

sudo python3 /opt/nodeconfig/remote_command.py -w 13=ffffffffffffffffffffffffffffffff,14=ffffffffffffffffffffffffffffffff -t 120 -d 60 -i BROADCAST

Finally, you will have to remove the encryption keys from the Treon Gateway as well:

echo ‘{“cipher_key”:”ffffffffffffffffffffffffffffffff”,”authentication_key”:”ffffffffffffffffffffffffffffffff”}’ > /tmp/wp_network;sudo /usr/sbin/configure_sink -x -c /tmp/wp_network

 

Treon Support

You still have questions? Our dedicated team of experts is happy to help you! Please contact Treon Support directly by e-mail.

Did you know? Treon offers Premium Support and Maintenance Packages for our customers. Get even more out of Treon and boost your sales - inquire now about features and prices!

   


Was this article helpful? Let us know.