Volume control with rotary encoder - Printable Version +- BlueWave Studio forum (https://bluewavestudio.io/community) +-- Forum: Community (https://bluewavestudio.io/community/forum-85.html) +--- Forum: How to (https://bluewavestudio.io/community/forum-69.html) +--- Thread: Volume control with rotary encoder (/thread-1811.html) Pages:
1
2
|
Volume control with rotary encoder - Mella - 07-23-2020 Hello, After several months of using CarPi (kodi 15) in my vehicle, I was looking for a newer and more stable solution to set up in the location I created with my 3D printer I acquired an Openauto Pro license more than a year ago now, but due to lack of time I had not yet installed it in my car, now done After several hours / days of basic configuration that I had not properly understood, due to - The Wi-Fi connection (intermediate difficulty) It must be understood that it is the raspberry (OpenAuto Pro) that must be paired to your phone and not the opposite, for me there is only the 2.4GHz which works, 5GHz does not display OpenAuto in the connections available on my phone. A solution, I am a buyer, thank you Phone wireless connection (difficult) the issue was resolved by enabling the develop my phone option in addition to the developer settings in Android Auto on this video (3:03) USB audio converter (intermediate difficulty) Four USB ports, only one works (probably because of the converter) USB audio converter I use: Hope this information will help the most lost Now that everything is working perfectly, I would like to try to control the volume and the music change through rotary encoders like this They work perfectly with CarPi, but do not work at all with Openauto Pro I researched several hours / days, trying to see the possibilities available and to understand what was possible to do with OpenAuto with the little knowledge I have in Python programming. I read some information here http://blog.amnuts.com/2017/01/11/rotary-volume-control-for-the-raspberry-pi/ but as said above my lack of knowledge fails me. I also read on this Openauto-like project https://github.com/opencardev/crankshaft/wiki/Customizing-Crankshaft that GPIO triggers for OpenAuto actions was enabled by default for volume control, this is also the case for OpenAuto Pro? By thanking you in advance for your help I wish a good day RE: Volume control with rotary encoder - Daniel_BlueWave - 07-23-2020 In order to use Android Auto wireless connection please follow this guide: https://bluewavestudio.io/community/showthread.php?tid=1540 Your issue with USB is not common, maybe RPi is defected? For Volume control you have to write a script that will convert input values into keystrokes according to User Guide, Section Keyboard controls: http://bluewavestudio.io/resources/openauto_pro_user_guide/openauto_userguide.pdf RE: Volume control with rotary encoder - Mella - 07-23-2020 Thank you for your reply. I followed the guide well, it was a great help and allowed me to better understand the implementation of OpenAuto. For volume control, being a novice I really don't know where to start, wouldn't he have more information about this on the forum or elsewhere? Or maybe someone who would take the time to explain to me Because once the script is written, which is for me at the moment impossible for lack of knowledge, where will I have to place it to make it work and especially what would be the command executed Will I be able to hope for a future update that could incorporate this functionality of volume control via rotary encoder? RE: Volume control with rotary encoder - Viper - 07-24-2020 For rotary encoder functionality have a look here. RE: Volume control with rotary encoder - Mella - 07-27-2020 Thank you for your reply So I have to change the rotary encoder to use this script? The encoders that I have for this project have 20 pulses unlike what you indicated to me which have 24 pulses RE: Volume control with rotary encoder - Viper - 07-28-2020 (07-27-2020, 03:11 PM)Mella Wrote: Thank you for your replyI don't think that that matters. RE: Volume control with rotary encoder - Mella - 07-31-2020 I finally got it to work, but the KY-040 rotary encoder, quote above does not work for me I tried to connect it by following this comparative example, but without success Using this model, reference PEC11-4215F-S24 everything works perfectly By searching on the net I found some for less than $ 2 each Here is in detail what I did to make it work ROTARY ENCODER INSTALLATION 1) This script requires the installation of evtest and xdotool
2) Create a directory containing the executable
3) Creation of the script
4) Copy the script
5) Save the script under nano Ctrl+x + Y 6) Make the script executable
7) Run the script
8) Put the path of the script file in /etc/xdg/lxsession/LXDE-pi/autostart
9) Add the path of the .bash
10) Save under nano Ctrl+x + Y 11) restart sudo reboot Now that the first rotary encoder is working I would like to do two things 1) Activate a second encoder which would be used to browse the lists or change the song (next / previous) 2) use this style push button To launch applications like in this video, any help would be welcome Here is the .bash I am using rotary_encoder.zip (Size: 717 bytes / Downloads: 509) Thanks to Viper or his help and to ktb for his schematic and script Excellent day to all RE: OAP5 on RPi4B + AudioInjector Octo - frankpintosr - 08-01-2020 (07-31-2020, 02:22 PM)Mella Wrote: For my part I have not succeeded in making the KY-040 rotary encoder work you are talking about I got the adafruit encoder working using the scripts from Mella. The scripts you provided work great and require no changes. I did, however, have to change the wiring to use this type of rotary dial. If folks are a novice like me, they may benefit from step by step instructions also. Here is what I came up with.
RE: Volume control with rotary encoder - Mella - 08-02-2020 Perfect thanks for sharing , I keep it warm, it can always be useful Could you share the source of this diagram, thanks Now it would be really nice to be able to use a second rotary encoder in order to be able to navigate (next / previous music) For the moment I take care of the integration of these wireless controllers that I have just received More information Guide for steering wheel remote control RE: Volume control with rotary encoder - frankpintosr - 08-03-2020 (08-02-2020, 07:49 PM)Mella Wrote: Perfect thanks for sharing , I keep it warm, it can always be useful I got the RPi header breakout image from here https://www.raspberrypi.org/documentation/usage/gpio/images/GPIO-Pinout-Diagram-2.png The rotary dial image came from here https://th.bing.com/th/id/OIP.VhygLsDfskPk0DD0dxkK1QHaKk?pid=Api&rs=1 The other image is just a table I made I would like to figure out a second dial also. But for now I am focused on creating the "faceplate" for the Pi to be mounted in my car. Thanks again, great post! |