amfitech / amfiprot

MIT License
3 stars 1 forks source link

USB connection lost #6

Open mahnu opened 1 week ago

mahnu commented 1 week ago

First of all thanks for providing this package!

I have a USB connection problem and would like to know if you can help me.

I am using the amfitrack on Linux:

$ python --version
Python 3.12.3
$ pip list
Package            Version
------------------ --------
amfiprot           0.1.11
amfiprot_amfitrack 0.0.1a14
cobs               1.2.1
crcmod             1.7
libusb-package     1.0.26.1
pip                24.0
pyserial           3.5
pyusb              1.2.1

Here is what I get when I try to run python ./amfiprot/examples/read_config.py:

USB device: Amfitrack Hub (206833693831)
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Traceback (most recent call last):
  File "/home/demo/git/./amfiprot/examples/read_config.py", line 23, in <module>
    cfg = dev.config.read_all()
          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/demo/venv/lib/python3.12/site-packages/amfiprot/configurator.py", line 13, in read_all
    for cat_index in range(self._get_category_count()):
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/demo/venv/lib/python3.12/site-packages/amfiprot/configurator.py", line 86, in _get_category_count
    packet = self.device._await_packet(ReplyCategoryCountPayload)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/demo/venv/lib/python3.12/site-packages/amfiprot/device.py", line 120, in _await_packet
    raise TimeoutError("Packet not returned.")
TimeoutError: Packet not returned.
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!
Write Task USB connection lost.
Write Task Reconnecting...
Write Task Connection re-established!

Few months ago, everything worked very well. Any idea of how I can deal with this problem?

mahnu commented 1 week ago

I just try with previous versions of the amfitrack package and managed to get it working again using 0.1.8 (pip install --force-reinstall -v "amfiprot==0.1.8"). All version > 0.1.8 don't seem to work.

I will use version 0.1.8 as a workaround from now on.