project-owner / Peppy.doc

Peppy documentation
GNU General Public License v3.0
55 stars 16 forks source link

Encoders issue - request for help #21

Closed PetrSyk closed 1 week ago

PetrSyk commented 4 weeks ago

I have problem with encoders. They doesn't work. Only one of then do something but wrong. When I turn with him one step the player is muted. Next steps unmuted it and so on again. Nothing else. Turn off/on on web ui doesnt have any effect - still the same. I also checked config.txt. My configuration Rpi3, gpio extpansion board, hifiberry mini amp, Miro. Please could anybody give me advice? Any Idea. Thanks

project-owner commented 4 weeks ago

Hi,

Please run the following commands in a terminal with Pi connected to the Internet:

sudo apt-get remove python3-RPi.GPIO
sudo apt-get install python3-rpi-lgpio

This is described here: https://github.com/project-owner/PeppyPlayers.doc/wiki/Known-Issues

Regards

PetrSyk commented 3 weeks ago

Thanks for the advice, I used it and it's better. Could you please clarify something for me please? The volume encoder works up and down but over one step. One step sound, second silent. Is it that correct? Thank you.

project-owner commented 3 weeks ago

I cannot reproduce the issue which you described. Please make sure that you correctly connected rotary encoder pins: https://github.com/project-owner/Peppy.doc/wiki/Rotary-Encoders

PetrSyk commented 3 weeks ago

Please see the attached images. The grey wire to ground. There is also clamp on the middle pin of encoder. Thank you for checking .

IMG_6654 IMG_6658 IMG_6657

project-owner commented 3 weeks ago

Hi, the connection looks OK to me. Please make sure that MiniAmp doesn't use pins used by encoder.

After switching to the new library 'rpi-lgpio' the encoders are not so stable anymore. I need to investigate if any software changes should be done to stabilize it. With the old library (RPi.GPIO) encoders were more stable. If you don't need any new features in the player you can try one of the previous disk images (e.g. Kandinsky Edition) to see if the encoder works better there.

PetrSyk commented 2 weeks ago

Yes there is a conflict HIFIBERRY MINIAMP GPIOs 18-21 (pins 12, 35, 38 and 40) are used for the sound interface. GPIO16 can be used to mute the power stage. GPIO26 shuts down the power stage. You can’t use these GPIOs for any other purpose.

project-owner commented 2 weeks ago

You can assign different pins to encoders: https://raw.githubusercontent.com/project-owner/Peppy.doc/master/images/software/re-config.png

PetrSyk commented 2 weeks ago

I changed connections to free pins Up 16->5 Down 26->6 Mute 13->13

Left 6->22 Right 12->23 Select 5->27 Save&Reboot

Only mute is working correctly. Volume up or down nothing. Selections sometimes something.

project-owner commented 2 weeks ago

Hmm, weird. For me it works with the original assignment (16, 26, 13) but doesn't work (except Mute) with your assignment (5, 6, 13). Instead of the Volume Up/Down it works as Move Right. I'll try to debug during the coming weekend.

project-owner commented 1 week ago

It looks like the diagram on this page was wrong: https://github.com/project-owner/Peppy.doc/wiki/Rotary-Encoders Pin GPIO6 is actually pin 31 and GPIO12 is pin 32. So, if you configure the following pins it should work: Up 16->5 (pin 29 on connector) Down 26->12 (pin 32 on connector) Mute 13->13

PetrSyk commented 1 week ago

Unfortunately I am still not fully successful. Mute and select works. Others not. IMG_2195 IMG_2198

project-owner commented 1 week ago

I've double checked, pins 5, 12, 13 work for me. There is just one issue related to the Mute - it automatically switches on. I need to investigate why that happens.

Please check that you correctly connected pins on the 'even' side of the connector. Also I'd recommend to disconnect the second encoder just for testing. And finally check that there is nothing selected in the GPIO sections 'Player Buttons' and 'Menu Buttons'. If it still doesn't work disconnect all boards from Pi and leave only one encoder connected.

PetrSyk commented 1 week ago

I found a fault on the board. It already works. Thank you for your support and patience.