Build an open future with us.

Invest in Mycroft and become a community partner.

Mycroft with Google AIY Voice kit disk image


#41

Thanks @tjoen. I think for the short term it makes sense for me to just return the 3B+ boards and get the 3B ones. Saves me $5 a board. I don’t need 5GHz wireless :slight_smile:

Thank you for your work on the image.


#42

hmm, ok. I first uninstalled mopidy 2.1 with:
sudo pip uninstall mopidy
sudo apt-get uninstall mopidy

then reinstalled with:

sudo apt-get uninstall mopidy libsox-fmt-mp3 mopidy-spotify mopidy-local-sqlite

setup my mopidy.conf with a local dir of mp3’s,

[local]
enabled = true
library = sqlite
media_dir = /media/Walkman
scan_flush_threshold = 100
scan_follow_symlinks = false

sudo systemctl enable mopidy
sudo systemctl start mopidy

index that mp3 dir:

sudo mopidyctl local scan

I then did a “play artist beasty boys” in the mycroft-cli and it played the song.
I also did a “play track glorybox” in the mycroft-cli and it played Portishead glorybox.
Both were in my mounted mp3 directory.
Still not able to install a webinterface though, but mopidy seems to work here.

I did have a webinterface installed before, but I did not document it.

I’m using @Enverex mopidy skill:
msm install https://github.com/Enverex/skill-mopidy-local.git


#43

okay. and which mopidy config file does it load ? also, is your mopidy installation on usr/bin or usr/local/bin ?


#44

It’s in /usr/local/bin/mopidy
And my mopidy config is in /etc/mopidy/mopidy.conf

[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy

[logging]
config_file = /etc/mopidy/logging.conf
debug_file = /var/log/mopidy/mopidy-debug.log

[local]
enabled = true
library = sqlite
media_dir = /media/Walkman
scan_flush_threshold = 100
scan_follow_symlinks = false

[m3u]
playlists_dir = /var/lib/mopidy/playlists

[http]
enabled = true
hostname = 0.0.0.0
port = 6680
static_dir =
zeroconf = Mopidy HTTP server on $hostname

[spotify]
enabled = false

[local-sqlite]
enabled = true
directories =
  Albums                  local:directory?type=album
  Artists                 local:directory?type=artist
  Composers               local:directory?type=artist&role=composer
  Genres                  local:directory?type=genre
  Performers              local:directory?type=artist&role=performer
  Release Years           local:directory?type=date&format=%25Y
  Tracks                  local:directory?type=track
  Last Week's Updates     local:directory?max-age=604800
  Last Month's Updates    local:directory?max-age=2592000
timeout = 10
use_album_mbid_uri = true
use_artist_mbid_uri = false
use_artist_sortname = false

grtz, Tjoen


#45

are you sure these are the correct commands ?


#46

also, the biggest catch is around installing a web extension or any extension which is done through pip install. since that’s where the user permissions and config files are in conflicts. on a stock rpi setup, this works flawlessly but with mycroft setup - there’s some work around py virtual environment and user permissions


#47

ah sorry,

I just checked my bash log again,
should indeed be

‘sudo apt-get purge mopidy’

then install using that

sudo apt-get install libsox-fmt-mp3 mopidy-spotify mopidy-local-sqlite


#48

hey @tjoen

so tried this as well. tell you what’s currently happening -

  1. after removing and purging everything, did a fresh mopidy install
  2. updated the config file at /etc/mopidy/
  3. when i run sudo mopidyctl config -
  4. i still see the same config file details (though they are not the same in /etc/mopidy or ~/.config) - which is it doesn’t reflect http (i have removed static dir = though its still showing up in the config file), it doesn’t show mopify (which i have added the extension via pip and also modified the config file)

here it is for reference (output of mopidyctl config) -

^Cpi@picroft:~ sudo mopidyctl configf
Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf config" as user mopidy
[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy
max_tracklist_length = 10000
restore_state = false

[logging]
color = true
console_format = %(levelname)-8s %(message)s
debug_format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n  %(message)s
debug_file = /var/log/mopidy/mopidy-debug.log
config_file = /etc/mopidy/logging.conf

[audio]
mixer = software
mixer_volume = 
output = autoaudiosink
buffer_time = 

[proxy]
scheme = 
hostname = 
port = 
username = 
password = 

[mpd]
enabled = true
hostname = 127.0.0.1
port = 6600
password = 
max_connections = 20
connection_timeout = 60
zeroconf = Mopidy MPD server on $hostname
command_blacklist = 
  listall
  listallinfo
default_playlist_scheme = m3u

[http]
enabled = true
hostname = ::
port = 6680
static_dir =
zeroconf = 

[stream]
enabled = true
protocols = 
  http
  https
  mms
  rtmp
  rtmps
  rtsp
metadata_blacklist = 
timeout = 5000

[m3u]
enabled = true
base_dir =
default_encoding = latin-1
default_extension = .m3u8
playlists_dir = /var/lib/mopidy/playlists

[softwaremixer]
enabled = true

[file]
enabled = true
media_dirs = 
  $XDG_MUSIC_DIR|Music
  ~/|Home
excluded_file_extensions = 
  .jpg
  .jpeg
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[local]
enabled = true
library = json
media_dir = /var/lib/mopidy/media
scan_timeout = 1000
scan_flush_threshold = 100
scan_follow_symlinks = false
excluded_file_extensions = 
  .directory
  .html
  .jpeg
  .jpg
  .log
  .nfo
  .png
  .txt

actual file in /etc/mopidy/mopidy.conf -

[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy

[logging]
config_file = /etc/mopidy/logging.conf
debug_file = /var/log/mopidy/mopidy-debug.log

[local]
media_dir = /var/lib/mopidy/media

[m3u]
playlists_dir = /var/lib/mopidy/playlists

[mopify]
enabled = true
debug = false

[spotify]
enabled = true
username = **
password = **
client_id = **
client_secret = **
bitrate = 160
volume_normalization = true
private_session = true
timeout = 10
allow_cache = true
allow_network = true
allow_playlists = true
search_album_count = 20
search_artist_count = 10
search_track_count = 50
toplist_countries =

[http]
enabled = true
hostname = ::
port = 6680
zeroconf =


#49

really scratching my head over this, since i have scoured through related posts on this forum. have a feeling that its just one command away from sorting this out and enjoy mycroft to the fullest.


#50

So does the service start if you try: sudo systemctl start mopidy
What does the /var/log/mopidy.mopidy.log say?

If I manually run /usr/bin/mopidy it seems to create a config file
at /home/pi/.config/mopidy/mopidy.conf (or in root dir if using sudo…)

Mopidy then seems to be running, but I cannot reach the webinterface.
So I can only use the service to start it, which is what I want anyway.


#51

yes, service starts. its enabled as a system service. i can also see the webpage at ipadd:6680. as mentioned earlier, the problem is the config file its loading. hence, cannot access the web frontends, plugins and so on…


#52

Yes, but you don’t need a webinterface to use the skill though…

It is much handier, 'cause you can use your phone for instance, but it should work without a webinterface too. If you can see the webinterface then the skill should work.


#53

hmm. not sure. as you can see from the config file that its not updated with [spotify] section in the output of sudo mopidyctl config. which i have provided the details in the /etc/mopidy/mopidy.conf file. i want to control spotify via mopidy and bunch of other plugins such as tune in, podcasts etc.


#54

output when i check the status -

● mopidy.service - Mopidy music server
   Loaded: loaded (/lib/systemd/system/mopidy.service; enabled)
   Active: active (running) since Tue 2018-04-03 17:25:25 CEST; 1h 11min ago
  Process: 682 ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy (code=exited, status=0/SUCCESS)
  Process: 630 ExecStartPre=/bin/mkdir -p /var/cache/mopidy (code=exited, status=0/SUCCESS)
 Main PID: 696 (mopidy)
   CGroup: /system.slice/mopidy.service
           └─696 /usr/bin/python /usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf

Apr 03 17:25:31 picroft mopidy[696]: INFO     Starting Mopidy audio
Apr 03 17:25:31 picroft mopidy[696]: INFO     Starting Mopidy backends: StreamBackend, M3UBackend, FileBackend, LocalBackend
Apr 03 17:25:31 picroft mopidy[696]: INFO     No local library metadata cache found at /var/lib/mopidy/local/library.json.gz. Please run `mopidy local scan` to index your local music library. If you do not have a local music collection, you can disable the local backend to hide this message.
Apr 03 17:25:31 picroft mopidy[696]: INFO     Loaded 0 local tracks using json
Apr 03 17:25:31 picroft mopidy[696]: INFO     Starting Mopidy core
Apr 03 17:25:31 picroft mopidy[696]: INFO     Audio output set to "autoaudiosink"
Apr 03 17:25:31 picroft mopidy[696]: INFO     Starting Mopidy frontends: MpdFrontend, HttpFrontend
Apr 03 17:25:31 picroft mopidy[696]: INFO     MPD server running at [::ffff:127.0.0.1]:6600
Apr 03 17:25:32 picroft mopidy[696]: INFO     HTTP server running at [::]:6680
Apr 03 17:25:32 picroft mopidy[696]: INFO     Starting GLib mainloop```

#55

Everything I install from the apt-source seems to work here and be picked up by mopidy…

I also installed mopidy-spotify from the apt directory.
Installing from apt-get enabled it for me, it tries to load it from my config, (and complains because I did not enter the settings.)

so sudo apt-get install mopidy-tunein mopidy-podcast mopidy-spotify
should work, but you probably tried that already?

The only thing that does not work for me is installing from pip.


#56

same here with pip.

are you able to pass a command - hey mycroft, play michael jackson from spotify ? or play radio from tune in ?


#57

I don’t have a premium account so spotify does load, but does not work anyway.
I will check the tune-in plugin tomorrow.
My testmachines are in the office,

Local directories/artists already play fine with “play artist michael jackson”. I think the skill from @forslund works a bit different, allowing you to skip the artist or track keyword.


#58

I just installed podcast and tune-in though apt-get, and they get installed and loaded.

cat /var/log/mopidy/mopidy.log:

2018-04-04 13:20:15,329 INFO [1665:MainThread] mopidy.__main__: Starting Mopidy 2.1.0
2018-04-04 13:20:15,379 INFO [1665:MainThread] mopidy.config: Loading config from builtin defaults
2018-04-04 13:20:15,389 INFO [1665:MainThread] mopidy.config: Loading config from /etc/mopidy/mopidy.conf
2018-04-04 13:20:15,395 INFO [1665:MainThread] mopidy.config: Loading config from command line options
2018-04-04 13:20:15,790 INFO [1665:MainThread] mopidy.__main__: Enabled extensions: mpd, http, stream, m3u, tunein, softwaremixer, file, podcast, local, local-sqlite
2018-04-04 13:20:15,791 INFO [1665:MainThread] mopidy.__main__: Disabled extensions: spotify
2018-04-04 13:20:16,072 INFO [1665:MainThread] mopidy.commands: Starting Mopidy mixer: SoftwareMixer
2018-04-04 13:20:16,079 INFO [1665:MainThread] mopidy.commands: Starting Mopidy audio
2018-04-04 13:20:16,085 INFO [1665:MainThread] mopidy.commands: Starting Mopidy backends: PodcastBackend, StreamBackend, M3UBackend, FileBackend, LocalBackend, TuneInBackend
2018-04-04 13:20:16,126 INFO [1665:Audio-2] mopidy.audio.actor: Audio output set to "autoaudiosink"
2018-04-04 13:20:16,167 INFO [1665:MainThread] mopidy.local.library: Loaded 105 local tracks using sqlite
2018-04-04 13:20:16,186 INFO [1665:MainThread] mopidy.commands: Starting Mopidy core
2018-04-04 13:20:16,232 INFO [1665:MainThread] mopidy.commands: Starting Mopidy frontends: MpdFrontend, HttpFrontend
2018-04-04 13:20:16,236 INFO [1665:MainThread] mopidy.mpd.actor: MPD server running at [::ffff:127.0.0.1]:6600
2018-04-04 13:20:16,243 INFO [1665:HttpFrontend-12] mopidy.http.actor: HTTP server running at [::ffff:0.0.0.0]:6680
2018-04-04 13:20:16,244 INFO [1665:MainThread] mopidy.commands: Starting GLib mainloop

So the big problem is installing the webinterfaces with pip.

I’ll see if doing a manual install with git works. May take some time, I’m currently a bit busy with a totally unrelated android VR game.


#59

okay, but it does it work via voice command ?


#60

I don’t think so, spotify maybe works with forslunds version?
I’m not sure what skill you are using. There are at least 3 different versions as far as I know.

I came across http://remotedy.com/ which works nicely in browsing and playing songs using my android phone, but I’m not sure if it also searches spotify.