Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSPR Callsign with one char prefix failed. #29

Open
pe0fko opened this issue Apr 28, 2023 · 4 comments
Open

WSPR Callsign with one char prefix failed. #29

pe0fko opened this issue Apr 28, 2023 · 4 comments

Comments

@pe0fko
Copy link

pe0fko commented Apr 28, 2023

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

@ivica3730k
Copy link

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
Copy link

ivica3730k commented Dec 19, 2024

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

@pe0fko
Copy link
Author

pe0fko commented Dec 19, 2024

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

@ivica3730k
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants