Comments (10)
I'm using version 0.7.7 of PyChromecast as specified in the requirements file.
I tried updating to the latest release (0.8.1) and am getting the following error instead ERROR:pychromecast.socket_client:Failed to connect, retrying in 5.0
I've only tried this with Wifi.
from mkchromecast.
tl;dr I got it to work by disabling AirServer but I also think we should set the tries
argument in the pychromecast.get_chromecasts
call.
Alright, I got it to work and have some interesting findings to share.
The reason it wasn't working is because I am running AirServer, which configures my laptop to be an AirPlay/Google Cast receiver. Disabling the Google Cast feature fixes the problem.
I haven't looked into the Google Cast protocol extensively, but it seems that AirServer's implementation is incomplete. Nmapping my google home and my chromecast shows that the two devices expose an http server on port 8008 and an ajp13 server on 8009. However, when I startup AirServer, while there is an ajp13 server on port 8009, nothing is exposed on 8008. This port is necessary to query the device status (see here), and returns an error otherwise. I also confirmed that a webserver on port is 8008 is indeed necessary according to this documentation.
The reason mkchromecast wasn't working is because the call to pychromecast.get_chromecasts
here doesn't specify any configurations. This means that while pychromecast was able to successfully connect to two of my cast devices (home and chromecast), it failed to connect to my third cast device (airserver on laptop) and therefore never returns.
The fix is very simple: set the tries
argument to something small when making the get_chromecasts
call. This would prevent the underlying library from retrying to connect to server in perpetuity and return the fully functioning and available cast devices. A value of 1 or 2 is sufficient in my opinion.
If you think it's a good idea, I will hapilly make the PR.
from mkchromecast.
Which version of pychromecast have you installed?. There are other people having similar issues (see https://github.com/balloob/pychromecast/issues?utf8=%E2%9C%93&q=No%20handlers%20could%20be%20found%20for%20logger%20) but I am not able to find any conclusive message. In some of the comments, it is mentioned that the cast
object has to wait until the connection is fully setup. That is assured in mkchromecast/cast.py#L243.
Does this happen both in LAN and WiFi?.
from mkchromecast.
I tried updating to the latest release (0.8.1) and am getting the following error instead ERROR:pychromecast.socket_client:Failed to connect, retrying in 5.0
One last question, is it only happening when using mkchromecast?. I used to have these problems before, and my wifi router was to blame. I might be wrong.
I've only tried this with Wifi.
Does it happen with the cable?
from mkchromecast.
Were you able to solve this problem?. I still think is something related to your wifi router. Some time ago, there someone reported in #27 that was not able to cast anything through wifi and updating his wifi driver helped #27 (comment). Of course, I understand that in macOS that is not the case, but I haven't been able to reproduce this issue.
I had it before, and it was due to the router that was given to me by ISP.
from mkchromecast.
It is indeed only happening with mkchromecast and it doesn't work when I connect to the router via ethernet.
I'm planning to investigate more extensively but haven't gotten around to it yet.
from mkchromecast.
That would be nice. Unfortunately, I haven't been able to reproduce it by myself.
from mkchromecast.
Thanks for this information!. I also think it would be a good idea to set tries
to some finite value. If you do the PR, could you add it as an option? in that way, users can turn it to original behavior when desired. All flags in mkchromecast
are set here https://github.com/muammar/mkchromecast/blob/master/mkchromecast/__init__.py (no idea if it was the best way of doing so), I don't know what name we could choose for that flag maybe just --tries
or something else?.
from mkchromecast.
Yup, that sounds good to me. I should have something up next weekend.
from mkchromecast.
Yup, that sounds good to me. I should have something up next weekend.
Thanks :).
from mkchromecast.
Related Issues (20)
- Deprecate youtube-dl for yt-dlp HOT 2
- Add encapsulation, reduce code duplication, and simplify cascading logic
- Does not play any audio on google speakers HOT 1
- sys tray disappears after searching for devices
- TypeError: Descriptors cannot not be created directly. HOT 2
- Using --video crashes the app HOT 2
- archlinux mkchromecast-git package targets unstable `master` branch HOT 5
- Error with start HOT 2
- Support for playlists
- Restore ability to use updated settings without restarting mkchromecast HOT 1
- How is it possible to transmit the volume, pause and resume via command line?
- `-n` fails to find Chromecast when TV is powered off
- Crash when I try to connect to a pair of Sonos One SL HOT 1
- Installing mkchromecast with brew HOT 1
- Issues with Tray Application: ModuleNotFoundError: No module named 'imp' HOT 5
- Unable to detect Sonos One speaker HOT 5
- Re-enable Sonos support in mkchromecast HOT 1
- `self.codec` is not set appropriately on Mac HOT 7
- Cant find Chromecast [Arch Linux]
- Glitch/bug on Mac Sonoma 14.5 (Macbook Air M2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mkchromecast.