Node Discovery from Device Cloud to XIG failed

29 views
Skip to first unread message

Xian Lin Song

unread,
Jan 23, 2015, 1:49:09 AM1/23/15
to xbee-inter...@googlegroups.com
When using Device Cloud API Explorer to do a Examle -> SCI -> RCI -> XBee -> Discovery Nodes, (I am using 802.15.4 though, not zigbee module)

<sci_request version="1.0">
  <send_message cache="false">
    <targets>
      <device id="00000000-00000000-B827EBFF-FFB548F2"/>
    </targets>
    <rci_request version="1.1">
      <do_command target="zigbee">
        <discover/>
      </do_command>
    </rci_request>
  </send_message>
</sci_request>

The response is

<sci_reply version="1.0">
  <send_message>
    <device id="00000000-00000000-B827EBFF-FFB548F2">
      <rci_reply version="1.1">
        <do_command>
          <error id="1" desc="Application call failed"/>
        </do_command>
      </rci_reply>
    </device>
  </send_message>
</sci_reply>

I encountered the below error in the XIG console:

cp4pc.rci - Received do_command request
Traceback (most recent call last):
  File "./library/ext/cp4pc/rci/model/device.py", line 153, in handle_xml
    return self._xml_tag(target_node.handle_xml(xml_tree), attributes={'target': target})
  File "./library/ext/cp4pc/rci/controller/zigbee.py", line 61, in handle_xml
    return TargetNode.handle_xml(self, xml_tree)
  File "./library/ext/cp4pc/rci/model/base.py", line 335, in handle_xml
    ret += child_node.handle_xml(xml_child)
  File "./library/ext/cp4pc/rci/controller/zigbee.py", line 110, in handle_xml
    ET.SubElement(device, 'parent_addr').text = '0x'+node.addr_parent[1:-2].lower()
TypeError: 'int' object has no attribute '__getitem__'

However, if using Example->SCI->Python Callback to implement a "Node Discovery" AT Command "ND"

<!-- 
See http://www.digi.com/wiki/developer/index.php/Rci for
an example of a python implementation on a NDS device to
handle this SCI request
-->
<sci_request version="1.0">
  <send_message>
    <targets>
      <device id="00000000-00000000-B827EBFF-FFB548F2"/>
    </targets>
    <rci_request version="1.1">
      <do_command target="xig">
        <at hw_address="00:13:A2:00:XX:XX:XX:XX!" command="ND" />
      </do_command>
    </rci_request>
  </send_message>
</sci_request>

The response is

<sci_reply version="1.0">
  <send_message>
    <device id="00000000-00000000-B827EBFF-FFB548F2">
      <rci_reply version="1.1">
        <do_command target="xig">
          <at_response command="ND" operation="get" result="ok" type="int" value="0x0"/>
        </do_command>
      </rci_reply>
    </device>
  </send_message>
</sci_reply>

If issue "NI" the response is OK and I can see my "NI" value in value field

<sci_reply version="1.0">
  <send_message>
    <device id="00000000-00000000-B827EBFF-FFB548F2">
      <rci_reply version="1.1">
        <do_command target="xig">
          <at_response command="NI" operation="get" result="ok" type="str" value="MySensor"/>
        </do_command>
      </rci_reply>
    </device>
  </send_message>
</sci_reply>

May I know how to do the node discovery from Device Cloud via XIG?

Xian Lin Song

unread,
Jan 23, 2015, 2:21:06 AM1/23/15
to xbee-inter...@googlegroups.com
I found the reason is at the line 110 of file

vi library/ext/cp4pc/rci/controller/zigbee.py

 Comment out the line 110 which is "addr_parent"

            ET.SubElement(device, 'type').text = self.TYPE_CONVERSION.get(node.type, '0')
            ET.SubElement(device, 'ext_addr').text = node.addr_extended[1:-2].lower()+'!' #remove '[' and ']'
            ET.SubElement(device, 'net_addr').text = '0x'+node.addr_short[1:-2].lower()
            # ET.SubElement(device, 'parent_addr').text = '0x'+node.addr_parent[1:-2].lower()

Now it gives me correct response, of course without parent address. Need time to look into the code and fix this "int" and "list" conflict ( error due to python treat the node.addr_parent[1:-2] as an int, not list]

No permanent fix yet... Will update if I found one. Or if someone can contribute to the source code and fix this error, I will be appreciated.

Xian Lin Song

unread,
Jan 23, 2015, 2:26:43 AM1/23/15
to xbee-inter...@googlegroups.com
Or maybe because the remote XBee is a 802.15.4 not Zigbee, it has no parent so parent address is an INT not a LIST???
Reply all
Reply to author
Forward
0 new messages