Skip to content

otii_is_logged_in command appears to fail from Linux on Python 3.10 #13

@pscheidler

Description

@pscheidler

When trying to connect from a Raspi running Ubuntu 22.04, Python 3.10 using

        client = otii_client.OtiiClient()
        self.otii = client.connect()

I get

File "/home/ubuntu/.local/lib/python3.10/site-packages/otii_tcp_client/otii_client.py", line 170, in connect
    self.otii = Connect(host, port, try_for_seconds, licensing, credentials, licenses)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/otii_tcp_client/otii_client.py", line 59, in __init__
    if not self.is_logged_in():
  File "/home/ubuntu/.local/lib/python3.10/site-packages/otii_tcp_client/otii.py", line 169, in is_logged_in
    raise otii_exception.Otii_Exception(response)
otii_tcp_client.otii_exception.Otii_Exception: {'type': 'error', 'errorcode': 'Invalid command', 'cmd': 'otii_is_logged_in', 'trans_id': '1', 'data': {}}

I can work around this by using

        client = otii_client.OtiiClient()
        self.otii = client.connect(licensing='manual')
        print(f"Using credentials {credentials=}")
        self.otii._login(credentials)
        try:
            self.otii.return_license(LICENSE_ID)
        except Exception as e:
            print(f'Ran into error, hopefully license is available. Error = {e}')
        assert self.otii.get_licenses()[0]['available'], 'License not available'
        self.otii.reserve_license(LICENSE_ID)

Our system does have the otii server already running, and we should already have a license. Please let me know if you need more info

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions