help setting gpio with rotary encoders - pisuke74 - 04-15-2023
hi to everyone
i am from Volumio and in previous system I ve setted
GPIO 27 - 22 function prev /next title
GPIO 4 - 17 function decrease / increase volume
GPIO 9 - 10 function seek in title
i am using 3 rotary encoder on my dac
i ve read about gpio control in system menu but I don't know what insert in CMD space...
thanks for any help
If I am on correct path.. is there a list of CMD that I can insert?
thanks
RE: help setting gpio with rotary encoders - Tim Curtis - 04-15-2023
Try the mpc commands. Separate the command arguments with a comma when entered into the CMD field of GPIO Config.
Examples:
Code: # Playback control
mpc,next
mpc,prev
mpc,seek,+10%
mpc,seek,-10%
# Volume
/var/www/vol.sh,up,5
/var/www/vol.sh,dn,5
/var/www/vol.sh,mute
mpc help
Code: pi@kef:~ $ mpc help
Usage: mpc [options] <command> [<arguments>]
mpc version: 0.33
Options:
-v, --verbose Give verbose output
-q, --quiet Suppress status message
--no-status synonym for --quiet
-h, --host=<host> Connect to server on <host>
-P, --password=<password> Connect to server using password <password>
-p, --port=<port> Connect to server port <port>
-f, --format=<format> Print status with format <format>
-w, --wait Wait for operation to finish (e.g. database update)
-r, --range=[<start>]:[<end>] Operate on a range (e.g. when loading a playlist)
Commands:
mpc Display status
mpc add <uri> Add a song to the queue
mpc crop Remove all but the currently playing song
mpc current Show the currently playing song
mpc del <position> Remove a song from the queue
mpc play [<position>] Start playing at <position>
mpc next Play the next song in the queue
mpc prev Play the previous song in the queue
mpc pause Pauses the currently playing song
mpc pause-if-playing Pauses the currently playing song; exits with failure if not playing
mpc toggle Toggles Play/Pause, plays if stopped
mpc cdprev Compact disk player-like previous command
mpc stop Stop playback
mpc seek [+-][HH:MM:SS]|<0-100>% Seeks to the specified position
mpc seekthrough [+-][HH:MM:SS] Seeks by an amount of time within the song and playlist
mpc clear Clear the queue
mpc outputs Show the current outputs
mpc enable [only] <output # or name> [...] Enable output(s)
mpc disable [only] <output # or name> [...] Disable output(s)
mpc toggleoutput <output # or name> [...] Toggle output(s)
mpc outputset <output # or name> <name>=<value> Set output attributes
mpc queued Show the next queued song
mpc shuffle Shuffle the queue
mpc move <from> <to> Move song in queue
mpc playlist [<playlist>] Print <playlist>
mpc listall [<file>] List all songs in the music dir
mpc ls [<directory>] List the contents of <directory>
mpc lsplaylists List currently available playlists
mpc load <file> Load <file> into the queue
mpc insert <uri> Insert a song to the queue after the current track
mpc prio <prio> <position/range> ... Change song priorities in the queue
mpc save <file> Save a queue as <file>
mpc rm <file> Remove a playlist
mpc volume [+-]<num> Set volume to <num> or adjusts by [+-]<num>
mpc repeat <on|off> Toggle repeat mode, or specify state
mpc random <on|off> Toggle random mode, or specify state
mpc single <on|off> Toggle single mode, or specify state
mpc consume <on|off> Toggle consume mode, or specify state
mpc search <type> <query> Search for a song
mpc searchadd <type> <query> Search songs and add them to the queue
mpc find <type> <query> Find a song (exact match)
mpc findadd <type> <query> Find songs and add them to the queue
mpc searchplay <pattern> Find and play a song in the queue
mpc list <type> [<type> <query>] Show all tags of <type>
mpc crossfade [<seconds>] Set and display crossfade settings
mpc clearerror Clear the current error
mpc mixrampdb [<dB>] Set and display mixrampdb settings
mpc mixrampdelay [<seconds>] Set and display mixrampdelay settings
mpc update [<path>] Scan music directory for updates
mpc rescan [<path>] Rescan music directory (including unchanged files)
mpc sticker <uri> <get|set|list|delete|find> [args..] Sticker management
mpc stats Display statistics about MPD
mpc version Report version of MPD
mpc idle [events] Idle until an event occurs
mpc idleloop [events] Continuously idle until an event occurs
mpc replaygain [off|track|album] Set or display the replay gain mode
mpc channels List the channels that other clients have subscribed to.
mpc sendmessage <channel> <message> Send a message to the specified channel.
mpc waitmessage <channel> Wait for at least one message on the specified channel.
mpc subscribe <channel> Subscribe to the specified channel and continuously receive messages.
mpc listneighbors List neighbors.
mpc mount [<uri> <storage>] List mounts or add a new mount.
mpc unmount <uri> Remove a mount.
See man 1 mpc for more information about mpc commands and options
pi@kef:~ $
RE: help setting gpio with rotary encoders - pisuke74 - 04-16-2023
ok thanks. not clear how to use it. how to integrate with the web interface.. is there a walkthrough ? thanks
so if I understand for seek and next I have to set like screenshot and tested works...
also volume works.. but how to set the degrees of knob .. tried to set debounce to 1 (like Volumio) seems great
is there a limit of 8 buttons in moode?
RE: help setting gpio with rotary encoders - Tim Curtis - 04-16-2023
What do you mean by "how to integrate with the web interface"?
What is your usage scenario that requires more than 8 GPIO?
RE: help setting gpio with rotary encoders - pisuke74 - 04-16-2023
(04-16-2023, 02:20 PM)Tim Curtis Wrote: What do you mean by "how to integrate with the web interface"? (resolved inserting the command in web interface)
What is your usage scenario that requires more than 8 GPIO?
vol + vol - seek + seek - track + track - . with the 3 knob I have 3 press ... 6+3 = 9... I can use for mute, pause and if possible reboot.. (how can I set pause mute and reboot if possible?
RE: help setting gpio with rotary encoders - Tim Curtis - 04-16-2023
The GPIO Config screen is limited to 8 pins.
You might want to use a rotary encoder for volume instead of two dedicated push buttons.
RE: help setting gpio with rotary encoders - pisuke74 - 04-16-2023
(04-16-2023, 05:16 PM)Tim Curtis Wrote: The GPIO Config screen is limited to 8 pins.
You might want to use a rotary encoder for volume instead of two dedicated push buttons.
ok thanks. I have 3 rotary encoder but they have the push function .
I use all encoder for volume seek and ff function. ok if limit Is 8
RE: help setting gpio with rotary encoders - the_bertrum - 04-17-2023
It sounds like you are using up and down on the rotary encoders as discreet buttons? If you look in the Audio Config section of the moOde UI, under the "Volume options" section, you will see a built in rotary encoder volume section which you may find works more like a traditional volume knob (the further you turn the knob, the bigger the effect).
RE: help setting gpio with rotary encoders - Bedlore - 07-06-2023
Hey all, not wanting to high-jack the thread so let me know if I should start a new one.
I'm wanting to actually retro-fit an motor encoder into my analogue amp. I don't want to use the software volume as it effects the quality but I would love to use the mood interface to control the volume of my amp pot.
Is this possible using the setup you describe here or is it only for reading from a rotary encoder?
RE: help setting gpio with rotary encoders - Tim Curtis - 07-06-2023
You should start a new thread in Support.
Describe the "motor encoder".
|