airsonos icon indicating copy to clipboard operation
airsonos copied to clipboard

After update to Sonos v7.0 Searching for Sonos devices on network...

Open krizor opened this issue 7 years ago • 14 comments

After Sonos Update to v7.0 none of my Sonos device get detected by airsonos anymore.

as previously mentioned in #135 / #73 I tried to adjusted the ip in the sonos.js file

from 239.255.255.250 : _this.socket.send(PLAYER_SEARCH, 0, PLAYER_SEARCH.length, 1900, '239.255.255.250'); to 192.168.178.255 : _this.socket.send(PLAYER_SEARCH, 0, PLAYER_SEARCH.length, 1900, '192.168.178.255');

But still I am getting : Searching for Sonos devices on network...

root@raspberrypi:~# node -v v0.12.1 root@raspberrypi:~# nodejs -v v0.10.41 root@raspberrypi:~# airsonos --version 0.2.6

root@raspberrypi:~# airsonos --diagnostics --verbose *** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi. *** WARNING *** Please fix your application to use the native API of Avahi! *** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node *** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. *** WARNING *** Please fix your application to use the native API of Avahi! *** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister AirSonos Diagnostics node version v0.12.1 operating sys linux (arm) ip address 192.168.178.27

Searching for Sonos devices on network...

Device {"host":"192.168.178.42","port":1400,"state":{}} (ZPS1) - attrs: {"CurrentZoneName":"Küche", "CurrentIcon":"x-rincon-roomicon:kitchen", "CurrentConfiguration":"1"} - info: {"SoftwareVersion":"34.7-35162c", "DisplaySoftwareVersion":"7.0", "HardwareVersion":"1.8.3.7-2", "IPAddress":"192.168.178.42", "MACAddress":"XX:XX:XX:XX:XX:EA", "CopyrightInfo":"© 2004-2015 Sonos, Inc. All Rights Reserved.", "ExtraInfo":"OTP: ", "HTAudioIn":"0", "Flags":"0"} `- topology: [{"group":"RINCON_5CAAFD21189601400:6", "coordinator":"true", "wirelessmode":"1", "wirelessleafonly":"0", "hasconfiguredssid":"1", "channelfreq":"2447", "behindwifiext":"0", "wifienabled":"1", "location":"http://192.168.178.44:1400/xml/device_description.xml", "version":"34.7-35162c", "mincompatibleversion":"33.0-00000", "legacycompatibleversion":"25.0-00000", "bootseq":"608", "uuid":"RINCON_5CAAFD21189601400", "name":"Kinderzimmer"},{"group":"RINCON_5CAAFD98102201400:14", "coordinator":"true", "wirelessmode":"1", "wirelessleafonly":"0", "hasconfiguredssid":"1", "channelfreq":"2447", "behindwifiext":"0", "wifienabled":"1", "location":"http://192.168.178.60:1400/xml/device_description.xml", "version":"34.7-35162c", "mincompatibleversion":"33.0-00000", "legacycompatibleversion":"25.0-00000", "bootseq":"29", "uuid":"RINCON_5CAAFD98102201400", "name":"Schlafzimmer"},{"group":"RINCON_5CAAFD2112EA01400:9", "coordinator":"true", "wirelessmode":"1", "wirelessleafonly":"0", "hasconfiguredssid":"1", "channelfreq":"2447", "behindwifiext":"0", "wifienabled":"1", "location":"http://192.168.178.42:1400/xml/device_description.xml", "version":"34.7-35162c", "mincompatibleversion":"33.0-00000", "legacycompatibleversion":"25.0-00000", "bootseq":"48", "uuid":"RINCON_5CAAFD2112EA01400", "name":"Küche"}]

/usr/local/lib/node_modules/airsonos/lib/diagnostics.js:21 delete info.SerialNumber; ^ TypeError: Cannot convert undefined or null to object at /usr/local/lib/node_modules/airsonos/lib/diagnostics.js:21:16 at /usr/local/lib/node_modules/airsonos/node_modules/sonos/lib/sonos.js:585:21 at Request._callback (/usr/local/lib/node_modules/airsonos/node_modules/sonos/lib/sonos.js:128:21) at self.callback (/usr/local/lib/node_modules/airsonos/node_modules/request/request.js:129:22) at Request.emit (events.js:107:17) at ClientRequest.self.clientErrorHandler (/usr/local/lib/node_modules/airsonos/node_modules/request/request.js:239:10) at ClientRequest.emit (events.js:107:17) at Socket.socketErrorListener (_http_client.js:272:9) at Socket.emit (events.js:107:17) at net.js:451:14 at process._tickCallback (node.js:355:11)

Anyone got this problem too ?

krizor avatar Dec 13 '16 16:12 krizor

Mine just hangs on that message. but no errors. Only the location of the sonos in verbose diag

Airsonos --diagnostics --verbose AirSonos Diagnostics node version v6.9.4 operating sys darwin (x64) ip address 192.168.5.104

Searching for Sonos devices on network...

Device {"host":"192.168.5.103","port":1400,"state":{}} (ZPS1) - attrs: {"CurrentZoneName":"Corner", "CurrentIcon":"x-rincon-roomicon:living", "CurrentConfiguration":"1"} - info: {"SoftwareVersion":"33.15-33210", "DisplaySoftwareVersion":"6.4.2", "HardwareVersion":"1.8.3.7-1", "IPAddress":"192.168.5.103", "MACAddress":"XX:XX:XX:XX:XX:6C", "CopyrightInfo":"© 2004-2015 Sonos, Inc. All Rights Reserved.", "ExtraInfo":"OTP: ", "HTAudioIn":"0"} `- topology: [{"group":"RINCON_5CAAFD22706C01400:0", "coordinator":"true", "wirelessmode":"1", "wirelessleafonly":"0", "hasconfiguredssid":"1", "channelfreq":"2412", "behindwifiext":"0", "wifienabled":"1", "location":"http://192.168.5.103:1400/xml/device_description.xml", "version":"33.15-33210", "mincompatibleversion":"32.0-00000", "legacycompatibleversion":"25.0-00000", "bootseq":"4", "uuid":"RINCON_5CAAFD22706C01400", "name":"Corner"}]

Ciscog33k avatar Jan 28 '17 02:01 Ciscog33k

Hi,

i have same problem, think Airsonos is dead.

Have someone a solution ?

spitfire4all avatar Feb 01 '17 18:02 spitfire4all

What worked for me (Sonos version 7.1 and iOS 10):

(1) Definitely use node Version 0.10.28 like mentioned in stephen's original blog post and strongly recommended by Sathya1984's howto in issue 340.

(2) Edit file </path/to/node/modules>/airsonos/node_modules/sonos/lib/logicalDevice.js in line 86 as described by ady624's reply in issue 216. But it will be sufficient to add device.coordinator === 'false' to the if-statement:

if (device.coordinator === 'false' || device.name === 'BRIDGE' || device.name === 'BOOST') return;

Finally start airsonos. Hope this helps!

anjog avatar Feb 17 '17 19:02 anjog

Hi, Is anyone able to tell me which file to edit on windows to fix this issue please ?

many thanks

trillian796 avatar Mar 26 '17 18:03 trillian796

Just coming back here to tell what worked for me:

Versions used

OSX El Capitan (10.11.6) Node 0.10.28 or 7.9.0 Sonos 7.2 airsonos 0.2.6 (last one as of this writing)

1. Patch logicalDevices.js

Edit:

<YOUR NODE INSTALL FOLDER>/node_modules/airsonos/node_modules/sonos/lib/logicalDevices.js

Replace:

if (device.name === 'BRIDGE' || device.name === 'BOOST') return; // devices to ignore in search

With:

if (device.coordinator === 'false' || device.name === 'BRIDGE' || device.name === 'BOOST') return; // devices to ignore in search

2. Patch sonos.js

Change the network broadcast ip address in sonos.js file. Tip: ifconfig | grep broadcast to find yours

Edit:

<YOUR NODE INSTALL FOLDER>/node_modules/airsonos/node_modules/sonos/lib/sonos.js

Replace 239.255.255.250:

_this.socket.send(PLAYER_SEARCH, 0, PLAYER_SEARCH.length, 1900, '239.255.255.250');

With your network broadcast ip address. Tip: ifconfig | grep broadcast to find yours. In my case it was 192.168.0.255:

_this.socket.send(PLAYER_SEARCH, 0, PLAYER_SEARCH.length, 1900, '192.168.0.255');

3. Patch helper.js

This step is not need for node 0.10.28. This step is only needed for more recent versions of node, where the "Invalid key length" error on crypto.js file would pop up.

Edit:

<YOUR NODE INSTALL FOLDER>/node_modules/airsonos/node_modules/nodetunes/lib/helper.js 

Replace the line:

var decipher = crypto.createDecipheriv('aes-128-cbc', audioAesKey, audioAesIv);

With these two:

var audioAesKeyBuffer = new Buffer(audioAesKey, 'binary');
var decipher = crypto.createDecipheriv('aes-128-cbc', audioAesKeyBuffer, audioAesIv);

Important

Running airsonos --diagnostics or airsonos --diagnostics --verbose only works for printing the infos! It doesn't actually connect to the device! When we want to really test airsonos, we have to remove the extra parameters and only call airsonos alone. Calling with the aforementioned params would leave the command hanging without finding the device. But after removing them, it found and successfully connected to my device!

Only the delay problem persists for me... Please ping me if you find a solution.

lfilho avatar Apr 20 '17 15:04 lfilho

Updated my answer above with steps for newer versions of node (tested with 7.9)

lfilho avatar Apr 20 '17 15:04 lfilho

Just tried this and it works! Thanks for the patch.

mattabullock avatar Apr 20 '17 21:04 mattabullock

@lfilho Have you submitted a PR with this fix? Is this not backwards-compatible with earlier version of Node?

gnestor avatar May 22 '17 21:05 gnestor

I have only collated here all the information existing elsewhere... The authors in the different repos are already aware... Depends on how / when they will apply these changes and sync up the new versions... On Mon 22. May 2017 at 23:26, Grant Nestor [email protected] wrote:

@lfilho https://github.com/lfilho Have you submitted a PR with this fix? Is this not backwards-compatible with earlier version of Node?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stephen/airsonos/issues/342#issuecomment-303224502, or mute the thread https://github.com/notifications/unsubscribe-auth/AARQhNWN_-2mSSYsBCJa-y1v8902NWnhks5r8f1ugaJpZM4LL6jm .

lfilho avatar May 23 '17 15:05 lfilho

Thanks @lfilho. I got airsonos working on macOS 10.12.5, node v6.11.0, with Sonos v7.3 by applying your patches 1 and 3. It finds my Sonos Connect, my 2x Play:3 stereo pair, my 2x Play:1 stereo pair, but not my PlayBar (with 2x Play:1 as surround speakers). Edit It does find the PlayBar. It was grouped with another zone when I started airsonos, but after ungrouping and restarting airsonos it works!

ebaauw avatar Jun 29 '17 17:06 ebaauw

Thanks for this!

mmlindeboom avatar Aug 04 '17 19:08 mmlindeboom

Thanks! This works on OSX 10.12.6 with Node 6.11.2.

alejandroposada avatar Aug 31 '17 00:08 alejandroposada

/usr/local/lib/node_modules/airsonos/node_modules/sonos/lib/logicalDevice.js

(Note the name of the file has no 's')

LwsBtlr avatar Nov 23 '17 20:11 LwsBtlr

multicast still seems to work for me (I read somewhere sonos' ssdp implementation tries multicast AND broadcast to see if either works??), but airsonos wasn't really registering for the multicast group properly, which could presumably cause problems on networks with igmp snooping enabled.

this seems to work ok for me:

  this.socket.bind(function() {
    _this.socket.setMulticastTTL(1);
    _this.socket.addMembership('239.255.255.250');
    _this.socket.send(PLAYER_SEARCH, 0, PLAYER_SEARCH.length, 1900, '239.255.255.250');
  });

Haven't tested it with igmp-proxy forwarding to another network yet. Hoping to try it in a few days...

dropwhile avatar Dec 31 '17 08:12 dropwhile