ASU-cubesat / phxsat-gsw-public

Public repository to allow people to hear from and communicate with the Phoenix CubeSat
6 stars 0 forks source link

Callsign storage in main.c #9

Closed N6RFM closed 4 years ago

N6RFM commented 4 years ago

Ability to enter source and destination call sign at startup is great! Thanks.

Of note, when modifying main.c to include call signs and disable call sign prompt, the last character appears truncated in direwolf console.

call signs entered at prompt [0L] N6RFM>WJ2XOY:� m<0x01><0x00><0x01><0x02><0x03><0x04><0x05><0x06><0x07><0x08><0x09><0x0a><0x0b><0x0c><0x0d><0x0e><0x0f><0x10><0x11><0x12><0x13>�y��

callsigns entered by editing main.c and disabling call sign prompt [0L] N6RF>WJ2XO:� a<0x01><0x00><0x01><0x02><0x03><0x04><0x05><0x06><0x07><0x08><0x09><0x0a><0x0b><0x0c><0x0d><0x0e><0x0f><0x10><0x11><0x12><0x13>�y��

adding a space after each call sign in the main.c code seems to resolve the issue. [0L] N6RFM>WJ2XOY:� {<0x01><0x00><0x01><0x02><0x03><0x04><0x05><0x06><0x07><0x08><0x09><0x0a><0x0b><0x0c><0x0d><0x0e><0x0f><0x10><0x11><0x12><0x13>�y��

sarahsrogers commented 4 years ago

Understood. Thank you for bringing this to our attention Bob. I'll add a note about this to our readme in case anyone chooses to edit the main.c code permanently instead of using the prompt at startup.

vivekjc commented 4 years ago

Hello Bob,

The missing character at the end occurred as the callsign entered at the prompt had a line change character at the end and we needed to compensate for that by saving one less character. Since this didn't happen with the callsign entered in main.c the issue arose.

This has been fixed in the latest commit. You would need to pull both this repo and the libcsp one.

Rgds Vivek

N6RFM commented 4 years ago

Hi Vivek,

Looks like something may be incorrect? Started with a clean git pull git submodule update --init cd libcsp git checkout master cd .. make ./quickMake.sh gives -> [0L] PQRST>KI7OO:� <0x7f><0x01><0x00><0x01><0x02><0x03><0x04><0x05><0x06><0x07><0x08><0x09><0x0a><0x0b><0x0c><0x0d><0x0e><0x0f><0x10><0x11><0x12><0x13>�y�� looks like source and dest reversed? I was expecting ABCDEF>PQRST

So, edited main.c to enable callsign input prompt #define DISABLE_CALLSIGN_PROMPT 0 re-ran make, ./quickMake.sh, input N6RFM as source and WJ2XOY as dest. now --> [0L] WJ2XOY>KI7OOY:� y<0x01><0x00><0x01><0x02><0x03><0x04><0x05><0x06><0x07><0x08><0x09><0x0a><0x0b><0x0c><0x0d><0x0e><0x0f><0x10><0x11><0x12><0x13>�y��

Next, I uncommented line 70 char callsign[1024] = CALL_SIGN; // This is used if prompt is disabled. make gives --> Makefile:41: recipe for target 'all' failed make: *** [all] Error 1

Any advice on what I might have done wrong? Thanks. Bob

vivekjc commented 4 years ago

The incorrect callsign assignment was happening since the program was incorrectly writing both the callsigns to the 7th byte onward. This basically overwrote the source and destination callsign to the source callsign section of the ax.25 header.

I have corrected this issue in the latest commit. Please feel free to test and let us know if you face any other issues. Thanks again for testing out our code.

Regards, Vivek

N6RFM commented 4 years ago

Hi Vivek,

Thanks for fixing this. It now works properly. Much appreciated.

As an FYI, in main.src for this latest repo, the callsign prompt is set to 1 and thus disabled (line 30). In this circumstance, the initial screen comes up as

Source callsign has been set to SRC Destination callsign has been set to DES

which may confuse some new users. May be better to toggle to 0 and enable the callsign prompt in the next commit.

The other thing that new users may have to be reminded of is after running git submodule update --init, it remains important to cd libcsp and run git checkout master. I was confused myself for a moment since after the git submodule update --init command, a version of libcsp was checked out, but not the correct branch. Running make using the incorrect branch gives an error.

Thanks again. Looking forward to the release of the bird!
Best, Bob

vivekjc commented 4 years ago

Thank you for your suggestions Bob! We will work on making the user experience more seamless. This would involve using a config file that stores the user preference on first startup and allows them to either reuse their configuration or change it. We will track this in a separate issue. Closing this issue for now, but please feel free to reopen if needed.