[PLUGIN] RotaryEncoder II

I was looking this too :

CONNECTING A BOARD WITH CABLES
Some users don’t want to plug the board directly onto the Pi, but connect it via cables. First of all let’s say that this isn’t a supported configuration and we won’t guarantee that this will work at all. You would have to connect ALL power supply pins and all pins listed above. We strongly recommend to connect all pins with a 40-pin flat-ribbon cable. But even then you can’t be sure it will work. The shorter the cable you’re using the better your chances. Don’t even try long 30-50cm cables here!
Also note that soldering onto the HiFiBerry board will void warranty.

I would advice to request support from Hifiberry. I think we have tried everything, the issue seems with the AMP100. Not with the encoder plugin, as it works flawless on the rPi.
Sorry

Yes you’re right, the issue is coming from the AMP100. I’ll try to get support from Hifiberry.

And yes we probably tried everything, thank you all for all of your tips and patience! :pray:

no problem, at least let us know the outcome. So we can help others with the same issue.

Yes for sure, I’ll post the solution here if I found it :slight_smile:

when I make changes in the plugin ui, should those values save to the config.json file? My file does not change. I’m wondering if that is why I can’t get my encoder to work.

When you make changes in the UI and save them, they are saved in /data/configuration/system_hardware/rotaryencoder2/config.json.
Please note, that there is another version of the file under /data/plugins/system_hardware/rotaryencoder2/config.json, which is not changing when you save, because it is the ‘reference’ version of the file, which stays always “as installed” - U can e.g. use it to go back to the default, when something is messed up.

If the file in the configuration folder is really not saved, then please report back, because then I will need to upgrade my test-system to the latest Volumio version and see what changed.

This is also the answer to this question

1 Like

could you please try the encoder and the plugin without connecting the AMP100 board (just select another audio output in the menu, analog or HDMI)

with this test you can understand if the AMP100 board is the “guilty”, removing it from the equation (please physically disconnect it from the system)

Was already done. Standalone with only the rPi it works.

OK, so it definitely is a problem with the AMP100 board, better to contact the manufacturer for support

he already did.

1 Like

I posted a few videos on Hifiberry Community to show how it works perfectly directly to the Raspberry and how it messes up with the AMP100. Hoping I’ll get a solution!

As you can see and hear, with the Raspberry by itself, the volume does change as excepted : video-A

When connected through the AMP100, it doesn’t make any sense, if I turn the rotary clockwise or anti-clockwise, the volume goes down, sometimes the volume goes up a few ms after turning the button.

In video-B,I use the GPIO through the AMP100, and as you can see and hear, sometimes anti-clockwise turn the volume up, one second after it turns the volume down… and after it doesn’t do anything…

Another example with the AMP 100, maybe not easy to hear. What I did 2 steps anti-clockwise (the volume turn down) and then 1 step clockwise (the volume still turn down…) : video-C

Hi again.
I needed some time to catch up.
As far as I read, the issue only occurs with both the Amp100 and the rotary connected and disappears, when the Amp100 is removed.
The failure mode you describe (direction of rotation not consistently working, lagging) reminded me of typical issues with floating pins, poor pull-up/pull-down configuration etc. What I mean: it sounds like the digital input is not clean at the GPIO 8 & 11 pins.
If the lines on the Amp100 PCB are just passed through 1:1 from the RPi Header to the Amp100 header without anything connected, there is no rationale explanation why it should not work.
However, if there is anything connected to the pins on the Amp100 board (e.g. resistive connections to GND) the combination of the pull-ups of the KY-040 and that resistive connection could make a voltage devider and bring the voltage level at the GPIO into the wrong range (high voltage is < V_IH or low voltage is > V_IL). The RPi will not be able to properly interpret it and it may sometimes be interpreted as high, sometimes as low (randomized by switching noise).
Best would be to measure the voltage directly on the GPIO pins with a Multimeter or better Oscilloscope. Multimeters start at 5€ on eBay - might be worth investing.

The Hifiberry support told me it is not 1:1 because they didn’t have enough space on the PCB, but GPIO-8 and GPIO-11 are active. (from Hifiberry community)

Ok I’ll try to check on that side too!

Otherwise, do you think it could be a good solution to solder the rotary cables directly on the back of the Raspberry? Or it would interfer?

you could try a gpio header extension or if you are handy solder directly to the gpio pins of raspberry pi.

and then the only question is whether it works well.

Oh, that’s a good idea! I have no idea this could exist, I definitely should try that instead of soldering, way less risky!

But that header-extension is not guaranteed to solve the issue. The electrical connection will still be there and connect to whatever is on the Amp100 PCB. You move the connection to another location, but it still is on the same net, same potential.
It may however enable you to use other GPIOs.

By 1:1 I do not mean, that all pins are connected (obviously not the case as stated by the Hifiberry support), but I meant that the available pins are just passed through the PCB with no components connected to them on the PCB. In that case, it should not make any difference whether you connect to the pin on RPi, Amp100 or header-extension.

you’re right, that’s why I also mentioned “and then the only question is whether it works well”

maybe other gpio work, he can probably try it, such a header doesn’t cost that much.

Just another idea: Are we sure that the GND pin and 3V3 pin of the Amp100 header are connected through the PCB? If GND would be floating, that might explain the erratic behavior.
I suppose, that all of them are just connected to the GND-plane in the PCB - but who knows.
Maybe just try to use the other GND pins - chances are slim, however.