MPD command missing ? - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7) +--- Thread: MPD command missing ? (/showthread.php?tid=3567) |
MPD command missing ? - electroremy - 03-06-2021 Hi everybody I'm trying to command my Moode Audio RPI with URL requests sent by a an Arduino DIY automation system, which uses Ethernet as HTTP client and HTTP server on port 80. It can also use DNS to resolve names and contact a server or a website. This is the MPD reference : https://www.musicpd.org/doc/html/protocol.html#command-playlistinfo With Moode audio, this commands work fine: http://moode/command/?cmd=next http://moode/command/?cmd=previous http://moode/command/?cmd=pause http://moode/command/?cmd=play http://moode/command/?cmd=stop http://moode/command/?cmd=vol.sh%2085 // set volume to 85% - mind '%20' is 'space' char http://moode/command/?cmd=play%2021 // play song n°22 in the queue ; mind that song n°1 is '0' not '1' But other commands do not work at all: http://moode/command/?cmd=playlistinfo http://moode/command/?cmd=currentsong ... I want to do a "full command line" if possible. And if possible, I want to "navigate" in MP3 directory : - get list of files in current dir - get list of dir in current dir - go inside dir - go back to parent dir - add files to queue - clear queue Also my Arduino system can use other port than 80 to connect to a server. But Arduino do not have enough power, ROM and RAM to handle complex secure connexions (like HTTPS or SSH) Best regards. RE: MPD command missing ? - TheOldPresbyope - 03-06-2021 @electroremy As stated in the setup.txt file, Code: //////////////////////////////////////////////////////// Note well that MPD commands available via MPC (try "mpc help") are not the exactly same as the commands in the MPD Protocol (the documentation you reference). For example, there is no playlistinfo available. You cited the MPD protocol section, so did you read the first sentence in it? Quote:The MPD command protocol exchanges line-based text records between client and server over TCP. If you telnet to port 6600 you'll see how the protocol works. Just type a command and look at the response. Regards, Kent RE: MPD command missing ? - electroremy - 03-07-2021 Hi, Thank you ; so I have to use MPC commands as listed here : https://linux.die.net/man/1/mpc And what about "bluetooth connection" ? As I can connect a smartphone with bluetooth to play podcasts, Moode Audio will be "locked" - it's a logic behavoir But if I send MPC command while Moode is already connected to bluetooth, what's appends ? Can I crash Moode Audio ? Is it possible to get Moode Audio "state" ? Regards, RE: MPD command missing ? - TheOldPresbyope - 03-07-2021 (03-07-2021, 02:13 PM)electroremy Wrote: Hi, Since the versions of MPD and MPC used in moOde evolve over time, I suggest you ask the code directly what commands it accepts. Code: pi@moode:~ $ mpc help MPC is a companion to MPD. Using moOde as a Bluetooth speaker bypasses MPD. If you make changes to the MPD status you won't see the effect until you stop using the Bluetooth connection. Regards, Kent RE: MPD command missing ? - vinnn - 03-07-2021 @electroremy Yes mpc is a command-line mpd client, the mpd binary is the daemon not the client. Yes you can stream to bluetooth from your phone. Moode is a Linux distribution that ships multiple audio playback/renderer programs with a custom web interface to browse, configure & control it all. The programs that output audio on Moode such as mpd, bluez-alsa, librespot, upmpdcli etc. all output directly to the configured ALSA device driver which can take a single input at a time. Moode's web UI blanks out the screen when the sound device is in use by something other than mpd to inform the user and prevent ugly errors. If you try to play music in one program whilst another is using the ALSA device it will just fail until the ALSA device is not in use. RE: MPD command missing ? - electroremy - 03-11-2021 Hi I use telnet with some usefull commands : Code: telnet Note that commands are those listed in MPD doc not MPC, they are sometimes not the same that works with http://moode/command/?cmd=xxx currentsong return name and also the ID So, I can make several calls of 'playlistid x' with x = currentsong ID - 5 to currentsong ID + 5 to display a part of current playlist on a LCD screen Indeed, ask Moode to give all playlist song give too much data, I have to get info song by song. This allow me basic control of Moode audio, like a remote for Hifi CD player But to change queue and load other songs or playlists, I have to go back to computer or smartphone interface. I find there are some function that use 'URI' (as listfiles {URI}) but I don't know how to write correct URI for files located in USB stick Regards, RE: MPD command missing ? - TheOldPresbyope - 03-11-2021 @electroremy Here's what the docs say about listfiles Quote:Lists the contents of the directory URI, including files are not recognized by MPD. URI can be a path relative to the music directory or an URI understood by one of the storage plugins. The response contains at least one line for each directory entry with the prefix “file: ” or “directory: “, and may be followed by file attributes such as “Last-Modified” and “size”. So, now the question is "what is the music directory?" In moOde's case, it is /var/lib/mpd/music. Here's what's in mine: Code: pi@moode:/var/lib/mpd/music $ ls Using the MPD protocol I can ask for a listing of a particular subdirectory on the particular USB thumbdrive which is plugged into this player: Code: telnet moode.local 6600 Regards, Kent RE: MPD command missing ? - electroremy - 03-14-2021 Hi I'm confused about the "curentsong" and "playlistid x" commands Indeed, Moode Audio MPC telnet first send a "OK MPD 0.22.0" response. I have to wait for the next data packet that contains the song info. Moode Audio MPC telnet interface is very fast and responsive with commands that sends no data or just "OK" ...but there is a delay between the 2nd data Thus, to get 11 songs names, it takes 3 to 5 seconds... There is a way to avoid this and force MPD to send all data in the first packet (in config files or elsewhere) ? This is the code to received data after sending a command : Code: int len; Regards |