|
|
|
|
@ -339,20 +339,27 @@ if __name__ == "__main__":
|
|
|
|
|
sim_config = True
|
|
|
|
|
print("Simulated telemetry mode is configured.")
|
|
|
|
|
else:
|
|
|
|
|
query = ["timeout", "2", "i2cdetect", "-y", "3"] # Test if Solar board is present
|
|
|
|
|
try:
|
|
|
|
|
result = subprocess.run(query, capture_output=True, text=True, check=True)
|
|
|
|
|
# query = ["timeout", "2", "i2cdetect", "-y", "3"] # Test if Solar board is present
|
|
|
|
|
# try:
|
|
|
|
|
# result = subprocess.run(query, capture_output=True, text=True, check=True)
|
|
|
|
|
# print(f"Command run was: {query}")
|
|
|
|
|
# print("Sucess!")
|
|
|
|
|
# print(f"Output of the command (stdout): {result}")
|
|
|
|
|
except subprocess.CalledProcessError as e:
|
|
|
|
|
# except subprocess.CalledProcessError as e:
|
|
|
|
|
# print(f"Command failed with return code: {e.returncode}")
|
|
|
|
|
# print(f"Command run was: {e.cmd}")
|
|
|
|
|
# print(f"Output of the command (stdout): {e.stdout}")
|
|
|
|
|
# print(f"Error output of the command (stderr): {e.stderr}")
|
|
|
|
|
print("Sim mode automatically turned on!")
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
file = open("/home/pi/CubeSatSim/sim_mode_auto")
|
|
|
|
|
print("Simulated telemetry mode automatically turned on!")
|
|
|
|
|
sim_mode = True
|
|
|
|
|
sim_config = True
|
|
|
|
|
file.close()
|
|
|
|
|
except:
|
|
|
|
|
if (debug_mode == 1):
|
|
|
|
|
print("/home/pi/CubeSatSim/sim_mode_auto not found")
|
|
|
|
|
if len(config) > 5:
|
|
|
|
|
sq = config[5]
|
|
|
|
|
if (mode == 'p') or (mode == 'P'):
|
|
|
|
|
|