[PLUGIN] RotaryEncoder II

It should be working, when you directly connect to the RPi.
What GPIO are you using, how do you connect, do you use an external pull resistor, any additional settings made in /Boot/userconfig.txt?
For some GPIOs that are not internally pulled up by default, you may need to enable the internal pull-up in /Boot/userconfig.txt.
Details here
E.g. to enable the pull-up on GPIO 18 you would add gpio=18=pu

I used GPIO-27 for SW from the KY-40 to the RPi and have no settings made in /boot/userconfig.txt .

For each GPIO-N I use, I should add “gpio=N=pu” in /boot/userconfig.txt?

No, the CLK and DT pins of KY-040 already have hardware pull-ups.
You should only add it for the push-button pin, which does not have a hardware pull-up.

I have put some info together here

This section has info on how to determine Pull up configuration, if you have an RPi4.

1 Like

i had to edit the userconfig file to enable the pull up on that pin. there is no pull up on my encoder board for the push button.

1 Like

Thank you for your reply. I’ll try after coming back from vacation.

Can’t wait to come back! ahah

Was a fix ever found for this? BUG with Rotary Encoder Plug in

I’m having the same issue.

Many thanks

WP

Hi WP, welcome to the thread. The Post you are referring to is from the first Rotary Encoder Plug-in. This Thread is about the Rotary Encoder 2 plug-in.
I’m the author of the latter.
Since both plugins work differently, your issue is probably different.
To help you, we need more info.
You can find more information about using the plug-in and how to report issues in the first post.

I am having the same problem as described here:

Source: BUG with Rotary Encoder Plug in

I have been testing out with Rotary Encoder and find that when I enable the plug in, it basically kills the entire system.

  1. enable encoder plug in
  2. configure pins
  3. plug in actually works.
  4. reboot system
    cannot get any new access via wifi
    cannot get access via hard wire

Network will not reconnect

  1. have to reflash OS and start again.

Everything runs perfectly until I install and enable the rotart plug in and reboot.

Let me know if I can do any other test for you.

Does anyone have a fix for this?

Many thanks,

WP

what volumio version are you using?

what plugin version are you using?

are you installing manually or from the plugin store?

the link you sent is pretty old, and it’s referring to the old Rotary Encoder plugin for Volumio2.

on Volumio3, you should use Rotary Encoder II from the plugin store

Thanks for the questions.

I’m using what I assume to be the latest version of Volumio (I downloaded it from the Volumio website in October)

The plugin is Rotary Encoder II, installed from the plugin store.

Read your problem report again: normally the plug-in does not do anything with the wifi or Ethernet connection.
I can think of two explanations:

  1. The hardware connection/wiring of the rotary is causing issues:e.g. some unwanted current affecting the power supply (if you have such current, the power may be too weak to drive the network)
  2. Something is sending commands so fast, that the RPi is too busy to run the network. But I never experienced such high load ever on my system. I can always connect via ssh even during debugging.
    First recommendation is to check proper wiring

Which version of the plug-in do you use? It is displayed in the plug-in section under installed plugins

1 Like

Thanks, you are correct with explanation one.

I was trying to power a speaker with the Pi USB port. Now that I have unplugged the speaker, the rotary encoders are working fine.

Time to rethink how I power the speaker in this setup!

Thanks again!

WP

Keep in mind, that the RPi officially needs a 5.1V power supply. If you are running on a regular Phone-USB-Charger, you may already be violating the spec. They are normally rated 5V and the RPi drops a little voltage over its input protection circuit.
The above link also has the maximum current, that each model can drive on the USB.
Good luck!

You’re right – I was running the Pi on a cheap knock-off (supposedly designed for the Pi, but with only 5V power!)

Could this be the reason for my problem?

I might try the setup with an official 5.1V power supply.

If your Pi is connected to a display via HDMI you may see a small flash symbol in the corner of the screen sometimes indicating under-voltage. If you look into the log, you may see messages saying under-voltage detected.
You can also use a multimeter to measure the actual voltage on the 5V pin of the RPi header.
Official supplies from the RPi foundation have 5.1V.

Even with sufficient voltage, you still need to make sure, that both the RPi and your power supply can deliver sufficient current. If the Speaker draws more current than the supply can deliver or the RPi can safely pass from supply to Speaker, you may need a USB-Hub with separate power supply (as described in the article I linked above).

If you need more detailed help, please disclose your RPi model and the power requirements of the Speaker - there should be a label with current (symbol I, unit A or mA) or power (symbol P, unit W or mW) requirements on the side or back. I also need to know, if there are more USB peripherals connected

Thanks, unfortunately having prchased an official Pi power supply, I’m still having the same issue.

Funnily enough it is only the second rotary encoder that doesn’t work. The first encoder works fine. Swapping the encoder itself with a different one also makes no difference.

I’ve attached a pic of my set up.

Components:

  • Minirig speaker (running off an internal battery)
  • Raspberry Pi 4b
  • 5 inch capacitive touch screen

Regarding the log, can I check this this via Putty SSH?

Many thanks for your assistance and please excuse any amateurish questons!


@WoodenPi

Can you draw a schematic for all your wiring. Its almost impossible to see where everything is wired to.

Also what are you doing to set the logic state of your gpio’s, I dont see any pull up/down resistors any where.
I also dont see any current limiting resistors inline between your rotary’s, switches and the gpio pins which could be potentially dangerous to your RPi

M1ck has already asked most of the questions I would also have.
Even if the RPi is making it look easy, you are still more or less directly playing with the GPIO pins of a microprocessor.
I have spent hours to write instructions about wiring. Did you take some time to read those?
You can find them here

If you follow the basic recommendations there, it should work.

Hi, I want to use 2 rotary encoders for seek in title and second for volume but I want to have additional separate buttons. is it possible to use with this pluggin separate momentary button instead of using rotary encoder with integrated button?
This is my actual setup.

My idea is to have buttons for:
Play - works
Stop - works
Next - works
Prev -works
Mute - ???
Shutdown - works
Repeat - ???

and 2 encoders for volume and seek title

If I understand you correctly, you want to use 7 buttons and two rotaries.
That is not possible out of the box.
The plug-in supports up to 3 rotaries with button. You are free to use up to 3 rotaries without button (or without wiring the button) + up to 3 separate buttons.
You could additionally load another plug-in to support the other buttons, e.g. “GPIO Buttons” by @Darmur
You will need quite a lot of GPIOs though: 7+4. Watch out for the blocked ones.