Added VFO Encoder on RPi #1710
Replies: 1 comment
-
|
I have started building up some Wiki pages to document the changes I made to enable the encoders and switches, and how to configure them. Configuration is hard coded in these early days. https://github.com/K7MDL2/SDRPlusPlus/wiki Tonight, I refactored the code and added support for 3 GPIO encoders, 2 encoder push switches, and created 4 encoder-enabled functions. They are VFO Tune, FFT MAX, FFT MIN, and ZOOM. FFT MAX and MIN share the same encoder, toggled by the encoder's push switch. ZOOM and a function TBD share the 2nd encoder. You only need to insert 1 function call to open and use the encoder or switch results assuming you set up the configuration at compile time. I am sure this will evolve over time as a proper configuration solution comes to be. The main reason I am adding encoder support is to have a compact portable SDR solution with RF high sensitivity and high visual detail that could reside on a tripod connected to a 122GHz system. Signals are very weak. Using an AirspyHF+ for the 144Mhz IF. The offset can be 122GHz making the frequency readout match actual which is always nice. For the encoder functions, I am focusing on enabling the controls that need the most manipulation and minimize or eliminate the use of a keyboard and attempt to use touch for anything else needed. Given our fixed band IF rig usage, we anticipate doing some slight tuning, and lot of FFT/ZOOM adjustment. Volume would be used a lot also but that is easy to control via touch since it is a larger slider control. The FFT/Zoom sliders are narrow and only 2 of the 3 are visible without vertical scrolling on a 7" screen making touch difficult. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In my fork I have added a small amount of code in core/src/gui/main_window.cpp to enable reading the PI OS filesystem for rotary encoder events.
https://github.com/K7MDL2/SDRPlusPlus
I cloned the scroll wheel code replacing the mouse wheel events with the encoder events and removed the requirement to have the mouse in the FFT window area.
On a RPi use you must add this dtoverlay line so the OS handles the encoder events for you and presents the events in a file.
for RPi5
for RPi4
I have steps-per-period=4 which suits my particular encoder, adjust to suit yours. Also set the pins to match yours.
Some time ago I built a Pi control head for my Hermes Lite 2 (HL2) SDR which has several encoders with push switches. Inside is a small USB Audio dongle feeding a stereo amp and speakers and some other things like a 12V to 5V DC-DC converter and buffers for PTT. The case is a Smarti Pi Pro (deep) with the official Pi 7" touch screen at 800x 480. The newer Touch 2 screen is 1280 x 720. I upgraded the Pi4B some time back to a Pi5. The microphone is for when I run PiHPSDR or SparkSDr as a transceiver.
I plan to add more code for the other encoders and their switches to set the min and max FFT levels and maybe step rate. One of the knobs is an analog volume pot for the stereo amp module so I do not use digital volume.
At program init I attempt to open the event file if it exists with this path and name
I do not know if that name changes for every operating system. Certainly it will for additional encoders. You may need to edit it to match what you find. If it does change, could probably search for all files with rotary and maybe query the properties like pin number and sort it out.
On a Pi5 it builds pretty fast, especially when only changing 1 file.
Beta Was this translation helpful? Give feedback.
All reactions