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

SyntaxError: invalid syntax when running antfs-cli #186

Open
L150 opened this issue Nov 15, 2020 · 6 comments
Open

SyntaxError: invalid syntax when running antfs-cli #186

L150 opened this issue Nov 15, 2020 · 6 comments

Comments

@L150
Copy link

L150 commented Nov 15, 2020

Hi,
I'm running Kali Linux and got this to work in the past, but this time I get a syntax error when trying to run antfs-cli.
The installation went well both with openant ant antfs-cli, at least that's what I think.

Could you guide me how to resolve this?


antfs-cli --pair
Traceback (most recent call last):
File "/usr/local/bin/antfs-cli", line 11, in
load_entry_point('antfs-cli==0.4', 'console_scripts', 'antfs-cli')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2852, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2443, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2449, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/lib/python2.7/dist-packages/antfs_cli-0.4-py2.7.egg/antfs_cli/program.py", line 181
print(" - Passkey:", end=" ")
^
SyntaxError: invalid syntax

@Tigge
Copy link
Owner

Tigge commented Nov 15, 2020

I recently removed the Python 2.7 support since it has reached end of life at the end of last year. Please try with Python 3.6 or above.

@L150
Copy link
Author

L150 commented Nov 15, 2020

Right, I should have tried Python 3 of course. The installation worked fine. Thx!

But now I get another message when I try to pair my 910xt.
Of course there is something I have missed, could you help me with this one as well?


Driver available: [<class 'ant.base.driver.USB2Driver'>, <class 'ant.base.driver.USB3Driver'>]

  • Using: <class 'ant.base.driver.USB2Driver'>
    Request basic information...
    Capabilities: array('B', [8, 3, 0, 186, 54, 0])
    Starting system...
    Key done...
    Searching...
    Exception in thread ant.base:
    Traceback (most recent call last):
    File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
    File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
    File "/usr/local/lib/python3.8/dist-packages/ant/base/ant.py", line 180, in _worker
    and message.data[1] == 0x01
    AttributeError: 'Message' object has no attribute 'data'
    Traceback (most recent call last):
    File "/usr/local/lib/python3.8/dist-packages/antfs_cli-0.4-py3.8.egg/antfs_cli/program.py", line 384, in main
    g.start()
    File "/usr/local/lib/python3.8/dist-packages/ant/fs/manager.py", line 223, in start
    self._main()
    File "/usr/local/lib/python3.8/dist-packages/ant/fs/manager.py", line 150, in _main
    if self.on_link(beacon):
    File "/usr/local/lib/python3.8/dist-packages/antfs_cli-0.4-py3.8.egg/antfs_cli/program.py", line 167, in on_link
    self.link()
    File "/usr/local/lib/python3.8/dist-packages/ant/fs/manager.py", line 383, in link
    self._send_command(LinkCommand(self._frequency, 4, self._serial_number))
    File "/usr/local/lib/python3.8/dist-packages/ant/fs/manager.py", line 199, in _send_command
    self._channel.send_acknowledged_data(data)
    File "/usr/local/lib/python3.8/dist-packages/ant/easy/channel.py", line 119, in send_acknowledged_data
    self.wait_for_event([Message.Code.EVENT_TRANSFER_TX_COMPLETED])
    File "/usr/local/lib/python3.8/dist-packages/ant/easy/channel.py", line 50, in wait_for_event
    return wait_for_event(ok_codes, self._node._events, self._node._event_cond)
    File "/usr/local/lib/python3.8/dist-packages/ant/easy/filter.py", line 73, in wait_for_event
    return wait_for_message(match, process, queue, condition)
    File "/usr/local/lib/python3.8/dist-packages/ant/easy/filter.py", line 62, in wait_for_message
    raise AntException("Timed out while waiting for message")
    ant.easy.exception.AntException: Timed out while waiting for message
    Interrupted: Timed out while waiting for message

@Tigge
Copy link
Owner

Tigge commented Nov 15, 2020

I just merged a pull request to openant which might have fixed this. Could you try installing again? If not it should be possible to use openant commit ae9e7366fb78b2c39467e1a028b34cfb0c64ffd7.

@bluebaer7
Copy link

bluebaer7 commented Nov 15, 2020

installed the update on pi3b+ and got follow error:

**

pi@pi:~/garmin/antfs-cli $ antfs-cli Traceback (most recent call last): File "/usr/local/bin/antfs-cli", line 11, in <module> load_entry_point('antfs-cli==0.4', 'console_scripts', 'antfs-cli')() File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 561, in load_entry_point File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 2631, in load_entry_point File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 2291, in load File "build/bdist.linux-armv7l/egg/pkg_resources/__init__.py", line 2297, in resolve File "/usr/local/lib/python2.7/dist-packages/antfs_cli-0.4-py2.7.egg/antfs_cli/program.py", line 181 print(" - Passkey:", end=" ") ^ SyntaxError: invalid syntax

**

@L150
Copy link
Author

L150 commented Nov 27, 2020

Hi, have reinstalled both Kali and Python3. Get this Timed Out message.
Looks like it finds the USB when running lsusb, but I'm thinking about a faulty Ant stick...?
Any opinions?
Perhaps using USB3 driver?

──(anon㉿kali)-[~]
└─$ antfs-cli --pair
Driver available: [<class 'ant.base.driver.USB2Driver'>, <class 'ant.base.driver.USB3Driver'>]

  • Using: <class 'ant.base.driver.USB2Driver'>
    Request basic information...
    Capabilities: array('B', [8, 3, 0, 186, 54, 0])
    Starting system...
    Key done...
    Searching...
    Exception in thread ant.base:
    Traceback (most recent call last):
    File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
    File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
    File "/usr/local/lib/python3.8/dist-packages/ant/base/ant.py", line 180, in _worker
    and message.data[1] == 0x01
    AttributeError: 'Message' object has no attribute 'data'
    Traceback (most recent call last):
    File "/usr/local/lib/python3.8/dist-packages/antfs_cli-0.4-py3.8.egg/antfs_cli/program.py", line 384, in main
    g.start()
    File "/usr/local/lib/python3.8/dist-packages/ant/fs/manager.py", line 223, in start
    self._main()
    File "/usr/local/lib/python3.8/dist-packages/ant/fs/manager.py", line 150, in _main
    if self.on_link(beacon):
    File "/usr/local/lib/python3.8/dist-packages/antfs_cli-0.4-py3.8.egg/antfs_cli/program.py", line 167, in on_link
    self.link()
    File "/usr/local/lib/python3.8/dist-packages/ant/fs/manager.py", line 383, in link
    self._send_command(LinkCommand(self._frequency, 4, self._serial_number))
    File "/usr/local/lib/python3.8/dist-packages/ant/fs/manager.py", line 199, in _send_command
    self._channel.send_acknowledged_data(data)
    File "/usr/local/lib/python3.8/dist-packages/ant/easy/channel.py", line 119, in send_acknowledged_data
    self.wait_for_event([Message.Code.EVENT_TRANSFER_TX_COMPLETED])
    File "/usr/local/lib/python3.8/dist-packages/ant/easy/channel.py", line 50, in wait_for_event
    return wait_for_event(ok_codes, self._node._events, self._node._event_cond)
    File "/usr/local/lib/python3.8/dist-packages/ant/easy/filter.py", line 73, in wait_for_event
    return wait_for_message(match, process, queue, condition)
    File "/usr/local/lib/python3.8/dist-packages/ant/easy/filter.py", line 62, in wait_for_message
    raise AntException("Timed out while waiting for message")
    ant.easy.exception.AntException: Timed out while waiting for message
    Interrupted: Timed out while waiting for message

┌──(anon㉿kali)-[~]
└─$

@Tigge
Copy link
Owner

Tigge commented Nov 28, 2020

@L150 There should be a new openant out with a fix for this

@bluebaer7 Looks like you are also running Python 2.7. It is now unsupported.

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

3 participants