Flight Application
Radio RX/TX
Commands
Has a bunch of commands that can be called via radio, with an argument.
Contains a dictionary of commands mapping their 2 byte header to a function.
- radio_utils.commands.copy_file(task, args)[source]
Copy a file from source to dest
- Parameters
task – The task that called this function
args (str) – json string [source, dest]
- radio_utils.commands.delete_file(task, file)[source]
Delete file
- Parameters
task – The task that called this function
file (str) – The path to the file to delete
- radio_utils.commands.exec_py(task, args)[source]
Execute the python code, and do not return the result
- Parameters
task – The task that called this function
args (str) – The python code to execute
- radio_utils.commands.list_dir(task, path)[source]
List the contents of a directory, and downlink the result
- Parameters
task – The task that called this function
path (str) – The path to the directory to list
- radio_utils.commands.move_file(task, args)[source]
Move a file from source to dest. Does not work when moving from sd to flash, should copy files instead.
- Parameters
task – The task that called this function
args (str) – json string [source, dest]
Message Classes
- class radio_utils.message.Message(priority, str, with_ack=False)[source]
The most basic message type. Supports ascii messages no longer than 251 bytes. Other message types should inherit from this class.
- Parameters
- class radio_utils.naive.NaiveMessage(priority, str)[source]
Bases:
MessageTransmits the message 249 bytes at a time. Sets special headers for the first packet, middle packets, and last packet.
- Parameters
- class radio_utils.chunk.ChunkMessage(priority, path)[source]
Bases:
MessageTransmits the message 251 bytes at a time. Sets special headers for the first packet, middle packets, and last packet. Reads from a file one chunk at a time.
- Parameters
priority (int) – The priority of the message (higher is better)
path – The path to the file containing the message to send
Transmission Queue
The Transmission Queue is a max heap of messages to be transmitted.
Messages must support the __lt__, __le__, __eq__, __ge__, and __gt__ operators. This enables to the max heap to compare messages based on their priority.
- radio_utils.transmission_queue.peek()[source]
Returns the next message to be transmitted
- Returns
The next message to be transmitted
- Return type
- radio_utils.transmission_queue.pop()[source]
Returns the next message to be transmitted and removes it from the transmission queue
- Returns
The next message to be transmitted
- Return type
- radio_utils.transmission_queue.push(msg)[source]
Push a msg into the transmission queue
- Parameters
msg (Message | NaiveMessage | ChunkMessage) – The message to push
Tasks
Beacon Task
- class Tasks.beacon_task.task[source]
Bases:
Task- beacon_packet()[source]
Creates a beacon packet containing the: CPU temp, IMU temp, gyro, acceleration, magnetic, and state byte. The state byte is the index of the current state in the alphabetically ordered state list. This data is packed into a c struct using struct.pack.
If no IMU is attached it returns a packet of 0s.
Blink Task
Deployment Manager Task
Manages deployment of the cubesat’s antenna.
When contact is established with the groundstation (f_contact is True, set by the radio task) the cubesat switches to normal mode. If f_burn is false and the cubesat has been up for 5 minutes, the burnwire is activated. Every 24 hours the cubesat activates the burn wire.
GNC Task
IMU Task
Radio Task
Radio Task:
Manages all radio communication for the cubesat.