Raw frame payload decoder to json with raw and converted (SI) values
NOTE: All frames transmitted by the satellite are AX.25 frames. Here, describing "different types of frames" we mean recognition at our application level - frankly speaking we have in mind the content of AX.25 Information Field.
PW-Sat2 transmits lots of frame types that are recognized by us by the first byte of AX.25 Information Field (let's call it "frame payload" for short). Most of the frames are so-called response frames - they confirm that uplink telecommand was received and accepted by the satellite. Another important type is "FileSend" frame that transports chunks of files (containing experiments results and historical telemetry). All those frames are transmitted on demand, never by the satellite itself. However, PW-Sat2 will be sending so-called telemetry frame (beacon) in 60 seconds interval. Each telemetry (beacon) frame has exactly the same fields (i.e. values from the same sensors/subsystems etc.). So it's the most important frame to be parsed.
Parsed takes raw frame data - but NOT whole AX.25 frame - Information Field only, so be careful when using it.
If parsed frame is of telemetry (beacon) type - it returns a json object with decoded and converted values. In example_frames
folder we provide you with some example telemetry frame telemetry_frame_payload.bin
. But, if provided frame is of different type (check periodic_frame_payload.bin
and file_list_frame_payload.bin
) - the returned value is frame_object
- python object representing frame of particular type.
Please note that the only valid telemetry frames (beacon) parser is available here: https://github.com/PW-Sat2/PWSat2OBC/tree/master/integration_tests/emulator/beacon_parser - the script in this repo (FramePayloadDecoder) also uses this code (as submodule).
But if you really need to write beacon (telemetry) parser on your own, for simplicity, assume such format of payload (AX.25 Information Field):
| 0xCD | 229 bytes data |
0xCD
is telemetry frame marker (beacon). Other frames have different markers here.- 229-bytes data structure (be careful and take exact amount of bits, there is no padding to bytes!).
- SI units converters can be found in these files: https://github.com/PW-Sat2/PWSat2OBC/tree/master/integration_tests/emulator/beacon_parser
- If there is no conversion function linked in the table below - the value does not need conversion (or data are solely for diagnostics and needs more investigation than simple conversion formula)
- Note that some values are two's complement (signed type).
- Always cross check results of your own parser with parser from this repository.
Sum: 1832 bits