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

"No Sonos zone found" #9

Open
shanehull opened this issue Mar 25, 2017 · 27 comments
Open

"No Sonos zone found" #9

shanehull opened this issue Mar 25, 2017 · 27 comments

Comments

@shanehull
Copy link

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?

@janbar
Copy link
Owner

janbar commented Mar 25, 2017

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)

@shanehull
Copy link
Author

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
Copy link
Author

This is no longer an issue!

@jenskh
Copy link

jenskh commented Nov 17, 2017

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.

@janbar
Copy link
Owner

janbar commented Nov 20, 2017

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.

@jenskh
Copy link

jenskh commented Nov 20, 2017

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

@janbar
Copy link
Owner

janbar commented Nov 21, 2017

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
Copy link
Owner

janbar commented Nov 21, 2017

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.

@jenskh
Copy link

jenskh commented Nov 21, 2017

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?

@janbar
Copy link
Owner

janbar commented Nov 21, 2017

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:

DBG(DBG_INFO, "%s: search target not matches (%s)\n", __FUNCTION__, val);

to print the discovered device string for your system. Then to try to match the string updating the code here:
#define DISCOVER_ST "urn:schemas-upnp-org:device:ZonePlayer:1"

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

@shanehull
Copy link
Author

shanehull commented Dec 14, 2017

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
Copy link
Author

shanehull commented Dec 14, 2017

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.

@janbar
Copy link
Owner

janbar commented Dec 14, 2017

@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 janbar reopened this Dec 14, 2017
@shanehull
Copy link
Author

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

@janbar
Copy link
Owner

janbar commented Dec 15, 2017

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.

@shanehull
Copy link
Author

Will do some more tests tonight!

@janbar
Copy link
Owner

janbar commented Dec 26, 2017

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.

@GuenMat
Copy link

GuenMat commented Jan 4, 2018

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.

@janbar
Copy link
Owner

janbar commented Jan 4, 2018

@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 ?

@GuenMat
Copy link

GuenMat commented Jan 5, 2018

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
Copy link

GuenMat commented Jan 5, 2018

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

@janbar
Copy link
Owner

janbar commented Jan 5, 2018

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

@baurmatt
Copy link

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.

@jenskh
Copy link

jenskh commented Jan 14, 2018

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

@denysvitali
Copy link

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

@janbar
Copy link
Owner

janbar commented Feb 25, 2018

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

@AureliaSpatz
Copy link

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.)

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

No branches or pull requests

7 participants