Programming enterprise sensors with custom values


#1

Hi there,

I’ve programmed some of your enterprise sensors with custom parameters (encryption key and PAN ID) and I’ve noticed that these values do not survive a device reset i.e., I press the reset button once and the values I set revert back to 7FFF for the PAN ID and the default encryption key.

Here’s the Python code that I’m using to set the values:

    remote_xbee.set_parameter(PARAM_NETWORK_ID, bytearray.fromhex(pad_hex(num_char=None,hexed="7AAA")))
    time.sleep(0.25)
    remote_xbee.set_parameter(PARAM_ENCRYPTION_KEY, CUSTOM_ENCRYPTION_KEY)
    remote_xbee.write_changes()

My understanding is that the new settings I’m writing should survive a press of the reset button. Is there something I’m missing here?

Thanks a lot,
Ida


#2

Hi Ida,
I think you are trying to send data to the xbee. This wont work. You will need to send complete command to the sensor and sensor will set these parameters.
for example to set pan id you will need to send this 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
The command structure can be found here


Currently this is whats happening
You are setting the parameter in the xbee but as soon as you reset the device the controller will over write those parameters with the stored values.

Let me know if you have any other questions.

Thanks


#3

Hi Bhaskar,

Thanks for your advice. Following it, I am now sending a complete command to the sensor to set the wireless network ID based on the example from https://ncd.io/ncd-io-wireless-sensor-raw-commands/
However, I’ve noticed that these values do not survive a device reset i.e., I press the reset button once and the values I set revert back to 7FFF.
This is the logger from XBee I am seeing in my terminal and so I can see that the complete command is being sent as it matches the one on your website.

/dev/cu.usbserial-A106B3U5SENT        OperatingMode.API_MODE7E 00 15 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F7 05 00 00 00 7C DE 9E

I also just tried to send that command over the serial console in XCTU. Whereas before I was getting the expected return value of

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

. Now I am getting this back:

00 24 97 05 00 13 A2 00 41 8C 2D A5 FF FE 46 4E 00 FF FE 00 13 A2 00 41 8C 2D A5 20 00 FF FE 01 00 C1 05 10 1E 35 E6

I’ve also attached my python code to set the wireless sensor network id.

sensor_config.py (2.8 KB)
ncd_packet.py (457 Bytes)

Not entirely sure what is going on here.

Thanks a lot,
Ida


#4

try read network ID command and see if it responds with 0x7FFF.
whats the sensor type?

Thanks


#5

It is a thermocouple


#6

Did you try read network ID.
i never seen anything like this in past. @jacob can you give it a try.

Thanks


#7

Without digging through more digi source code than is healthy for me. Does the device.sendpacket wrap anything in the digi API by default?

If it doesn’t then you will need to make sure you do this manually. Or just use their remote_device objects and let the library handle the API. Also my documentation is showing the packets must start with a “Delimiter” value followed by two bytes for the length before the 10 00 will be put in the packet.

If it does then you can ignore everything else that isn’t part of the “Payload”. My definition of Payload is based on the packet breakdown available in figure 15 on the thermocouple manual: https://ncd.io/long-range-iot-wireless-thermocouple-sensor-product-manual/

In either case the code you sent over is not sending anything after the network ID 7cde so there is no payload being loaded in the broadcast.

Unless I’m missing something which is quite possible.


#8

Hi,
is there any other sensor in the config mode?
try one sensor at one time because right now we are sending commands in broadcast.
Thanks


#9

No the other sensor is not even powered.


#10

can you use this UI and test with it.


or using labview ui

Thanks