This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2640R2F: AoA: rtls_aoa_iq_log.py returned key error

Part Number: CC2640R2F

Hi, 

Please see the log below, while running rtls_aoa_iq_log.py, it returned a key error.

The master found the slave and then it exited.

Would you give your comments? Thanks!

(.venv) C:\ti\simplelink_cc2640r2_sdk_3_20_00_21\tools\blestack\rtls_agent\examples>rtls_aoa_iq_log.py
ERROR: 2 nodes could not be identified. Are they programmed?
54:6C:0E:A0:4B:C9 AOA_RX, RTLS_MASTER
None
None
B0:91:22:69:F3:50 CM, AOA_RX, RTLS_PASSIVE

Sending example command RTLS_CMD_IDENTIFY; responses below

{"originator": "Nwp", "type": "SyncRsp", "subsystem": "RTLS", "command": "RTLS_CMD_IDENTIFY", "payload": {"capabilities": {"CM": true, "AOA_TX": false, "AOA_RX": true, "TOF_SLAVE": false, "TOF_PASSIVE": false, "TOF_MASTER": false, "RTLS_SLAVE": false, "RTLS_MASTER": false, "RTLS_PASSIVE": true}, "identifier": "B0:91:22:69:F3:50"}}
{"originator": "Nwp", "type": "SyncRsp", "subsystem": "RTLS", "command": "RTLS_CMD_IDENTIFY", "payload": {"capabilities": {"CM": false, "AOA_TX": false, "AOA_RX": true, "TOF_SLAVE": false, "TOF_PASSIVE": false, "TOF_MASTER": false, "RTLS_SLAVE": false, "RTLS_MASTER": true, "RTLS_PASSIVE": false}, "identifier": "54:6C:0E:A0:4B:C9"}}
{"originator": "Nwp", "type": "SyncRsp", "subsystem": "RTLS", "command": "RTLS_CMD_SCAN", "payload": {"status": "RTLS_SUCCESS"}}
{"originator": "Nwp", "type": "SyncRsp", "subsystem": "RTLS", "command": "RTLS_CMD_SCAN", "payload": {"status": "RTLS_SUCCESS"}}
{"originator": "Nwp", "type": "AsyncReq", "subsystem": "RTLS", "command": "RTLS_CMD_SCAN_STOP", "payload": {"status": "RTLS_SUCCESS"}}
{"originator": "Nwp", "type": "SyncRsp", "subsystem": "RTLS", "command": "RTLS_CMD_SCAN", "payload": {"status": "RTLS_SUCCESS"}}
{"originator": "Nwp", "type": "AsyncReq", "subsystem": "RTLS", "command": "RTLS_CMD_SCAN_STOP", "payload": {"status": "RTLS_SUCCESS"}}
{"originator": "Nwp", "type": "SyncRsp", "subsystem": "RTLS", "command": "RTLS_CMD_SCAN", "payload": {"status": "RTLS_SUCCESS"}}
{"originator": "Nwp", "type": "AsyncReq", "subsystem": "RTLS", "command": "RTLS_CMD_SCAN_STOP", "payload": {"status": "RTLS_SUCCESS"}}
{"originator": "Nwp", "type": "SyncRsp", "subsystem": "RTLS", "command": "RTLS_CMD_SCAN", "payload": {"status": "RTLS_SUCCESS"}}
{"originator": "Nwp", "type": "AsyncReq", "subsystem": "RTLS", "command": "RTLS_CMD_SCAN_STOP", "payload": {"status": "RTLS_SUCCESS"}}
{"originator": "Nwp", "type": "SyncRsp", "subsystem": "RTLS", "command": "RTLS_CMD_SCAN", "payload": {"status": "RTLS_SUCCESS"}}
{"originator": "Nwp", "type": "AsyncReq", "subsystem": "RTLS", "command": "RTLS_CMD_SCAN_STOP", "payload": {"status": "RTLS_SUCCESS"}}
{"originator": "Nwp", "type": "SyncRsp", "subsystem": "RTLS", "command": "RTLS_CMD_SCAN", "payload": {"status": "RTLS_SUCCESS"}}
{"originator": "Nwp", "type": "AsyncReq", "subsystem": "RTLS", "command": "RTLS_CMD_SCAN", "payload": {"eventType": 0, "addrType": 0, "addr": "B0:91:22:65:B5:23", "rssi": -44, "dataLen": 11, "data": "0A:09:52:54:4C:53:53:6C:61:76:65"}}
{"originator": "Nwp", "type": "AsyncReq", "subsystem": "RTLS", "command": "RTLS_CMD_SCAN_STOP", "payload": {"status": "RTLS_SUCCESS"}}
Traceback (most recent call last):
File "C:\ti\simplelink_cc2640r2_sdk_3_20_00_21\tools\blestack\rtls_agent\examples\rtls_aoa_iq_log.py", line 156, in <module>
master_node.rtls.connect(addressType, address)
File "C:\ti\simplelink_cc2640r2_sdk_3_20_00_21\tools\blestack\rtls_agent\.venv\lib\site-packages\unpi\serialnode.py", line 51, in wrapper
return call_builder(self, *args, **kwargs)
File "C:\ti\simplelink_cc2640r2_sdk_3_20_00_21\tools\blestack\rtls_agent\.venv\lib\site-packages\unpi\serialnode.py", line 48, in call_builder
return self.sender(builderclass.build(*args, **kwargs))
File "C:\ti\simplelink_cc2640r2_sdk_3_20_00_21\tools\blestack\rtls_agent\.venv\lib\site-packages\unpi\unpiparser.py", line 236, in build
payload = cls.struct.build({**argsdict, **kwargs})
File "C:\ti\simplelink_cc2640r2_sdk_3_20_00_21\tools\blestack\rtls_agent\.venv\lib\site-packages\construct\core.py", line 352, in build
self.build_stream(obj, stream, **contextkw)
File "C:\ti\simplelink_cc2640r2_sdk_3_20_00_21\tools\blestack\rtls_agent\.venv\lib\site-packages\construct\core.py", line 364, in build_stream
self._build(obj, stream, context, "(building)")
File "C:\ti\simplelink_cc2640r2_sdk_3_20_00_21\tools\blestack\rtls_agent\.venv\lib\site-packages\construct\core.py", line 1998, in _build
subobj = obj[sc.name] # raises KeyError
KeyError: 'connInterval'

  • I've found the cause which is that master_node.rtls.connect and set_ble_conn_info have wrong parameters in SDK release.

  • Hi,

    Did you solve the problem? Do you know the proper arguments? I would really appreciate your answers.

    Regards

  • Sure, please see the following:

    diff --git a/tools/blestack/rtls_agent/examples/rtls_aoa_iq_log.py b/tools/blestack/rtls_agent/examples/rtls_aoa_iq_log.py
    index b7b27eb..3f8ec05 100644
    --- a/tools/blestack/rtls_agent/examples/rtls_aoa_iq_log.py
    +++ b/tools/blestack/rtls_agent/examples/rtls_aoa_iq_log.py

    @@ -87,7 +87,7 @@ if __name__ == '__main__':

    # How many AoA sample buffers should be stored.
    # None means infinite. Press Ctrl+C to terminate in this case.
    - pkt_limit = 1 # None # 5
    + pkt_limit = None # 5

    # Preferred RTLS Slave BLE address, or None for any
    slave_addr = None # '54:6C:0E:A0:4B:B2'
    @@ -153,7 +153,7 @@ if __name__ == '__main__':
    # Once the scan has stopped and we have a valid address, then connect
    if msg.command == 'RTLS_CMD_SCAN_STOP':
    if address is not None and addressType is not None and (slave_addr is None or slave_addr == address):
    - master_node.rtls.connect(addressType, address)
    + master_node.rtls.connect(addressType, address, 800)
    else:
    # If we didn't find the device, keep scanning.
    master_node.rtls.scan()
    @@ -164,7 +164,7 @@ if __name__ == '__main__':
    for node in passive_nodes:
    node.rtls.set_ble_conn_info(msg.payload.accessAddress, msg.payload.connInterval,
    msg.payload.hopValue, msg.payload.mSCA, msg.payload.currChan,
    - msg.payload.chanMap)
    + msg.payload.chanMap, msg.payload.crcInit)

    Regards,

    Yonghua

  • Oh, thank you very much. Btw I'v already installed the new version of SDK and it works properly however your solution may be useful for others as I found many unresolved problems with this case.

    Best regards,

    Aleksandra Wróblewska