Skip to content
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

Discovery is timing out #62

Open
mjc-gh opened this issue Jan 26, 2018 · 4 comments
Open

Discovery is timing out #62

mjc-gh opened this issue Jan 26, 2018 · 4 comments

Comments

@mjc-gh
Copy link

mjc-gh commented Jan 26, 2018

Does this gem work with modern versions of Ruby? I am unable to install it on Ruby 2.0.

$ rvm use 2.0
$ gem install sonos
ERROR:  Error installing sonos:
        rack requires Ruby version >= 2.2.2.

On Ruby 2.2, 2.3, and 2.4 it is timing out on Discovery:

2.3.1 :003 > Sonos::System.new
Timed out...
 => #<Sonos::System:0x007faf27d40b88 @topology=[], @groups=[], @devices=[]>

Any suggestions?

@xbelanch
Copy link

Same there... is still alive this gem?

@mjc-gh
Copy link
Author

mjc-gh commented Mar 16, 2018

FWIW, through some "aggressive" monkey patching, I was able to work around the discovery issues and query my speaker for details

speaker = Sonos::Device::Speaker.new('192.168.100.99')

def speaker.group_master
  OpenStruct.new(ip: '192.168.100.99')
end

speaker.now_playing

@xbelanch
Copy link

Oh, that's great! have you planned to share your patch?

@mjc-gh
Copy link
Author

mjc-gh commented Mar 19, 2018

This patch is extremely hacky and just a workaround (as I am monkey patching my speaker instance's singleton class with a group_master method).

I think a better long term solution is to make some modifications to the code and allow for initializing a speaker using a static IP address. This way, we can avoid the need to auto discovery altogether. I can look more into the code and see what would be needed to achieve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants