/volumio-rotary-encoder-plugin

Simple dual rotary encoder plugin for Volumio 2.x

Primary LanguageJavaScriptMIT LicenseMIT

volumio-rotary-encoder-plugin

Volumio 2 plugin to configure two simple rotary encoders.

Lazy installation of unsanctioned versions (quick version)

  1. SSH into server
  2. Execute the below command:
sudo wget -O volumio_install_from_zip.sh https://raw.githubusercontent.com/Saiyato/volumio-plugin-helper/master/volumio_install_from_zip.sh

This will download the installation script.

  1. Execute the script (DO NOT USE sudo!) you've just downloaded using the below command:
sh volumio_install_from_zip.sh Saiyato volumio-rotary-encoder-plugin

You can use this install script for any plugin (if they are hosted separately), just add $1 = author and $2 = repository.

Lazy installation by downloading the whole git repo (takes longer to download)

  1. SSH into server
  2. Execute the below command:
sudo wget -O volumio_installer.sh https://raw.githubusercontent.com/Saiyato/volumio-rotary-encoder-plugin/master/volumio_installer.sh

This will download the installation script.

  1. Execute the script (DO NOT USE sudo!) you've just downloaded using the below command:
sh volumio_installer.sh

Quick start

  1. Connect your rotary encoder(s) and write down the pins you have used
  • CLK = pin A
  • DT = pin B

Alt text

The rest of the pins is self explanatory.

  1. Install the plugin
  2. Configure your encoder(s) using the pins you wrote down.
    • Configure CLK to 0 (zero) to disable the encoder
    • Configure SW to 0 (zero) to disable the (push) button on the encoder
  3. Choose your logic (KY040 or gray coding)

Alt text

Source: http://www.stuffaboutcode.com/2015/05/raspberry-pi-and-ky040-rotary-encoder.html

Troubleshooting

Should you encounter any problems with the encoder try the following:

  1. Add HW (hardware) debouncing; I've ordered 0.1uF capacitors to place between CLK and GND and/or DT and GND
  2. Try other rotary logic; I've tried to minimize the amount of double reads for my KY040 function, but the default gray coding should work too.

I'd advise to use HW debouncing as most people seem to have solved their problems using that solution.