JTEncode icon indicating copy to clipboard operation
JTEncode copied to clipboard

WSPR Callsign with one char prefix failed.

Open pe0fko opened this issue 2 years ago • 4 comments

Hello, I did have some trouble with a one char prefix in the wspr callsign (F/PE0FKO), it was not received by the wspr systems. Did check the code for the JTEncode::wspr_encode() function and found the problem in JTEncode::wspr_bit_packing(). There, in the function line 1000, the 3 and 2 char prefix is handled, only the one char prefix is not! I fixed the code with some extra if statement for the 1 char prefix and it works (for me ;-)), maybe you update the repo for that. 73, Fred, pe0fko

pe0fko avatar Apr 28 '23 20:04 pe0fko

Hello, I did have some trouble with a one char prefix in the wspr callsign (F/PE0FKO), it was not received by the wspr systems. Did check the code for the JTEncode::wspr_encode() function and found the problem in JTEncode::wspr_bit_packing(). There, in the function line 1000, the 3 and 2 char prefix is handled, only the one char prefix is not! I fixed the code with some extra if statement for the 1 char prefix and it works (for me ;-)), maybe you update the repo for that. 73, Fred, pe0fko

Hello Fred. Would you mind sharing your code, I have same problem decoding my M/9A3ICE callsign!

73 Ivica

ivica3730k avatar Dec 19 '24 00:12 ivica3730k

Hello, I did have some trouble with a one char prefix in the wspr callsign (F/PE0FKO), it was not received by the wspr systems. Did check the code for the JTEncode::wspr_encode() function and found the problem in JTEncode::wspr_bit_packing(). There, in the function line 1000, the 3 and 2 char prefix is handled, only the one char prefix is not! I fixed the code with some extra if statement for the 1 char prefix and it works (for me ;-)), maybe you update the repo for that. 73, Fred, pe0fko

Hello Fred. Would you mind sharing your code, I have same problem decoding my M/9A3ICE callsign!

73 Ivica

For anyone currently curious this is the code snippet:


      if (prefix[1] == ' ' || prefix[1] == 0) {
        prefix[3] = 0;
        prefix[2] = prefix[0];
        prefix[1] = ' ';
        prefix[0] = ' ';

      } else if (prefix[2] == ' ' || prefix[2] == 0) {
        prefix[3] = 0;
        prefix[2] = prefix[1];
        prefix[1] = prefix[0];
        prefix[0] = ' ';
      }

i will follow up with a propper pr when I test if I have broken anything else with this. thanks @pe0fko

ivica3730k avatar Dec 19 '24 00:12 ivica3730k

Thanks Ivica, the code looks Ok and I did use it this year a lot . I hope it will be in the lib code, after change to platformio I did forget to add it :-(

73, Fred, pe0fko.

//PE0FKO : The single prefix fix.
#if 1
                        if(prefix[1] == ' ' || prefix[1] == 0)
                        {
                                // Right align prefix
                                prefix[3] = 0;
                                prefix[2] = prefix[0];
                                prefix[1] = ' ';
                                prefix[0] = ' ';
                        }
                        else if(prefix[2] == ' ' || prefix[2] == 0)
                        {
                                // Right align prefix
                                prefix[3] = 0;
                                prefix[2] = prefix[1];
                                prefix[1] = prefix[0];
                                prefix[0] = ' ';
                        }
#else
                        if(prefix[2] == ' ' || prefix[2] == 0)
                        {
                                // Right align prefix
                                prefix[3] = 0;
                                prefix[2] = prefix[1];
                                prefix[1] = prefix[0];
                                prefix[0] = ' ';
                        }
#endif

pe0fko avatar Dec 19 '24 13:12 pe0fko

Thanks Ivica, the code looks Ok and I did use it this year a lot . I hope it will be in the lib code, after change to platformio I did forget to add it :-(

73, Fred, pe0fko.

//PE0FKO : The single prefix fix.
#if 1
                        if(prefix[1] == ' ' || prefix[1] == 0)
                        {
                                // Right align prefix
                                prefix[3] = 0;
                                prefix[2] = prefix[0];
                                prefix[1] = ' ';
                                prefix[0] = ' ';
                        }
                        else if(prefix[2] == ' ' || prefix[2] == 0)
                        {
                                // Right align prefix
                                prefix[3] = 0;
                                prefix[2] = prefix[1];
                                prefix[1] = prefix[0];
                                prefix[0] = ' ';
                        }
#else
                        if(prefix[2] == ' ' || prefix[2] == 0)
                        {
                                // Right align prefix
                                prefix[3] = 0;
                                prefix[2] = prefix[1];
                                prefix[1] = prefix[0];
                                prefix[0] = ' ';
                        }
#endif

Cheers sir! I have opened a pr

ivica3730k avatar Dec 19 '24 17:12 ivica3730k