Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reader with no 'AirProtocolLLRPCapabilities' #8

Open
cnieves1 opened this issue Jun 27, 2024 · 0 comments
Open

Reader with no 'AirProtocolLLRPCapabilities' #8

cnieves1 opened this issue Jun 27, 2024 · 0 comments

Comments

@cnieves1
Copy link

cnieves1 commented Jun 27, 2024

I'm connecting to a reader, and got this logging error:

--- Logging error ---
Traceback (most recent call last):
  File "C:\Python312\Lib\logging\__init__.py", line 1160, in emit
    msg = self.format(record)
          ^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\logging\__init__.py", line 999, in format
    return fmt.format(record)
           ^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\logging\__init__.py", line 703, in format
    record.message = record.getMessage()
                     ^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\logging\__init__.py", line 392, in getMessage
    msg = msg % self.args
          ~~~~^~~~~~~~~~~
  File "C:\Users\user\test\sllurp-measurements\sllurp\llrp.py", line 127, in __repr__
    ret = llrp_data2xml(self.msgdict)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\test\sllurp-measurements\sllurp\llrp_proto.py", line 3590, in llrp_data2xml
    ans += __llrp_data2xml(msg[p], p)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\test\sllurp-measurements\sllurp\llrp_proto.py", line 3577, in __llrp_data2xml
    res += __llrp_data2xml(sub, p, level + 1)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\test\sllurp-measurements\sllurp\llrp_proto.py", line 3569, in __llrp_data2xml
    fields = Message_struct[name]['fields']
             ~~~~~~~~~~~~~~^^^^^^
KeyError: 'AirProtocolLLRPCapabilities'
Call stack:
  File "C:\Users\user\test\example.py", line 470, in <module>
    main(cmd_args)
  File "C:\Users\user\test\example.py", line 263, in main
    reader = Reader(args.host[0])
  File "C:\Users\user\test\sllurp-measurements\sllurp\reader.py", line 37, in __init__
    self.startConnection()
  File "C:\Users\user\test\sllurp-measurements\sllurp\llrp.py", line 212, in startConnection
    self.getCapabilities()
  File "C:\Users\user\test\sllurp-measurements\sllurp\llrp.py", line 298, in getCapabilities
    self.capabilities = self.readLLRPMessage('GET_READER_CAPABILITIES_RESPONSE')
  File "C:\Users\user\test\sllurp-measurements\sllurp\llrp.py", line 580, in readLLRPMessage
    self.rawDataReceived(self.transport.read(self.reportTimeout()))
  File "C:\Users\user\test\sllurp-measurements\sllurp\llrp.py", line 608, in rawDataReceived
    self.handleMessage(lmsg)
  File "C:\Users\user\test\sllurp-measurements\sllurp\llrp.py", line 618, in handleMessage
    logger.debug('LLRPMessage received: %s', lmsg)
Unable to print the message and arguments - possible formatting error.
Use the traceback above to help find the error.

This can be easily solved changed line 3569 of llrp_proto.py from:

fields = Message_struct[name]['fields']

to:

fields = Message_struct[name]['fields'] if name in Message_struct else []

I don't know if this has any other implications...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant