Moode Forum
Navigation using remote control - 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: Navigation using remote control (/showthread.php?tid=7706)



Navigation using remote control - scaronpce - 05-07-2025

Hello Tim,

I am probably not looking at this properly but I would like to navigate playlists, libraries, etc., using a remote control.

This would need to interface with the web display (just like the /var/www/util/vol.sh script).

Is there such a script or a method to do so ? Reading through various scripts in /var/www and "googling" the issue did not help ;-(

Regards,


RE: Navigation using remote control - Tim Curtis - 05-07-2025

Specific parts of moode can be controlled remotely via a REST API. This is documented in the Setup Guide.


RE: Navigation using remote control - TheOldPresbyope - 05-07-2025

@scaronpce

Try searching the FAQs and Guides subforum for terms like "remote" or "remote control". I wrote several and so do others. They should give you ideas.

Regards,
Kent


RE: Navigation using remote control - dheijl - 05-07-2025

I use flirc tv usb gadgets that you can program for any remote and use the remote to select moode radio stations and other functions using trigger-happy scripts. No need for the Web interface.


RE: Navigation using remote control - TheOldPresbyope - 05-07-2025

(05-07-2025, 06:37 PM)dheijl Wrote: I use flirc tv usb gadgets that you can program for any remote and use the remote to select moode radio stations and other functions using trigger-happy scripts. No need for the Web interface.

So search the same subforum on "flirc".


RE: Navigation using remote control - scaronpce - 05-08-2025

Hello Forum members,

Before using TriggerHappy or anything else, the following simple REST command fails using either the host name or "localhost" that I would place in a configuration file.

Code:
musical@moOde:~ $ curl http://localhost/command/?cmd=set_volume 95
{"volume":"100","muted":"no"}curl: (28) Failed to connect to 0.0.0.95 port 80 after 133482 ms: Couldn't connect to server
musical@moOde:~ $ curl http://localhost/command/?cmd=get_volume
{"volume":"100","muted":"no"}
musical@moOde:~ $ curl http://moode/command/?cmd=get_volume
{"volume":"100","muted":"no"}
musical@moOde:~ $ curl http://moode/command/?cmd=set_volume 95
{"volume":"100","muted":"no"}curl: (28) Failed to connect to 0.0.0.95 port 80 after 133427 ms: Couldn't connect to server
musical@moOde:~ $ ping -c 1 moode
PING moOde (127.0.1.1) 56(84) bytes of data.
64 bytes from moOde (127.0.1.1): icmp_seq=1 ttl=64 time=0.034 ms

--- moOde ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.034/0.034/0.034/0.000 ms
musical@moOde:~ $

I get proper results with the "get_" commands such as:
Code:
musical@moOde:~ $ curl http://moode/command/?cmd=get_output_format
{"format":"Not playing"}
musical@moOde:~ $



RE: Navigation using remote control - Tim Curtis - 05-09-2025

For one thing URL's can't have spaces. Your Browser will perform URL encoding to replace spaces and such with %HEX equivalents. The curl command has some options for URL encoding.


RE: Navigation using remote control - scaronpce - 05-09-2025

Sheepish grin! Always check the obvious first.

For those about to make similar mistakes, here is a (work in progress) triggerhappy configuration for the OSMC USB remote control:
Code:
# Volume keys: move 1 unit on short press, mute/restore on long press
## Deprecated as of moOde 9.3.3
##KEY_MINUS 1 /var/www/util/vol.sh -dn 1
##KEY_MINUS 2 /var/www/util/vol.sh -mute
##KEY_EQUAL 1 /var/www/util/vol.sh -up 1
##KEY_EQUAL 2 /var/www/util/vol.sh -restore
KEY_MINUS 1 curl http://moode/command/?cmd=set_volume%20-dn%201
KEY_MINUS 2 curl http://moode/command/?cmd=set_volume%20-mute
KEY_EQUAL 1 curl http://moode/command/?cmd=set_volume%20-up%201
KEY_EQUAL 2 curl http://moode/command/?cmd=set_volume%20-restore

# Play/Pause: ignore duration, act on key release
KEY_PLAYPAUSE 0 /usr/bin/mpc toggle
KEY_STOP 0 /usr/bin/mpc stop

# Default / Shuffle: ignore duration, act on key release
KEY_BACK 0 /usr/bin/mpc clear; /usr/bin/mpc load 'Default Playlist'; /usr/bin/mpc play
KEY_C 0 /usr/bin/mpc shuffle

# Navigation: previous/next entry on key release
KEY_LEFT  0 /usr/bin/mpc prev
KEY_DOWN  0 /usr/bin/mpc prev
KEY_RIGHT 0 /usr/bin/mpc next
KEY_UP    0 /usr/bin/mpc next

# Unused keys:
# KEY_ESC       1       command
# KEY_I 1       command
# KEY_ENTER     1       command
m# Volume keys: move 1 unit on short press, mute/restore on long press
## Deprecated as of moOde 9.3.3
##KEY_MINUS 1 /var/www/util/vol.sh -dn 1
##KEY_MINUS 2 /var/www/util/vol.sh -mute
##KEY_EQUAL 1 /var/www/util/vol.sh -up 1
##KEY_EQUAL 2 /var/www/util/vol.sh -restore
KEY_MINUS 1 curl http://moode/command/?cmd=set_volume%20-dn%201
KEY_MINUS 2 curl http://moode/command/?cmd=set_volume%20-mute
KEY_EQUAL 1 curl http://moode/command/?cmd=set_volume%20-up%201
KEY_EQUAL 2 curl http://moode/command/?cmd=set_volume%20-restore

# Play/Pause: ignore duration, act on key release
KEY_PLAYPAUSE 0 /usr/bin/mpc toggle
KEY_STOP 0 /usr/bin/mpc stop

# Default / Shuffle: ignore duration, act on key release
KEY_BACK 0 /usr/bin/mpc clear; /usr/bin/mpc load 'Default Playlist'; /usr/bin/mpc play
KEY_C 0 /usr/bin/mpc shuffle

# Navigation: previous/next entry on key release
KEY_LEFT  0 /usr/bin/mpc prev
KEY_DOWN  0 /usr/bin/mpc prev
KEY_RIGHT 0 /usr/bin/mpc next
KEY_UP    0 /usr/bin/mpc next

# Unused keys:
# KEY_ESC       1       command
# KEY_I 1       command
# KEY_ENTER     1       command

I can observe that the display is updated in a web browser connected to moOde but that the HDMI display is not synchronized. Is there a setting to keep all displays synchronized ?

Regards,


RE: Navigation using remote control - scaronpce - 05-12-2025

Hello Forum,

Here is a complete triggerhappy configuration for this OSMC Remote Control to control moOde during playback.
  • Home: replace the current playlist with the default playlist and start playing
  • Info: toggle coverview
  • Left,Right: seek 20 seconds backward/forward
  • Up,Down: previous/next entry on playlist (subject to random)
  • OK: toggle random mode
  • Back: drop everything except the currently playing item
  • List: shuffle the current playlist
  • Play/Pause: toggles between play and pause
  • Stop: Stop!
  • VolDown: Lower volume by one unit, mute on long press
  • VolUP: Increase volume by one unit, restore volume on long press
Note: coverview toggle is only applicable to the local display.

In the hope that this is useful to someone else ...

Code:
# Simple moOde remote control configuration for the OSMC USB controller
#

# Volume keys: move 1 unit on short press, mute/restore on long press
## Deprecated as of moOde 9.3.3
##KEY_MINUS 1 /var/www/util/vol.sh -dn 1
##KEY_MINUS 2 /var/www/util/vol.sh -mute
##KEY_EQUAL 1 /var/www/util/vol.sh -up 1
##KEY_EQUAL 2 /var/www/util/vol.sh -restore
KEY_MINUS 1 curl http://moode/command/?cmd=set_volume%20-dn%201
KEY_MINUS 2 curl http://moode/command/?cmd=set_volume%20-mute
KEY_EQUAL 1 curl http://moode/command/?cmd=set_volume%20-up%201
KEY_EQUAL 2 curl http://moode/command/?cmd=set_volume%20-restore

# Play/Pause: ignore duration, act on key release
KEY_PLAYPAUSE 0 /usr/bin/mpc toggle
KEY_STOP 0 /usr/bin/mpc stop

# Crop / Shuffle: ignore duration, act on key release
KEY_BACK 0 /usr/bin/mpc crop
KEY_C 0 /usr/bin/mpc shuffle

# Navigation: [-+]20s/previous/next entry on key release
KEY_LEFT  0 /usr/bin/mpc seek -00:00:20
KEY_RIGHT 0 /usr/bin/mpc seek +00:00:20
KEY_DOWN  0 /usr/bin/mpc prev
KEY_UP    0 /usr/bin/mpc next

# OK: toggle random mode on key release
KEY_ENTER 0 /usr/bin/mpc random

# Home: restart the default playlist on key release
KEY_ESC 0 /usr/bin/mpc clear; /usr/bin/mpc load 'Default Playlist'; /usr/bin/mpc play

# info: toggle coverview on short/long key press
KEY_I 1 curl http://moode/command/?cmd=set_coverview%20-on
KEY_I 2 curl http://moode/command/?cmd=set_coverview%20-off