[PLUGIN] RotaryEncoder II

Thank you for your commitment. I am a liitle bit busy and this project have to wait. For now I cant do that becauseIi had to use this sd card for different project ( its winter-spring time and this card was quick help recuse for my heat pump) but i created image of this card before. I can reproduce that or send you this image if this help but this is 32 GB. So i will back to this project but i do not know when.

Managed to get the plugin installed via the Volumio plugin store. Showing v 1.0.15.

With 1 rotary encoder set to volume I successfully set the volume up/down however everytime the current playing track reverts to the beginning.

Entry from debug log below

info: [ROTARYENCODER2] addEventHandle received from rotary: 1 → Dir: 1
info: [ROTARYENCODER2] emitDialCommand: 1 with value 1for Rotary: 1
info: [ROTARYENCODER2] emitDialCommand: VOLUME UP
info: VolumeController::SetAlsaVolume+
info: CoreStateMachine::pushState
info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
info: CoreCommandRouter::volumioPushState

I should say I did have trouble getting this working, I struggled to get the config to save after the initial saving which I believe is a known bug on previous versions. Running the workaround mentioned in this thread worked (copying config file from one location to another) so not sure if it could be linked to that?

Thanks

UPDATE - Looks like it does the same using my IR remote so think its a general config issue. I’ll explore in the wider forum.

Sounds like something else is wrong.
In the Latest version you should not need to use any workaround. If you have to, something is wrong.

Yeah would seem that way wouldn’t it. Still at initial build phase so will try a fresh install of Volumio

Hi,
I would like to configure the long press action with the system command “reboot 6”, could someone tell me how to do it?

Thanks

Should be easy:

You need to use the “Emit Websocket Message” option in the push-button config like described in the documentation under “Dial Function”.
It is documented under dial function but the same option is available for push-button.

In the textfields you need to put the following:

In principle, you can put any Websocket message you can find in the code for the Websocket API.

it does not work

Hi, sorry, it seems I did not remember correctly from the top of my head how I implemented it. Instead of putting single quotes, you need to put curly brackets into the Data field.
I updated my answer. Tried it, works on my system.

Hi T0MR0,
Thanks for the reply
unfortunately it doesn’t work
the command I need to pass to the system is ‘reboot 6’ (with the number),
this will allow direct booting from partition number 6 in a PINN/NOOBS multiboot system
note that in ssh session it works fine
I have tried with:
command: reboot 6
data: {}

command: reboot
data: {6}

command: exec(‘reboot 6’)
data: {}

but nothing
I also tried to edit line 807 in /data/plugins/system_hardware/rotaryencoder2/index.js
from

self.socket.emit('reboot')
to

self.socket.emit('reboot 6')

so that ‘reboot 6’ is default action in [Reboot] drop-down menu but it doesn’t work like that either

Hi! Sorry, I overlooked the 6.
Since you want to call an OS command, that will not work.
As mentioned in my previous post, the plug-in only supports sending Websocket calls.
If there is a plug-in, that supports sending your commands or calling system functions, you could call that plug-in from the rotary plug-in. Alternatively, you could ask for implementing this in the Websocket API.

Now I understand why it doesn’t work even by editing your index.js file

Thank you

Hi, T0MR0
Is there a way to navigating through the menu with rotary encoder?

Hi jandes!
There is no direct possibility since to my knowledge there are no Websocket calls for that implemented.
I do not plan to implement it in the rotary plugin, because that is beyond its purpose.
However, if there is any plugin, that can act similar to an HID (mouse, touchscreen) to operate the web-frontend on a display and exposes the right functions, the rotary could control that other plugin via the websocket commands. I do something similar with a plugin that displays the menu on an LCD display and allows to control it (however, it is not mature enough to publish and I have no time to finish it).

Hello…

I like to fix a rotary enoder to my volumio streamer.
Rpi 4 2 gb
IQ audio dac pro
Volumio 3.546

Expecting kind support to fux a rotary encoder to control. Volume up & down, play, pause, next, previous…etc.

Thank you
Naveen

Expecting kindly for looking first.
Have you even bothered to look in the plugin section?

very interesting, I think it would be very useful, possibly with a simplified interface just for source/music browse and play functions. I hope you find the time to do it :slight_smile:

Thanks

Also recommend the first post on this thread with the link to the plugins documentation

Thank you :+1:

Why do you need to reboot ?
Is is due to volumio unresponsive ?

From what I understand If its just Volumio you need to restart and not the underlying OS
line 807 of /data/plugins/system_hardware/rotaryencoder2/index.js

change
self.socket.emit('reboot')

to
this.commandRouter.restart();

Then when you press and hold it will simply restart Volumio, also alot quicker than a full reboot, and no need to worry about which partition its booting into.

I had the rotary encoder working but after upgrading to the latest version of Volumio it will not save my changes in the Rotary Encoder II plug ins. I tried enabling the Live Loggin and got the following message.
info: Received Get System Version
info: CoreCommandRouter::executeOnPlugin: system , getSystemVersion
info: CALLMETHOD: system_hardware rotaryencoder2 updateEncoder [object Object]
info: CoreCommandRouter::executeOnPlugin: rotaryencoder2 , updateEncoder
error: [ROTARYENCODER2] detachListener: could not kill handler process