rmst / yoke

Turns your Android device into a customizable gamepad for Windows/Mac/Linux
MIT License
219 stars 24 forks source link

Yoke crash on startup #52

Closed pmolodyk closed 4 years ago

pmolodyk commented 4 years ago

I am using Fedora 32. After running yoke-enable-uinput I run yoke and get the following error and the app crashes:

Starting service... Press Ctrl+C to exit.
Shutting down...
Exception in thread zeroconf-Engine-32239:
Traceback (most recent call last):
  File "/usr/lib64/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/home/pmolodyk/.local/lib/python3.8/site-packages/zeroconf/__init__.py", line 1314, in run
    reader.handle_read(socket_)
  File "/home/pmolodyk/.local/lib/python3.8/site-packages/zeroconf/__init__.py", line 1396, in handle_read
    self.zc.handle_query(msg, None, _MDNS_PORT)
  File "/home/pmolodyk/.local/lib/python3.8/site-packages/zeroconf/__init__.py", line 2716, in handle_query
    DNSText(
  File "/home/pmolodyk/.local/lib/python3.8/site-packages/zeroconf/__init__.py", line 618, in __init__
    assert isinstance(text, (bytes, type(None)))
AssertionError
Traceback (most recent call last):
  File "./yoke", line 85, in <module>
    service.run()
  File "/home/pmolodyk/.local/lib/python3.8/site-packages/yoke/service.py", line 162, in run
    zeroconf.register_service(self.info, ttl=10)
  File "/home/pmolodyk/.local/lib/python3.8/site-packages/zeroconf/__init__.py", line 2419, in register_service
    self._broadcast_service(info)
  File "/home/pmolodyk/.local/lib/python3.8/site-packages/zeroconf/__init__.py", line 2459, in _broadcast_service
    DNSText(info.name, _TYPE_TXT, _CLASS_IN | _CLASS_UNIQUE, info.other_ttl, info.text), 0
  File "/home/pmolodyk/.local/lib/python3.8/site-packages/zeroconf/__init__.py", line 618, in __init__
    assert isinstance(text, (bytes, type(None)))
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./yoke", line 90, in <module>
    service.close()
  File "/home/pmolodyk/.local/lib/python3.8/site-packages/yoke/service.py", line 213, in close
    zeroconf.unregister_service(self.info)
  File "/home/pmolodyk/.local/lib/python3.8/site-packages/zeroconf/__init__.py", line 2503, in unregister_service
    out.add_answer_at_time(DNSText(info.name, _TYPE_TXT, _CLASS_IN | _CLASS_UNIQUE, 0, info.text), 0)
  File "/home/pmolodyk/.local/lib/python3.8/site-packages/zeroconf/__init__.py", line 618, in __init__
    assert isinstance(text, (bytes, type(None)))
AssertionError
pzmarzly commented 4 years ago

Are you running the latest version from master?

Your error looks a lot like #50

pmolodyk commented 4 years ago

I installed it with pip

pmolodyk commented 4 years ago

I cloned the repo and launched yoke from the /bin folder, and got

Traceback (most recent call last):
  File "./yoke", line 17, in <module>
    service = yoke.Service(args.name, args.id, args.iface, args.port, args.buffer)
TypeError: __init__() takes  from 2 to 3 positional arguments but 6 were given
pmolodyk commented 4 years ago

So it seems the version of yoke in pip3 conflicts with the latest commit, I replaced the yoke dir from ~/.local/lib/python3.8/site-packages/yoke with the one from the commit and now I can start it up but when I connect from the phone I get

Traceback (most recent call last):
  File "/home/pmolodyk/.local/lib/python3.8/site-packages/yoke/service.py", line 364, in run
    v = self.preprocess(m, len(self.dev.events))
  File "/home/pmolodyk/.local/lib/python3.8/site-packages/yoke/service.py", line 288, in preprocess
    v = tuple([int(m) for m in v])
  File "/home/pmolodyk/.local/lib/python3.8/site-packages/yoke/service.py", line 288, in <listcomp>
    v = tuple([int(m) for m in v])
ValueError: invalid literal for int() with base 10: b' 9.548422 -0.41191998 2.197351 0.0 0.0 0.0 0.0'
jayasio commented 4 years ago

I'm getting the same issue on Windows

ValueError: invalid literal for int() with base 10: b' 1.3410755 -0.037809316 9.714447 0.0 0.0 0.0 0.0'

Is this a possible solution? (StackOverflow)

jayasio commented 4 years ago

I think replacing int() with int.from_bytes() solves the issue, but I'm not sure of the byte type and byte order.

pzmarzly commented 4 years ago

We changed not just the Python backend, but also the Android app, so the message format is different. That's probably why it isn't working for you. The latest version can be found in devel/app-debug.apk (for Android <= 8), or in this comment (should work for all Android versions but I haven't got any feedback).

Yes, the version split has been a mess for past 2 years or so, we should probably finally get rid of all v0.1 things. @rmst

BTW this project could use more maintainers (I'm not even on Android anymore).

pmolodyk commented 4 years ago

I got it running, thanks, so I guess we can close this issue. Steam still doesn't recognise yoke as a gamepad, though, so I cant use it.