You are using an unsupported browser!

Please upgrade your version of IE to at least 9, or use a modern browser such as Chrome or Firefox.

Sending Configuration Commands - Overview

The following guide demonstrates the fundamental configuration commands required to configure NCD Enterprise Low-Power Long Range Wireless Sensors.  A Wireless Modem will be required to configure NCD wireless sensors over a wireless connection.  The examples shown below assume you have knowledge of DigiMesh® API Packet Structure, including MAC addresses and checksum calculations.  We STRONGLY ADVISE using NCD Alpha Station software to configure sensors; however, if integration of sensor configuration is absolutely required, the commands shown below may be used.  Please note that you MUST change the MAC address (shown in the API frames below 00 13 A2 00 41 91 1B 83) to match the MAC address of your sensor, you must also re-calculate the checksum (the last byte of the API frame) to include the new MAC address.  Additionally, the PAN id MUST be set to 0x7BCD.  This PAN id is reserved for configuration ONLY, and may not be used for daily operation.  If at anytime you would like to see a working sample of configuration, please download the latest version of Alpha Station and examine the included source code.  Alpha Station runs under Microsoft Visual Studio Community Edition, and is a FREE download from Microsoft.  Alpha Station handles all configuration commands automatically and is capable of configuring every device that has been discovered.  The commands shown below are explained in greater detail within product manuals, this guide is a summary overview of all configuration command samples.  Also note that configuration commands cannot be sent to NCD wireless sensors while in run mode.  Each sensor must be placed in configuration mode, which will drain the battery very quickly.  Be SURE to execute these commands quickly and return each sensor to RUN mode to preserve battery life.  Optionally, NCD wireless sensors may be powered from a external power supply during configuration.

Enter Configuration Mode

Step 1 : Power up the sensor.

Step 2: Every sensor has 2 buttons: Reset and Configuration (RST and CFG).  Enter configuration mode by holding both buttons down.  Next, release the reset button.  Wait 6 seconds and release the CFG button.  The sensor will send a Configuration API frame, indicating it is in configuration mode.  The API frame will look similar to this:

7E 00 1C 90 00 13 A2 00 41 91 1B 83 FF FE C2 7A 00 00 00 23 00 00 50 47 4D 00 00 00 00 00 00 0A

Above command contains the sensor MAC address. This MAC address can be used to send future targeted commands to this particular sensor.

In the above case, the MAC address is 00 13 A2 00 41 91 1B 83

Note: Throughout this guide we will be sending data in broadcast mode and sensors ID and node ID will be set to 0. This is done to make these commands work with all the sensors and all the nodes. These commands can be used with all the sensors without any change. 

For optimal performance keep only one sensor in config mode at a time.

Reminder: During configuration mode, the sensor PAN id needs to be set as 0x7BCD. if you are using Alpha Station software, you don’t need to do this. Alpha Station software will do this automatically. 

Read Sleep Duration

 

This command can be used to read the sensor sleep duration.  The sleep duration determines how frequently the sensor wakes up and sends sensor data.  The interval is set in seconds.  Short intervals will drain the battery faster while longer intervals will provide a very long battery life.

Read Sleep Duration Command

7E 00 13 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F7 15 00 00 00 E8

In the above command the remote device address is set as broadcast. The address is  00 00 00 00 00 00 FF FF. If you are planning to send this command to a particular sensor, replace this with the MAC address of the sensor.  Again, the sensor MUST be in configuration mode.

The Wireless Sensor will respond with the stored delay value:

7E 00 1C 90 00 13 A2 00 41 91 1B 83 FF FE C1 7C 00 02 00 0E 00 00 00 02 58 00 00 00 00 00 00 A6

From the above command we can extract the following data

A. Sensor MAC address: 00 13 A2 00 41 91 1B 83

B. Sensor over all payload: 7C 00 02 00 0E 00 00 00 02 58 00 00 00 00 00 00

C. Delay Value: 0x00 0x02 0x58 (data bytes 23, 24, and 25)

Delay in Seconds = (0x00 x 65536) + (0x02 x 256) + 0x58 = 600 Seconds = 10 Minutes

Set Sensor Node ID and Sleep Duration

This Command can be used to set the sensor node and sleep duration, note that both values are stored together using the same command.

Set Node ID and Sleep Duration Command Example:

7E 00 17 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F7 02 00 00 00 01 00 01 2C CD

In the above command, the remote device address is set as broadcast. The address is  00 00 00 00 00 00 FF FF. If you are planning to send this command to a particular sensor, replace this with the mac address of the sensor. The Command Contains Sensor payload which contains Sensor Node ID and Delay value.

Payload: F7 02 00 00 00 01 00 01 2C  

Note that F7 is the command header byte and 02 is the sub command for storing the Node ID and Sleep Duration. 

A. Node ID: 0x01 (Byte 23).

B. New Delay Value — 00 01 2C –(data bytes 24, 25, and 26)

Delay in seconds = (0x00 x 65536) + (0x01 x 256) + 0x2C = 300 Seconds = 5 Minutes

In the Above command we set the new node to 1 and sleep duration value to 300 seconds (5 Minutes).

Once the sensor receives this command, it will send a response back. This response will contain the info regarding command success or failure.

In his case, the response will look something like this:

7E 00 1C 90 00 13 A2 00 41 91 1B 83 FF FE C1 7C 01 05 00 0E 00 00 FF 00 00 00 00 00 00 00 00 FD

Read Sensor Network ID

The Network ID is also known as PAN ID. This feature can be used to build a private Wireless Sensor Network. All sensors with same network ID will be able to talk to one gateway with the same Network ID.  This is a extremely useful feature when you need to deploy hundreds of sensors in one area or if you want to divide the factory floor in few different zones and monitor each zone independently.  Each zone and gateway/modem should be assigned the same Network ID, allowing the separation of sensors into smaller, more manageable groups.  For instance, a large factory floor should consist of several groups of sensors working under different Network IDs that help characterize the different areas of the factory.  Network IDs allow you to build these groups easily.  When broadcasting data using separate Network IDs, multiple gateways may be used in each zone, allowing sensor data to be collected by several different computers or servers.  This kind of redundancy is essential in large installations.

Read Sensor Network ID Command:

7E 00 13 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F7 19 00 00 00 E4

Sensor will respond with the Network ID:

7E 00 1C 90 00 13 A2 00 41 91 1B 83 FF FE C1 7C 00 05 00 0E 00 00 7F FF 00 00 00 00 00 00 00 7F

From the above response, we can extract the following data:

A. Sensor MAC address: 00 13 A2 00 41 91 1B 83

B. Sensor over all payload:

7C 00 05 00 0E 00 00 7F FF 00 00 00 00 00 00 00

C. Network ID: 0x07FF (data bytes 23 and 24)

Set Wireless Sensor Network ID

This command can be used to set the private sensor network ID.  Please note, Network ID 0x7BCD is reserved for configuration and should NEVER be used as a network ID for general use.

Set Wireless Sensor Network ID Command:

7E 00 15 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F7 05 00 00 00 7C DE 9E

Above Command Contains the following payload:  F7 05 00 00 00 7C DE

Note that F7 is the command header byte and 05 is the sub command for setting the Sensor Network ID. 

In the Above command we set the new network ID to 0x7CDE.

Once the sensor receives this command, it will send a response back. This response will contain information regarding command success or failure.

In his case the response was successful, responding with the following frame:

7E 00 1C 90 00 13 A2 00 41 91 1B 83 FF FE C1 7C 00 09 00 0E 00 00 FF 00 00 00 00 00 00 00 00 FA

Read Sensor Destination Address

This Command can be used to read the sensor destination address. When the Sensor is in broadcast mode, the destination address will show up as 0x0000FFFF.

This Command can be used to read the sensor destination address.

Read Sensor destination address Command:

7E 00 13 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F7 18 00 00 00 E5

Sensor will respond with the Stored destination address: 

7E 00 1C 90 00 13 A2 00 41 91 1B 83 FF FE C1 7C 00 13 00 0E 00 00 00 00 FF FF 00 00 00 00 00 F1

From the above command, we can extract the following data:

A. Sensor over all payload: 7C 00 13 00 0E 00 00 00 00 FF FF 00 00 00 00 00

B. Sensor MAC address: 00 13 A2 00 41 91 1B 83

C. Destination Address: 0000FFFF (data bytes 23, 24, 25, and 26)

The sensor response 0000FFFF  indicates that the sensor is in broadcast mode.  Any other value will indicate the sensor is directing its data to a specific address.  We DO NOT ADVISE sending sensor data to a specific address, we advise broadcasting data using different Network IDs (PAN IDs) to put data into clustered zones.  Should a specific gateway or modem fail while in service, it will be much easier to deploy a new gateway.  Otherwise, you will need to reconfigure each sensor to a new gateway or modem.

Set Sensor Destination Address

Every sensor is designed to send sensor data either in broadcast mode or to a particular destination address.

This command can be used to set the particular destination address. We do not recommend use of this command. The reason behind this is, lets say you have 100 sensors and all sensors are sending data to fix destination address. Should a problem arise and the destination modem quits working, you will need to get a new modem, which will have a different address from the old modem. Due to the address differences between the old modem and the new modem, the new modem will NOT receive any sensor data. You will have to re-program all sensors with new destination address.  Again, we STRONGLY ADVISE using Network IDs (PAD IDs), to build Broadcast Zones.  

What is Destination Address?  Every sensor and gateway modem has a wireless module and every wireless module has a MAC address. This MAC address is also known has the destination address.  By default, all sensors send data in broadcast mode.  This allows all the gateways and modems in the area to receive the sensors data give the condition that modem has the same PAN ID and encryption key as the sensors.

When you store a destination address the sensor will send data to that destination address only.  The sensor CANNOT communicate with any other modem in the area.  The following command allows you to specify a destination address for all data: 

Set Destination address Command:

This command we will send only the lower 4 bytes of the destination address (the upper 4 bytes do not change). 

7E 00 17 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F7 03 00 00 00 12 34 56 78 E6

Above Command Contains the payload, including a New Sensor destination address:

Complete Payload: F7 03 00 00 00 12 34 56 78 

F7 is the command header byte and 03 is the sub command for setting a new destination address.

A. New Destination Address: 12345678 (data bytes 23, 24, and 25)

In the Above command we set the new destination address to 12345678.

Once sensor receives this command it will send a response back. This response will contain the info regarding command success or failure.

In his case the response was successful and will look something like this:

7E 00 1C 90 00 13 A2 00 41 91 1B 83 FF FE C1 7C 00 0E 00 0E 00 00 FF 00 00 00 00 00 00 00 00 F5

Set Sensor Destination to Broadcast

This Command can be used to set the sensor destination address to broadcast mode. After setting to broadcast mode, all the modems with the same PAN id and Encryption key will receive the sensor data.  This is HIGHLY RECOMMENDED configuration:

Set Sensor Destination address to broadcast:

7E 00 13 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F7 01 00 00 00 FC

Complete Payload: F7 01 00 00 00

 F7 is the command header byte and 01 is the sub command for setting the Destination Address to Broadcast Mode.

Read Wireless Sensor Transmission Power Level

This Command can be used to read the wireless radio transmission power. This value will indicate how much power the radio is putting out. Higher the value, higher the power wireless radio will be sending, resulting in a longer range.  Lower values are desirable as this can greatly improve battery life, especially when high power data transmissions are not required.

Read Sensor Power Command:

7E 00 13 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F7 16 00 00 00 E7

Sensor will respond with the Power Level value:

7E 00 1C 90 00 13 A2 00 41 91 1B 83 FF FE C1 7C 00 09 00 0E 00 00 04 00 00 00 00 00 00 00 00 F5

From the above command we can extract the following data

A. Sensor MAC address: 00 13 A2 00 41 91 1B 83

B. Sensor payload:  7C 00 09 00 0E 00 00 04 00 00 00 00 00 00 00 00

C. Power Level 0x04 (data byte 23)

The sensor will send a value from 0x00 to 0x04.  The default value is 0x04, allowing for the greatest possible transmission range and the shortest battery life.

Set Wireless Sensor Transmission Power Level

This command can be used to change the sensor transmission power. The default value is 4 which means the highest transmission power and shortest battery life. If you set this value lower, it will reduce the wireless range and improve battery life. 

You can set this value lower if the sensor and receiver modem are in close proximity. 

This Command can be used to change the wireless module power level:

7E 00 14 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F7 04 00 00 00 03 F6

Above Command Contains Sensor payload which contains new power level value.

Complete Payload: F7 04 00 00 00 03

F7 is the command header byte and 04 is the sub command for setting the Sensor Transmit Power Level.

In the Above command, we set the new power level to 3 (byte 23).

Once the sensor receives this command, it will send a response back. This response will contain the info regarding command success or failure.

In his case the response was successful:

7E 00 1C 90 00 13 A2 00 41 91 1B 83 FF FE C1 7C 00 19 00 0E 00 00 FF 00 00 00 00 00 00 00 00 EA

Read Wireless Sensor Retries

This command can be used to read number of retires.  The number of retries is one of the most useful settings for NCD wireless sensors.  Lets say the number of retires is set to 5. In a normal case, the sensor will wake up, gather data, send data to the modem, and go back to sleep.  But due to some environmental issues (lets say a few trucks were driving by and they came in between the sensor and the modem) the modem didn’t receive the data. In that case, the sensor will try 4 more times to send the data.  If the modem still doesn’t get the data after all 5 tries, the sensor will quite trying and will go back to sleep.  The sensor will wake up after the predefined sleep time and will try again. 

The highest number of retries allowed is 10.

Read The number of Sensor Retries:

7E 00 13 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F7 17 00 00 00 E6

Sensor will respond with the Retries value: 

7E 00 1C 90 00 13 A2 00 41 91 1B 83 FF FE C1 7C 00 1B 00 0E 00 00 0A 00 00 00 00 00 00 00 00 DD

From the above command, we can extract the following data:

A. Sensor MAC address: 00 13 A2 00 41 91 1B 83

B. Sensor over all payload:  7C 00 1B 00 0E 00 00 0A 00 00 00 00 00 00 00 00

C. Retries Number: 0x0A (data byte 23)

 

Set Wireless Sensor number of Retries

This Command can be used to set the number of retries.  The highest number of retries allowed is 10.

This Command can be used to change the number of retries:

7E 00 14 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F7 06 00 00 00 05 F2

The above Command Contains a Sensor payload which contains a new number of retries value:

Complete Payload: F7 06 00 00 00 05 

F7 is the command header byte and 06 is the sub command for setting the Retries value.

In the Above command we set the retries value to 5 (byte 23).

Once the sensor receives this command, it will send a response back. This response will contain the info regarding command success or failure.

In his case the response was successful:

7E 00 1C 90 00 13 A2 00 41 91 1B 83 FF FE C1 7C 00 1D 00 0E 00 00 FF 00 00 00 00 00 00 00 00 E6

Set Wireless Sensor Encryption Key

This Command can be used to set the encryption key. 

All ncd.io wireless sensors comes with 128bit AES encryption. This encryption can be used to secure your wireless sensor networks. Once you set the key make sure you keep a copy of the key. The can only be set, it can not be read.

Once you set the sensor encryption key set the same key to the Modem. If the modem doesn’t have the same key and PAN id as the sensor than they wont be able to communicate to each other. 

©2019 National Control Devices, LLC

ncd.io

Made in the USA
5 Year Warranty
Free Shipping on orders over $100
Free Shipping on orders over $100

To learn something new, take the path that you took yesterday. ~John Burroughs

*

Log in with your credentials

or    

Forgot your details?

Create Account