Using the latest official repository version of Mopidy (2.2.3) on an new installation of Raspbian Buster Lite, no events are sent through my WebSockets connection. RPC requests/responses work as expected.
I’m using my own WebSockets client, but the log shows no attempt at sending events, so I would suspect this to be a server issue.
Log extract from an RPC event (Change volume)
DEBUG 2019-09-20 19:38:51,159 [944:HttpServer] mopidy.http.handlers
Received WebSocket message from [[My IP]]: u'{"jsonrpc":"2.0","id":2,"method":"core.mixer.set_volume","params":[68]}'
DEBUG 2019-09-20 19:38:51,168 [944:SoftwareMixer-1] mopidy.mixer
Mixer event: volume_changed(volume=68)
DEBUG 2019-09-20 19:38:51,166 [944:HttpServer] mopidy.http.handlers
Sent WebSocket message to [[My IP]]: '{"jsonrpc": "2.0", "id": 2, "result": true}'
DEBUG 2019-09-20 19:38:51,171 [944:SoftwareMixer-1] mopidy.listener
Sending volume_changed to MixerListener: {'volume': 68}
DEBUG 2019-09-20 19:38:51,177 [944:Core-10] mopidy.listener
Sending volume_changed to CoreListener: {'volume': 68}
DEBUG 2019-09-20 19:38:51,181 [944:MpdFrontend-11] mopidy.listener
Sending mixer to MpdSession: {}
Are you sure you are not closing the websocket connection? I suspect this isn’t a server issue as tools like websocat work just fine. Can you provide the full log and the full mopidy deps?
Sorry, my account had been put on hold for that second comment. The log extract from my first post also included an “Closed WebSocket connection” message.
I think I need to emphasize that when I write RPC requests/responses in my question, I still send and receive these through WebSockets. It’s only the “event” type messages I do not receive.
I’ve tried to use existing Web Frontends, but none of them receive live updates.
That’s odd, why are none of Mopidy’s dependencies shown? The one I wanted to see is the Tornado version as the latest Mopidy release doesn’t support Tornado v5 - one of the issues being broken websocket events. It is fixed in the development version available from github.
If you install Mopidy using pip it will correctly pull in Tornado v4.x, did you install it some other way?
Apt should also have pulled in the correct version of Tornado, I hope. Can you see what verison of Tornado you have installed? I’m still puzzled why deps didn’t list everything like normal.
Package: mopidy
Version: 2.2.3-1
Priority: optional
Section: sound
Maintainer: Stein Magnus Jodal <jodal@debian.org>
Installed-Size: 836 kB
Depends: adduser, debconf, gir1.2-gst-plugins-base-1.0, gir1.2-gstreamer-1.0,
gstreamer1.0-plugins-good, gstreamer1.0-plugins-ugly, lsb-base, python-gst-1.0,
python-tornado (>= 2.3), debconf (>= 0.5) | debconf-2.0, python-pkg-resources,
python-pykka, python-requests, python:any (<< 2.8), python:any (>= 2.7~)
Recommends: gstreamer1.0-alsa, gstreamer1.0-pulseaudio, gstreamer1.0-tools
Suggests: mopidy-doc
Homepage: https://www.mopidy.com/
Download-Size: 164 kB
APT-Manual-Installed: yes
APT-Sources: http://apt.mopidy.com buster/main armhf Packages
Description: music server with support for MPD/HTTP clients
Mopidy is an extensible music server which can play music from local
files, radio streams, and cloud services such as Spotify and SoundCloud.
.
Searches combine results from all music sources, and tracks can be mixed from
all sources in the play queue. Spotify or SoundCloud playlists are
also available for use.
apt show python-tornado
Package: python-tornado
Version: 5.1.1-4
Priority: optional
Section: web
Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
Installed-Size: 1,800 kB
Depends: ca-certificates, python (<< 2.8), python (>= 2.7~), python-backports-abc, python-concurrent.futures, python-singledispatch, python:any (<< 2.8), python:any (>= 2.7~), libc6 (>= 2.4)
Suggests: python-mysqldb, python-pycurl, python-tornado-doc, python-twisted
Breaks: python-zmq (<< 17.0.0-1~)
Homepage: http://www.tornadoweb.org/
Download-Size: 354 kB
APT-Manual-Installed: no
APT-Sources: http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
Description: scalable, non-blocking web server and tools
Tornado is a Python web framework and asynchronous networking library,
originally developed at FriendFeed. By using non-blocking network I/O,
Tornado can scale to tens of thousands of open connections, making it ideal
for long polling, WebSockets, and other applications that require a
long-lived connection to each user.
.
This is the Python 2 version of the package.
pip show tornado
Name: tornado
Version: 5.1.1
Summary: Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.
Home-page: http://www.tornadoweb.org/
Author: Facebook
Author-email: python-tornado@googlegroups.com
License: http://www.apache.org/licenses/LICENSE-2.0
Location: /usr/lib/python2.7/dist-packages
Requires:
Required-by:
OK, well Tornado 5.x is the problem for sure. I guess the Apt package never got updated with the Tornado version restriction.
So either grab the lastest development version of Mopidy from GitHub (if you are developing a client you’ll want to use that anyway since Mopidy v3.0 will remove many deprecated parts of the API). Or manually pin your Tornado version to 4.x while we sort out the package.
The issue should be fixed. The version problem was specifically restricting Tornado < 5 but the latest release of Mopidy (v2.3.1) supports Tornado 4.4+.