Thank you for your donation!


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


What API commands are there besides the ones listed in the Setup Guide?
#1
I was wondering what API commands there were, specifically if I could enable and disable the bluetooth renderer from the API, or if that is something else I would have to work on doing. 

I was trying to automate that to work with my phone via. an app, but I cannot figure out for the life of me if that is remotely possible. 

Thanks for the help Moode Audio Forums!
~SteadyStatus21
Reply
#2
The REST API is documented in the Setup Guide. There is also the moodeutl cli command. See help below.

Code:
pi@hsu:~ $ moodeutl --help
Usage: moodeutl [OPTION]
Moode utility programs

With no OPTION print the help text and exit.

-a             Print features availability
-A [add|rm N]  Update features availability
-d             Dump session file (requires sudo)
-d [-nr]       Dump session file, no radio (requires sudo)
-d [-gv var]   Dump session file, get value (requires sudo)
-D [var]       Delete session variable (requires sudo)
-e [filename]  Export settings to [filename] or ~/moodecfg-<timestamp>.ini (requires sudo)
-i             Import settings from /boot/moodecfg.ini (requires sudo)
-f             Print supported audio formats
-F             Print full alsacap info
-l             Print moode log
-m             Run system monitor
-s             Print system info
-c             Scan for SMB hosts
-C             Scan for SMB shares [host | IP address]
-N             Scan for NFS hosts
-M             Scan for MPD hosts
-o             List audio overlays
-q             Query sql database
-r             Restart servers
-R             Restart renderer [--bluetooth | --airplay | --spotify | --squeezelite | --roonbridge]
-t             Print last 10 lines of moode log and wait
-u             Check radio station urls for playability
-U             Check station urls, list only unplayable
--hwparams     Print ALSA hardware params
--btreset      Reset Bluetooth to off
--odcclear     Clear output device cache
--mpdlog       Print MPD log
--updlog       Print in-place update log
--mountmonlog  Print mount monitor log
--autocfglog   Print auto config update log
--sleepint     Print daemon sleep intervals
--mooderel     Print moOde release
--pirev        Print Pi revision
--osinfo       Print OS info
--version      Print program version
--help         Print this help text
pi@hsu:~ $

There's no command specifically for turning on/off a renderer but you could probably code one. Here are the relevant files:

Code:
# REST API
/var/www/command/index.php

# Function lib
/var/www/inc/renderer.php

# Renderer Config
/var/www/ren-config.php

# Worker job processing daemon
/var/www/daemon/worker.php
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
(05-10-2024, 04:52 PM)Tim Curtis Wrote: The REST API is documented in the Setup Guide. There is also the moodeutl cli command. See help below.

Code:
pi@hsu:~ $ moodeutl --help
Usage: moodeutl [OPTION]
Moode utility programs

With no OPTION print the help text and exit.

-a             Print features availability
-A [add|rm N]  Update features availability
-d             Dump session file (requires sudo)
-d [-nr]       Dump session file, no radio (requires sudo)
-d [-gv var]   Dump session file, get value (requires sudo)
-D [var]       Delete session variable (requires sudo)
-e [filename]  Export settings to [filename] or ~/moodecfg-<timestamp>.ini (requires sudo)
-i             Import settings from /boot/moodecfg.ini (requires sudo)
-f             Print supported audio formats
-F             Print full alsacap info
-l             Print moode log
-m             Run system monitor
-s             Print system info
-c             Scan for SMB hosts
-C             Scan for SMB shares [host | IP address]
-N             Scan for NFS hosts
-M             Scan for MPD hosts
-o             List audio overlays
-q             Query sql database
-r             Restart servers
-R             Restart renderer [--bluetooth | --airplay | --spotify | --squeezelite | --roonbridge]
-t             Print last 10 lines of moode log and wait
-u             Check radio station urls for playability
-U             Check station urls, list only unplayable
--hwparams     Print ALSA hardware params
--btreset      Reset Bluetooth to off
--odcclear     Clear output device cache
--mpdlog       Print MPD log
--updlog       Print in-place update log
--mountmonlog  Print mount monitor log
--autocfglog   Print auto config update log
--sleepint     Print daemon sleep intervals
--mooderel     Print moOde release
--pirev        Print Pi revision
--osinfo       Print OS info
--version      Print program version
--help         Print this help text
pi@hsu:~ $

There's no command specifically for turning on/off a renderer but you could probably code one. Here are the relevant files:

Code:
# REST API
/var/www/command/index.php

# Function lib
/var/www/inc/renderer.php

# Renderer Config
/var/www/ren-config.php

# Worker job processing daemon
/var/www/daemon/worker.php

Ah, gotcha! Thank you so much Tim!
Reply


Forum Jump: