-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add downlink frame counter and global health packet transmission #75
Conversation
…f debug_print with debug_log.
…ng) and DownlinkBufferElement (for implementation of the packet header)
This should become v1.3.0 if accepted. Substantial non-breaking changes to functionality. |
BTW, here is what the new downlink health packets look like: The order that systems appear in the last, repeating 4 byte chunk of the packet is defined by the system order set in apps/main.cpp. That is:
But you can also just identify each system's errors on the ground using the 1-byte System ID field (see systems.json). |
I'm finding some improvements to make with the Formatter-side implementation of these ping/health packets. The overall packet structure seems fine and none of this should affect parsing (GSE-side implementation). But some flags are not used/inconvenient in their current form.
|
I tested this today with one canister and added new code to address (1) and (2) in my last comment. I'm happy with how it behaves, and added a parser to telemetry_tools to ingest the data. I have not exhaustively tested setting and clearing of all errors in the health packet, but I want to:
So that's what will happen next. |
Overview
Frame counting
This is a draft implementation of frame counters for downlink packets, to address #74. This implementation does not require changes to the v3.0.0 GSE logger for downlink data to be stored accurately (the header bytes used to implement this frame counter are ignored by the v3.0.0
Listener
).This change enables a more robust logger design in the ground segment, by adding a frame-counting field to the downlink packet header in the last two bytes. Logging on the ground can inspect this frame counter and reassemble packets with matching
frame_counter
back into a single frame, rather than assuming that packet loss only occurs when a packet collision occurs on the ground when assembling a frame.Global status message
This PR also adds system-specific error tracking and status transmission. The types of errors tracked here are software related, and the Formatter can now report errors for subsystems related to reading individual packets, reading complete frames, SpaceWire command errors, failure to process and dispatch uplink commands, or errors packetizing and preparing data for downlink. These errors are tracked separately for each
SystemManager
in the main loop. An error is auint16_t
-sized list of flags.These error
uint16_t
s are all concatenated and sent as a global health message to the GSE once per mainCircle::manage_systems()
call. These downlink messages are sent to thehousekeeping
system (0x02
) and with the type codePING
(0x20
).Problems addressed
The prior downlink and logger design was vulnerable to the following types of packet loss events: if a frame suffers packet loss during downlink and has a gap for a certain packet at index$i$ in the frame, if the next frame sent fills the gap at packet index $i$ , before overwriting any other packets from the first frame, all subsequent frames will incur a packet shift at that position. They will be incorrectly logged with their packet at $i$ coming from the next frame in the frame sequence.
Testing
I have tested all this code in the
foxsimile
framework on a single machine, and updated a local copy of the GSEListener
to utilize theframe_counter
field in the new header. All works well on the formatter side. I will put in a PR for the GSE changes so that we can track validation there separately.Global health messages/errors have not introduced new problems in running the formatter, and downlink messages appear correct. But more stress-testing is needed to actually trigger all error flags and validate clearing of errors on board.