Git Product home page Git Product logo

xbox-remote-power's Introduction

xbox-remote-power

Please go to https://github.com/OpenXbox for continued development of this and much more.

This is a little script that can turn your Xbox One on remotely. It works over both LAN and WAN, provided you have port 5050 forwarded to your Xbox One.

If you're looking for a complete SmartGlass implementation, take a look at OpenXbox/xbox-smartglass-core-python.

How to use

You need three things for this to work:

  • Python 2 or 3 installed
  • IP address of your Xbox One
  • Live device ID of your Xbox One

To find the IP of your Xbox, go to Settings -> Network -> Advanced settings. To find your Live device ID, go to Settings -> System -> Console info. NOTE: It's probably a good idea to keep this information a secret!

If you want to use this over the internet, you'll also need port 5050 forwarded to your Xbox One.

Run the script as follows, replacing with the IP of your Xbox and with your Live device ID.

python xbox-remote-power.py -a <ip address> -i <live id>

Alternatively, you can also run the script without any arguments and you'll be prompted for the IP and Live device ID.

python xbox-remote-power.py

There is also a "fire and forget" BAT script and shell script available. You will need to edit these files first and enter your IP and Live device ID before they will work.

xbox-remote-power's People

Contributors

derfreimann avatar larrysteeze avatar ritty5 avatar schamper 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xbox-remote-power's Issues

Remote Start on home network only

Hi,

This is a great little tool, thank you for writing it. I am trying to get the remote start to work when I am off of my home network. I have port forwarded 5050 on my router and have also assigned a static IP address (on both the Xbox and Router). I have bridged my modem with the router so I am not going to be doubled NAT'd. It doesn't work for some reason. I have also placed the Xbox in the DMZ and still it does not work. I am using a Linksys router, not sure where to go to from here?

Thx

Only Working Intermittently

I'm not able to get this to work reliably. Sometimes it just wont run. It always works if I try it shortly after turn the console off, but if the console has been off for a while it doesn't always work. I have the console on "instant on" mode. Below is the code from a unsuccessful attempt.

Johns-Air:~ John$ /Users/John/xbox-remote-power.sh ; exit;
Sending power on packets to 24.178.88.26...
Traceback (most recent call last):
File "./xbox-remote-power.py", line 83, in
main()
File "./xbox-remote-power.py", line 37, in main
send_power(s, power_packet)
File "./xbox-remote-power.py", line 62, in send_power
s.send(data)
socket.error: [Errno 51] Network is unreachable
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

How to turn off the XBOX??

How to turn off the XBOX??
ן know the torn on msg is -
power_payload = b'\x00' + chr(len(live_id)).encode() + live_id.upper() + b'\x00'
power_header = b'\xdd\x02\x00' + chr(len(power_payload)).encode() + b'\x00\x00'
power_packet = power_header + power_payload

Can anyone tell me how to turn off the Xbox ???

NSlookup issue - advice please

Hi, i had this working perfectly for months but my router blew up and I had to replace it, same brand but different model (prev Asus RT-N66U, now RT-AC66U_B1)

I've reconfigured port 5050 pointing to the Xbox One (10.0.0.15) but when I run the bat I get this message and then it doesn't power on:

image

If I NSlookup something online on the network, 10.0.0.4 for example, that works but anything offline throws that message.

Any ideas what may be causing this change? Firewall issue, DNS? I'm a bit stumped

Byte string to turn off xbox?

Hi,

This works great for turning on my xbox programatically. I want to be able to turn it off as well. Any ideas about how I should proceed figuring out the byte string?

I tried recording the communication from the xbox windows app when I give the command but I can't seem to figure out the correct encoding.

Any ideas would be great!

Thanks!

Power down functionality

Hey

I found this script when looking for a feature for Home Assistant to power off XBox.

Is it possible to modify the script to allow sending a packet to turn off the console?

I actually need that more than being able to turn it on remotely.

Thanks

help please

I´ve installed python 3 on my windows and tryied to run in the shell it gives me this error:
C:>python xbox-remote-power.py
192.168.0.6: y
FD00C611FFBF141A: y
Traceback (most recent call last):
File "xbox-remote-power.py", line 83, in
main()
File "xbox-remote-power.py", line 26, in main
s.connect((args.ip_addr, XBOX_PORT))
socket.gaierror: [Errno 11001] getaddrinfo failed

Will only work if my xbox was recently on

The code is working for me both remotely and locally, however it will not work if my xbox has been powered off for more then 5 minutes. If I recently had the xbox on, it will work. Any thoughts?

Not Working

I have tried this both connected to my network and to a different one wit's no avail. I changed the ip and live Id but it is not turning on. Any idea what the issue is?

Doesn't work over WAN

Hi I have been testing and using the Python Script. I could get it to work on LAN but not over a WAN. Any ways to fix this? I was trying to turn on brothers Xbox over WAN. Port Forwarding is done and correct IP address and Live Device ID.

invalid syntax

hi
python complete noob here
but...
I get an invalid syntax when I even try to use the command alone without the xbox information.
Basically tried python 3, 3.1 and 3.5
pasting
python xbox-remote-power.py
into the command line.
Am I doing it incorrectly?
I apologize if this is a basic question.
thanks

xbox live id case sensitive

Microsoft, in it's infinite wisdom, seems to only be able to handle upper case characters. I used lower case and the xbox refused to wake. I changed it to upper case and it worked first time. Could you please convert the id to uppercase internally?

Not Working

Installed Python and Executed the code with correct ip address and live device id. It failed. (I tried over LAN and it failed)

Enter the IP address: 192.168.1.XX
Enter the Live ID: <16 digit alpha-numeric id>
Sending power on packets to 192.168.1.XX...
Xbox should turn on now, pinging to make sure...
Failed to ping Xbox :(
Do you wish to keep trying? (y/n): y
Sending power packets and pinging until Xbox is on...
Failed to ping Xbox :(
Failed to ping Xbox :(
Failed to ping Xbox :(
Failed to ping Xbox :(
Failed to ping Xbox :(
Failed to ping Xbox :(

Background Settings of my Xbox One S:
Number 1> my console is on Energy saving mode (it has to be, else i won't be searching on internet and run this script if i set to instant on mode)
Number 2> my console is connected to router/internet via LAN cable. Its a wired connection And not on Wi-Fi. (I need to do this to good stream over LAN)
Number 3> my console is allocated static ip in my LAN. So ip address is not an issue.
Number 4> my console NAT type is open.

So, I kindly request you to please tell me what to do to get this script work. Also tell me the limitations of this script and also at the same time add the limitations to the project description on this github website as well so that no one will waste time like me do.

how do you install this?

I can't get the xbox to show up in homeassistant. how do you install this? i tried:

pip install xbox-remote-power

and got:

(homeassistant) homeassistant@raspberrypi:/srv/homeassistant $ pip install xbox-remote-power
Collecting xbox-remote-power
Could not find a version that satisfies the requirement xbox-remote-power (from versions: )
No matching distribution found for xbox-remote-power

thanks for any help!!

need help

I truly appreciate your work here. This is the ONLY solution i have found that works without IR blaster.

I am trying to create custom remote recipe on anymote app on ios.
Is this just a simple TCP request? if so, can you send me an example raw request data. Also, Can you give me a little more detail on what exactly are you doing to turn on the xbox?

Enhancement Request: Add Power Off

I would like to be able to power off my Xbox One as well. I don't have the payload code needed to do this and I can't seem to find it documented anywhere.

MAC address connectivity feature wanted

As many routers use DHCP to dynamically assign IP addresses, it would be nice to store the XBOX ONE MAC address in a configuration file to reliably link to the xbox's static address.

Powering Off

Looking at line 36 of xbox-remote-power.py:
power_header = b'\xdd\x02\x00' + chr(len(power_payload)).encode() + b'\x00\x00'

I've attempted to work out a power off code as yours matched the 0xDD02 for powering the console on in the complete OpenXbox/xbox-smartglass-core-python repo. For powering off that repo notes on line 212 of enum.py:
PowerOff = 0x39

Would the change be possible on your line 36 above on my system? Please help with understanding what the power_header would need to be to send a power off.

Ping works but power on doesn't

Trying to figure out it if is a power setting configuration issue or something else. I am running the Xbox One S and power mode is set to instant-on.

Xbox app on my android seems to work for power on, when I run the script with my credentials and the Xbox on the ping succeeds.

However if it do it with the Xbox off it fails, even with retries for about 5 minutes.

Thanks for any help here, looking to integrate with Amazon Alexa to automate a couple more things around the house. @Schamper

Error on running

Sending power packets and pinging until Xbox is on...
Traceback (most recent call last):
File "xbox-remote-power.py", line 82, in
main()
File "xbox-remote-power.py", line 52, in main
send_power(s, power_packet)
File "xbox-remote-power.py", line 62, in send_power
time.sleep(1)

‘AttributeError’ thrown on OS X

Running the command via the bash script on OS X (10.11.2) can generate the following output. The script still causes the Xbox to power-up, even with this error.

$ ./xbox-remote-power.sh 
Sending power on packets to 172.16.28.7
Xbox should turn on now
Traceback (most recent call last):
  File "xbox-remote-power.py", line 98, in <module>
    main()
  File "xbox-remote-power.py", line 68, in main
    s.send(bytes.fromhex(XBOX_PING))
AttributeError: type object 'str' has no attribute 'fromhex'

Current Python library:

$ which python
/usr/bin/python

$ python --version
Python 2.7.10

Works Intermittently

This seems to only work intermittently. It rarely works on the first attempt. Sometimes if I choose to continue trying after the first ping fail, it works after several minutes. Sometimes it never ends up coming on. I've tried a couple of other WOL scripts and had similar results so I imagine it's something to do with the XB1 rather than your script. Do you have any ideas why this is happening or at least, have you seen similar issues?

Power Off

Have you ever considered making another script to switch the Xbox One off? Do you know if it's possible. Any help would be appreciated.

Thanks,

PS. Script works great for me.

Which live ID?

I noticed the live-id the script reports is different than that you find going through the xbox menus. That reported by the script is missing the first the first byte (first 2 characters) but then seems to have two characters at the end, 0y, as a replacement. The script does not work for me---although I'm trying it because of issues the xbox app has on turning on my xbox. Is the script still working for people?

Finally, with people familiar how the xbox turn-on works, why would Microsoft have the following instructions to get the xbox app to work (following these instructions I can get by xbox to turn on/off using the app if I do it right after I turn it off---otherwise it s tops working):

Step 1
CLEAR PERSITENT STORAGE:
Goto Home > settings > disc and blue ray > Blu-ray > persistent storage > clear persistent storage. (Please do this three times
Step 2
CLEAR CONSOLE MAC ADDRESS:
Home > settings > network > advance settings > alternate MC address > clear > restart
Step 3 - this one scared the **** out of me but nothing bad happened.
DELETE PROFILE:
Settings>>Sign in, Security & Passkey>>and then select the option "Remove me from Xbox".
Step 4
POWER CYCLE:
Turn off console > unplug everything from the console > wait for 2 minutes and plug everything back > Turn On the console.
Step 5
DOWNLOAD PROFILE:
To download your profile once again, please click the "Avatar Icon">>>and then select the "Add New" option to re-download the profile.
Step 6
CONFIRM YOU HAVE AN OPEN NAT This one kind of ran for me but that may be because my NAT was open already.
Settings > Network > Test Multiplayer connection> (Do not select Continue or Select) > Use your Controller and at the same time both bumpers and triggers (It should be at the same time) > another test will run and It will open the NAT after.
Try the application and it should work.

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.