How to get a ConnectPort's uniqueID via Python

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 I have to write a very complex method to be able to get a simple line of information.

, 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 ?

  • One way to list all the devices in your account is /ws/DeviceCore /sci GET request.
  • Are you referring to this, ?
  • With what information you need to get device ID of a device?
  • X2e do not support Modules:digicli, digiweb, digiwdog etc.

Please provide all these information which would help in understanding your requirement.


1- As mentionned, I’m trying to get the DeviceId via python, not via Etherios. Etherios is out of the picture and never will be.
2- I did use the example on that link you provided without success.
3- I’m not sure of your question, but here’s the answer to what I think you mean: I’m using a python application for various task and once an hour this python app need to checkin to my server to confirm it is alive and well. I want to use the uniqueID of the device for that checkin.
4- I know it does not support these modules, that’s what I’m stating in my question.

I received the following from digi support:

Using RCI:

import rci

response = rci.process_request(’ ')

LANposition = response.find(‘’)
DigiMAC = response[LANposition+5:LANposition+22]

This returns the ethernet MAC of the device. It works on X2 and X2e variants.

1 Like