Code Monkey home page Code Monkey logo

xbox-smartglass-core-python's People

Contributors

dependabot[bot] avatar hunterjm avatar schamper avatar tuxuser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

xbox-smartglass-core-python's Issues

Analog input nothing happen!

only button keys can be work
xbox.console.gamepad_input(GamePadButton.DPadUp) # works good
xbox.console.gamepad_input(GamePadButton.A) # works good

xbox.console.gamepad_input(GamePadButton.Clear,l_trigger=0xff) # nothing to do...
xbox.console.gamepad_input(GamePadButton.Clear,l_trigger=0xffff) # nothing to do...
xbox.console.gamepad_input(GamePadButton.Clear,l_trigger=0xffffff) # nothing to do...

need some help about Analog keys format .

Cannot find "%AppData%\Local\OpenXbox\Xbox"

I am running Windows 10 version 1803, running Python 3.6.5. While trying to use any of the tools from the SmartGlass Core, I get the following error:

Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\runpy.py", line 85, in _run_code

    exec(code, run_globals)
  File "C:\Users\User\AppData\Local\Programs\Python\Python36-32\Scripts\xbox-authenticate.exe\__main__.py", line 5, in <module>
  File "C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\site-packages\xbox\webapi\scripts\__init__.py", line 8, in <module>
    os.mkdir(DATA_DIR)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\User\\AppData\\Local\\OpenXbox\\xbox'

I've made sure that the Python folder as well as the Scripts folder are present on my PATH, and I'm not sure where to go from here.

Issue authenticating

Hi,

Suddenly I am getting an error when trying to authenticate, this happens both through the rest api as well as with xbox-authenticate and xbox-tui, this is the stacktrace:

File "/usr/local/lib/python3.6/dist-packages/urwid/wimp.py", line 540, in keypress
self._emit('click')
File "/usr/local/lib/python3.6/dist-packages/urwid/widget.py", line 460, in _emit
signals.emit_signal(self, name, self, *args)
File "/usr/local/lib/python3.6/dist-packages/urwid/signals.py", line 265, in emit
result |= self._call_callback(callback, user_arg, user_args, args)
File "/usr/local/lib/python3.6/dist-packages/urwid/signals.py", line 295, in _call_callback
return bool(callback(*args_to_pass))
File "/usr/local/lib/python3.6/dist-packages/xbox/webapi/scripts/tui.py", line 274, in _on_button_press
self._authenticate(email, pwd)
File "/usr/local/lib/python3.6/dist-packages/xbox/webapi/scripts/tui.py", line 252, in _authenticate
self.auth_mgr.authenticate(do_refresh=True) # do_refresh=self.need_refresh
File "/usr/local/lib/python3.6/dist-packages/xbox/webapi/authentication/manager.py", line 174, in authenticate
self.access_token, self.refresh_token = self._windows_live_authenticate(self.email_address, self.password)
File "/usr/local/lib/python3.6/dist-packages/xbox/webapi/authentication/manager.py", line 228, in _windows_live_authenticate
response = self.__window_live_authenticate_request(email_address, password)
File "/usr/local/lib/python3.6/dist-packages/xbox/webapi/authentication/manager.py", line 391, in __window_live_authenticate_request
server_data = self.extract_js_object(resp.content, "ServerData")
File "/usr/local/lib/python3.6/dist-packages/xbox/webapi/authentication/manager.py", line 208, in extract_js_object
return demjson.decode(matches[0])
File "/usr/local/lib/python3.6/dist-packages/demjson.py", line 5699, in decode
return_stats=(return_stats or write_stats) )
File "/usr/local/lib/python3.6/dist-packages/demjson.py", line 4915, in decode
raise errors[0]
demjson.JSONDecodeError: Missing value for object property, expected ":"

these are the versions:
{"xbox-smartglass-auxiliary":null,"xbox-smartglass-core":"1.0.12","xbox-smartglass-nano":null,"xbox-smartglass-rest":"0.9.8","xbox-smartglass-stump":"0.9.5","xbox-webapi":"1.1.7"}

Xbox on different subnet

Hi, I noticed an earlier issue with this name, but that was resolved by adding a NIC and that is not something I want to do, I have my Xbox Smartglass Container running (as part of Home Assistant) on a machine in a management vnet (10.0.0.x) while my xbox is in my IoT vnet (10.0.2.x), I'm using Unifi gear, and have setup IGMP snooping on both networks, I've also added IGMP proxy with the Management Lan as upstream and the IoT lan as downstream. My firewall rules are to allow all traffic from Mngt to IoT, and I've added explicit rules to allow traffic to the xbox ip, and for UDP on port 5050 to the xboxip as well.

When I do a /device call or /device?addr=xboxip I get back:
{"devices":{},"success":true}

The xbox app on my phone works when connected to the IoT network and doesn't see the xbox when on the regular network.

Any pointers to what else I can try to get it working.

I can't install due to incompatible python?

I just upgraded to the latest python, but it seems maybe it's too new?

pi@raspberrypi:~ $ python -V Python 3.8.0 pi@raspberrypi:~ $ pip install xbox-smartglass-core Defaulting to user installation because normal site-packages is not writeable Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting xbox-smartglass-core Using cached https://www.piwheels.org/simple/xbox-smartglass-core/xbox_smartglass_core-1.2.2-py2.py3-none-any.whl (84 kB) ERROR: Package 'xbox-smartglass-core' requires a different Python: 3.5.3 not in '>=3.6' pi@raspberrypi:~ $

anybody know how I can successfully install this?

Unable to launch apps remotely

Hi,
recently I encountered issue with launching apps using ConsoleWrap.launch_title() method . I was using it earlier with "ms-windows-store:" to launch Store app and "ms-settings" for Settings.
I observed that it stopped working for me (app does not launch on Xbox).
I've also tried using GET request: "device/<Xbox_live_id>/launch/ms-windows-store:". The output of that was: {"launched":"ms-windows-store:","success":true} but still it didn't trigger application launch.
My suspicion is that problem is related with latest OS updates of Xbox One.

Console is Xbox One X with OS version: 10.0.17763.4088.

I am using Python 3.7.0. This is my enviroment:
appdirs==1.4.3
asn1crypto==0.24.0
certifi==2019.3.9
cffi==1.12.2
chardet==3.0.4
Click==7.0
construct==2.9.41
cryptography==2.3.1
demjson==2.2.4
dpkt==1.9.1
Flask==1.0.2
gevent==1.3.7
greenlet==0.4.15
idna==2.8
itsdangerous==1.1.0
Jinja2==2.10
MarkupSafe==1.1.1
marshmallow==2.19.1
marshmallow-objects==1.0.19
pycparser==2.19
requests==2.21.0
six==1.12.0
urllib3==1.24.1
urwid==2.0.1
Werkzeug==0.15.0
xbox-smartglass-core==1.0.12
xbox-smartglass-rest==0.9.8
xbox-smartglass-stump==0.9.5
xbox-webapi==1.1.7

TypeError: from_buffer() cannot return the address of the raw string within a bytes or unicode or bytearray object

Hi,
Why do I always get error such as this;

user@ubuntu1604:~$ xbox-poweroff --all
INFO:authentication:Loaded token <class 'xbox.webapi.authentication.token.AccessToken'> from file
INFO:authentication:Loaded token <class 'xbox.webapi.authentication.token.RefreshToken'> from file
INFO:authentication:Loaded token <class 'xbox.webapi.authentication.token.UserToken'> from file
INFO:authentication:Loaded token <class 'xbox.webapi.authentication.token.XSTSToken'> from file
Traceback (most recent call last):
  File "/usr/local/bin/xbox-poweroff", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/dist-packages/xbox/sg/scripts/poweroff.py", line 63, in main
    state = c.connect(userhash, token)
  File "/usr/local/lib/python3.5/dist-packages/xbox/sg/console.py", line 284, in connect
    xsts_token=xsts_token)
  File "/usr/local/lib/python3.5/dist-packages/xbox/sg/protocol.py", line 452, in connect
    self.send_message(m)
  File "/usr/local/lib/python3.5/dist-packages/xbox/sg/protocol.py", line 137, in send_message
    data = packer.pack(msg, self.crypto)
  File "/usr/local/lib/python3.5/dist-packages/xbox/sg/packer.py", line 117, in pack
    packed_protected = crypto.encrypt(iv, packed_protected)
  File "/usr/local/lib/python3.5/dist-packages/xbox/sg/crypto.py", line 274, in encrypt
    return Crypto._encrypt(self._encrypt_key, iv, plaintext)
  File "/usr/local/lib/python3.5/dist-packages/xbox/sg/crypto.py", line 323, in _encrypt
    return Crypto._crypt(key=key, iv=iv, encrypt=True, data=data)
  File "/usr/local/lib/python3.5/dist-packages/xbox/sg/crypto.py", line 341, in _crypt
    return cryptor.update(data) + cryptor.finalize()
  File "/usr/local/lib/python3.5/dist-packages/cryptography/hazmat/primitives/ciphers/base.py", line 149, in update
    return self._ctx.update(data)
  File "/usr/local/lib/python3.5/dist-packages/cryptography/hazmat/backends/openssl/ciphers.py", line 120, in update
    n = self.update_into(data, buf)
  File "/usr/local/lib/python3.5/dist-packages/cryptography/hazmat/backends/openssl/ciphers.py", line 131, in update_into
    "unsigned char *", self._backend._ffi.from_buffer(buf)
**TypeError: from_buffer() cannot return the address of the raw string within a bytes or unicode or bytearray object**

I am able to authenticate and discover, but when I try something else I always get that error.
I have check dependencies and versions, and it all seem correct.
What am I missing.

Running Version: 1.1.7

Cant refresh tokens

I have a strange issue that I cant seem to see anyone else having.

I always get the error AuthenticationManager was not able to authenticate with provided tokens or user credentials! even though the refresh token is in date?

As soon as the access_token expires the home assistant plugin starts chucking out [custom_components.xboxone.media_player] Refreshing authentication tokens failed! almost every 8 seconds. I have manually tried refreshing and its still does the original error.

I am currently running this in docker using the below versions:

"xbox-smartglass-core": "1.2.2",
"xbox-smartglass-nano": null,
"xbox-webapi": "1.1.8"

I have experienced this in all versions since before it was rolled into the core. I have ran out of ideas on how to fix it, any help would be appreciated.

Rest API not working

I may not be understanding, but I'm getting the following error below. Am I missing something?

The scripts from CLI work fine. Does the rest server not look at these login scripts?

{"message":"Console liveid is not alive","success":false}

Cannot load Apps

I’m not able to load apps.

Is this a known issue, or something I’m doing wrong?

HELP! Everything is broken! OMG

xbox-smartglass-nano is broken!

YES, you are not alone. It currently is broken and there is no workaround. Be patient

After upgrading to xbox-smartglass-core v1.3.0 dependencies are broken, there are weird errors popping up!

You used python virtual environments, right?

Here is what you gotta do:

  1. Delete the old python virtual environment
  2. Create a new virtual environment
  3. Install latest xbox-smartglass-core via pip

Practical example

  1. Delete old virtual env folder.
    Now:
python3 -m venv venv
source venv/bin/activate
pip install xbox-smartglass-core

The ReST server is broken, none of the old requests work anymore!

Yup, that's expected too. The ReST server was migrated to the FastApi framework and the API was changed / cleaned up.

Check out: https://github.com/OpenXbox/xbox-smartglass-core-python#rest-api

Meh, the new upgrade to asyncio is shit, I want the old version.

Ok, whatever. Clone the old state of the repo and pin xbox-webapi to ==1.1.8. There obviously wont be any support for older versions tho.

The library reports something like xyz was not awaited ...

Thanks, good catch. I forgot something while migrating from gevent to asyncio. Please file an issue, attach a log and describe how this condition was reached.

Python 3.6 Requirement Necessary?

First off, thanks for the awesome documentation around the smartglass interface! I was looking to integrate this library into Home Assistant, which is an open source home automation hub. Unfortunately, the project is run mostly on python 3.5, along with the base images they provide.

Is there a compatibility reason for this library to require 3.6 and not support 3.5, or was the decision mainly for extra language features (like Flag)?

If there are no technical limitations, would you be open to a PR enabling 3.5 support?

Fallout 4 Xbox

Hello,

I came across this repo whilst searching for an api for the fallout 4 pip boy app. I was wondering if this library was capable of getting that data from my Xbox.

Unable to list devices after successful authentication

Latest version of xbox-webapi-python, authenticated successfully via API calls, /auth shows that I have a current token and identifies me as the correct user.

/device and /device?addr=<xbox ip> return [] even when XBox LiveID is provided in query string

Only thing I can think of is that the XBox is on a different VLAN to the WebAPI Server, however all ports are open and IGMP traffic is allowed between the two subnets.

Is it possible to launch apps directly?

I've managed to authenticate, power the Xbox on, and wait until it's discoverable and connect.

The last part of my script would be to launch the LiveTV app. The documentation is... less helpful than I might like. I know that I need to use the launch_title() method, and that it takes one positional arg and another optional (uri and location). However, it's less clear just what those should look like, and how I could determine the correct values (either programmatically, or just something to hardcode in... there's only one app I want to launch). I'm not the strongest python coder, but I perused the rest app's code and I see where it is using this method, but since the user has to supply the value to it, I still have no idea what I'm looking for. I'm not even sure if that value changes from Xbox to Xbox, or from reboot to reboot or whatever.

Is this even possible to do anymore? Another issue on the core-csharp project says Microsoft may have nuked this feature from orbit.

If anyone's interested, this is to be run from Retropie plugged into the second HDMI port, and would allow it to bring up its own screen directly once activated.

Potential dependency conflicts between xbox-smartglass-rest-python and urwid

Hi, as shown in the following full dependency graph of xbox-smartglass-rest-python, xbox-webapi requires urwid, while the installed version of xbox-smartglass-core(1.0.12) requires urwid==2.0.1.

According to Pip's “first found wins” installation strategy, urwid==2.0.1 is the actually installed version.

Although the first found package version urwid==2.0.1 just satisfies the later dependency constraint (urwid==2.0.1), it will lead to a build failure once developers release a newer version of bleach.

Dependency tree--------

xbox-smartglass-rest-python-master
| +-flask(version range:*)
| | +-click(version range:>=5.1)
| | +-itsdangerous(version range:>=0.24)
| | +-jinja2(version range:>=2.10.1)
| | | +-markupsafe(version range:>=0.23)
| | +-werkzeug(version range:>=0.15)
| +-xbox-smartglass-core(version range:>=1.0.12)
| | +-aenum(version range:==2.1.2)
| | +-appdirs(version range:==1.4.3)
| | +-construct(version range:==2.9.41)
| | +-cryptography(version range:==2.3.1)
| | +-dpkt(version range:==1.9.1)
| | +-gevent(version range:==1.3.7)
| | +-urwid(version range:==2.0.1)
| | +-xbox-webapi(version range:>=1.1.2)
| | | +-appdirs(version range:*)
| | | +-demjson(version range:*)
| | | +-requests(version range:*)
| | | | +-certifi(version range:>=2017.4.17)
| | | | +-chardet(version range:<3.1.0,>=3.0.2)
| | | | +-idna(version range:>=2.5,<2.9)
| | | | +-urllib3(version range:<1.26,>=1.21.1)
| | | +-urwid(version range:*)
| +-xbox-smartglass-stump(version range:>=0.9.5)
| | +-marshmallow-objects(version range:*)
| | | +-marshmallow(version range:*)
| | +-xbox-smartglass-core(version range:>=1.0.12)
| | | +-aenum(version range:==2.1.2)
| | | +-appdirs(version range:==1.4.3)
| | | +-construct(version range:==2.9.41)
| | | +-cryptography(version range:==2.3.1)
| | | +-dpkt(version range:==1.9.1)
| | | +-gevent(version range:==1.3.7)
| | | +-urwid(version range:==2.0.1)
| | | +-xbox-webapi(version range:>=1.1.2)
| | | | +-appdirs(version range:*)
| | | | +-demjson(version range:*)
| | | | +-requests(version range:*)
| | | | +-urwid(version range:*)
| +-xbox-webapi(version range:>=1.1.7)
| | +-appdirs(version range:*)
| | +-demjson(version range:*)
| | +-requests(version range:*)
| | | +-certifi(version range:>=2017.4.17)
| | | +-chardet(version range:<3.1.0,>=3.0.2)
| | | +-idna(version range:>=2.5,<2.9)
| | | +-urllib3(version range:<1.26,>=1.21.1)
| | +-urwid(version range:*)

Thanks for your attention.
Best,
Neolith

xbox-client

Hi,

When running xbox-client or many of the other commands, I get this error.

xbox-client --verbose

INFO:authentication:Loaded token <class 'xbox.webapi.authentication.token.AccessToken'> from file
INFO:authentication:Loaded token <class 'xbox.webapi.authentication.token.RefreshToken'> from file
INFO:authentication:Loaded token <class 'xbox.webapi.authentication.token.UserToken'> from file
INFO:authentication:Loaded token <class 'xbox.webapi.authentication.token.XSTSToken'> from file
DEBUG:xbox.sg.protocol:Received DiscoverResponse from 192.168.1.138
<XStructObj: None>(Container:
header = Container:
pkt_type = PacketType.DiscoveryResponse
unprotected_payload_length = 655
protected_payload_length = None
version = 2
unprotected_payload = Container:
flags = PrimaryDeviceFlag.AllowAnonymousUsers|AllowAuthenticatedUsers
type = ClientType.XboxOne
name = u'Xbox-SystemOS' (total 13)
uuid = 049ae374-d032-46b4-3f98-8c1fa887fd4c
last_error = 0
cert = <CertificateInfo: liveid=FD00F24E11D68BXX, pubkey=<cryptography.hazmat.backends.openssl.ec._EllipticCurvePublicKey object at 0x7fd4f88a4400>>
protected_payload = None)
DEBUG:xbox.sg.protocol:Received DiscoverResponse from 192.168.1.138
<XStructObj: None>(Container:
header = Container:
pkt_type = PacketType.DiscoveryResponse
unprotected_payload_length = 655
protected_payload_length = None
version = 2
unprotected_payload = Container:
flags = PrimaryDeviceFlag.AllowAnonymousUsers|AllowAuthenticatedUsers
type = ClientType.XboxOne
name = u'Xbox-SystemOS' (total 13)
uuid = 049ae374-d032-46b4-3f98-8c1fa887fd4c
last_error = 0
cert = <CertificateInfo: liveid=FD00F24E11D68BXX, pubkey=<cryptography.hazmat.backends.openssl.ec._EllipticCurvePublicKey object at 0x7fd4f88a4128>>
protected_payload = None)
Traceback (most recent call last):
File "/usr/local/bin/xbox-client", line 10, in
sys.exit(main())
File "/usr/local/lib/python3.5/dist-packages/xbox/sg/scripts/client.py", line 76, in main
state = console.connect(userhash, token)
File "/usr/local/lib/python3.5/dist-packages/xbox/sg/console.py", line 284, in connect
xsts_token=xsts_token)
File "/usr/local/lib/python3.5/dist-packages/xbox/sg/protocol.py", line 452, in connect
self.send_message(m)
File "/usr/local/lib/python3.5/dist-packages/xbox/sg/protocol.py", line 137, in send_message
data = packer.pack(msg, self.crypto)
File "/usr/local/lib/python3.5/dist-packages/xbox/sg/packer.py", line 117, in pack
packed_protected = crypto.encrypt(iv, packed_protected)
File "/usr/local/lib/python3.5/dist-packages/xbox/sg/crypto.py", line 274, in encrypt
return Crypto._encrypt(self._encrypt_key, iv, plaintext)
File "/usr/local/lib/python3.5/dist-packages/xbox/sg/crypto.py", line 323, in _encrypt
return Crypto._crypt(key=key, iv=iv, encrypt=True, data=data)
File "/usr/local/lib/python3.5/dist-packages/xbox/sg/crypto.py", line 341, in _crypt
return cryptor.update(data) + cryptor.finalize()
File "/usr/local/lib/python3.5/dist-packages/cryptography/hazmat/primitives/ciphers/base.py", line 149, in update
return self._ctx.update(data)
File "/usr/local/lib/python3.5/dist-packages/cryptography/hazmat/backends/openssl/ciphers.py", line 120, in update
n = self.update_into(data, buf)
File "/usr/local/lib/python3.5/dist-packages/cryptography/hazmat/backends/openssl/ciphers.py", line 131, in update_into
"unsigned char *", self._backend._ffi.from_buffer(buf)
TypeError: from_buffer() cannot return the address of the raw string within a bytes or unicode or bytearray object


Requirement already satisfied: xbox-smartglass-core in /usr/local/lib/python3.5/dist-packages (1.0.12)
Requirement already satisfied: xbox-webapi>=1.1.2 in /usr/local/lib/python3.5/dist-packages (from xbox-smartglass-core) (1.1.7)
Requirement already satisfied: construct==2.9.41 in /usr/local/lib/python3.5/dist-packages (from xbox-smartglass-core) (2.9.41)
Requirement already satisfied: gevent==1.3.7 in /usr/local/lib/python3.5/dist-packages (from xbox-smartglass-core) (1.3.7)
Requirement already satisfied: appdirs==1.4.3 in /usr/local/lib/python3.5/dist-packages (from xbox-smartglass-core) (1.4.3)
Requirement already satisfied: urwid==2.0.1 in /usr/local/lib/python3.5/dist-packages (from xbox-smartglass-core) (2.0.1)
Requirement already satisfied: cryptography==2.3.1 in /usr/local/lib/python3.5/dist-packages (from xbox-smartglass-core) (2.3.1)
Requirement already satisfied: aenum==2.1.2; python_version <= "3.5" in /usr/local/lib/python3.5/dist-packages (from xbox-smartglass-core) (2.1.2)
Requirement already satisfied: dpkt==1.9.1 in /usr/local/lib/python3.5/dist-packages (from xbox-smartglass-core) (1.9.1)
Requirement already satisfied: demjson in /usr/local/lib/python3.5/dist-packages (from xbox-webapi>=1.1.2->xbox-smartglass-core) (2.2.4)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from xbox-webapi>=1.1.2->xbox-smartglass-core) (2.9.1)
Requirement already satisfied: greenlet>=0.4.14; platform_python_implementation == "CPython" in /usr/local/lib/python3.5/dist-packages (from gevent==1.3.7->xbox-smartglass-core) (0.4.15)
Requirement already satisfied: cffi!=1.11.3,>=1.7 in /usr/local/lib/python3.5/dist-packages (from cryptography==2.3.1->xbox-smartglass-core) (1.12.3)
Requirement already satisfied: asn1crypto>=0.21.0 in /usr/local/lib/python3.5/dist-packages (from cryptography==2.3.1->xbox-smartglass-core) (0.24.0)
Requirement already satisfied: six>=1.4.1 in /usr/lib/python3/dist-packages (from cryptography==2.3.1->xbox-smartglass-core) (1.10.0)
Requirement already satisfied: idna>=2.1 in /usr/local/lib/python3.5/dist-packages (from cryptography==2.3.1->xbox-smartglass-core) (2.8)
Requirement already satisfied: pycparser in /usr/local/lib/python3.5/dist-packages (from cffi!=1.11.3,>=1.7->cryptography==2.3.1->xbox-smartglass-core) (2.19)

Cant figure out why.. running python3.5.2.
Any idea?

Linux (Raspbian) - Failed building wheel for gevent

When setting up through the PiP install on a Raspberry Pi, I always get this error:

Running setup.py bdist_wheel for gevent ... |``^H^-^C^error
 Failed building wheel for gevent
 Running setup.py clean for gevent
 Running setup.py bdist_wheel for cryptography ... error
 Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-vgnQoo/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpozddzApip-wheel- --python-tag cp27:
 Package libffi was not found in the pkg-config search path.
 Perhaps you should add the directory containing `libffi.pc'
 to the PKG_CONFIG_PATH environment variable
 No package 'libffi' found
 Package libffi was not found in the pkg-config search path.
 Perhaps you should add the directory containing `libffi.pc'
 to the PKG_CONFIG_PATH environment variable
 No package 'libffi' found
 Package libffi was not found in the pkg-config search path.
 Perhaps you should add the directory containing `libffi.pc'
 to the PKG_CONFIG_PATH environment variable
 No package 'libffi' found
 Package libffi was not found in the pkg-config search path.
 Perhaps you should add the directory containing `libffi.pc'
 to the PKG_CONFIG_PATH environment variable
 No package 'libffi' found
 Package libffi was not found in the pkg-config search path.
 Perhaps you should add the directory containing `libffi.pc'
 to the PKG_CONFIG_PATH environment variable
 No package 'libffi' found
 c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
  #include <ffi.h>
                  ^
 compilation terminated.
 Traceback (most recent call last):
   File "<string>", line 1, in <module>
   File "/tmp/pip-build-vgnQoo/cryptography/setup.py", line 319, in <module>
     **keywords_with_side_effects(sys.argv)
   File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
     _setup_distribution = dist = klass(attrs)
   File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 317, in __init__
     self.fetch_build_eggs(attrs['setup_requires'])
   File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 372, in fetch_build_eggs
     replace_conflicting=True,
   File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 846, in resolve
     dist = best[req.key] = env.best_match(req, ws, installer)
   File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1118, in best_match
     return self.obtain(req, installer)
   File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1130, in obtain
     return installer(requirement)
   File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 440, in fetch_build_egg
     return cmd.easy_install(req)
   File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 699, in easy_install
     return self.install_item(spec, dist.location, tmpdir, deps)
   File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 725, in install_item
     dists = self.install_eggs(spec, download, tmpdir)
   File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 906, in install_eggs
     return self.build_and_install(setup_script, setup_base)
   File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1145, in build_and_install
     self.run_setup(setup_script, setup_base, args)
   File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1133, in run_setup
     raise DistutilsError("Setup script exited with %s" % (v.args[0],))
 distutils.errors.DistutilsError: Setup script exited with error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

 ----------------------------------------
 Failed building wheel for cryptography

Docker image?

There are 2 unofficial docker image of this available but none of them work. Would you be able to release an official Docker version? Would be very much appreciated.

No module named xbox.sg

When I try using the smartglass api, I receive an error "No module named xbox.sg".

It happens on command line and in the IDE (Spyder). The other imports are working well, e. g. xbox.webapi

I tried a lot of stuff, like explicity adding the lib to pythonPath, also tried installing via pip and via "python setup.py install".

Also when I use spyder and type "from xbox.sg.console import Console" and than click on sg or consle he opens the correct files.

So I dont really get what the error could be... is there any reason why this shouldn't work?

OS: Ubuntu 16.04 Python: 3.6

ModuleNotFoundError: No module named 'xbox.webapi.scripts.tui'

Hi,

On a brand new Python 3.8 virtual environment (Ubuntu 20.04), every command return the same error :

(openxbox) [flaunay@LPT-FLAUNAY ~]$ xbox-tui
<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
Traceback (most recent call last):
  File "/home/flaunay/personal/virtualenv/openxbox/bin/xbox-tui", line 5, in <module>
    from xbox.scripts.main_cli import main_tui
  File "/home/flaunay/personal/virtualenv/openxbox/lib/python3.8/site-packages/xbox/scripts/main_cli.py", line 20, in <module>
    from xbox.handlers import tui, gamepad_input, text_input, fallout4_relay
  File "/home/flaunay/personal/virtualenv/openxbox/lib/python3.8/site-packages/xbox/handlers/tui.py", line 17, in <module>
    from xbox.webapi.scripts.tui import WebAPIDisplay
ModuleNotFoundError: No module named 'xbox.webapi.scripts.tui'

And visibly, there is no file named tui.py in xbox/webapi/scripts directory :

(openxbox) [flaunay@LPT-FLAUNAY ~]$ ls -lnh /home/flaunay/personal/virtualenv/openxbox/lib/python3.8/site-packages/xbox/webapi/scripts/
total 24K
-rw-r--r-- 1 212193 200513 3,0K oct.  28 21:13 authenticate.py
-rw-r--r-- 1 212193 200513 3,3K oct.  28 21:13 change_gamertag.py
-rw-r--r-- 1 212193 200513 2,1K oct.  28 21:13 friends.py
-rw-r--r-- 1 212193 200513  389 oct.  28 21:13 __init__.py
drwxr-xr-x 2 212193 200513 4,0K oct.  28 21:13 __pycache__
-rw-r--r-- 1 212193 200513 1,1K oct.  28 21:13 search.py

I am missing something ?

Thank you in advance.

PS : urwid is installed

[UWP development] Mixing smartglass and device portal core API

Hi there,

First of all, you've bee doing a terrific job with backward engineering of the smartglass protocol, no doubts about that!

I have a following question:
Have you tried to mix, use in the same time, the smartglass, for instance to start the console, and device portal core api (https://docs.microsoft.com/en-us/windows/uwp/debug-test-perf/device-portal-api-core) to for instance install/start an app using its id?

I tried but it looked like to use smartglass one has to be outside of the 'dev mode' which is at the same time required to use device portal core api.

Maybe it's only matter of some configuration.
Do you have some experience in that field?

Thanks again,
cheers!

Unit tests

We need basic tests written, I missed out on that initially.

dockerfile missing bind args

When building the container it by default wont allow you to connect to the rest server as the interface is binding to 127.0.0.1.

Changing this to the host machines IP allows connection. I would suggest allowing this as an environment arg if you can.

ADB daemon invalid packets

First of all, fantastic work on this project.

I am using Home Assistant to track the status of my devices using the command:
adb connect <ipaddress> > /dev/null && adb shell dumpsys power | grep 'Display Power' | cut -d "=" -f 2
This is producing a ton of error messages in the logs:

<gevent._socket3.socket object, fd=6, fam" 400 - 0.000497, proto=0>: Invalid HTTP method: 'CNXN\x00\x00\x00\x01\x00\x00\x04\x00\x1b\x00\x00\x00M\n'
<gevent._socket3.socket object, fd=6, fam" 400 - 0.000440, proto=0>: Invalid HTTP method: 'CNXN\x00\x00\x00\x01\x00\x00\x04\x00\x1b\x00\x00\x00M\n'
<gevent._socket3.socket object, fd=6, fam" 400 - 0.000447, proto=0>: Invalid HTTP method: 'CNXN\x00\x00\x00\x01\x00\x00\x04\x00\x1b\x00\x00\x00M\n'
<gevent._socket3.socket object, fd=6, fam" 400 - 0.000412, proto=0>: Invalid HTTP method: 'CNXN\x00\x00\x00\x01\x00\x00\x04\x00\x1b\x00\x00\x00M\n'

It would be great if we could "whitelist" only messages from a genuine xbox and filter out these invalid packets. More than happy to do whatever testing is required.

xbox-cli discover - broken?

I'm getting the following when trying to run the discover option.

Xbox SmartGlass main client started
Traceback (most recent call last):
File "/usr/local/bin/xbox-cli", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.6/dist-packages/xbox/scripts/main_cli.py", line 426, in main
discovered = cli_discover_consoles(args)
File "/usr/local/lib/python3.6/dist-packages/xbox/scripts/main_cli.py", line 302, in cli_discover_consoles
discovered = Console.discover(addr=args.address, timeout=1)
File "/usr/local/lib/python3.6/dist-packages/xbox/sg/console.py", line 215, in discover
cls.__start_cls_protocol()
File "/usr/local/lib/python3.6/dist-packages/xbox/sg/console.py", line 134, in __start_cls_protocol
cls.protocol.start()
File "/usr/local/lib/python3.6/dist-packages/gevent/baseserver.py", line 325, in start
self.init_socket()
File "/usr/local/lib/python3.6/dist-packages/gevent/server.py", line 253, in init_socket
self.socket = self.get_listener(self.address, self.family)
File "/usr/local/lib/python3.6/dist-packages/xbox/sg/protocol.py", line 80, in get_listener
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
OSError: [Errno 22] Invalid argument

SIGSEGV whenever I try to do anything.

<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
<frozen importlib._bootstrap>:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
Xbox SmartGlass main client started
fish: 'xbox-cli discover' terminated by signal SIGSEGV (Address boundary error)

Python 3.8.5

Lost socket after disconnect/reconnect

I think I found another issue. Not sure where exactly it is, but fairly easy to replicate in both my PR branch, and the master branch.

Steps to reporduce:

  1. Load TUI with console already on.
  2. Connect to console with "c"
  3. Disconnect from console with "d"
  4. Re-connect to console with "c"
  5. Wait for first _heartbeat

Result:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/gevent/greenlet.py", line 536, in run                                                                                                                                                         
    result = self._run(*self.args, **self.kwargs)                                                                                                                                                                                            
  File "/Users/jason/xbox-smartglass-core-python/xbox/sg/protocol.py", line 265, in _heartbeat                                                                                                                                               
    self.ack([], [], ServiceChannel.Core, need_ack=True)                                                                                                                                                                                    
  File "/Users/jason/xbox-smartglass-core-python/xbox/sg/protocol.py", line 498, in ack                                                                                                                                                     
    self.send_message(msg, channel=channel, blocking=need_ack)                                                                                                                                                                              
  File "/Users/jason/xbox-smartglass-core-python/xbox/sg/protocol.py", line 162, in send_message                                                                                                                                            
    self.socket.sendto(data, (addr, PORT))                                                                                                                                                                                                  
AttributeError: 'CoreProtocol' object has no attribute 'socket'                                                                                                                                                                             
Sat Jun 16 11:51:33 2018 <Greenlet at 0x10a035930: <bound method CoreProtocol._heartbeat of <CoreProtocol at 0x109fb8550 address=0.0.0.0:61568>>> failed with AttributeError

ImportError: cannot import name 'Flag'

OS: Raspbian Wheezy
Python Version: Python 3.5


When running `xbox-discover` , `xbox-poweroff` or `xbox-poweron` (not `xbox-authenticate`,  I get the following error message:

```(env) pi@raspberrypi:~ $ xbox-poweroff
Traceback (most recent call last):
  File "/home/pi/.local/bin/xbox-poweroff", line 7, in <module>
    from xbox.sg.scripts.poweroff import main
  File "/home/pi/.local/lib/python3.5/site-packages/xbox/sg/scripts/poweroff.py", line 13, in <module>
    from xbox.sg.console import Console
  File "/home/pi/.local/lib/python3.5/site-packages/xbox/sg/console.py", line 40, in <module>
    from xbox.sg.crypto import Crypto
  File "/home/pi/.local/lib/python3.5/site-packages/xbox/sg/crypto.py", line 34, in <module>
    from xbox.sg.enum import PublicKeyType
  File "/home/pi/.local/lib/python3.5/site-packages/xbox/sg/enum.py", line 5, in <module>
    from enum import Enum, Flag
ImportError: cannot import name 'Flag'

Media seek endpoint: TypeError: send_media_command() takes 2 positional arguments but 3 were given

Tried the seek command via

curl -X GET -i 'http://192.168.178.65:5557/device/myliveid/media/seek/5

but rest server gets error 500 with following log:

[2018-11-19 16:19:50,188] ERROR in app: Exception on /device/myliveid/media/seek/5 [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.5/dist-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/iobroker/node_modules/iobroker.xbox/python_modules/lib/python3.5/site-packages/xbox/rest/decorators.py", line 21, in decorated_function
    return f(*args, **kwargs)
  File "/opt/iobroker/node_modules/iobroker.xbox/python_modules/lib/python3.5/site-packages/xbox/rest/routes/device.py", line 214, in media_command_seek
    console.send_media_command(enum.MediaControlCommand.Seek, seek_position)
TypeError: send_media_command() takes 2 positional arguments but 3 were given
192.168.178.37 - - [2018-11-19 16:19:50] "GET /device/myliveid/media/seek/5 HTTP/1.1" 500 412 0.021084

Issue Connecting

Authentication works, now it is stuck at 'Connecting'
The log says:
xbox.sg.protocol: Sending ConnectRequest to 192.168.0.70
xbox.sg.protocol: Sending ConnectRequest to 192.168.0.70
xbox.sg.protocol: Sending ConnectRequest to 192.168.0.70
xbox.sg.protocol: Sending ConnectRequest to 192.168.0.70
... (repeatedly)
No timeouts are triggered, it just is stuck at 'Connecting' indefinitely

Cannot authenticate on rest server with v1.2.1

Getting the following error response "message":"Unhandled authentication error: expected str, bytes or os.PathLike object, not NoneType"

On client side nothing has changed, also the errors does not really make sense as response.

127.0.0.1 - - [2020-04-01 23:35:36] "GET /auth HTTP/1.1" 200 1915 0.007661
[2020-04-01 23:35:38,664] ERROR: {'success': False, 'message': 'Unhandled authentication error: expected str, bytes or os.PathLike object, not NoneType', 'two_factor_required': False}
127.0.0.1 - - [2020-04-01 23:35:38] "POST /auth/login HTTP/1.1" 500 274 4.761167
[2020-04-01 23:35:39,387] WARNING: Failed to import NanoManager (depends on xbox-smartglass-nano). /nano endpoint will not work!
127.0.0.1 - - [2020-04-01 23:35:39] "GET /device?addr=192.168.178.95 HTTP/1.1" 200 514 2.614691
[2020-04-01 23:35:40,466] ERROR: Exception in CoreProtocol datagram handler
Traceback (most recent call last):
  File "/opt/iobroker/node_modules/iobroker.xbox/python_modules/lib/python3.6/site-packages/xbox/sg/protocol.py", line 240, in handle
    self._on_message(msg, channel)
  File "/opt/iobroker/node_modules/iobroker.xbox/python_modules/lib/python3.6/site-packages/xbox/sg/protocol.py", line 313, in _on_message
    self._on_json(msg, channel)
  File "/opt/iobroker/node_modules/iobroker.xbox/python_modules/lib/python3.6/site-packages/xbox/sg/protocol.py", line 357, in _on_json
    self.on_json(text, channel)
  File "/opt/iobroker/node_modules/iobroker.xbox/python_modules/lib/python3.6/site-packages/xbox/sg/utils/events.py", line 34, in __call__
    handler(*args, **kwargs)
  File "/opt/iobroker/node_modules/iobroker.xbox/python_modules/lib/python3.6/site-packages/xbox/sg/manager.py", line 71, in _pre_on_json
    self._on_json(data, channel)
  File "/opt/iobroker/node_modules/iobroker.xbox/python_modules/lib/python3.6/site-packages/xbox/stump/manager.py", line 124, in _on_json
    self.console.protocol._set_result(msg.msgid, msg)
  File "/opt/iobroker/node_modules/iobroker.xbox/python_modules/lib/python3.6/site-packages/xbox/sg/protocol.py", line 272, in _set_result
    self._pending[identifier].set(result)
KeyError: '2dce51fd.2'
127.0.0.1 - - [2020-04-01 23:35:42] "GET /auth HTTP/1.1" 200 5668 0.011081
[2020-04-01 23:35:43,484] ERROR: {'success': False, 'message': "Message '2dce51fd.2': 'Message.CONFIGURATION' got no response!"}
127.0.0.1 - - [2020-04-01 23:35:43] "GET /device/FD003F65D1219026/connect HTTP/1.1" 500 220 4.088705

I have an issue when i executed xbox-rest-server

xbox-rest-server
:228: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
:228: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
:228: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
:228: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
:228: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
:228: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
:228: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
:228: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/bin/xbox-rest-server", line 5, in
from xbox.scripts.rest_server import main
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/xbox/scripts/rest_server.py", line 4, in
monkey.patch_all()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/gevent/monkey.py", line 1137, in patch_all
patch_ssl(_warnings=_warnings, _first_time=first_time)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/gevent/monkey.py", line 183, in ignores
return func(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/gevent/monkey.py", line 888, in patch_ssl
gevent_mod, _ = _patch_module('ssl', _warnings=_warnings)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/gevent/monkey.py", line 362, in _patch_module
gevent_module = getattr(import('gevent.' + name), name)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/gevent/ssl.py", line 32, in
from gevent import _ssl3 as _source # pragma: no cover
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/gevent/_ssl3.py", line 171, in
class SSLSocket(socket):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/gevent/_ssl3.py", line 184, in SSLSocket
family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None,
NameError: name 'AF_INET' is not defined

Xbox-fo4-relay no module called apt and crypto

Hello,

When running the command above I get this error

Traceback (most recent call last):
File "/usr/local/bin/xbox-fo4-relay", line 9, in
load_entry_point('xbox-smartglass-auxiliary==0.9.0', 'console_scripts', 'xbox-fo4-relay')()
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 480, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 2691, in load_entry_point
return ep.load()
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 2322, in load
return self.resolve()
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 2328, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/lib/python3.6/dist-packages/xbox_smartglass_auxiliary-0.9.0-py3.6.egg/xbox/auxiliary/scripts/fo4.py", line 14, in
from xbox.sg.console import Console
File "/usr/local/lib/python3.6/dist-packages/xbox/sg/console.py", line 40, in
from xbox.sg.crypto import Crypto
File "/usr/local/lib/python3.6/dist-packages/xbox/sg/crypto.py", line 85, in
class Crypto(object):
File "/usr/local/lib/python3.6/dist-packages/xbox/sg/crypto.py", line 86, in Crypto
_backend = default_backend()
File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/init.py", line 40, in default_backend
_default_backend = MultiBackend(_available_backends())
File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/init.py", line 27, in _available_backends
"cryptography.backends"
File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/init.py", line 26, in
for ep in pkg_resources.iter_entry_points(
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 2328, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/openssl/init.py", line 7, in
from cryptography.hazmat.backends.openssl.backend import backend
File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 17, in
from cryptography import utils, x509
File "/usr/lib/python3/dist-packages/cryptography/x509/init.py", line 7, in
from cryptography.x509.base import (
File "/usr/lib/python3/dist-packages/cryptography/x509/base.py", line 15, in
from cryptography.x509.extensions import Extension, ExtensionType
File "/usr/lib/python3/dist-packages/cryptography/x509/extensions.py", line 19, in
from cryptography.hazmat.primitives import constant_time, serialization
File "/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/constant_time.py", line 9, in
from cryptography.hazmat.bindings._constant_time import lib
ModuleNotFoundError: No module named 'cryptography.hazmat.bindings._constant_time'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/init.py", line 5, in
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in
import apt
File "/usr/lib/python3/dist-packages/apt/init.py", line 23, in
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
File "/usr/local/bin/xbox-fo4-relay", line 9, in
load_entry_point('xbox-smartglass-auxiliary==0.9.0', 'console_scripts', 'xbox-fo4-relay')()
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 480, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 2691, in load_entry_point
return ep.load()
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 2322, in load
return self.resolve()
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 2328, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/lib/python3.6/dist-packages/xbox_smartglass_auxiliary-0.9.0-py3.6.egg/xbox/auxiliary/scripts/fo4.py", line 14, in
from xbox.sg.console import Console
File "/usr/local/lib/python3.6/dist-packages/xbox/sg/console.py", line 40, in
from xbox.sg.crypto import Crypto
File "/usr/local/lib/python3.6/dist-packages/xbox/sg/crypto.py", line 85, in
class Crypto(object):
File "/usr/local/lib/python3.6/dist-packages/xbox/sg/crypto.py", line 86, in Crypto
_backend = default_backend()
File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/init.py", line 40, in default_backend
_default_backend = MultiBackend(_available_backends())
File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/init.py",

Could anyone help me as I have googled this and nothing has worked so far. Or at least point me I the right direction as to how to fix this.

Thanks

eject disc script?

is there a script to eject the disc in the xbox one x? my eject button stopped working... if not. is it possible? and does anybody have time to make one? :)

any help would be appreciated!

thanks!!

xbox-tui crash when bringing up commands

When selecting my Xbox and hitting C for commands, shortly after the menu appears, the TUI crashes.

Version: 1.0.12 on Ubuntu 18.10
Python 3.6.7rc1

  File "src/gevent/greenlet.py", line 716, in gevent._greenlet.Greenlet.run───────────────│ Disconnect                                               │─────────────────────────────────────────────────────────────────────────────────────────
  File "/usr/local/lib/python3.6/dist-packages/urwid/raw_display.py", line 404, in <lambda> Power off                                                │─────────────────────────────────────────────────────────────────────────────────────────
    event_loop, callback, self.get_available_raw_input())                                 │                                                          │
  File "/usr/local/lib/python3.6/dist-packages/urwid/raw_display.py", line 467, in parse_input                                                       │─────────────────────────────────────────────────────────────────────────────────────────
    event_loop.remove_alarm(self._input_timeout)──────────────────────────────────────────│                                                          │─────────────────────────────────────────────────────────────────────────────────────────
  File "/usr/local/lib/python3.6/dist-packages/xbox/sg/scripts/tui.py", line 639, in remove_alarm                                                    │
    if handle._start_event.active:                                                        │                                                          │
AttributeError: 'gevent._greenlet.Greenlet' object has no attribute '_start_event'────────│                                                          │─────────────────────────────────────────────────────────────────────────────────────────
2019-04-11T09:17:52Z <Greenlet "Greenlet-0" at 0x7f5bf9744748: <lambda>> failed with AttributeError                                                  │
☼                                                                                         │                                                          │
Traceback (most recent call last):                                                        │                                                          │
  File "/usr/local/lib/python3.6/dist-packages/urwid/main_loop.py", line 384, in _run     │                                                          │
    self.event_loop.run()                                                                 │                                                          │
  File "/usr/local/lib/python3.6/dist-packages/xbox/sg/scripts/tui.py", line 681, in run  │                                                          │
    self._completed_greenlets.popleft().get(block=False)                                  │                                                          │
  File "src/gevent/greenlet.py", line 633, in gevent._greenlet.Greenlet.get               │                                                          │
  File "src/gevent/greenlet.py", line 312, in gevent._greenlet.Greenlet._raise_exception  │                                                          │
  File "/usr/local/lib/python3.6/dist-packages/gevent/_compat.py", line 47, in reraise    │                                                          │
    raise value.with_traceback(tb)                                                        │                                                          │
  File "src/gevent/greenlet.py", line 716, in gevent._greenlet.Greenlet.run               │                                                          │
  File "/usr/local/lib/python3.6/dist-packages/urwid/raw_display.py", line 404, in <lambda>                                                          │
    event_loop, callback, self.get_available_raw_input())                                 │                                                          │
  File "/usr/local/lib/python3.6/dist-packages/urwid/raw_display.py", line 467, in parse_input                                                       │
    event_loop.remove_alarm(self._input_timeout)                                          │                                                          │
  File "/usr/local/lib/python3.6/dist-packages/xbox/sg/scripts/tui.py", line 639, in remove_alarm                                                    │
    if handle._start_event.active:                                                        │                                                          │
AttributeError: 'gevent._greenlet.Greenlet' object has no attribute '_start_event'        │                                                          │
☼                                                                                         │                                                          │
During handling of the above exception, another exception occurred:                       │                                                          │
☼                                                                                         │                                                          │
Traceback (most recent call last):                                                        │                                                          │
  File "/usr/local/bin/xbox-tui", line 11, in <module>                                    │                                                          │
    sys.exit(main())                                                                      │                                                          │
  File "/usr/local/lib/python3.6/dist-packages/xbox/sg/scripts/tui.py", line 723, in main │                                                          │
    app.run()                                                                             │                                                          │
  File "/usr/local/lib/python3.6/dist-packages/xbox/sg/scripts/tui.py", line 611, in run  │                                                          │
    self.loop.run()                                                                       │                                                          │
  File "/usr/local/lib/python3.6/dist-packages/urwid/main_loop.py", line 286, in run      │                                                          │
    self._run()                                                                           └──────────────────────────────────────────────────────────┘
  File "/usr/local/lib/python3.6/dist-packages/urwid/main_loop.py", line 386, in _run
    self.screen.stop() # clean up screen control
  File "/usr/local/lib/python3.6/dist-packages/urwid/display_common.py", line 760, in stop
    self._stop()
  File "/usr/local/lib/python3.6/dist-packages/urwid/raw_display.py", line 243, in _stop
    signals.emit_signal(self, INPUT_DESCRIPTORS_CHANGED)
  File "/usr/local/lib/python3.6/dist-packages/urwid/signals.py", line 265, in emit
    result |= self._call_callback(callback, user_arg, user_args, args)
  File "/usr/local/lib/python3.6/dist-packages/urwid/signals.py", line 295, in _call_callback
    return bool(callback(*args_to_pass))
  File "/usr/local/lib/python3.6/dist-packages/urwid/main_loop.py", line 371, in _reset_input_descriptors
    self.screen.unhook_event_loop(self.event_loop)
  File "/usr/local/lib/python3.6/dist-packages/urwid/raw_display.py", line 389, in unhook_event_loop
    event_loop.remove_alarm(self._input_timeout)
  File "/usr/local/lib/python3.6/dist-packages/xbox/sg/scripts/tui.py", line 639, in remove_alarm
    if handle._start_event.active:
AttributeError: 'gevent._greenlet.Greenlet' object has no attribute '_start_event'

The crash also breaks my terminal to a point where I need to run stty sane before input shows up again.

reduce logging to INFO?

Any way to reduce logging?

Sep 18 22:43:33 pot xbox-rest-server[29310]: [2019-09-18 22:43:33,809] DEBUG in protocol: Received Ack message on ServiceChannel Ack from 192.168.3.20
Sep 18 22:43:33 pot xbox-rest-server[29310]: [2019-09-18 22:43:33,814] DEBUG in protocol: Sending Ack message on ServiceChannel Core to 192.168.3.20
Sep 18 22:43:33 pot xbox-rest-server[29310]: [2019-09-18 22:43:33,818] DEBUG in protocol: Received Ack message on ServiceChannel Ack from 192.168.3.20

tried -l /dev/null but that does not seem to help, it still logs to stdout

can't install

i recently did a fresh install of raspbian to get rid of a bunch of permissions problems I was having. I got everything back up and running EXCEPT being able to turn my xbox off using homebridge and/or homeassistant. each time I try to install smartglass-core-python I get errors. I can't remember how I got it to work last time around? here's my log:

pi@raspberrypi:~ $ pip install xbox-smartglass-core
Collecting xbox-smartglass-core
Using cached https://files.pythonhosted.org/packages/13/c8/2ffce1ddabe5b73422c7c46e808e4b02dbbc9362d2ecd2aee2a65e6e30a5/xbox_smartglass_core-1.0.12-py2.py3-none-any.whl
Collecting urwid==2.0.1 (from xbox-smartglass-core)
Collecting xbox-webapi>=1.1.2 (from xbox-smartglass-core)
Using cached https://files.pythonhosted.org/packages/2d/bf/aaf24cc78184393c5c2472e822c0e145b793e346a8085bee02e89a3428ba/xbox_webapi-1.1.7-py2.py3-none-any.whl
Collecting construct==2.9.41 (from xbox-smartglass-core)
Collecting aenum==2.1.2; python_version <= "3.5" (from xbox-smartglass-core)
Using cached https://files.pythonhosted.org/packages/44/c4/7cda7e7e71e18ad999cb9d23f9969f818af1ed6be71d18db7963680b8320/aenum-2.1.2-py2-none-any.whl
Collecting gevent==1.3.7 (from xbox-smartglass-core)
Collecting appdirs==1.4.3 (from xbox-smartglass-core)
Using cached https://files.pythonhosted.org/packages/56/eb/810e700ed1349edde4cbdc1b2a21e28cdf115f9faf263f6bbf8447c1abf3/appdirs-1.4.3-py2.py3-none-any.whl
Collecting dpkt==1.9.1 (from xbox-smartglass-core)
Using cached https://files.pythonhosted.org/packages/e1/0f/30a8462ed17092a5d61ea12e212e9ce3740f19f5f9f2431287410429d306/dpkt-1.9.1-py2-none-any.whl
Collecting cryptography==2.3.1 (from xbox-smartglass-core)
Using cached https://files.pythonhosted.org/packages/22/21/233e38f74188db94e8451ef6385754a98f3cad9b59bedf3a8e8b14988be4/cryptography-2.3.1.tar.gz
Collecting requests (from xbox-webapi>=1.1.2->xbox-smartglass-core)
Using cached https://files.pythonhosted.org/packages/ff/17/5cbb026005115301a8fb2f9b0e3e8d32313142fe8b617070e7baad20554f/requests-2.20.1-py2.py3-none-any.whl
Collecting demjson (from xbox-webapi>=1.1.2->xbox-smartglass-core)
Collecting cffi>=1.11.5 (from gevent==1.3.7->xbox-smartglass-core)
Using cached https://files.pythonhosted.org/packages/e7/a7/4cd50e57cc6f436f1cc3a7e8fa700ff9b8b4d471620629074913e3735fb2/cffi-1.11.5.tar.gz
Collecting greenlet>=0.4.14 (from gevent==1.3.7->xbox-smartglass-core)
Collecting asn1crypto>=0.21.0 (from cryptography==2.3.1->xbox-smartglass-core)
Using cached https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting idna>=2.1 (from cryptography==2.3.1->xbox-smartglass-core)
Using cached https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl
Collecting six>=1.4.1 (from cryptography==2.3.1->xbox-smartglass-core)
Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting enum34 (from cryptography==2.3.1->xbox-smartglass-core)
Using cached https://files.pythonhosted.org/packages/c5/db/e56e6b4bbac7c4a06de1c50de6fe1ef3810018ae11732a50f15f62c7d050/enum34-1.1.6-py2-none-any.whl
Collecting ipaddress (from cryptography==2.3.1->xbox-smartglass-core)
Using cached https://files.pythonhosted.org/packages/fc/d0/7fc3a811e011d4b388be48a0e381db8d990042df54aa4ef4599a31d39853/ipaddress-1.0.22-py2.py3-none-any.whl
Collecting urllib3<1.25,>=1.21.1 (from requests->xbox-webapi>=1.1.2->xbox-smartglass-core)
Using cached https://files.pythonhosted.org/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests->xbox-webapi>=1.1.2->xbox-smartglass-core)
Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests->xbox-webapi>=1.1.2->xbox-smartglass-core)
Using cached https://files.pythonhosted.org/packages/56/9d/1d02dd80bc4cd955f98980f28c5ee2200e1209292d5f9e9cc8d030d18655/certifi-2018.10.15-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.11.5->gevent==1.3.7->xbox-smartglass-core)
Using cached https://www.piwheels.org/simple/pycparser/pycparser-2.19-py2.py3-none-any.whl
Building wheels for collected packages: cryptography, cffi
Running setup.py bdist_wheel for cryptography ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-sE3Q5U/cryptography/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/tmpTNT_Ucpip-wheel- --python-tag cp27:
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing libffi.pc' to the PKG_CONFIG_PATH environment variable No package 'libffi' found Package libffi was not found in the pkg-config search path. Perhaps you should add the directory containing libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing libffi.pc' to the PKG_CONFIG_PATH environment variable No package 'libffi' found Package libffi was not found in the pkg-config search path. Perhaps you should add the directory containing libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
#include <ffi.h>
^
compilation terminated.
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-sE3Q5U/cryptography/setup.py", line 318, in
**keywords_with_side_effects(sys.argv)
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 317, in init
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 372, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 846, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1118, in best_match
return self.obtain(req, installer)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1130, in obtain
return installer(requirement)
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 440, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 699, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 725, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 906, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1145, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1133, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1


Failed building wheel for cryptography
Running setup.py clean for cryptography
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-sE3Q5U/cryptography/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" clean --all:
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing libffi.pc' to the PKG_CONFIG_PATH environment variable No package 'libffi' found Package libffi was not found in the pkg-config search path. Perhaps you should add the directory containing libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing libffi.pc' to the PKG_CONFIG_PATH environment variable No package 'libffi' found Package libffi was not found in the pkg-config search path. Perhaps you should add the directory containing libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
#include <ffi.h>
^
compilation terminated.
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-sE3Q5U/cryptography/setup.py", line 318, in
**keywords_with_side_effects(sys.argv)
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 317, in init
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 372, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 846, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1118, in best_match
return self.obtain(req, installer)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1130, in obtain
return installer(requirement)
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 440, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 699, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 725, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 906, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1145, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1133, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1


Failed cleaning build dir for cryptography
Running setup.py bdist_wheel for cffi ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-sE3Q5U/cffi/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/tmpAyNrVOpip-wheel- --python-tag cp27:
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing libffi.pc' to the PKG_CONFIG_PATH environment variable No package 'libffi' found Package libffi was not found in the pkg-config search path. Perhaps you should add the directory containing libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing libffi.pc' to the PKG_CONFIG_PATH environment variable No package 'libffi' found Package libffi was not found in the pkg-config search path. Perhaps you should add the directory containing libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-armv7l-2.7
creating build/lib.linux-armv7l-2.7/cffi
copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/init.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/recompiler.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/commontypes.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/error.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/ffiplatform.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/api.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/lock.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/model.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/cparser.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/verifier.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/vengine_gen.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/_cffi_include.h -> build/lib.linux-armv7l-2.7/cffi
copying cffi/parse_c_type.h -> build/lib.linux-armv7l-2.7/cffi
copying cffi/_embedding.h -> build/lib.linux-armv7l-2.7/cffi
copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-2.7/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-armv7l-2.7
creating build/temp.linux-armv7l-2.7/c
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-Ub3vap/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-armv7l-2.7/c/_cffi_backend.o
c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
#include <ffi.h>
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1


Failed building wheel for cffi
Running setup.py clean for cffi
Failed to build cryptography cffi
Installing collected packages: urwid, urllib3, idna, chardet, certifi, requests, demjson, appdirs, xbox-webapi, construct, aenum, pycparser, cffi, greenlet, gevent, dpkt, asn1crypto, six, enum34, ipaddress, cryptography, xbox-smartglass-core
Running setup.py install for cffi ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-sE3Q5U/cffi/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-xJqYGp-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing libffi.pc' to the PKG_CONFIG_PATH environment variable No package 'libffi' found Package libffi was not found in the pkg-config search path. Perhaps you should add the directory containing libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing libffi.pc' to the PKG_CONFIG_PATH environment variable No package 'libffi' found Package libffi was not found in the pkg-config search path. Perhaps you should add the directory containing libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-2.7
creating build/lib.linux-armv7l-2.7/cffi
copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/init.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/recompiler.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/commontypes.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/error.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/ffiplatform.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/api.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/lock.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/model.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/cparser.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/verifier.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/vengine_gen.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/_cffi_include.h -> build/lib.linux-armv7l-2.7/cffi
copying cffi/parse_c_type.h -> build/lib.linux-armv7l-2.7/cffi
copying cffi/_embedding.h -> build/lib.linux-armv7l-2.7/cffi
copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-2.7/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-armv7l-2.7
creating build/temp.linux-armv7l-2.7/c
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-Ub3vap/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-armv7l-2.7/c/_cffi_backend.o
c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
#include <ffi.h>
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-sE3Q5U/cffi/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-xJqYGp-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-sE3Q5U/cffi/

it may be worth noting that I originally tried this with home assistant than figured a way to use the python scripts to work with homebridge using cmdswitch2. maybe I need to re-install the home assistant plugin to allow this to install properly?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.