noson-app icon indicating copy to clipboard operation
noson-app copied to clipboard

"No Sonos zone found"

Open shanehull opened this issue 7 years ago • 27 comments

Hi,

Just tried to test this app out and received "No Sonos zone found".

It's a fresh install of 16.04, no VPN or anything, just connected directly to the network the Sonos Play is on.

Are there any logs I can access?

shanehull avatar Mar 25 '17 02:03 shanehull

If you installed the app from my launchpad repository or if you bold the app from source you can start the app with flag --debug as the following:

noson-app --debug 2>&1 | tee noson.log

Else if you installed the app from SNAP then type the following:

noson.noson-app --debug 2>&1 | tee noson.log

The discovering section looks like that:

(SONOS)FindDeviceDescription: starting new context
(SONOS)FindDeviceDescription: location url found (http://192.168.0.197:1400/xml/device_description.xml)
(SONOS)FindDeviceDescription: server string found (Linux UPnP/1.0 Sonos/34.16-37101 (ZP120))
(SONOS)FindDeviceDescription: search target matches (urn:schemas-upnp-org:device:ZonePlayer:1)

janbar avatar Mar 25 '17 07:03 janbar

Thanks! Looks like it's not specific to this app.

The same discovery issue is occurring on all 3rd part apps supporting Sonos, eg. VOX, airsonos.

Seems like they've restricted it on purpose.

shanehull avatar Apr 06 '17 23:04 shanehull

This is no longer an issue!

shanehull avatar Jun 14 '17 23:06 shanehull

I have this error. Can it be because i have my Sonos system connected via a sonos bridge? When starting i debug mode i get: root@jk-ThinkPad-S3-Yoga-14:/usr/include# noson --debug 2>&1 | tee noson.log qml: Zones_QMLTYPE_172(0x29b8140): In Ubuntu.Components 1.3, the use of Page.title, Page.flickable and Page.head is deprecated. Use Page.header and the PageHeader component instead. (SONOS)registerModel: 0x2b438a0 (Q:0) qml: Debug: LANG=da_DK (SONOS)ReceiveData: socket(0x7ffc00d4cad8) timed out (SONOS)ReceiveData: socket(0x7ffc00d4cad8) timed out (SONOS)ReceiveData: socket(0x7ffc00d4cad8) timed out (SONOS)ReceiveData: socket(0x7ffc00d4cad8) timed out (SONOS)ReceiveData: socket(0x7ffc00d4cad8) timed out (SONOS)ReceiveData: socket(0x7ffc00d4cad8) timed out (SONOS)ReceiveData: socket(0x7ffc00d4cad8) timed out (SONOS)ReceiveData: socket(0x7ffc00d4cad8) timed out (SONOS)ReceiveData: socket(0x7ffc00d4cad8) timed out (SONOS)ReceiveData: socket(0x7ffc00d4cad8) timed out [PERFORMANCE]: Last frame took 42 ms to render.

jenskh avatar Nov 17 '17 20:11 jenskh

Hi. Seems there isn't any response from the sonos. You have to be in the same wifi or wired network as the sonos. The app works like the android or ios app, so if it works with one of these, it will work with the app.

janbar avatar Nov 20 '17 08:11 janbar

Hi janbar. Thank you for your quick answer. The pc is on the same wireless network as my phone. And the phone works with the sonos native android app. But my pc with Ubuntu 16.04 gets this error (timed out). The timed out messages appears emmediatlly like with no delay in between the messages. Could the error be that it is because my Sonos connection to the router is through a Sonos bridge and not a "real" zone?

My topology is like this Router ----Wireless connection to phone and Ubuntu pc | cabled connection to Sonos Bridge | wireless Sonos network with 8 Sonos zones and two cr100 controllers

jenskh avatar Nov 20 '17 20:11 jenskh

The timeout message is "normal": the app is awaiting a feedback from the device. Also that timeout seems the app found a device... mmm. At this stage the app is calling url describing the topology. I am afraid the bridge doesn't work as player device.

janbar avatar Nov 21 '17 07:11 janbar

After checking my code, the timeout occurs when discovering devices. So for your case none player device has been found. During 5 sec the app search for upnp devices with special discover string like ...player:1.

janbar avatar Nov 21 '17 08:11 janbar

Maybe its the looking after "...player:1", that's the culprit. Anyway i'm not sure what a Sonos bridge announces it self as - i guess that it's not "....player:1" And all the players are connected to the local network via the bridge - so no players are foound on the local network. Would it be possible to try and discover a bridge besides the players?

jenskh avatar Nov 21 '17 10:11 jenskh

It should be. But the sonos specs are not opened and it requires reverse engineering. If you know C++ a little you can try to update the code here: https://github.com/janbar/noson-app/blob/4741edbf1fdca9380ce6dd28f3a81cf56a3af5ff/backend/lib/noson/noson/src/sonossystem.cpp#L352 to print the discovered device string for your system. Then to try to match the string updating the code here: https://github.com/janbar/noson-app/blob/4741edbf1fdca9380ce6dd28f3a81cf56a3af5ff/backend/lib/noson/noson/src/sonossystem.cpp#L276

In the README file of the project I explain how to compile the app on Ubuntu 16.04 or 16.10.

janbar avatar Nov 21 '17 19:11 janbar

Yep, I'm getting the same issue with just a Play 1 connected to the same AP.

Sniffing the packet gives me: ST: urn:schemas-upnp-org:device:ZonePlayer:1\r\n

And: NT: urn:schemas-upnp-org:device:ZonePlayer:1\r\n

shanehull avatar Dec 14 '17 08:12 shanehull

And: NT: upnp:rootdevice\r\n

And: NT: uuid:RINCON_949F3E81785201400\r\n

Not sure which packet is the discover and which the app should be looking for.

shanehull avatar Dec 14 '17 08:12 shanehull

@shed909 , thanks for your feedback. I found the issue. Seems the reponse of your devices doesn't return the ST string, and my code check for it. It isn't a requirement, and I could continue the handshake.

janbar avatar Dec 14 '17 23:12 janbar

I figured something like that was happening. Glad I could help!

shanehull avatar Dec 14 '17 23:12 shanehull

I pushed a commit in master including the check's removing. Also the snap package has been build and it is available from the store.

janbar avatar Dec 15 '17 08:12 janbar

Will do some more tests tonight!

shanehull avatar Dec 18 '17 22:12 shanehull

I refactored the app for Ubuntu 17.10 and later. No SNAP package is available for this version. You have to install the deb package from my PPA. A SNAP package could be available once 18.04 is out (April 2018). But you should prefer the native package from my PPA.

janbar avatar Dec 26 '17 11:12 janbar

Hi, I am on ubuntu 17.10. I installed the noson app 3.0.3 from the ppa package without issue. But when the application starts, it tells me that "No sonos zones were found". I have 2 play 1 and 1 play 5 running as a group at the same time on the same wifi network. I checked the firewall in case, but there is no blocked packet linked to the app I think.

As it seems to work for a lot of people, I do not understand what I am doing wrong. Is there anything else I can try ?

Below you'll find the debug logs (nothing to see unfortunately, and I clicked to search zones three times).

"using file ':/i18n/noson_fr.qm ' for translations." qml: LANG=fr_FR (SONOS)registerModel: 0x55d5abc64900 () (SONOS)registerModel: 0x55d5abc620a0 (FV:2) (SONOS)registerModel: 0x55d5abc63c70 () (SONOS)registerModel: 0x55d5abc60250 (A:ALBUM) (SONOS)registerModel: 0x55d5abc61160 (A:ALBUMARTIST) (SONOS)registerModel: 0x55d5abc5f390 (A:GENRE) (SONOS)registerModel: 0x55d5abc62d30 (R:0/0) (SONOS)registerModel: 0x55d5abc5e890 (SQ:) (SONOS)registerModel: 0x7fe15c00fd70 (Q:0)

Thanks in advance.

GuenMat avatar Jan 04 '18 11:01 GuenMat

@GuenMat , strange output. Mine looking like:

"using file ':/i18n/noson_fr.qm ' for translations."
(SONOS)Process: bind port 1400
qml: LANG=fr_FR
(SONOS)registerModel: 0x5586bf0ef370 ()
(SONOS)registerModel: 0x5586bf0eea10 (FV:2)
(SONOS)registerModel: 0x5586bf0ef040 ()
(SONOS)registerModel: 0x5586bf0ee410 (A:ALBUM)
(SONOS)registerModel: 0x5586bf0ee710 (A:ALBUMARTIST)
(SONOS)registerModel: 0x5586bf0ee110 (A:GENRE)
(SONOS)registerModel: 0x5586bf0eed10 (R:0/0)
(SONOS)registerModel: 0x5586bf0eded0 (SQ:)
qml: register account: type=519 sn=5 token=f...
(SONOS)FindDeviceDescription: starting new context
(SONOS)FindDeviceDescription: location url found (http://192.168.0.194:1400/xml/device_description.xml)
(SONOS)FindDeviceDescription: server string found (Linux UPnP/1.0 Sonos/39.4-48021 (ZP90))
(SONOS)FindDeviceDescription: search target matches

As you can see, the app create a network socket on a port (1400) at line 2. Could you check if the app is listening the network ? By trying to browse the url http://localhost:1400. You should see on your browser the message below:

capture du 2018-01-05 00-18-03

Then have you the log line (SONOS)FindDeviceDescription: starting new context (line 13) on app startup ?

janbar avatar Jan 04 '18 23:01 janbar

Hi, thanks for the reply.

When the app is started, I can see the following on the browser at http://localhost:1400

Noson Event Broker Version 1.5.6, compiled on Jan 3 2018 at 16:01:23

For the logs, I have now the following:

guenmat@AsusRog:~$ noson-app --debug 2>&1 | tee noson.log
"using file ':/i18n/noson_fr.qm ' for translations."
qml: LANG=fr_FR
(SONOS)registerModel: 0x5633d6a28880 ()
(SONOS)registerModel: 0x5633d6a25d40 (FV:2)
(SONOS)registerModel: 0x5633d6a27bf0 ()
(SONOS)registerModel: 0x5633d6a23ef0 (A:ALBUM)
(SONOS)registerModel: 0x5633d6a24e00 (A:ALBUMARTIST)
(SONOS)registerModel: 0x5633d6a23030 (A:GENRE)
(SONOS)registerModel: 0x5633d6a26cb0 (R:0/0)
(SONOS)registerModel: 0x5633d6a22280 (SQ:)
(SONOS)registerModel: 0x5633d6d74120 (Q:0)
(SONOS)ReceiveData: socket(0x7fdb9c0013c8) timed out (0)

If i use a curl call on the controller from my computer to get what is currently playing (conky), it works:

guenmat@AsusRog:~$ curl -H 'SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#GetPositionInfo"' -X POST -H 'Content-type: text/xml' -d '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetPositionInfo xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID></u:GetPositionInfo></s:Body></s:Envelope>' 192.168.0.131:1400/MediaRenderer/AVTransport/Control

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetPositionInfoResponse xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><Track>29</Track><TrackDuration>0:03:24</TrackDuration><TrackMetaData>&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:r=&quot;urn:schemas-rinconnetworks-com:metadata-1-0/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt;&lt;item id=&quot;-1&quot; parentID=&quot;-1&quot; restricted=&quot;true&quot;&gt;&lt;res protocolInfo=&quot;x-file-cifs:*:audio/mpeg:*&quot; duration=&quot;0:03:24&quot;&gt;x-file-cifs://GUENMATNAS/Musique/Musique/Jessie%20Ware/Jessie%20Ware%20-%20Glasshouse/Jessie%20Ware%20-%2009%20-%20Slow%20me%20down.mp3&lt;/res&gt;&lt;r:streamContent&gt;&lt;/r:streamContent&gt;&lt;upnp:albumArtURI&gt;/getaa?u=x-file-cifs%3a%2f%2fGUENMATNAS%2fMusique%2fMusique%2fJessie%2520Ware%2fJessie%2520Ware%2520-%2520Glasshouse%2fJessie%2520Ware%2520-%252009%2520-%2520Slow%2520me%2520down.mp3&amp;amp;v=6&lt;/upnp:albumArtURI&gt;&lt;dc:title&gt;Slow me down&lt;/dc:title&gt;&lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt;&lt;dc:creator&gt;Jessie Ware&lt;/dc:creator&gt;&lt;upnp:album&gt;Glasshouse&lt;/upnp:album&gt;&lt;upnp:originalTrackNumber&gt;9&lt;/upnp:originalTrackNumber&gt;&lt;r:albumArtist&gt;Jessie Ware&lt;/r:albumArtist&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;</TrackMetaData><TrackURI>x-file-cifs://GUENMATNAS/Musique/Musique/Jessie%20Ware/Jessie%20Ware%20-%20Glasshouse/Jessie%20Ware%20-%2009%20-%20Slow%20me%20down.mp3</TrackURI><RelTime>0:01:16</RelTime><AbsTime>NOT_IMPLEMENTED</AbsTime><RelCount>2147483647</RelCount><AbsCount>2147483647</AbsCount></u:GetPositionInfoResponse></s:Body></s:Envelope>

So the sonos devices are visible and accessibles. Tell me if you want me to do another test.

All the sonos devices are in firmware 8.2.2.

GuenMat avatar Jan 05 '18 08:01 GuenMat

Hi again, everything is working fine. It was a firewall issue. UFW is configured on my computer, and I allowed the ports documented on the sonos documentation https://sonos.custhelp.com/app/answers/detail/a_id/692/~/configuring-your-firewall-to-work-with-sonos

But then I tried to disabled the firewall and check the ports used by the app. Here are too attempts:

$ lsof -i :1025-9999 +c 15
noson-gui        7363 guenmat   25u  IPv4 1250803      0t0  TCP *:1400 (LISTEN)
noson-gui        7363 guenmat   28u  IPv4 1250109      0t0  TCP AsusRog:54202->192.168.0.131:1400 (ESTABLISHED)
$ lsof -i :1025-9999 +c 15
noson-gui        7715 guenmat   25u  IPv4 1255120      0t0  TCP *:1400 (LISTEN)
noson-gui        7715 guenmat   30u  IPv4 1255664      0t0  TCP AsusRog:54354->192.168.0.131:1400 (ESTABLISHED)

So a random port is used on sonos detection at each startup (54202 then 54354). And they were blocked by the firewall. I suppose it is UPNP protocol.

So allowing connection from my computer to the sonos controller did the trick.

Really sorry for making lose your time. It works now perfectly well. It is nice to control sonos from a linux desktop. Thank you for your work

GuenMat avatar Jan 05 '18 09:01 GuenMat

@GuenMat, that's great to work now. It is a good report for any others users using firewall.

janbar avatar Jan 05 '18 18:01 janbar

Problem for me seemed to be the Hue Bridge within the same network. Noson only discoverd that. After disconnecting and reconnecting it, everything now magically works.

baurmatt avatar Jan 14 '18 12:01 baurmatt

My problem was a firewall problem as well. Allowing incomming packets from my zone made everything work. Command: "sudo ufw allow from zone_ip_address" Thank you for a very needed controller software

jenskh avatar Jan 14 '18 15:01 jenskh

Okay, I had the exact same problem (the device was discovered but the zone didn't show up). I solved w/ sudo iptables -I INPUT -p tcp --dport 1400 -j ACCEPT.

Unfortunately this wasn't mentioned in the README

denysvitali avatar Feb 25 '18 20:02 denysvitali

@denysvitali , the range 1400-1409 can be bound by the app for the upnp callback.

janbar avatar Feb 25 '18 22:02 janbar

I've just installed noson on my new openSUSE Leap 15.2 system and also get "No Sonos zone found". The debug output is as follows:

Signal handler is enabled.
"using file ':/i18n/noson_en.qm ' for translations."
thumbnailer: register API [LASTFM]
thumbnailer: register API [DEEZER]
installing thumbnails cache in folder "/home/linux/.local/share/janbar/io.github.janbar.noson/QML/OfflineStorage"
thumbnailer is initialized
qml: LANG=en_GB
thumbnailer: configure API [DEEZER]
registerContent: 0x564788a2e1e0 ()
registerContent: 0x564788a2af40 (FV:2)
registerContent: 0x564788a2d130 ()
registerContent: 0x564788a25ef0 (SQ:)
registerContent: 0x564788a2c080 ()
registerContent: 0x5647888ae2f0 ()

I'm connected to the same network as my Sonos Play 1 and my mobile phone. My phone connects successfully yet my computer doesn't. I have no firewall rules yet:

firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: wlan2
  sources: 
  services: ssh dhcpv6-client
  ports: 
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

(It was working on my now defunct laptop with Manjaro and previously Ubuntu 18.04.)

AureliaSpatz avatar Mar 01 '21 06:03 AureliaSpatz