helloparthshah / StadiaWireless

Stadia Wireless enables you to use your stadia controller wirelessly. Not just with stadia, but with any game.
MIT License
447 stars 26 forks source link

[Bug] Error when running controller.py #1

Closed ELowry closed 2 years ago

ELowry commented 2 years ago

When I run the controller.py script, I get the following error (I just removed the exact folder locations):


PS [...]\StadiaWireless> python controller.py
192.168.137.1
Connecting to: 0.0.0.0:80
Traceback (most recent call last):
  File "[...]\StadiaWireless\controller.py", line 112, in <module>
    asyncio.run(main())
  File "[...]\Python\Python310\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "[...]\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
    return future.result()
  File "[...]\StadiaWireless\controller.py", line 109, in main
    async with serve(handler, '0.0.0.0', port):
  File "[...]\Python\Python310\lib\site-packages\websockets\legacy\server.py", line 1070, in __aenter__
    return await self
  File "[...]\Python\Python310\lib\site-packages\websockets\legacy\server.py", line 1088, in __await_impl__
    server = await self._create_server()
  File "[...]\Python\Python310\lib\asyncio\base_events.py", line 1505, in create_server
    raise OSError(err.errno, 'error while attempting '
PermissionError: [Errno 13] error while attempting to bind on address ('0.0.0.0', 80): an attempt was made to access a socket in a way forbidden by its access permissions```

Looking online, it looks like Python isn't requesting admin privileges but requires them; however, I am not well versed in python scripting, so I'm not sure how to achieve this. And yes, I am running my terminal in admin mode.

Note: I'm running Windows 11 22H2 at the moment.

Edit: I believe Windows 11 requires admin privileges for more actions than previous Windows versions; this may be the underlying reason. It also seems that there are python modules designed to request admin priviledges out there.
helloparthshah commented 2 years ago

This is rather an issue with the port 80 already being used. Ensure that nothing is running on port 80 or change it to some other port such as 3000 or 8000.

Note: You'll also need to change how it stores the IP into ip.js and add a :port_number at the end of it

ELowry commented 2 years ago

So after some testing; this does indeed seem to be the case!

Again, I'm not too familiar with python; but I imagine there is some form of try/get error handling; in which case it might be interesting to include the following:

helloparthshah commented 2 years ago

I released a new update this morning. Could you check if it is working? You can directly download the release 1.0.0 and run server.exe

ELowry commented 2 years ago

I get the following error message; which I guess is because the port it's trying to use is still not available?


 * Serving Flask app 'server' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
An attempt was made to access a socket in a way forbidden by its access permissions
helloparthshah commented 2 years ago

The latest release should fix this.