Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.

Devices could be null and therefore forEach was not available resulting ... #131

Closed
wants to merge 1 commit into from

Conversation

fasol2002
Copy link

Devices could be null and therefore forEach was not available resulting in an exception when airsonos startup

@stephen
Copy link
Owner

stephen commented Mar 14, 2015

What Sonos setup would cause the device list to be null? My assumption here was that if at least one device was reporting back, then devices should be populated to at least one item.

@fasol2002
Copy link
Author

Hi stephen,

I should have mention that I run airsonos on debian, the sonos topology: Sonos BRIDGE + Sonos Play:5. Regarding Air play devices: none.
I added the following line to try to get more information:

console.log('err:' + err + ', devices:' + devices);

This is what I get:

debian# airsonos 
[...WARNINGS about Avahi ]
Searching for Sonos devices on network...
err:Method Not Allowed, devices:undefined
err:null, devices:[object Object],[object Object]

I can't guess why the first attempt is failing "Method Not Allowed" but the erroneous attempt should be handled before iterating on the devices list.

@nkabbara
Copy link

Hi Stephen,

I got this same error. When I applied fasol2002's patch it worked.

Thanks.

@sberan
Copy link

sberan commented May 10, 2015

I've seen devices come in null - the err object is populated with "internal server error". Ignoring the error works fine too.

@fasol2002
Copy link
Author

Unfortunately ignoring the error wasn't enough in my case.

--- Message initial ---

De : "Sam Beran" notifications@github.com
Envoyé : 10 mai 2015 18:02
A : "stephen/airsonos" airsonos@noreply.github.com
Cc: "Remi" fasol2002@hotmail.com
Objet : Re: [airsonos] Devices could be null and therefore forEach was not available resulting ... (#131)

I've seen devices come in null - the err object is populated with "internal server error". Ignoring the error works fine too.


Reply to this email directly or view it on GitHub:
#131 (comment)

@manshurtigh
Copy link

I've got the forEach error too. When I implemented fasol2002's patch everything worked just fine. I've two Play 1 and one playbar all connected to each other with surround.

@siddharthm83
Copy link

I tried updating with fasol2002's patch. I get the below:

airsonos --verbose
Searching for Sonos devices on network...

Its not able to find the sonos devices. Any tips? I have a full sonos system. I am running OSX yosemite 10.10.2, node v0.12.7

It is able to find the devices but devices seem to be null. Here is the output with diagnostics turned true
airsonos
AirSonos Diagnostics
node version v0.12.7
operating sys darwin (x64)
ip address 10.0.0.5

Searching for Sonos devices on network...

Device {"host":"10.0.0.15","port":1400,"state":{}} (ZPS9)
- attrs: {"CurrentZoneName":"Living Room", "CurrentIcon":"x-rincon-roomicon:living", "CurrentConfiguration":"1"} - info: {"SoftwareVersion":"29.5-91030",
"DisplaySoftwareVersion":"5.4",
"HardwareVersion":"1.9.1.10-1",
"IPAddress":"10.0.0.15",
"MACAddress":"XX:XX:XX:XX:XX:2B",
"CopyrightInfo":"© 2004-2014 Sonos, Inc. All Rights Reserved.",
"ExtraInfo":"OTP: ",
"HTAudioIn":"21"}
`- topology: [{"group":"RINCON_B8E937BE42F401400:2",
"coordinator":"false",
"htsat":"true",
"wirelessmode":"0",
"hasconfiguredssid":"0",
"channelfreq":"5765",
"behindwifiext":"0",
"wifienabled":"1",
"location":"http://10.0.0.17:1400/xml/device_description.xml",
"version":"29.5-91030",
"mincompatibleversion":"28.0-00000",
"legacycompatibleversion":"24.0-0000",
"bootseq":"7",
"uuid":"RINCON_B8E937BE42F401400",
"name":"Living Room"},{"group":"RINCON_B8E937BD7D6A01400:3",
"coordinator":"false",
"htsat":"true",
"wirelessmode":"0",
"hasconfiguredssid":"0",
"channelfreq":"5765",
"behindwifiext":"0",
"wifienabled":"1",
"location":"http://10.0.0.16:1400/xml/device_description.xml",
"version":"29.5-91030",
"mincompatibleversion":"28.0-00000",
"legacycompatibleversion":"24.0-0000",
"bootseq":"7",
"uuid":"RINCON_B8E937BD7D6A01400",
"name":"Living Room"},{"group":"RINCON_000E589B087201400:2",
"coordinator":"false",
"htsat":"true",
"wirelessmode":"0",
"hasconfiguredssid":"0",
"channelfreq":"5765",
"behindwifiext":"0",
"wifienabled":"1",
"location":"http://10.0.0.18:1400/xml/device_description.xml",
"version":"29.5-91030",
"mincompatibleversion":"28.0-00000",
"legacycompatibleversion":"24.0-0000",
"bootseq":"10",
"uuid":"RINCON_000E589B087201400",
"name":"Living Room"},{"group":"RINCON_B8E937BD7DF801400:1",
"coordinator":"true",
"wirelessmode":"0",
"hasconfiguredssid":"0",
"channelfreq":"2437",
"behindwifiext":"0",
"wifienabled":"1",
"location":"http://10.0.0.19:1400/xml/device_description.xml",
"version":"29.5-91030",
"mincompatibleversion":"28.0-00000",
"legacycompatibleversion":"24.0-0000",
"bootseq":"4",
"uuid":"RINCON_B8E937BD7DF801400",
"name":"Master Bedroom"},{"group":"RINCON_000E5866E85401400:0",
"coordinator":"true",
"wirelessmode":"0",
"hasconfiguredssid":"0",
"channelfreq":"2437",
"behindwifiext":"0",
"wifienabled":"1",
"location":"http://10.0.0.2:1400/xml/device_description.xml",
"version":"29.5-90191",
"mincompatibleversion":"28.0-00000",
"legacycompatibleversion":"24.0-0000",
"bootseq":"17",
"uuid":"RINCON_000E5866E85401400",
"name":"BRIDGE"},{"group":"RINCON_000E58B7172B01400:1",
"coordinator":"true",
"wirelessmode":"0",
"hasconfiguredssid":"0",
"channelfreq":"2437",
"behindwifiext":"0",
"wifienabled":"1",
"location":"http://10.0.0.15:1400/xml/device_description.xml",
"version":"29.5-91030",
"mincompatibleversion":"28.0-00000",
"legacycompatibleversion":"24.0-0000",
"bootseq":"10",
"uuid":"RINCON_000E58B7172B01400",
"name":"Living Room"}]

@stephen stephen closed this Aug 24, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants