Industrial Wireless Sensor Configuration
In this article we will learn how to configure the ncd.io industrial wireless sensor, to configure these sensors you will need a wireless receiver and a computer. You can configure these sensors simply by sending uart commands, so if you are trying to this using a desktop computer you will need a USB to the wireless adapter. If you are using it with IOT computers like article photon, electron, onion omega, raspberry pi, in that case, you can connect the wireless receiver directly with the available uart. You can find all the necessary hardware on ncd.io. In my setup, i will be using
- wireless temperature humidity sensor
- USB to wireless adapter
- A computer
Configuration Mode –
This Mode is used to set up all the parameters in the wireless sensors. To enable the configuration mode press the reset button( labeled as RST on the enclosure) and then hold the configuration button( labeled as CFG on the enclosure) for 5 seconds. This operation will put the sensor into configuration mode. In the configuration mode, we can change all kinds of parameters in the wireless sensor. This setup configuration will work with all ncd.io wireless sensors.
Once the module is in configuration mode it will send this command to let you know that it’s in configuration mode
7E 00 0F 90 00 13 A2 00 41 26 B2 31 FF FE C2 50 47 4D CD
-
Changing the Sensor Node ID and Sleep time – To set the ID and delay you will need to send this command
Command: 0xF7, node ID, Delay (3bytes) – (total 5 bytes)
Response: OK, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
Example command In AT mode == 0xF7,0x01,0x00,0x00,0x03
Once You send this command, your sensor node ID will be changed to 1 and the delay will be changed to 3 seconds
Example Command in API mode
Command: 7E 00 13 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F7 01 00 00 03 F9
Response: 7E 00 17 90 00 13 A2 00 41 26 B2 31 FF FE C2 4F 4B 00 00 00 00 00 00 00 00 0D 0A
2. Set Destination Address –
this is one of most important command, let’s say you have a wireless sensor and you want to send its data to a particular receiver in that case you will need add that receiver address into the wireless sensor. You can also set the module into the broadcast mode and it will send the data to all the receivers.
Command: 0xF6, Dest address (8bytes) – (total 9 bytes)
Response: OK, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
Example Command in AT mode == 0xF6,0x34, 0x30,0x41,0x36,0x36,0x31,0x44,0x46 ( You can find the reciver address on the bottom side of your reciver module, my module address is 40A661DF)
This command will change the sensor desitnation address and it will send its data to this address after reboot.
Example command In API mode
Command : 7E 00 17 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F5 34 30 41 36 36 31 44 46 33
Response : 7E 00 17 90 00 13 A2 00 41 26 B2 31 FF FE C2 4F 4B 00 00 00 00 00 00 00 00 0D 0A
3. Set Module In the Broadcast mode –
If you are not sure about the destination address or wants to send the sensor readings to multiple receivers, in that case, you can put the wireless sensor module board into the broadcast mode. To but the module in the broadcast you will use this command
Command: 0xF3,0x01
Response: OK, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
Command In API mode
Command: 7E 00 10 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F3 01 00
Response: 7E 00 17 90 00 13 A2 00 41 26 B2 31 FF FE C2 4F 4B 00 00 00 00 00 00 00 00 0D 0A
4. Get Destination Address –
This command can be used to read the wireless sensor destination address
Command: 0xF6, 0x44, 0x4c, 0x52, 0x58 – (total 5 bytes)
Response: Destination address (8 bytes), 0x00,0x00,0x00,0x00,0x0D
Example Command In API mode
Command: 7E 00 13 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F6 44 4C 52 58 C4
Response: 7E 00 17 90 00 13 A2 00 41 26 B2 31 FF FE C2 30 30 30 30 46 46 46 46 00 00 0D CC
5. Get Delay –
If you want to check after how long your sensor is sending the data, you can check it by using this command.
Command: 0xF6, 0x44, 0x45, 0x4c, 0x59 – (total 5 bytes)
Response: delay (first 3 bytes), 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
Example Command In API mode
Command: 7E 00 13 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F6 44 45 4C 59 D0
Response: 7E 00 17 90 00 13 A2 00 41 26 B2 31 FF FE C2 00 00 03 00 00 00 00 00 00 00 0D A1
In the set delay and destiantion command we set our delay to 3 seconds in the get delay comamnd as you can see our delay is set to 3 seconds.
Advance Commands:
These are few commands which are rarely changed, we do not advice to change them, these should be changed only if you know what these commands mean.
6. Set Wireless Sensor Module RF power == This command can be used to set the wireless sensor RF module
Command: 0xF6, 0x41, 0x54, 0x50, 0x4c, power – (Total 6 bytes)
Response: OK, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
Errors: EA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
EB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
EC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
Example Command in API mode
Command: 7E 00 14 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F6 41 54 50 4C 34 99
Response: 7E 00 17 90 00 13 A2 00 41 26 B2 31 FF FE C2 4F 4B 00 00 00 00 00 00 00 00 0D 0A
In the above command i set the RF power to 4. to know more about the power setting, check out Xbee S3B datasheet.
7. Get Wireless Sensor Module RF power == This command can be used to get the wireless sensor RF module
Command: 0xF6, 0x50, 0x4c, 0x52, 0x58 – (total 5 bytes)
Response: power, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
Example Command In API mode
Command: 7E 00 13 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F6 50 4C 52 58 B8
Response: 7E 00 17 90 00 13 A2 00 41 26 B2 31 FF FE C2 34 00 00 00 00 00 00 00 00 00 0D 70
8. Set Wireless Sensor Retries == This command can be used to set the retries, so lets say sensor work up and sent the data to the wireless receiver but it didn’t make to the receiver, in that case, it will send it again, by using this command we can define how many times the sensor will try before going back to sleep.
Command: 0xF6, 0x41, 0x54, 0x52, 0x52, number of retries – (Total 6 bytes)
Response: OK, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
Errors: EA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
EB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
EC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
Command In API mode
Command: 7E 00 14 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F6 41 54 52 52 34 91
Response: 7E 00 17 90 00 13 A2 00 41 26 B2 31 FF FE C2 4F 4B 00 00 00 00 00 00 00 00 0D 0A
In the abouve command i set the retries to 4.
9. Get Wireless Sensor Retries == This command can be used to read how many times wireless sensor will try to send the data before going back to sleep.
Command: 0xF6, 0x52, 0x52, 0x52, 0x58 – (total 5 bytes)
Response: Number of retries, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
Command In API mode
Command: 7E 00 13 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F6 52 52 52 58 B0
Response: 7E 00 17 90 00 13 A2 00 41 26 B2 31 FF FE C2 34 00 00 00 00 00 00 00 00 00 0D 70
10. Set PAN ID== This Command can be used if you have too many of these wireless sensor on one network and it’s creating any kind of interference, this happens very rarely.
Command: 0xF6, 0x41, 0x54, 0x49, 0x44, ID (4 bytes) – (Total 9 bytes)
Response: OK, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
Errors: EA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
EB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
EC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D
Command in API format
Command: 7E 00 17 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F6 41 54 49 44 37 46 46 46 D3
Response: 7E 00 17 90 00 13 A2 00 41 26 B2 31 FF FE C2 4F 4B 00 00 00 00 00 00 00 00 0D 0A
In the above command i am setting the PAN id to 7FFF.
Once you apply all your setting hit the reset button and all your new setting will take effect.