detect_boards - UWCubeSat/DubSat1 GitHub Wiki
detect_boards script
usage
detect_boards.py
is a python 3 script that creates and assigns environment variables that store COM port assignments for usage with the COSMOS telemetry server. for best results, run after connecting all boards, then completely restart COSMOS (including launcher).
NOTE: it is only necessary to run the script if you are attempting to connect directly to hardware.
requirements
- windows
- python 3
- pyserial (
pip install pyserial
) - pywin32 (
pip install pywin32
)
- pyserial (
- connected subsystem boards must output meta packets
how help, see how to install python packages
adding targets
- edit the
detect_boards.py
script (DS1Ops\scripts
). after the import statements you should see some code that looks something like this:
ports_list = [
None, #0
None, #1
None, #2
None, #3
None, #4
"PPT",
"EPSDIST",
"EPSGEN",
"EPSBATT",
"ADCS_ESTIM",
None, #10
"ADCS_SENSORPROC",
None, #12
None, #13
None, #14
None #15
]
- replace the "None" at the corresponding index of your board with a string to represent its name (e.g. "PPT"). that is all for this file.
- next, edit the
cmd_tlm_server.txt
file for your subsystem (DS1Ops\COSMOS\flatsat\config\targets\SUBSYSTEM_NAME
). - replace the two instances of
COMXX
with<%= ENV["FLATSAT_COMPORT_SUBSYSTEM_NAME"] %>
, whereSUBSYSTEM_NAME
is the same string you added todetect_boards.py
. - make sure you run the script again to set your new environment variables.