Standalone Smart Vibration Sensor V4 API Overview

Device Overview

Introducing NCD’s Explore the Standalone Smart Vibration Sensor V4 Capabilities. Lightweight rugged and reliable for accurate asset monitoring and boasting up to a 2-mile range using a wireless mesh networking architecture & Incorporating a 16-bit Vibration and integrated Temperature sensor.

This sensor combines these data with temperature data in a data packet, and transmits the result to modems and gateways within wireless range.  Once transmission is complete, the vibration sensor goes back to sleep, thus minimizing power consumption.

Features:

  • Small & lightweight for ease of installation.
  • IP65 rated sealed enclosure for dust &
    moisture protection.
  • D-cell battery for long-lasting operation.
  • A versatile user-configurable sample rate for slow or fast-running machines
  • Integrated temperature sensor in base.
  • In-Built Machine Learning optimizes power consumption.
  • Asset On-Time Calculator automatically tracks operational status.
  • Hardware Accelerator enhances vibration sampling accuracy.
  • Available Frequencies – 900Mhz, 868Mhz, and 2.4Ghz
  • Supports MESH networking via DigiMesh
  • Fully open Node-RED library for configuration and data ingestion

Frame Structure

Frame Communication at Power Up

When the device powers up, depending on the mode it is going to work in, it will have a different Power Up Frame 

Figure 3 provides an outline of the frame structure at Power Up, where the bytes highlighted in Red denote which mode the device has started in (Run, Configuration or Factory Default). You can look up the corresponding codes in Table 2.

If we further examine the Payload, we can use the Node ID and Sensor Type fields to determine the exact sensor that is sending the data.

A shown in the second column in Table 2, the sensor configures its PAN ID automatically depending upon the mode it is working in. During factory reset it sets the PAN ID to the value given in table therefore the factory reset frame will only be received if your Modem/Gateway PAN ID matches this ID. All 3 types of frames are shown in Figure 3, Figure 4 and Figure 5.

Figure 3: Communication Procedure - Power Up
Mode TypePAN ID set by Sensor (ASCII)Frame fieldOffset (Payload section)Value
RunID save by user / DefaultMode bytes70x52
80x55
90x4E
Configuration7BCDMode bytes70x50
80x47
90x4D
Factory Reset7FFFMode bytes70x50
80x55
90x4D

Let us look at the 3 possible power up frames to give an example:

Run Mode Frame

FieldNumber of bytesDescription
7E 00 1C 90 00 13 A2 00 42 53 64 53 FF FE C2 7A 00 00 00 72 00 00 52 55 4E 00 00 00 00 00 00 CEExample frame
0x7E1Delimiter
0x001C2Length
0x901Frame Type (Power Up)
0x0013A200425364538Source Address
0xFFFE2Reserved
0xC21R. Option
0x7A1Header with Power Up value
0x001Node ID
0x001Separator
0x00722Sensor Type
0x00002Separator
0x52554E3Mode Byte for Run Mode
0x0000000000006Reserved
0xCE1Checksum

Configuration Mode Frame

FieldNumber of bytesDescription
7E 00 1C 90 00 13 A2 00 42 53 64 53 FF FE C2 7A 00 00 00 72 00 00 50 47 4D 00 00 00 00 00 00 DFExample frame
0x7E1Delimiter
0x001C2Length
0x901Frame Type
0x0013A200425364538Source Address
0xFFFE2Reserved
0xC21R. Option
0x7A1Header
0x001Node ID
0x001Separator
0x00722Sensor Type
0x00002Separator
0x50474D3Mode Byte for Configuration Mode
0x0000000000006Reserved
0xDF1Checksum

Factory Reset Mode Frame

FieldNumber of bytesDescription
7E 00 1C 90 00 13 A2 00 42 53 64 53 FF FE C2 7A 00 00 00 72 00 00 50 55 4D 00 00 00 00 00 00 D1Example frame
0x7E1Delimiter
0x001C2Length
0x901Frame Type
0x0013A200425364538Source Address
0xFFFE2Reserved
0xC21R. Option
0x7A1Header
0x001Node ID
0x001Separator
0x00722Sensor Type
0x00002Separator
0x50554D3Mode Byte for Factory Reset Mode
0x0000000000006Reserved
0xD11Checksum

OTN Mode Frame

FieldNumber of bytesDescription
7E 00 1C 90 00 13 A2 00 42 53 64 53 FF FE C2 7A 00 00 00 72 00 00 4F 54 4E 00 00 00 00 00 00 D2Example frame
0x7E1Delimiter
0x001C2Length
0x901Frame Type
0x0013A200425364538Source Address
0xFFFE2Reserved
0xC21R. Option
0x7A1Header
0x001Node ID
0x001Separator
0x00722Sensor Type
0x00002Separator
0x4F544E3Mode Byte for OTN Mode
0x0000000000006Reserved
0xD21Checksum

FLY Mode Frame

FieldNumber of bytesDescription
7E 00 3E 90 00 13 A2 00 42 53 64 53 FF FE C2 7F 00 01 00 00 00 00 72 01 46 4C 59 00 00 FF FF 03 0A 14 01 00 04 02 01 14 03 02 01 00 00 FF FF 00 03 0A 00 00 00 01 55 95 0B 00 00 00 00 00 00 00 73 1CExample frame
0x7E1Delimiter
0x001C2Length
0x901Frame Type
0x0013A200425364538Source Address
0xFFFE2Reserved
0x001R. Option
0x7F1Header
0x001Node ID
0x011Firmware Version
0x00002Battery Voltage
0x001Counter
0x00722Sensor Type
0x001Reserved
0x464C593Mode Byte for FLY Mode
0x0000FFFF4Dest. Address
0x031Mode of operation
0x0A1ODR
0x141Sampling Duration
0x011Filter Status
0x001Low Freq SR
0x041High Freq SR
0x021Sampling Interval
0x011Raw on Request Timeout
0x141Dead Band
0x031Raw Packet Length
0x021FSR
0x011RPM Compute Status
0x0000FFFF4Auto Raw Dest. Address
0x001Auto Raw Interval
0x031Smart Mode Skip Counter
0x0A1Smart Mode Acceleration Threshold
0x000000014Uptime Counter
0x55950B3Hardware ID
0x000000004Reserved
0x000000734Tx Lifetime Counter
0x1C1Checksum

UPTHWRN Mode Frame

FieldNumber of bytesDescription
7E 00 1C 90 00 13 A2 00 42 53 64 53 FF FE C2 7F 00 0E 03 E9 12 00 72 00 55 50 54 48 57 52 4E 7AExample frame
0x7E1Delimiter
0x001C2Length
0x901Frame Type
0x0013A1004158C1CB8Source Address
0xFFFE2Reserved
0x001R. Option
0x7F1Header
0x001Node ID
0x0E1Firmware Version
0x03E92Battery Voltage
0x121Packet Counter
0x00722Sensor Type
0x001Reserved
0x5550544857524E7Mode Byte for UPTHWRN Mode
0x7A1Checksum

Sensor Data Frame

Run mode is the default mode of operation of this sensor. In this mode, the sensor sends periodic packets with the sensor measurement data. During the time it is not sending it enters deep-sleep to conserve power. The sensor’s X-bee module operates in API mode and sends packets to the saved destination address on the network specified by the saved PAN ID. Figure 4 illustrates the API transmission/reception procedure.

Figure 4: Communication Procedure - Run Mode

As this sensor has two possible frame structures for the Processed and RAW mode, we are detailing each one below:

Processed Data Frame

Frame FieldOffset (Payload section)Fixed Value (if any)LengthDescription
Header00x7F1Header to differentiate various types of packets
Node ID10x001Node ID to differentiate up to 256 nodes in a network. User configurable values
Firmware20x011Used to determine firmware version programmed in the device
Battery VoltageMSB 30x032Battery Voltage = 0.00322*(03*FF+FE)
LSB 40xFEBattery Voltage = ((Battery Voltage MSB x 256) + Battery Voltage LSB) x 0.00322 V
Packet Counter5-1It is an 8-bit counter that increments with each packet transmission. It can be used to detect missing packets
Sensor TypeMSB 60x002Two bytes to determine sensor type. It can be used in conjunction with Node ID to create sensor networks of up to 256 nodes for a single type of sensor and multiple such networks can coexist and can be differentiated in processing software on PC end.
LSB 70x72Sensor Type 114
Error/Reserved byte80x001Bit 1: Validity of Data for sensor:
- 0: Data is valid
- 1: Error in accessing sensor
In Processed Packet.
Bit 4: Message Type:
- 1: Motion Report
- 0: Regular Report
Sensor Data9/ Data[0]0x001Mode of Operation:
0x00 - Processed
0x01 - Raw
0x02 - On Demand
0x03 - Smart
Output Data Rate10/ Data[0]-1Vibration Sample Rate:
0x08 - 200Hz
0x09 - 400Hz
0x0A - 800Hz
0x0B - 1600Hz
0x0C - 3200Hz
0x0D - 6400Hz
0x0E - 12800Hz
0x0F - 25600Hz
Temperature11/ Data[0]-2Temperature value (Unsigned 16 bit int)
12/ Data[1]-Temperature in Celsius = (Data[0] * FF + Data[1]) / 100
RMS ACC in X Axis in mg13/ Data[0]-2rms_acc_x_mg value
14/ Data[1]-rms_acc_x_mg = (Data[0] * FF + Data[1]) / 1000
MAX ACC in X Axis in mg15/ Data[0]-2max_acc_x_mg value
16/ Data[1]-max_acc_x_mg = (Data[0] * FF + Data[1]) / 1000
RMS Velocity in X Axis in mm/sec17/ Data[0]-2rms_vel_x_mm_sec value
18/ Data[1]-rms_vel_x_mm_sec = (Data[0] * FF + Data[1]) / 100
RMS Displacement in X Axis in mm19/ Data[0]-2rms_disp_x_mm value
20/ Data[1]-rms_disp_x_mm = (Data[0] * FF + Data[1]) / 100
Frequency of Highest Peak in X direction21/ Data[0]-2X1 Hz Value
22/ Data[1]-X1_Hz = (Data[0] * FF + Data[1])
Frequency of Second Highest Peak in X direction23/ Data[0]-2X2_Hz Value
24/ Data[1]-X2_Hz = (Data[0] * FF + Data[1])
Frequency of Third Highest Peak in X direction25/ Data[0]-2X3_Hz Value
26/ Data[1]-X3_Hz = (Data[0] * FF + Data[1])
RMS ACC in Y Axis in mg27/ Data[0]-2rms_acc_y_mg value
28/ Data[1]-rms_acc_y_mg = (Data[0] * FF + Data[1]) / 1000
MAX ACC in Y Axis in mg29/ Data[0]-2max_acc_y_mg value
30/ Data[1]-max_acc_y_mg = (Data[0] * FF + Data[1]) / 1000
RMS Velocity in Y Axis in mm/sec31/ Data[0]-2rms_vel_y_mm_sec value
32/ Data[1]-rms_vel_y_mm_sec = (Data[0] * FF + Data[1]) / 100
RMS Displacement in Y Axis in mm33/ Data[0]-2rms_disp_y_mm value
34/ Data[1]-rms_disp_y_mm = (Data[0] * FF + Data[1]) / 100
Frequency of Highest Peak in Y direction35/ Data[0]-2Y1 Hz Value
36/ Data[1]-Y1_Hz = (Data[0] * FF + Data[1])
Frequency of Second Highest Peak in Y direction37/ Data[0]-2Y2_Hz Value
38/ Data[1]-Y2_Hz = (Data[0] * FF + Data[1])
Frequency of Third Highest Peak in Y direction39/ Data[0]-2Y3_Hz Value
40/ Data[1]-Y3_Hz = (Data[0] * FF + Data[1])
RMS ACC in Z Axis in mg41/ Data[0]-2rms_acc_z_mg value
42/ Data[1]-rms_acc_z_mg = (Data[0] * FF + Data[1]) / 1000
MAX ACC in Z Axis in mg43/ Data[0]-2max_acc_z_mg value
44/ Data[1]-max_acc_z_mg = (Data[0] * FF + Data[1]) / 1000
RMS Velocity in Z Axis in mm/sec45/ Data[0]-2rms_vel_z_mm_sec value
46/ Data[1]-rms_vel_z_mm_sec = (Data[0] * FF + Data[1]) / 100
RMS Displacement in Z Axis in mm47/ Data[0]-2rms_disp_z_mm value
48/ Data[1]-rms_disp_z_mm = (Data[0] * FF + Data[1]) / 100
Frequency of Highest Peak in Z direction49/ Data[0]-2Z1 Hz Value
50/ Data[1]-Z1_Hz = (Data[0] * FF + Data[1])
Frequency of Second Highest Peak in Z direction51/ Data[0]-2Z2_Hz Value
52/ Data[1]-Z2_Hz = (Data[0] * FF + Data[1])
Frequency of Third Highest Peak in Z direction53/ Data[0]-2Z3_Hz Value
54/ Data[1]-Z3_Hz = (Data[0] * FF + Data[1])
Revolutions Per Minute (RPM)55/ Data[0]-2Revolutions Per Minute Value
56/ Data[1]-RPM = ((Data[0] <<8) + Data[1])

Raw Data Frame

Frame FieldOffset (Payload section)Fixed Value (if any)LengthDescription
Header00x7F1Header to differentiate various types of packets
Node ID10x00 (Factory Default)1Node ID to differentiate up to 256 nodes in a network. User configurable values
Firmware20x011Used to determine firmware version programmed in the device
Battery VoltageMSB 30x032Battery Voltage = 0.00322*(03*FF+FE)
LSB 40xFEBattery Voltage = ((Battery Voltage MSB x 256) + Battery Voltage LSB) x 0.00322 V
Packet Counter5-1It is an 8-bit counter that increments with each packet transmission. It can be used to detect missing packets
Sensor TypeMSB 60x002Two bytes to determine sensor type. It can be used in conjunction with Node ID to create sensor networks of up to 256 nodes for a single type of sensor and multiple such networks can coexist and can be differentiated in processing software on PC end.
LSB 70x72Sensor Type 114
Error/Reserved byte80x001Bit 1: Validity of Data for sensor:
- 0: Data is valid.
- 1: Error in accessing sensor
In Time Domain Data (RAW) Packet.
Bit 4: Message Type:
- 1: Motion Report
- 0: Regular Report
Sensor Data9/ Data[0]0x011Mode of Operation:
00 - Processed
01 - Raw
02 - On Demand
03 - Smart
Output Data Rate10/ Data[0]-2Output Data Rate Value
11/Data[1]-ODR = (Data[0] * FF + Data[1])
Full Scale Range and Eabled Axis12/Data[0]-1Three MSB bit of the Axis byte to indicate FSR And 3 LSB bits indicates Axis
Hour13/Data[0]-1Hour = Data[0]
Minute14/Data[0]-1Minute = Data[0]
Device Temperature15/Data[0]-2Device Temperature Value
16/Data[1]-Temperature = (Data[0] * FF + Data[1]) / 100
Total Number of RF Packets17/Data[0]-2Total Number of RF Packets Value
18/Data[1]-Total Number of RF Packets = ((Data[0] << 8) + Data[1])
Current Packet Count value19/Data[0]-2Current Packet Count value
20/Data[1]-Current Packet Count = ((Data[0] << 8) + Data[1])
Time Domain Data Packets----
X1-Axis RAW ACC Data---X1= (01*0xFF+ 0xDE)*FSR coefficient
Y1-Axis RAW ACC Data---Y1= (01*0xFF+ 0x7A)*FSR coefficient
Z1-Axis RAW ACC Data---Z1= (3F*0xFF+ 0x8B)*FSR coefficient

Configuration Mode Frame

Configuration Mode (enter via CFG key press for 7 seconds at power up) is intended to setup the device over the wireless link, you can change parameter values that are subject to change via downlink commands.

When in Configuration Mode a FLY message is sent that if responded to with an OTN message extends the configuration window to 60 seconds so you can push multiple configuration changes.

In configuration mode, the device sets its X-bee pan id to 7BCD. Also, the destination address used by the sensor is extracted from the incoming packet (source address). This ensures that once you put a device in configuration mode you just need to change the PAN ID you are sending to in your Modem/Gateway to match with the sensor and start configuring your device.

A standard configuration packet and its fields are explained in Figure 5. Its possible responses are also shown. The complete set of commands supported by this sensor are shown in тхе Appendix, these can be used in the Parameters field of the Payload section. The sensor responds to these commands with an acknowledgement if the process completed successfully or with an error if it failed to setup a parameter. The respective Data and Reserve section length and values are shown in Table 6 for the case of acknowledgement. In the case of error, the reserved section will be fixed and not used, while the Error number byte will determine the type of error returned. These errors are in a separate section in the Appendix.

Figure 5: Communication Procedure - Configuration Mode

Example Configuration Commands

The following set of commands are an example on how to change some of the parameters that affect the operation of the Standalone Smart Vibration Sensor V4 (these are parameters that are general in nature, more on a network protocol/device level than device specific). You can find them in Appendix together wit the Device/Application Specific commands.

Read Sleep Duration

This command may be used to read the sensor sleep duration.  The sleep duration determines how frequently the sensor wakes up and send 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

When sending this command to a particular sensor, replace 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,  the following data may be extracted:

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 may be used to set the sensor node and sleep duration, note that both values are stored together using the same command.  The Node ID is a user-defined value from 00 to FF that may be used to help easily identify a sensor.  The Sleep Duration indicates the amount of time (in seconds) the sensor will sleep before waking up, taking a sample, sending a transmission, and going back to sleep.

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 to broadcast mode. The broadcast address is 00 00 00 00 00 00 FF FF, which will target all sensors in configuration mode.  Change the broadcast address to the MAC address of a individual sensor to target a particular sensor with this command (this is usually not required).  The Command Contains a Sensor payload which contains a 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 indicate success or failure of the command.

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 (Personal Area Network ID). This feature may be used to build a private Wireless Sensor Network. All sensors with the same Network ID will be able to talk to modems and gateway with the same Network ID.  This is useful when deploying hundreds of sensors in one area or applications which require division of sensors, modems, and gateways into different zones with independent monitoring of each zone.  Each sensor, gateway, and modem in a specific zone should share identical Network IDs, allowing the separation of sensors into smaller, more manageable groups. 

Large factory floors or high-rise building may consist of several groups of sensors working under different Network IDs that help characterize the different areas of the installation.  Network IDs make it easy to group sensors, modems, and gateways.  When broadcasting data using separate Network IDs, multiple modems and 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, following data may be extracted:

A. Sensor MAC Address

00 13 A2 00 41 91 1B 83

B. Complete Sensor 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 may be used to set the sensor Network ID.  Please note, Network ID 0x7BCD is reserved for configuration and should NEVER be used as a network ID for general use.  Please note the Modem/Gateway must also use a matching Network ID to communicate with the sensor.

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, a new network ID of 0x7CDE is configured.

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 may 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 may 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, the following data may be extracted:

A. Complete Sensor 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 (a specific modem or gateway).  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 or setup redundant gateways and modems.  Otherwise, reconfiguration of each sensor for a new gateway or modem will be required.

Set Sensor Destination Address

Every sensor is designed to send sensor data either in broadcast mode or to a particular destination address (modem or gateway).  By default, NCD sensors broadcast data to all available modems and gateways.  Data may be restricted to a single destination address (modem or gateway), though this configuration does not provide any form of redundancy in the event of a Modem or Gateway outage.  For this reason, we strongly advise against using this command.  Please consider setting the Network ID (PAN ID) to Setup Zones which will allow for redundancy in the event of a service outage.  The following command is provided for reference ONLY and should be used with caution as a modem or gateway failure will necessitate reconfiguration of each sensor (which would not be required if the Pan ID/Network ID were used).

What is a Destination Address?  Every sensor, gateway, and  modem have a unique MAC address which cannot be changed. This MAC address is also known as the destination address (printed on the side of the enclosure).  By default, all sensors send data in broadcast mode.  This allows all the gateways and modems in the area to receive sensors data provided they are all on the same PAN ID (Network ID) and use the same encryption key.

When a specific destination address is stored in the sensor, the sensor will send data to that specific destination address only.  The sensor CANNOT communicate with any other modem or gateway in the area.  The following command may be used to specify a specific destination address (modem or gateway) for all sensor 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

The 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 specific destination address.  In this example, the new Destination Address is 12345678.

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

In his example, the response will look something like this (if successful):

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 may be used to set the sensor destination address to broadcast mode, which is the default operation of NCD long range wireless sensors.  After setting to broadcast mode, all modems and gateways with the same PAN ID and Encryption key will receive the same sensor data.  This is the preferred configuration for all NCD sensors.  Segmenting sensors into groups requires a unique PAN ID (also known as Network ID) for each group.  All sensors, modems, and gateways must share the same PAN ID for each group.

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 may be used to read the wireless radio transmission power. This value will indicate how much RF power the radio is emitting. The higher the value, the higher the radiated wireless power, resulting in a longer range and decreased battery life (please note that all battery ratings are shown at maximum wireless transmission power).  Lower values are desirable in application that may benefit from 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, the following data may be extracted:

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 respond with a value from 0x00 to 0x04.  The default value is 0x04, allowing for the greatest possible transmission range and the shortest battery life.

Read Wireless Sensor Retries​

The following command may be used to read the 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 Machine Uptime 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, the following data may be extracted:

A. Sensor MAC Address

00 13 A2 00 41 91 1B 83

B. Complete Sensor 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 may be used to change the number of retries.  The highest number of retries allowed is 10:

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 may be used to set the encryption key. 

All ncd.io wireless sensors comes with 128bit AES encryption. The default encryption key secures a wireless sensor network of sensors, modems, and gateways.  Users have the option to change the default encryption key.  Please note this is a Write ONLY operation, it is not possible to read the encryption key from Sensors, Modems, or Gateways.  Be Sure to keep records accordingly.

Once the sensor encryption key is set in the sensor, be sure to set the same key in all modems and gateways.  If the modem or gateway doesn’t have the same key and PAN id as the sensor, there will be no way for sensors to communicate with modems or gateways.  In this event, only a factory reset may be used to recover communications.

The following Command may be used to change the encryption key:

7E 00 24 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F2 03 00 00 00 00 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 07

Complete Payload

F2 03 00 00 00 00 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA

F2 is the command header byte and 03 is the sub command for setting the ENY Key value.

Note — There is an Extra 0x00 Right before the ENY key value. Its a reserve byte and it should be there all the time. 

In the Above command, the default ENY Key value is programmed into the NCD sensor.

55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA

Once the sensor receives this command, it will change the Key immediately. 

In the event a key value is lost, factory reset the device.  The default key value will always be used after factory reset:

55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA

Troubleshooting

Here are some common issue one might encounter when first setting up the sensor or later on when advance configuration is performed:

1. No or low range/coverage. Data is not received by the Modem/Gateway. Make sure you have properly installed the antenna and have as little obstructions/metal surrounding the sensor.

2. Measurement data missing or values are inconsistent. This might be due to not installing/tightening the probe correctly. Make sure you screw it in all the way and that you position it appropriately where you want to perform the measurements,

3. In case data is not being received (was previously received) there might be a power issue. Check the batteries and or the status of the internal LEDs. You can also observe the battery voltage value in the Run Mode packets you last received to know if the batteries have diminished too much for the sensor to operate.

4. If there are connectivity issue where data is being received intermittently or packets are being lost/need retransmission, make sure that you are in a RF heavy noise environment and/or the sensor is not separated too far away from the nearest node. You might need to install more nodes to bust coverage. Check if the Modem/Gateway is powered properly and operation and its antenna has been installed properly.

5. In case you still can’t solve your issue head to our Community forum to get real time help from the NCD community of experts: https://community.ncd.io/

Appendix

Configuration Commands

Node-RED can be used to configure the device (check the Quick Start section), however you can use any tool as long as you adhere to the proper command structure described in this chapter.

Refer to the table below for a list of commands, their codes and an explanation of what parameter they affect.

No.CommandHeaderSub CommandParameter FieldDefault ValueDescription
1Set Broadcast Transmission 0XF70x01-0000FFFFThis will set the address to Broadcast mode. All the receiver with same ENY key and PAN ID will get the data packets
2Set ID and Sleep Interval0XF70x02NODE ID, D0 MSB,D1, D2 LSB0x00,0x00,0x02,0x58Sets the Device node ID and Data Transmission Interval. The node id value can go from 0-255 and The Data transmission value can go from 3-0xFFFFFF Seconds
3Set Destination Address0XF70x03A0 MSB, A1, A2, A300,00,FF,FFSets the Destination Address of the sensor. The sensor will send Run mode Data packets to this Address
4Set Power0XF70x04Power ( range 1-4)0x04Sets the RF power of the Sensor Radio
5Set PAN ID aka Network ID0XF70x05ID0 MSB, ID1 LSB 0x7FFFSets the PAN ID aka Network ID in the sensor. Only sensors, Gateway, and Modes with Same ID can communicate with each other
6Set Retries 0XF70x06Retries0x0ASets the number of Retries after unsuccessful transmission for the Sensor Radio
7Read Sleep Interval0XF70x15-0x00,0x02,0x58Reads the stored Sleep Interval value from the sensor
8Read Power0XF70x16-0x04Reads the stored RF Power value from the sensor
9Read Retries0XF70x17-0x0AReads the stored Retries value from the sensor
10Read Destination Address0XF70x18-00,00,FF,FFReads the stored Destination value from the sensor
11Read PAN ID aka Network ID0XF70x19-0x7FFFReads the PAN ID aka Network ID
12Enable Encryption 0XF20x01-0x01Enables the Encryption of the Frame Transmitted from the Sensor
13Disable Encryption 0XF20x02--Disables the Encryption of the Frame Transmitted from the Sensor
14Set Encryption Key0XF20x0300,K0 MSB, K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K1555AA55AA55AA55AA55AA55AA55AA55AASets the 128 bit AES Encryption Key

Command Acknowledgement Data

Each command (Appendix A) has its corresponding Acknowledgement with a specific format, size, sections, etc. Use the table below as reference for the parameter values.

No.CommandData bytesReserved bytesDataCalculation (if any)
1Set Broadcast Transmission 180xFF (OK)
2Set ID and Sleep Interval180xFF (OK)
3Set Destination Address180xFF (OK)
4Set Power180xFF (OK)
5Set PAN ID aka Network ID180xFF (OK)
6Set Retries 180xFF (OK)
7Read Sleep Interval36D0 MSB, D1, D2 LSBDelay = (D0 x 65536) + (D1 x 256) + D2
8Read Power18PowerDEC value
9Read Retries18RetriesDEC value
10Read Destination Address45A0 MSB, A1, A2, A3
11Read PAN ID aka Network ID27ID0 MSB, ID1
12Enable Encryption 180xFF (OK)
13Disable Encryption 180xFF (OK)
14Set Encryption Key180xFF (OK)

Application Specific Commands

No.CommandHeaderSub CommandReserve ByteProbe CommandCommand Code / ArgumentDescription
1Set Output Data Rate0xF40x4F0x65, 0x000x010x07 -- 400sps (Range 6.25 – 100 Hz)
0x08 -- 800sps (Range 12.5 – 200 Hz)
0x09 -- 1600sps (Range 25 – 400 Hz)
0x0A -- 3200sps (Range 50 – 800 Hz)
0x0B -- 6400sps (Range 100 – 1600 Hz)
0x0C -- 12800sps (Range 200 – 3200 Hz)
0x0D -- 25600sps (Range 400 – 6400 Hz)
Set the frequency at which the sensor outputs data after it has been sampled.NOTE: These are based on Default Filter Setting. LOW and HIGH PASS Filters Can be used to Change These Ranges
2Get Output Data Rate0xF40x4F0x65, 0x010x010x07 -- 400sps (Range 6.25 – 100 Hz)
0x08 -- 800sps (Range 12.5 – 200 Hz)
0x09 -- 1600sps (Range 25 – 400 Hz)
0x0A -- 3200sps (Range 50 – 800 Hz)
0x0B -- 6400sps (Range 100 – 1600 Hz)
0x0C -- 12800sps (Range 200 – 3200 Hz)
0x0D -- 25600sps (Range 400 – 6400 Hz)
3Set Sampling Duration0xF40x4F0x65, 0x020x01Valid Range:
0x01 -- 0x64
Period of samples in seconds must be > 0. The sample duration depends on the ODR value that has been set.
See next document section!
4Get Sampling Duration0xF40x4F0x65, 0x030x01
5Set Sampling Interval0xF40x4F0x65, 0x060x08 -- Every 1 minutes
0x00 -- Every 5 minutes
0x01 -- Every 10 minutes
0x02 -- Every 15 minutes
0x03 -- Every 20 minutes
0x04 -- Every 30 minutes
0x05 -- Every 60 minutes
0x06 -- Every 120 minutes
0x07 -- Every 180 minutes
Set the amount of time between each measurement or sample taken by the sensor. It determines how often the sensor collects data on vibration levels (such as acceleration, velocity, or displacement) over a specific period.
6Get Sampling Interval0xF40x4F0x65, 0x070x08 -- Every 1 minutes
0x00 -- Every 5 minutes
0x01 -- Every 10 minutes
0x02 -- Every 15 minutes
0x03 -- Every 20 minutes
0x04 -- Every 30 minutes
0x05 -- Every 60 minutes
0x06 -- Every 120 minutes
0x07 -- Every 180 minutes
7Set RTC0xF40x4F0x65, 0x08Byte 1 -- Hours
Byte 2 -- Minutes
Byte 3 -- Seconds
Set the internal sensor RTC using the provided values for hours, minutes, and seconds.
8Set Operation Mode0xF40x4F0x00, 0x090x00 -- Processed Mode
0x01 -- Raw Mode
0x02 -- Processed + Raw on Request
0x03 -- Smart Mode
Set the operation mode that the sensor will use. The default mode is Processed Mode.
9Get Operation Mode0xF40x4F0x65, 0x0A0x00 -- Processed Mode
0x01 -- Raw Mode
0x02 -- Processed + Raw on Request
0x03 -- Smart Mode
10Set Full-scale Range0xF40x4F0x65, 0x0B0x00 -- +/- 2g
0x01 -- +/- 4g
0x02 -- +/- 8g
0x03 -- +/- 16g
0x04 -- +/- 32g
0x05 -- +/- 64g
Set the maximum range of acceleration values the sensor can measure.
11Get Full-scale Range0xF40x4F0x65, 0x0C0x00 -- +/- 2g
0x01 -- +/- 4g
0x02 -- +/- 8g
0x03 -- +/- 16g
0x04 -- +/- 32g
0x05 -- +/- 64g
12Set Filters0xF40x4F0x65, 0x0D0x01 -- Enable
0x00 -- Disable
13Get Filters0xF40x4F0x65, 0x0E0x01 -- Enable
0x00 -- Disable
14Set On Request Timeout0xF40x4F0x00, 0x11Valid Range:
0x01 -- 0x0A
Value Range -- 1-10sec. Device will decide how long device will stay awake and wait for raw time domain request from command
15Get On Request Timeout0xF40x4F0x65, 0x12
16Set Dead Band Value in mg0xF40x4F0x00, 0x28Valid Range:
0x00 -- 0xFF
Value Range -- 0-255mg. Filters out acceleration values below the dead band threshold, treating them as noise.
17Get Dead Band Value in mg0xF40x4F0x65, 0x29
18Extend OTF Configuration Time0xF40x4F0x65, 0x32Extend OTF on time by 30sec
19Exit OTF Configuration Time0xF40x4F0x65, 0x33
20Set Motion Detection Threshold INT0xF40x4F0x50, 0x3C0x01Valid Range:
0x00 -- 0x28
The sensor will wake up and take samples when vibration goes above this threshold(Set threshold 400mg, Multiple of 50mg)
21Get INT Threshold0xF40x4F0x50, 0x3D0x01
22Request Time Domain Data0xF40x4F0x50, 0x130x01Once Sensor Receives This command it will Send RAW data to Requester (Only apply for mode 2 and 3)
23Set Acceleration Alert Threshold0xF40x4F0x00, 0x3EValid Range:
0x00 -- 0xFF
Set the minimum acceleration value to make LED indicator red.This will be an integer value that increments the threshold by 50mg. A value of 1 means turn the LED red if acceleration is above 50mg, 2 means 100mg, etc.**Only applies if LED Alert Mode is set to Acceleration.RED Alert Led Will Blink If the RMS acceleration readings go above this threshold(Set threshold 400mg, Multiple of 50mg)
24Get Acceleration Alert Threshold0xF40x4F0x00, 0x3F
25Set Velocity Alert Threshold0xF40x4F0x00, 0x40Valid Range:
0x00 -- 0xFF
Set the minimum velocity value to make LED indicator red.This will be an integer value that increments the threshold by 2mm/second. A value of 1 means turn the LED red if velocity is above 2mm/sec, 2 means 4mm/second, etc.**Only applies if LED Alert Mode is set to Velocity.RED Alert Led Will Blink If the RMS Velocity readings go above this threshold(Set threshold 20mm/sec, Multiple of 2mm/sec)
26Get Velocity Alert Threshold0xF40x4F0x00, 0x41
27Set Alert Mode to Acceleration0xF40x4F0x00, 0x42, 0x00Alert LED will blink if readings go above set Acceleration threshold
28Set Alert Mode to Velocity0xF40x4F0x00, 0x42, 0x01Alert LED will blink if readings go above set Velocity threshold
29Set Low Pass Filter0xF40x4F0x50, 0x340x010x00 -- 4 Filter Coefficient
0x01 -- 8 Filter Coefficient
0x02 -- 16 Filter Coefficient
0x03 -- 32 Filter Coefficient
0x04 -- 64 Filter Coefficient
0x05 -- 128 Filter Coefficient
0x06 -- 256 Filter Coefficient
0x07 -- 512 Filter Coefficient
0x08 -- 1024 Filter Coefficient
0x09 -- 2048 Filter Coefficient
This setting will set the LPF freq to ODR divided by Selected ValueExample: ODR = 800 and Filter Coefficient = 4LPF freq = 800/4 = 200Hz
30Get Low Pass Filter0xF40x4F0x50, 0x350x010x00 -- 4 Filter Coefficient
0x01 -- 8 Filter Coefficient
0x02 -- 16 Filter Coefficient
0x03 -- 32 Filter Coefficient
0x04 -- 64 Filter Coefficient
0x05 -- 128 Filter Coefficient
0x06 -- 256 Filter Coefficient
0x07 -- 512 Filter Coefficient
0x08 -- 1024 Filter Coefficient
0x09 -- 2048 Filter Coefficient
31Set High Pass Filter0xF40x4F0x50, 0x360x010x00 -- 4 Filter Coefficient
0x01 -- 8 Filter Coefficient
0x02 -- 16 Filter Coefficient
0x03 -- 32 Filter Coefficient
0x04 -- 64 Filter Coefficient
0x05 -- 128 Filter Coefficient
0x06 -- 256 Filter Coefficient
0x07 -- 512 Filter Coefficient
0x08 -- 1024 Filter Coefficient
0x09 -- 2048 Filter Coefficient
This setting will set the HPF freq to ODR divided by Selected ValueExample: ODR = 800 and Filter Coefficient = 64HPF freq = 800/64 = 12.5Hz
32Get High Pass Filter0xF40x4F0x50, 0x370x010x00 -- 4 Filter Coefficient
0x01 -- 8 Filter Coefficient
0x02 -- 16 Filter Coefficient
0x03 -- 32 Filter Coefficient
0x04 -- 64 Filter Coefficient
0x05 -- 128 Filter Coefficient
0x06 -- 256 Filter Coefficient
0x07 -- 512 Filter Coefficient
0x08 -- 1024 Filter Coefficient
0x09 -- 2048 Filter Coefficient
33Set Auto Raw Interval0xF40x4F0x50, 0x46Valid Range:
0x00 -- 0xFF
The interval is determined by the sample interval. If the value is set to 1 and the sample interval is 10 minutes, raw data will be sent every 10 minutes. If the value is set to 5, raw data will be sent every 50 minutes.
34Get Auto Interval0xF40x4F0x50, 0x47
35Set Auto Raw Destination0xF40x4F0x50, 0x48Valid Range:
0x00 -- 0xFFFFFFFF
Each time the sensor automatically transmits Time-Domain (raw) data, it will be sent either in broadcast mode or unicast mode (targeted address).Default value: 0000FFFF for Broadcast Mode
36Get Auto Raw Destination0xF40x4F0x50, 0x49
37Clear Probe Uptimers0xF40x4F0x50, 0x4BBy default, the sensor measures the total time the asset is on. This command will reset the internal uptime counter.
38Get Probe Uptimers0xF40x4F0x50, 0x4A
39Set Smart Mode Skip Interval0xF40x4F0x65, 0x4CValid Range:
0x00 -- 0xFF
Sensor will skip sending data this many times if vibration is below the smart threshold.
40GetSmart Mode Skip Interval0xF40x4F0x65, 0x4D
41Set Smart Mode Threshold0xF40x4F0x65, 0x4E0x01Valid Range:
0x00 -- 0xFFFE
If RMS acceleration is above this in any axis, it will send data. This will be an integer value that increments the interrupt threshold by 50 mg. A value of 1 means to wake the sensor if acceleration is above 50 mg, 2 means 100 mg, etc.
42Get Smart Mode Threshold0xF40x4F0x65, 0x4F0x01
43Set FLY Interval0xF40x4F0x65, 0x510x003C -- 1 Hour
0x0078 -- 2 Hours
0x00F0 -- 4 Hours
0x01E0 -- 8 Hours
0x02D0 -- 12 Hours
0x0438 -- 18 Hours
0x05A0 -- 24Hours
Set the interval at which the sensor performs Fly Mode transmissions.
44Get FLY Interval0xF40x4F0x65, 0x520x003C -- 1 Hour
0x0078 -- 2 Hours
0x00F0 -- 4 Hours
0x01E0 -- 8 Hours
0x02D0 -- 12 Hours
0x0438 -- 18 Hours
0x05A0 -- 24Hours
45Set Payload Lenght0xF40x4F0x50, 0x440x00 -- 55 Bytes
0x01 -- 100 Bytes
0x02 -- 150 Bytes
0x03 -- 180 Bytes
Set the amount of Time Domain Data included in each RAW transmission sent by the sensor.
46Get Payload Lenght0xF40x4F0x50, 0x450x00 -- 55 Bytes
0x01 -- 100 Bytes
0x02 -- 150 Bytes
0x03 -- 180 Bytes
47Enable RPM Calculate status0xF40x4F0x65, 0x550x01 -- Enable
0x02 -- Disable
Enable/disable whether the sensor calculates and reports the Rotations Per Minute (RPM) of a rotating machine or component during its measurements.
48Get RPM Calculate status0xF40x4F0x65, 0x560x01 -- Enable
0x02 -- Disable
49Set Max RAW Sample0xF40x4F0x65, 0x570x0400 -- 1024 Samples
0x8000 -- 2048 Samples
0x1000 -- 4096 Samples
0x1900 -- 6400 Samples
0x1FA4 -- 8100 Samples.
Defines the maximum number of samples the sensor captures for time-domain data
50Get Max RAW Sample0xF40x4F0x65, 0x580x0400 -- 1024 Samples
0x8000 -- 2048 Samples
0x1000 -- 4096 Samples
0x1900 -- 6400 Samples
0x1FA4 -- 8100 Samples.

Sample Duration vs ODR

Sample Rate (ODR)Sample Duration Max
200Hz40Sec
400Hz20sec
800Hz10sec
1600Hz5sec
3200Hz2.5sec
6400Hz1.26sec
12800Hz0.63sec
25600hz0.31sec

Error Code Descriptions

Here a summary is provided of what the different error codes mean (in case a valid Ack has not been received).

Error NumberDescription
0x01Invalid command
0x02Sensor Type mismatch
0x03Node ID mismatch
0x04Apply change command failed during X-bee parameter update
0x05Invalid API packet command response received after Apply change command
0x06Write command failed during X-bee parameter update
0x07Invalid API packet command response received after Write command
0x08Parameter change command failed during X-bee parameter update
0x09Invalid Parameter change command response packet received after Write command
0x0AInvalid/Incomplete packet received
0x0FInvalid parameter for setup/saving

Frame Checksum Calculation

In order to successfully communicate over the API protocol, the checksum is of vital importance. The X-bee at either end of the link will reject packets if the checksum does not match.

Calculation for transmission

For sending packets, the checksum calculation works as follows:

1. Not including the frame delimiter and length, add all the bytes and keep the lower 8 bits of result

2. Subtract this value from 0xFF (hex)

3. The resultant value is the checksum

4. Append this byte to the original packet for sending

Consider the example for the command Set Broadcast shown in APPENDIX A and see that the calculated checksum matches with the checksum sent by the terminal/LabVIEW. Let us break the example command below:

				
					7E00 1310 0000 0000 0000 00FF FFFF FE00 00F7 0100 0001 FB
				
			

If we extract the relevant bytes from the command we get:

				
					10 0000 0000 0000 00FF FFFF FE00 00F7 0100 0001
				
			

Adding the bytes and taking the last 8 bits yields:

				
					0x04
				
			

Substract the value obtained (0x04) from 0xFF

				
					0xFF-0x04=0xFB
				
			

We get a value matching the one in the packet checksum field.

Calculation for reception

Although checksum is matched by the X-bee itself, but for understanding follow these steps to match checksum at reception

1.     Not including the frame delimiter and length, add all the bytes including the received checksum

2.     Keep only the last 8 bits

3.      If the result is 0xFF, the checksum is correct and the packet can be processed.

Consider the example for the command Set Broadcast shown in APPENDIX A and see that the received packet checksum verifies since the result is 0xFF.

				
					7E00 1C90 1310 A200 4158 1CCB FFFE C17C 000D 0001 0000 FF00 0000 0000 0000 00F3
				
			

If we extract the relevant bytes from the command we get:

				
					90 1310 A200 4158 1CCB FFFE C17C 000D 0001 0000 FF00 0000 0000 0000 00F3
				
			

Adding the bytes and taking the last 8 bits yields:

				
					0xFF