Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


[HOW-TO] Spotify Connect Web for Moode
(09-04-2018, 05:04 AM)RafaPolit Wrote: You could try moving the script include just above the closing body tag, as the script takes control of the knob element which has not yet been included before the php ifs.

So, put the two lines in the footer right above the </body> line.

Depending on other configs, it may also work better inside the first 'if' block, where the knob is inserted, at the end of those scripts within the if block

Thanks for the reply Rafa. I moved the include around like you suggested but it had no effect. 

Since playing music is working beautifully, I will just wait for you to install 4.2 Big Grin
Reply
Rafa,

It looks like Tim is cooking up Spotify support. Hoping it's going to be in 4.3. If so, I'll wait for that too.

Thanks again for your effort. Perhaps you can help Tim code the part to display album art in HUD Big Grin

-ferdzb
Reply
Thanks for the heads up. I'll keep a close eye on that one!
Reply
Rafa,


I fixed my problem. The coder in me just doesn't quit Big Grin It's all working now! 

I debugged in chrome develop and noticed the spotify.js has doctype in it. The issue was I used wget to copy your spotify.js. It ended up with html contents (from github). I copied the raw file manually, now it works! Thank you thank you.

[Image: R7gCRCf.png?1]
Reply
By the way, to support coverview (screensaver), I had to update the screen saver tags ("#ss-") as well -

Code:
  // cover art
  $('#coverart-url, #ss-coverart-url').html('<img class="coverart" src="http://i.scdn.co/image/' + metadata.cover_uri.substr(metadata.cover_uri.lastIndexOf(':') + 1) + '" alt="Cover art not found">');

  // metadata
  $('#extratags, #ss-extratags').html('Spotify Connect active');
  $('#currentartist, #ss-currentartist').html(metadata.artist_name);
  $('#currentsong, #ss-currentsong').html(metadata.track_name);
  $('#currentalbum, #ss-currentalbum').html(metadata.album_name);



[Image: S3e0eLk.png?1]
Reply
That looks great!!!!! I'm really happy that someone tried this and that it works more or less fuzz-free!

Thanks for reporting back the success story! Best regards,
Rafa.

ps. I'll look into updating the WGET instructions for it to pull the RAW data and not the github HTML code. Thanks!
Reply
HI, I'm new to this forum.
I'm trying to use your work to connect with spotify, but it is not working.
I use Moode Audio 4.2.
I can hear pink noise with the speaker test.
$ sudo systemctl status spotify-connect-web.service gives this output which seems OK.


Code:
pi@moode:~ $ sudo systemctl status spotify-connect-web.service
● spotify-connect-web.service
  Loaded: loaded (/lib/systemd/system/spotify-connect-web.service; enabled; vendor preset: enabled)
  Active: active (running) since Fri 2018-09-07 22:26:56 CEST; 13min ago
Main PID: 21785 (spotify-connect)
  CGroup: /system.slice/spotify-connect-web.service
          ├─21785 /bin/sh /home/pi/spotify/spotify-connect.sh
          └─21787 python main.py --playback_device softvol -m Master --mixer_device_index 0 --bitrate 320 --name moOde Connect --key /home/pi/spotify/spotify-connect-web

Sep 07 22:26:56 moode systemd[1]: Started spotify-connect-web.service.
Sep 07 22:26:59 moode spotify-connect.sh[21785]: /home/pi/.local/lib/python2.7/site-packages/pylast/__init__.py:51: UserWarning: You are using pylast with Python 2. Pylas
Sep 07 22:26:59 moode spotify-connect.sh[21785]:   UserWarning,
lines 1-11/11 (END)
But I still can't see any device on my SPotify web interface or on my phone.

Am I missing something ?
Thanks,

Niiico
Reply
It appears that the procedure installed a Pylast version not compatible with Python 2.7.

If you inspect the contents of that __init__.py file that is reporting an issue, what is the version listed after the initial comments and the first group of includes?
Reply
Dear friends, in view of all the situations that arise with this procedure, I'm posting this here and have added it to the beginning of the thread as well:

IMPORTANT! This is a complex procedure and will involve trial and error while you wrestle with different Moode versions, packages and tool versions, hardware cards, etc. This is MOST CERTAINLY NOT a straightforward and easy procedure. If you are not really confortable with that, this is perhaps not the best approach for you.

There are other Spotify instructions that are easier and that are more universally reported as working. With this one, there is a good 40% chance that you will run into trouble, as you can read from the 120 posts that make this thread. This is only worth it if you absolutely need gapless playback. If not, please look elsewhere.

If after all this you still decide to try, please read through this thread and all it's posts. There is a good chance you will find others have walked that same path and found a solution.

If you still fail, post your problem, along with all the efforts you have taken to solve it: files checked, versions checked, naming conventions, etc. Please, try to solve your problems first, then come for help. Do not expect to just run the instructions and post a question about "how do I solve my problem".

Sorry to be so blunt, but I feel more peolple fail to get this working than those that get it to work. You have been warned, try this at your own risk!
Reply
(09-08-2018, 04:20 AM)RafaPolit Wrote: It appears that the procedure installed a Pylast version not compatible with Python 2.7.

If you inspect the contents of that __init__.py file that is reporting an issue, what is the version listed after the initial comments and the first group of includes?

No version listed

The code says python 2 will be outdated. But it is not yet.
If I comment the code displaying the warning, the status says I am connected.


Code:
pi@moode:~ $ sudo systemctl status spotify-connect-web.service
● spotify-connect-web.service
  Loaded: loaded (/lib/systemd/system/spotify-connect-web.service; enabled; vendor preset: enabled)
  Active: active (running) since Sat 2018-09-08 14:14:37 CEST; 5h 0min ago
Main PID: 1800 (spotify-connect)
  CGroup: /system.slice/spotify-connect-web.service
          ├─1800 /bin/sh /home/pi/spotify/spotify-connect.sh
          └─1802 python main.py --playback_device softvol -m Master --mixer_device_index 0 --bitrate 320 --name moOde Connect --key /home/pi/spotify/spotify-connect-web/

Sep 08 14:14:37 moode systemd[1]: Started spotify-connect-web.service.
lines 1-9/9 (END)


But I still don't see the player in Spotify.
And I have read your new warning and I am ok with it ;-)
Reply


Forum Jump: