Home/Support/Support Forum/how get the gateway address from a digi connectport in a python program?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

how get the gateway address from a digi connectport in a python program?

0 votes
I have a program into the Digi device, I need to get the gategay address in this programm but I dont know how?
asked Aug 7, 2014 in Python by Luz Cecilia New to the Community (2 points)
reshown Aug 8, 2014 by kavya

Please log in or register to answer this question.

2 Answers

+1 vote
 
Best answer
Same way. You can send RCI request(query_state) from device cloud and you can parse the response for the address of the xbee (search for zigbee_state in the response)

Or

You can telnet to the device and issue the command #>display xbee to get the device information which includes the address of the local xbee.
answered Aug 13, 2014 by trooper2 Veteran of the Digi Community (589 points)
selected Aug 13, 2014 by Luz Cecilia
ok thanks, but I want to get the Xbee RF module extended address using a .py program uploaded to the python section of the ConnectPort X2 (industrial), Is it possible?
Yes you can using the rci module.  Here is sample code:

import rci

# This is the rci request that will return device state
request = '''
<rci_request version="1.1">
  <query_state/>
</rci_request>

'''
# Response will store the response from the rci request
response = rci.process_request(request)

print response

Instead of just printing you will need to get the information you want from within the response.
OH! I understand now, thank you so much :)
0 votes
Do you want to get the gateway MAC address?
You can send RCI request(query_state) from device cloud and you can parse the response for the mac address.
Or
You can telnet to the device and issue the command #>display device to get the device information which includes MAC address.
answered Aug 11, 2014 by 16ksa23 Veteran of the Digi Community (426 points)
thanks but I want to get the Xbee`s extended address of the ConnectPort not the MAC address
...