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

Fixes the temporary issue of tmstmp == 0. Allows for running Telecommands w/o specifiying one beforehand. #258

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Freddydeddydoo
Copy link
Contributor

----------------------------------------------------------------------------------------------

This fix is meant to be temporary until we get the timestamp function working. This should make debugging and running telecommands as easy as it was before issue #53 was pushed.

----------------------------------------------------------------------------------------------

To Test:

  1. Run any Telecommand.
  2. Check the Timestamp (it should be 0).
  3. Rerun any telecommand. Check telecommand works as requested.
    - If you receive an error "Telecommand skipped due to timestamp collision" try Flashing/Building again.
  4. Check the timestamp again (it should be 0); Check if the telecommand works as requested.
  5. Run any Telecommand with the '@tssent=x' function. (Ex: CTS1+hello_world()@tssent=1!)
  6. Rerun the same telecommand with the same number.
    • The expected output should be "Telecommand skipped due to timestamp collision" This time, if the telecommand runs to completion, flash/build and try again.
  7. run another telecommand with the same 'tssent' value.
    • The expected output should be "Telecommand skipped due to timestamp collision" This time, if the telecommand runs to completion, flash/build and try again.
  8. rerun the same telecommand with another 'tssent' value that hasn't been used yet (ex. if you used '1' last time, use '4' now).
    • This time Telecommand should run to completion.

@kev9268
Copy link
Contributor

kev9268 commented Jan 17, 2025

Following test plan as instructed from above.

First entering the telecommand CTS1+hello_world()!. Telecommand runs normally with timestamp == 0. Rerunning the same telecommand and expected output is received. Telecommand rerun is successful and timestamp ==0.

FrontierSat time: 19700101T00:00:11.070, Uptime: 11070 ms
CTS1+hello_world()!
========================= UART Telecommand Received =========================
CTS1+hello_world()!

=========================
Parsed telecommand (len=20): 'CTS1+hello_world()!
'
0000000000000+0000011952_N [TELECOMMAND:NORMAL]: Executing telecommand from agenda slot 0, sent at tssent=0, scheduled for tsexec=0.
========================= Executing telecommand 'hello_world'=========================
0000000000000+0000011972_N [TELECOMMAND:NORMAL]: Hello, world!
========================= Response (duration=6ms, err=0) =========================

===========================================================================
FrontierSat time: 19700101T00:00:12.065, Uptime: 12065 ms
FrontierSat time: 19700101T00:00:13.060, Uptime: 13060 ms
FrontierSat time: 19700101T00:00:14.055, Uptime: 14055 ms
FrontierSat time: 19700101T00:00:10000000000000+0000020386_N [EPS:NORMAL]: Setting OBC time based on EPS time because last_source == TIM_SOURCE_NONE
OBC->EPS DATA (no tags): 1A 07 40 00 
OBC->EPS DATA (with tags): 3C 63 6D 64 3E 1A 07 40 00 3C 2F 63 6D 64 3E 
EPS->OBC ERROR: timeout before first byte received
0000000000000+0000020465_N [EPS:ERROR]: EPS_set_obc_time_based_on_eps_time() -> Error
FrontierSat time: 19700101T00:00:21.020, Uptime: 21020 ms
FrontierSat time: 19700101T00:00:22.015, Uptime: 22015 ms
FrontierSat time: 19700101T00:00:23.010, Uptime: 23010 ms
CTS1+hello_world()!
========================= UART Telecommand Received =========================
CTS1+hello_world()!

=========================
Parsed telecommand (len=20): 'CTS1+hello_world()!
'
0000000000000+0000023994_N [TELECOMMAND:NORMAL]: Executing telecommand from agenda slot 0, sent at tssent=0, scheduled for tsexec=0.
========================= Executing telecommand 'hello_world'=========================
0000000000000+0000024014_N [TELECOMMAND:NORMAL]: Hello, world!
========================= Response (duration=6ms, err=0) =========================

===========================================================================
FrontierSat time: 19700101T00:00:24.035, Uptime: 24035 ms

Second sent the telecommand 'CTS1+hello_world()@tssent=1!' it ran successfully at timestamp 'tssent=1' , then attempting to rerun the same command getting the expected output of timestamp collision.

CTS1+hello_world()@tssent=1!
========================= UART Telecommand Received =========================
CTS1+hello_world()@tssent=1!

=========================
Parsed telecommand (len=29): 'CTS1+hello_world()@tssent=1!
'
0000000000000+0000244817_N [TELECOMMAND:NORMAL]: Executing telecommand from agenda slot 0, sent at tssent=1, scheduled for tsexec=0.
========================= Executing telecommand 'hello_world'=========================
0000000000000+0000244837_N [TELECOMMAND:NORMAL]: Hello, world!
========================= Response (duration=6ms, err=0) =========================

===========================================================================
FrontierSat time: 19700101T00:04:04.947, Uptime: 244947 ms
FrontierSat time: 19700101T00:04:05.942, Uptime: 245942 ms

FrontierSat time: 19700101T00:04:20.867, Uptime: 260867 ms
CTS1+hello_world()@tssent=1!
========================= UART Telecommand Received =========================
CTS1+hello_world()@tssent=1!

=========================
Parsed telecommand (len=29): 'CTS1+hello_world()@tssent=1!
'
0000000000000+0000261256_N [TELECOMMAND:WARNING]: Telecommand skipped due to timestamp collision
FrontierSat time: 19700101T00:04:21.862, Uptime: 261862 ms 

In quick succession I ran the commands ''CTS1+hello_world()@tssent=2!', 'CTS1+hello_world()@tssent=3!' and 'CTS1+hello_world()@tssent=4!' with correct expected output and all telecommands ran successfully.

CTS1+hello_world()@tssent=2!
========================= UART Telecommand Received =========================
CTS1+hello_world()@tssent=2!

=========================
Parsed telecommand (len=29): 'CTS1+hello_world()@tssent=2!
'
0000000000000+0000433100_N [TELECOMMAND:NORMAL]: Executing telecommand from agenda slot 0, sent at tssent=2, scheduled for tsexec=0.
========================= Executing telecommand 'hello_world'=========================
0000000000000+0000433120_N [TELECOMMAND:NORMAL]: Hello, world!
========================= Response (duration=6ms, err=0) =========================

===========================================================================
FrontierSat time: 19700101T00:07:13.141, Uptime: 433141 ms
FrontierSat time: 19700101T00:07:14.136, Uptime: 434136 ms
FrontierSat time: 19700101T00:07:15.131, Uptime: 435131 ms
CTS1+hello_world()@tssent=3!
========================= UART Telecommand Received =========================
CTS1+hello_world()@tssent=3!

=========================
Parsed telecommand (len=29): 'CTS1+hello_world()@tssent=3!
'
0000000000000+0000435943_N [TELECOMMAND:NORMAL]: Executing telecommand from agenda slot 0, sent at tssent=3, scheduled for tsexec=0.
========================= Executing telecommand 'hello_world'=========================
0000000000000+0000435963_N [TELECOMMAND:NORMAL]: Hello, world!
========================= Response (duration=6ms, err=0) =========================

===========================================================================
FrontierSat time: 19700101T00:07:16.126, Uptime: 436126 ms
FrontierSat time: 19700101T00:07:17.121, Uptime: 437121 ms
0000000000000+0000437447_N [EPS:NORMAL]: Setting OBC time based on EPS time because last_source == TIM_SOURCE_NONE
OBC->EPS DATA (no tags): 1A 07 40 00 
OBC->EPS DATA (with tags): 3C 63 6D 64 3E 1A 07 40 00 3C 2F 63 6D 64 3E 
EPS->OBC ERROR: timeout before first byte received
0000000000000+0000437526_N [EPS:ERROR]: EPS_set_obc_time_based_on_eps_time() -> Error
FrontierSat time: 19700101T00:07:18.116, Uptime: 438116 ms
CTS1+hello_world()@tssent=4!
FrontierSat time: 19700101T00:07:19.111, Uptime: 439111 ms
========================= UART Telecommand Received =========================
CTS1+hello_world()@tssent=4!

=========================
Parsed telecommand (len=29): 'CTS1+hello_world()@tssent=4!
'
0000000000000+0000439554_N [TELECOMMAND:NORMAL]: Executing telecommand from agenda slot 0, sent at tssent=4, scheduled for tsexec=0.
========================= Executing telecommand 'hello_world'=========================
0000000000000+0000439574_N [TELECOMMAND:NORMAL]: Hello, world!
========================= Response (duration=6ms, err=0) =========================

===========================================================================
FrontierSat time: 19700101T00:07:20.106, Uptime: 440106 ms 

Now calling a different telecommand 'CTS1+echo_back_args(try)@tssent=6!', expected output is received at timestamp 6.

FrontierSat time: 19700101T00:15:33.975, Uptime: 933975 ms
CTS1+echo_back_args(try)@tssent=6!
========================= UART Telecommand Received =========================
CTS1+echo_back_args(try)@tssent=6!

=========================
Parsed telecommand (len=35): 'CTS1+echo_back_args(try)@tssent=6!
'
0000000000000+0000934611_N [TELECOMMAND:NORMAL]: Executing telecommand from agenda slot 0, sent at tssent=6, scheduled for tsexec=0.
========================= Executing telecommand 'echo_back_args'=========================
========================= Response (duration=0ms, err=0) =========================
SUCCESS: Echo Args: 'try'

===========================================================================
FrontierSat time: 19700101T00:15:34.970, Uptime: 934970 ms

Calling 'CTS1+echo_back_args(try)@tssent=1!' and 'CTS1+echo_back_args(try)@tssent=2!', expected value is received and timestamp collision at timestamp 1 and timestamp 2 is achieved as expected.

CTS1+echo_back_args(try)@tssent=1!
FrontierSat time: 19700101T00:15:51.889, Uptime: 951889 ms
========================= UART Telecommand Received =========================
CTS1+echo_back_args(try)@tssent=1!

=========================
Parsed telecommand (len=35): 'CTS1+echo_back_args(try)@tssent=1!
'
0000000000000+0000952268_N [TELECOMMAND:WARNING]: Telecommand skipped due to timestamp collision
FrontierSat time: 19700101T00:15:52.884, Uptime: 952884 ms

FrontierSat time: 19700101T00:15:56.864, Uptime: 956864 ms
CTS1+echo_back_args(try)@tssent=2!
========================= UART Telecommand Received =========================
CTS1+echo_back_args(try)@tssent=2!

=========================
Parsed telecommand (len=35): 'CTS1+echo_back_args(try)@tssent=2!
'
0000000000000+0000957526_N [TELECOMMAND:WARNING]: Telecommand skipped due to timestamp collision
FrontierSat time: 19700101T00:15:57.859, Uptime: 957859 ms

Then to conclude called the telecommand 'CTS1+echo_back_args(try)!'. Expected output was received at timestamp == 0

FrontierSat time: 19700101T00:16:03.829, Uptime: 963829 ms
CTS1+echo_back_args(try)!
========================= UART Telecommand Received =========================
CTS1+echo_back_args(try)!

=========================
Parsed telecommand (len=26): 'CTS1+echo_back_args(try)!
'
0000000000000+0000964753_N [TELECOMMAND:NORMAL]: Executing telecommand from agenda slot 0, sent at tssent=0, scheduled for tsexec=0.
========================= Executing telecommand 'echo_back_args'=========================
========================= Response (duration=1ms, err=0) =========================
SUCCESS: Echo Args: 'try'

===========================================================================
FrontierSat time: 19700101T00:16:04.824, Uptime: 964824 ms

@DeflateAwning
Copy link
Contributor

I would prefer not to merge this one, and instead just have someone implement the actual fix described in #254.

Would be okay if we closed this PR without merging?

@Freddydeddydoo
Copy link
Contributor Author

Of course. I'll close this issue then. I'll look into solving issue 254 then I apologize.

@DeflateAwning
Copy link
Contributor

No worries at all, thanks a lot!

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

Successfully merging this pull request may close these issues.

Duplicate Telecommands: Should telecommands get added due to @tssent or @tsexc?
4 participants