I need to get the DeviceID from a ConnectPort from within a Python program. This program is installed on X2, X3 and X2e product, I don't want to maintain different script depending on hardware. The main goal behind this is for the ConnectPort to "checkin" within my service to let me know it is connected via a TCP server and need to identify itself.
I used to be able to do it via digicli, which is not available in many recent ConnectPort, such as X2e
I can read the ethernet port and get the mac adress and assume this as a unique id, but then my X3's I have in the field wont be working properly as no ethernet port is present.
I looked into xbee.ddo_get_param(None, 'SL' -or 'SH') but my X2e product only return gibberish.
Here is the script :
serialhigh = xbee.ddo_get_param(None, 'SH')
seriallow = xbee.ddo_get_param(None, 'SL')
print "INFO: DeviceId found (sh) : " + str(serialhigh)
print "INFO: DeviceId found (sl) : " + str(seriallow)
Printed info is :
INFO: DeviceId found (sh) : ¢
INFO: DeviceId found (sl) : @_¹
I tried the RCI module:
with <rci_request><query_state/></rci_request> I have to write a very complex method to be able to get a simple line of information.
with <do_command target="zigbee">
<discover start="1" size="1" option="clear"/>
</do_command>, I have the same issue as with the query state.
Isn't there an easy way to access the device id from the Python engine ?