Hi Wim,
For the configuration using the radioberry as an hat :
The standard protocol does not give the possibility to change pihpsdr so you need to do the move the magic where you are able to control it.
in the filters.c you can find different 3 different implementations of controlling filter boards.
As you are using an arduino board i would advise you to use the following :
One of the filter boards is a very generic one.
#define ADDR_FILTERS 0x22 /* Arduino filter board interface switcher address for VA2SAJ Generic Filter Switching Board*/
See the code ; it sends the mox state and the fequency ; based on the frequency which is sent to your arduino you can determine how to control your filter board; using a BCD coding or anycombination you like .
from filters.h
if (i2c_filters_board & ((buffer[11] & 0x01) == 0x01 || (buffer[11] & 0x01) == 0x00)) {
currentMox = ((buffer[11] & 0x01) == 0x01) ? 1 : 0;
currentCW = cw;
if (currentMox != previousMox || currentCW != previousCW) {
previousMox = currentMox;
previousCW = currentCW;
unsigned char ldata[3];
ldata[0] = 0x03;
ldata[1] = ((buffer[11] & 0x01) == 0x01) ? 1 : 0;
ldata[2] = currentCW;
if (write(fd_i2c_filter, ldata, 3) < 0)
fprintf(stderr, "Error %d writing Alex data\n", errno);
fprintf(stderr, "PTT data 0 = %x \n", ldata[0]);
fprintf(stderr, "PTT data 1 = %x \n", ldata[1]);
fprintf(stderr, "PTT data 2 = %x \n", ldata[2]);
}
}
//*************************************************
// Send Frenquency to filter companion
//*************************************************
if (i2c_filters_board & (buffer[523] & 0xFE) == 0x12) {
if (currentfreq != previousfreq) {
previousfreq = currentfreq;
unsigned tempFreq = currentfreq;
unsigned char ldata[9];
ldata[0] = 0x04;
ldata[1] = (tempFreq / 10000000U) % 10;
ldata[2] = (tempFreq / 1000000U) % 10;
ldata[3] = (tempFreq / 100000U) % 10;
ldata[4] = (tempFreq / 10000U) % 10;
ldata[5] = (tempFreq / 1000U) % 10;
ldata[6] = (tempFreq / 100U) % 10;
ldata[7] = (tempFreq / 10U) % 10;
ldata[8] = (tempFreq / 1U) % 10;
if (write(fd_i2c_filter, ldata, 9) < 0)
fprintf(stderr, "Error %d setting frequency \n", errno);
else
fprintf(stderr, "Set Filters frequency to = %d \n", currentfreq);
}
}
}
Furthermore you could look to the protocol of HL2 which can give you information
A real nice puzzle to crack.... but you will find a solution!
Hope this helps to get you on the right track.
73 Johan
PA3GSB