samtherussell / squeezebox-controller

A python interface for controlling Logitech Squeezeboxes via the SqueezeboxServer
MIT License
14 stars 10 forks source link

JSON RPC not working #7

Closed mfraser closed 1 year ago

mfraser commented 1 year ago

Installing squeezebox-controller running from Python produces this:

from squeezebox_controller import SqueezeBoxController controller = SqueezeBoxController("192.168.2.109",9000) Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 449, in _make_request six.raise_from(e, None) File "", line 3, in raise_from File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 444, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.10/http/client.py", line 1374, in getresponse response.begin() File "/usr/lib/python3.10/http/client.py", line 318, in begin version, status, reason = self._read_status() File "/usr/lib/python3.10/http/client.py", line 300, in _read_status raise BadStatusLine(line) http.client.BadStatusLine: POST %2Fjsonrpc.js HTTP%2F1.1

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 489, in send resp = conn.urlopen( File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 785, in urlopen retries = retries.increment( File "/usr/local/lib/python3.10/dist-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/usr/local/lib/python3.10/dist-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 449, in _make_request six.raise_from(e, None) File "", line 3, in raise_from File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 444, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.10/http/client.py", line 1374, in getresponse response.begin() File "/usr/lib/python3.10/http/client.py", line 318, in begin version, status, reason = self._read_status() File "/usr/lib/python3.10/http/client.py", line 300, in _read_status raise BadStatusLine(line) urllib3.exceptions.ProtocolError: ('Connection aborted.', BadStatusLine('POST %2Fjsonrpc.js HTTP%2F1.1\r\n'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.10/dist-packages/squeezebox_controller/init.py", line 98, in init self.player_macs = self._populate_player_macs(playername_cleanup_func ) File "/usr/local/lib/python3.10/dist-packages/squeezebox_controller/init.py", line 374, in _populate_player_macs count = int(self._make_request('-', ["player","count", "?"])['result']['_count']) File "/usr/local/lib/python3.10/dist-packages/squeezebox_controller/init.py", line 396, in _make_request return handler(player) File "/usr/local/lib/python3.10/dist-packages/squeezebox_controller/init.py", line 390, in handler req = self.request_lib.post(self.end_point_url, json=payload) File "/usr/local/lib/python3.10/dist-packages/requests/api.py", line 115, in post return request("post", url, data=data, json=json, kwargs) File "/usr/local/lib/python3.10/dist-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, kwargs) File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 587, in request resp = self.send(prep, send_kwargs) File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 701, in send r = adapter.send(request, kwargs) File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 547, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine('POST %2Fjsonrpc.js HTTP%2F1.1\r\n'))

controller = SqueezeBoxController("192.168.2.110",9000) Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 449, in _make_request six.raise_from(e, None) File "", line 3, in raise_from File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 444, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.10/http/client.py", line 1374, in getresponse response.begin() File "/usr/lib/python3.10/http/client.py", line 318, in begin version, status, reason = self._read_status() File "/usr/lib/python3.10/http/client.py", line 300, in _read_status raise BadStatusLine(line) http.client.BadStatusLine: POST %2Fjsonrpc.js HTTP%2F1.1

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 489, in send resp = conn.urlopen( File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 785, in urlopen retries = retries.increment( File "/usr/local/lib/python3.10/dist-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/usr/local/lib/python3.10/dist-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 449, in _make_request six.raise_from(e, None) File "", line 3, in raise_from File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 444, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.10/http/client.py", line 1374, in getresponse response.begin() File "/usr/lib/python3.10/http/client.py", line 318, in begin version, status, reason = self._read_status() File "/usr/lib/python3.10/http/client.py", line 300, in _read_status raise BadStatusLine(line) urllib3.exceptions.ProtocolError: ('Connection aborted.', BadStatusLine('POST %2Fjsonrpc.js HTTP%2F1.1\r\n'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.10/dist-packages/squeezebox_controller/init.py", line 98, in init self.player_macs = self._populate_player_macs(playername_cleanup_func ) File "/usr/local/lib/python3.10/dist-packages/squeezebox_controller/init.py", line 374, in _populate_player_macs count = int(self._make_request('-', ["player","count", "?"])['result']['_count']) File "/usr/local/lib/python3.10/dist-packages/squeezebox_controller/init.py", line 396, in _make_request return handler(player) File "/usr/local/lib/python3.10/dist-packages/squeezebox_controller/init.py", line 390, in handler req = self.request_lib.post(self.end_point_url, json=payload) File "/usr/local/lib/python3.10/dist-packages/requests/api.py", line 115, in post return request("post", url, data=data, json=json, kwargs) File "/usr/local/lib/python3.10/dist-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, kwargs) File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 587, in request resp = self.send(prep, send_kwargs) File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 701, in send r = adapter.send(request, kwargs) File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 547, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine('POST %2Fjsonrpc.js HTTP%2F1.1\r\n'))

mfraser commented 1 year ago

Closing this as I was using the wrong port.