OK Folks, Don't get too excited, but I think I might the piHPSDR built in keyer working without any additional hardware...
I had to give up on my python keyer idea because it appears that some of the radioberry documentation is incorrect about what GPIO lines are still free and the python keyer needs at least 3 lines, so I explored fixing the latest version of piHPSDR at github instead.
At the moment, there are only TWO unused GPIO lines available. These are the ones normally reserved for use by the Pi console serial port. If that option is turned off, they can be used for the keyer left and right keys.
These are on the following GPIO lines: on pins 7 and 8 of the GPIO card:
CWR_LINE = 14;
CWL_LINE = 4;
Unfortunately, they are not available from the Radioberry OC connector and you must carefully solder wires to the back of the GPIO connector itself to connect them to your key jack.
The reason that the existing dialog cannot be used to set these IO pins is that the setup for the dialog clobbers the driver's GPIO pins when it checks pin availability and the driver crashes. To fix this problem, I hard coded the needed definitions into the source file called "gpio.c"
There's a section there for use with no ui controller. It's very important that "no controller" be selected when selecting the device at startup.
If you look at the source file, around line 967 you will find a case in a switch statement for NO_CONTROLLER.
I made it look like this and built pihpsdr:
case NO_CONTROLLER:
default:
//
// GPIO lines that are not used elsewhere: 5, 6, 12, 16,
// 22, 23, 24, 25, 27
//
CWR_LINE = 14;
CWL_LINE = 4;
// CWL_LINE = 5;
// CWR_LINE = 6;
// CWKEY_LINE = 12;
// PTTIN_LINE = 16;
// PTTOUT_LINE = 22;
CWOUT_LINE = 15;
memcpy(my_encoders, encoders_no_controller, sizeof(my_encoders));
memcpy(my_switches, switches_no_controller, sizeof(my_switches));
encoders = my_encoders;
switches = my_switches;
break;
I commented out the old lines and left them in place to help in locating them.
I used the following build options (in the file called "make.config.pihpsdr"
TCI=OFF
GPIO=ON
MIDI=ON
SATURN=OFF
USBOZY=OFF
SOAPYSDR=OFF
STEMLAB=OFF
SERVER=OFF
AUDIO=ALSA
Once the program is built you will have to reset all your preferences; when you do make sure to uncheck "CW handled in radio"
this appears to work fine here, but it's highly experimental. Don't try this unless you know your way around github and C programming.
I can't provide any help or binaries, since I have to do other patches to run my non-standard Low pass filter card.
If this experiment seems to be working out, perhaps we can come up with a better patch that can be submitted to the repository.
Also, it would be great if the FPGA could be modified by someone to pass these pins through to the radioberry's own IO connector instead of the ones that don't work!
Let me know if you have any success with this...
73
AE0GL, Mario