New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random issue with chromecast audio dongle #195
Comments
Hi: This just started happening with my chromecast audio too. It I enabled debug logging: INFO:pychromecast:Querying device status and curl -v http://192.168.0.86:8008/ssdp/device-desc.xml
< HTTP/1.1 404 Not Found
Has there been a ffirmware upgrade that broke pychromecast? |
So. What is most bizarre about this issue is... When you use the getchromecast method to discover the devices the dongle works fine. I ended up writing the below function, using globals (since I have other functions that need to be able to utilize the objects). I run into 0 issue with this method, and everything works out. Obviously you would need to change the device names to match your own. I also call the function inside of a thread, so that the rest of my script can continue execution without being blocked. Its troubling a bit to me though because I dont understand why this works, and creating the object manually with ip as a parameter does not. Nor why it only doesnt work on the dongle, yet works with manual creation for all other devices.
|
That worked! Its a little slow, but I least I have my music back. I
do hope that pychromecast.Chromecast() can be got to work again.
strunker writes:
So. What is most bizarre about this issue is... When you use the getchromecast method to discover the devices the dongle works fine. I ended up writing the below function, using globals (since I have other functions that need to be able to utilize the objects). I run into 0 issue with this method, and everything works out. Obviously you would need to change the device names to match your own.
I also call the function inside of a thread, so that the rest of my script can continue execution without being blocked.
Its troubling a bit to me though because I dont understand why this works, and creating the object manually with ip as a parameter does not. Nor why it only doesnt work on the dongle, yet works with manual creation for all other devices.
def BuildChromeCastObjects():
global CC1
global CC2
global CC3
global CC4
global CC5
global Tele
global Kitchen
global Bedroom
global Group
global LivingRoom
try:
chromecasts = pychromecast.get_chromecasts()
for dev in chromecasts:
print dev
if dev.device.friendly_name == "Strunker":
#television
CC1 = dev
Tele = CC1.media_controller
CC1.set_volume(volume)
elif dev.device.friendly_name == "Strunker Kitchen":
#kitchen dongle
CC2 = dev
Kitchen = CC2.media_controller
CC2.set_volume(volume)
elif dev.device.friendly_name == "Strunker SoundBar":
#bedroom soundbar
CC3 = dev
Bedroom = CC3.media_controller
CC3.set_volume(volume)
elif dev.device.friendly_name == "Group Audio":
#audio group
CC4 = dev
Group = CC4.media_controller
CC4.set_volume(volume)
elif dev.device.friendly_name == "Strunker SoundBar LR":
#bedroom soundbar
CC5 = dev
LivingRoom = CC5.media_controller
CC5.set_volume(volume)
else:
print "New Device We Have Not Enountered"
except Exception as E:
print "BIG CHROMECAST ERROR", E
StartChromecastThread = threading.Thread(target=BuildChromeCastObjects)
StartChromecastThread.start()
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#195 (comment)
…--
Les Smithson
|
Yes I'll also add that volume is a constant global variable.. when I start playing music on any of my devices I normalize the volume from wherever it is to a static value (0.3) and then raise or lower it from there.
And yeah the auto discovery is definitely slower than manual creation by ip. But like you said... Least it works ;)
Something must have changed with the dongle. Google doesn't really tell you when they are updating. I am opted out of all the beta releases of updates you can opt out in the Google home app.
But yeah. Confusing issue.
…-----Original Message-----
From: lsmithso <notifications@github.com>
To: balloob/pychromecast <pychromecast@noreply.github.com>
Cc: strunker <nothinworthlivinfor@yahoo.com>, Author <author@noreply.github.com>
Sent: Fri, 17 Nov 2017 12:45 PM
Subject: Re: [balloob/pychromecast] Random issue with chromecast audio dongle (#195)
That worked! Its a little slow, but I least I have my music back. I
do hope that pychromecast.Chromecast() can be got to work again.
strunker writes:
So. What is most bizarre about this issue is... When you use the getchromecast method to discover the devices the dongle works fine. I ended up writing the below function, using globals (since I have other functions that need to be able to utilize the objects). I run into 0 issue with this method, and everything works out. Obviously you would need to change the device names to match your own.
I also call the function inside of a thread, so that the rest of my script can continue execution without being blocked.
Its troubling a bit to me though because I dont understand why this works, and creating the object manually with ip as a parameter does not. Nor why it only doesnt work on the dongle, yet works with manual creation for all other devices.
def BuildChromeCastObjects():
global CC1
global CC2
global CC3
global CC4
global CC5
global Tele
global Kitchen
global Bedroom
global Group
global LivingRoom
try:
chromecasts = pychromecast.get_chromecasts()
for dev in chromecasts:
print dev
if dev.device.friendly_name == "Strunker":
#television
CC1 = dev
Tele = CC1.media_controller
CC1.set_volume(volume)
elif dev.device.friendly_name == "Strunker Kitchen":
#kitchen dongle
CC2 = dev
Kitchen = CC2.media_controller
CC2.set_volume(volume)
elif dev.device.friendly_name == "Strunker SoundBar":
#bedroom soundbar
CC3 = dev
Bedroom = CC3.media_controller
CC3.set_volume(volume)
elif dev.device.friendly_name == "Group Audio":
#audio group
CC4 = dev
Group = CC4.media_controller
CC4.set_volume(volume)
elif dev.device.friendly_name == "Strunker SoundBar LR":
#bedroom soundbar
CC5 = dev
LivingRoom = CC5.media_controller
CC5.set_volume(volume)
else:
print "New Device We Have Not Enountered"
except Exception as E:
print "BIG CHROMECAST ERROR", E
StartChromecastThread = threading.Thread(target=BuildChromeCastObjects)
StartChromecastThread.start()
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#195 (comment)
--
Les Smithson
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#195 (comment)
|
If it helps, the dongle firmware version is 1.28.100555
strunker writes:
Yes I'll also add that volume is a constant global variable.. when I start playing music on any of my devices I normalize the volume from wherever it is to a static value (0.3) and then raise or lower it from there.
And yeah the auto discovery is definitely slower than manual creation by ip. But like you said... Least it works ;)
Something must have changed with the dongle. Google doesn't really tell you when they are updating. I am opted out of all the beta releases of updates you can opt out in the Google home app.
But yeah. Confusing issue.
-----Original Message-----
From: lsmithso <notifications@github.com>
To: balloob/pychromecast <pychromecast@noreply.github.com>
Cc: strunker <nothinworthlivinfor@yahoo.com>, Author <author@noreply.github.com>
Sent: Fri, 17 Nov 2017 12:45 PM
Subject: Re: [balloob/pychromecast] Random issue with chromecast audio dongle (#195)
That worked! Its a little slow, but I least I have my music back. I
do hope that pychromecast.Chromecast() can be got to work again.
strunker writes:
> So. What is most bizarre about this issue is... When you use the getchromecast method to discover the devices the dongle works fine. I ended up writing the below function, using globals (since I have other functions that need to be able to utilize the objects). I run into 0 issue with this method, and everything works out. Obviously you would need to change the device names to match your own.
>
> I also call the function inside of a thread, so that the rest of my script can continue execution without being blocked.
>
> Its troubling a bit to me though because I dont understand why this works, and creating the object manually with ip as a parameter does not. Nor why it only doesnt work on the dongle, yet works with manual creation for all other devices.
>
> def BuildChromeCastObjects():
> global CC1
> global CC2
> global CC3
> global CC4
> global CC5
> global Tele
> global Kitchen
> global Bedroom
> global Group
> global LivingRoom
> try:
> chromecasts = pychromecast.get_chromecasts()
> for dev in chromecasts:
> print dev
> if dev.device.friendly_name == "Strunker":
> #television
> CC1 = dev
> Tele = CC1.media_controller
> CC1.set_volume(volume)
> elif dev.device.friendly_name == "Strunker Kitchen":
> #kitchen dongle
> CC2 = dev
> Kitchen = CC2.media_controller
> CC2.set_volume(volume)
> elif dev.device.friendly_name == "Strunker SoundBar":
> #bedroom soundbar
> CC3 = dev
> Bedroom = CC3.media_controller
> CC3.set_volume(volume)
> elif dev.device.friendly_name == "Group Audio":
> #audio group
> CC4 = dev
> Group = CC4.media_controller
> CC4.set_volume(volume)
> elif dev.device.friendly_name == "Strunker SoundBar LR":
> #bedroom soundbar
> CC5 = dev
> LivingRoom = CC5.media_controller
> CC5.set_volume(volume)
> else:
> print "New Device We Have Not Enountered"
> except Exception as E:
> print "BIG CHROMECAST ERROR", E
>
> StartChromecastThread = threading.Thread(target=BuildChromeCastObjects)
> StartChromecastThread.start()
>
> --
> You are receiving this because you commented.
> Reply to this email directly or view it on GitHub:
> #195 (comment)
--
Les Smithson
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#195 (comment)
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#195 (comment)
…--
Les Smithson
|
This is probably related to home-assistant/core#9965 . Long story short: the |
Cool but ssdp discovery is still working for the dongle.
Manually creating via ip isn't.
…-----Original Message-----
From: Marc Plano-Lesay <notifications@github.com>
To: balloob/pychromecast <pychromecast@noreply.github.com>
Cc: strunker <nothinworthlivinfor@yahoo.com>, Author <author@noreply.github.com>
Sent: Sun, 19 Nov 2017 8:41 AM
Subject: Re: [balloob/pychromecast] Random issue with chromecast audio dongle (#195)
This is probably related to home-assistant/core#9965 . Long story short: the `/ssdp/device-desc.xml` endpoint seems to be gone starting with 1.28.x release. The `/setup/eureka_info?options=detail` one still returns valid values, apparently everything needed. In the issue I linked, someone told he was currently working on a fix.
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#195 (comment)
|
I tested using the PR and it seems to work fine when connecting
directly.
strunker writes:
Cool but ssdp discovery is still working for the dongle.
Manually creating via ip isn't.
-----Original Message-----
From: Marc Plano-Lesay <notifications@github.com>
To: balloob/pychromecast <pychromecast@noreply.github.com>
Cc: strunker <nothinworthlivinfor@yahoo.com>, Author <author@noreply.github.com>
Sent: Sun, 19 Nov 2017 8:41 AM
Subject: Re: [balloob/pychromecast] Random issue with chromecast audio dongle (#195)
This is probably related to home-assistant/core#9965 . Long story short: the `/ssdp/device-desc.xml` endpoint seems to be gone starting with 1.28.x release. The `/setup/eureka_info?options=detail` one still returns valid values, apparently everything needed. In the issue I linked, someone told he was currently working on a fix.
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#195 (comment)
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#195 (comment)
…--
Les Smithson
|
Yes, that's expected. When using discovery, pychromecast already gets the required data (model name, api version, ...) via zeroconf and does not fail when the When manually creating via ip, the unpatched version of the library has to get the data via |
That makes perfect sense so we have to use that endpoint when doing manual creation by ip.
That makes good sense finally. Great.. thanks.
…-----Original Message-----
From: Otto Winter <notifications@github.com>
To: balloob/pychromecast <pychromecast@noreply.github.com>
Cc: strunker <nothinworthlivinfor@yahoo.com>, Author <author@noreply.github.com>
Sent: Sun, 19 Nov 2017 11:57 AM
Subject: Re: [balloob/pychromecast] Random issue with chromecast audio dongle (#195)
Yes, that's expected. When using discovery, pychromecast already gets the required data (model name, api version, ...) via zeroconf and **does not** fail when the `/ssdp/device-desc.xml` returns an error.
When manually creating via ip, the library **has to** get the data via `/ssdp/device-desc.xml`, so the manual setup fails when that endpoints returns a 404.
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#195 (comment)
|
@strunker I guess this issue can now closed, right? |
Yes we can close this since it's a duplicate issue. Thanks.
…-----Original Message-----
From: Otto Winter <notifications@github.com>
To: balloob/pychromecast <pychromecast@noreply.github.com>
Cc: strunker <nothinworthlivinfor@yahoo.com>, Mention <mention@noreply.github.com>
Sent: Tue, 21 Nov 2017 11:08 AM
Subject: Re: [balloob/pychromecast] Random issue with chromecast audio dongle (#195)
@strunker I guess this issue can now closed, right?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#195 (comment)
|
Sorry to jump in here, I couldn't find a forum or mailing list; I'm seeing this 404 error when trying to connect to my new Google Home Mini [Fedora 26, Python3, pychromecast 0.8.2/Jul-17] via IP address. Thing is, I am also getting an empty list from |
@fnxweb As you've already mentioned, you're using pychromecast version 0.8.2 (within home assistant, I suppose) but this issue has already been resolved in version 1.0.2 - so this issue will be fixed with the next Home Assistant release (see home-assistant/core#10728) |
Ah, thanks. No, it's the native F26 package. I'll rebuild it with a newer release. Cheers. |
OK ta, I can now create a |
@OttoWinter Ta; I only mentioned it FYI, I'm happy enough with access by IP (prefer, even). Unfortunately my Google Home Mini doesn't want to play ball anyway (trying to programmatically cast media, it just beeps at me and otherwise ignores me, and that's not just from pychromecast). I'll look into it again some other day. |
@fnxweb I ran into similar issue on this latest version. in 1.0.2 I am once again able to create via IP, which is good. However, like you, play_media was sporadic. It worked initially, but then started to fail sending audio to the dongle \ my sound bars. I tried local files, as well as youtube audio links and neither would play anything. For the time being I reverted back to the .8 version and am using the function I linked earlier in the thread to create the objects. I have no issue with play_media when using older version \ above function. The cost is I cant create via IP on .8 version. |
@strunker Which .8? I started with 0.8.2 which didn't work either way for me. |
Yeah your issue is a bit different you aren't getting success with auto discovery... 0.8.2 works for me \ most others with that method.
What os are you on? Would probably be helpful to post code too.
Bit out of scope for this thread but yeah.
…-----Original Message-----
From: Neil Bird <notifications@github.com>
To: balloob/pychromecast <pychromecast@noreply.github.com>
Cc: strunker <nothinworthlivinfor@yahoo.com>, Mention <mention@noreply.github.com>
Sent: Sun, 03 Dec 2017 2:36 PM
Subject: Re: [balloob/pychromecast] Random issue with chromecast audio dongle (#195)
@strunker Which .8? I started with 0.8.2 which didn't work either way for me.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#195 (comment)
|
@strunker Does 1.0.3 work for you now? Can this be closed? |
1.0.3 didn'twork for me but I changed my code for auto discovery and stayed on the version prior. I'd say close this. It seems to be working for everyone but me, so all good here. Thanks for your work and attention on this. |
This just started happening, one thing I noticed is that all my other chromecasts devices are using port 8008, I tried to swap the port to 8008 by using the port= param but this didnt seem to make a difference. I can connect to the dongle fine from my phone just isnt working via script anymore for only the audio dongle. Just a random connection error.
Traceback (most recent call last):
File "C:\Python27\Echo\test.py", line 158, in
CC2 = pychromecast.Chromecast("10.1.1.12",port=8009)
File "C:\Python27\lib\site-packages\pychromecast_init_.py", line 169, in init
"Could not connect to {}:{}".format(self.host, self.port))
pychromecast.error.ChromecastConnectionError: Could not connect to 10.1.1.12:8009
The text was updated successfully, but these errors were encountered: