Search does not seem to be working with SMAPI

33 views
Skip to first unread message

Matthew Antkowiak

unread,
Jan 17, 2018, 5:48:07 PM1/17/18
to Sonospy Development
Hi Mark


I have been Sonospy for a few years after you helped me get started and it has been working great.

However, just recently, the search functionality on the Sonos stopped working for music served via SMAPI.  The tracks are available to browse and play in the Sonos app, only search is not detecting any tracks, artist, albums, etc.

I have downloaded the latest version of the msrector5 branch.

After creating my db, I am running:

sonospy_proxy -sSonospy=Sonospy,sonospy.db,userindex3.ini -r

Note: userindex3.ini is a copy of userindex2.ini provided in the repo.

None of the other ini files were initially adjusted.  

In the pycpoint.log, I recieved the following error message:

Traceback (most recent call last):
  File "/opt/sonospy/app/sonospy/brisa/upnp/control_point/msearch.py", line 162, in _datagram_received
    cmd, headers = parse_http_response(data)
  File "/opt/sonospy/app/sonospy/brisa/core/network.py", line 259, in parse_http_response
    header, payload = data.split('\r\n\r\n')
ValueError: need more than 1 value to unpack
Unhandled exception in thread started by <bound method MSearch._datagram_received of <brisa.upnp.control_point.msearch.MSearch object at 0x7fdbb9fe7a90>>

Note: I am on Arch Linux, which has python3 as default.  I have put a wrapper around the sonospy install folder to default to python2.

Could you give any suggestions to debug the issue further?

Mark Henkelis

unread,
Jan 19, 2018, 12:54:52 PM1/19/18
to 'Matthew Antkowiak' via Sonospy Development

Hi,

The error is a failure in the code to process a return from an MSearch call - the app uses MSearch to find all UPnP devices on the your network.

If you run the Sonospy command directly on the command line in the sonospy rather than using sonospy_proxy in the base folder, you should see the name of the device causing the problem just before the error message:

    cd sonospy

    python pycpoint.py -p -sSonospy=Sonospy,,sonospy.db,userindex3.ini -r

One of the other guys reported a similar issue with a Synology NAS, but it went away (https://groups.google.com/forum/#!topic/sonospy-devel/oMatfCTaLsU).

Mark.

--
You received this message because you are subscribed to the Google Groups "Sonospy Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonospy-deve...@googlegroups.com.
To post to this group, send email to sonosp...@googlegroups.com.
Visit this group at https://groups.google.com/group/sonospy-devel.
For more options, visit https://groups.google.com/d/optout.

Matthew Antkowiak

unread,
Jan 19, 2018, 4:59:35 PM1/19/18
to Sonospy Development
Hi Mark

Following the steps in the linked post, it identified MyHarmony as the culprit. Details below:

data: HTTP/1.1 200 OK
CACHE-CONTROL: max-age = 1800
DATE:Fri, 19 Jan 2018 21:47:15 GMT
EXT:
SERVER: Ubuntu/10.04 UPnP/1.1 Harmony/16.3
ST: urn:myharmony-com:device:harmony:1
USN: uuid:8040b10d-eb73-4217-3de5-3cea046ea717::urn:myharmony-com:device:harmony:1
Traceback (most recent call last):
  File "/opt/sonospy/app/sonospy/brisa/upnp/control_point/msearch.py", line 162, in _datagram_received
    cmd, headers = parse_http_response(data)
  File "/opt/sonospy/app/sonospy/brisa/core/network.py", line 259, in parse_http_response
    header, payload = data.split('\r\n\r\n')
ValueError: need more than 1 value to unpack
Unhandled exception in thread started by <bound method MSearch._datagram_received of <brisa.upnp.control_point.msearch.MSearch object at 0x7f03a8c1ea90>>

Matthew Antkowiak

unread,
Jan 19, 2018, 5:21:18 PM1/19/18
to Sonospy Development
 Hi Mark

I unplugged the MyHarmony device and resetting up Sonospy, re-importing the music service into the Sonos app.  However, search is still not working in the Sonos app without the MyHarmony device on the network.  Digging further through the logs, has the error message below.  Nothing else flagged up (other than the other devices on the network).  

Args:
option.proxyonly: True
option.register: True
    Music service: Sonospy=Sonospy,sonospy.db,userindex3.ini
Proxy. Name: Sonospy
ERROR: Traceback (most recent call last):
  File "pycpoint.py", line 712, in __init__
    proxy.start()
  File "/opt/sonospy/app/sonospy/proxy.py", line 302, in start
    self._load()
  File "/opt/sonospy/app/sonospy/proxy.py", line 293, in _load
    self._add_root_device()
  File "/opt/sonospy/app/sonospy/proxy.py", line 237, in _add_root_device
    receive_notify=receive_notify)
  File "/opt/sonospy/app/sonospy/brisa/upnp/device/device.py", line 85, in __init__
    self._create_webserver(force_listen_url)
  File "/opt/sonospy/app/sonospy/brisa/upnp/device/device.py", line 104, in _create_webserver
    self.webserver = webserver.WebServer(host=p.hostname, port=p.port)
  File "/opt/sonospy/app/sonospy/brisa/core/webserver.py", line 1529, in __init__
    self.set_bind_address(self.host, self.port)
  File "/opt/sonospy/app/sonospy/brisa/core/webserver.py", line 1585, in set_bind_address
    raise ValueError('URL cannot be used by the webserver.')
ValueError: URL cannot be used by the webserver.

Thanks

Matthew

Mark Henkelis

unread,
Jan 19, 2018, 6:41:58 PM1/19/18
to 'Matthew Antkowiak' via Sonospy Development

The port that Sonospy is trying to use is in use already (port 50104 if you haven't changed it in the ini) - is Sonospy already running?

Matthew Antkowiak

unread,
Jan 20, 2018, 4:53:39 PM1/20/18
to Sonospy Development
Embarrassingly, it was user error, as I had not correctly triggered the stop job in my automated configuration.

Thanks Mark for identifying the issue.



Mark Henkelis

unread,
Jan 20, 2018, 6:10:00 PM1/20/18
to 'Matthew Antkowiak' via Sonospy Development

No problem.


On 20/01/18 21:53, 'Matthew Antkowiak' via Sonospy Development wrote:
Embarrassingly, it was user error, as I had not correctly triggered the stop job in my automated configuration.

Thanks Mark for identifying the issue.



Reply all
Reply to author
Forward
0 new messages