Index: cloud_sync.py =================================================================== diff -u -rcb3e00ce874f5c9e0d01f76701542dcd8752c221 -r8526ff48b8707a6ee883e3931dcbca0630ff3e15 --- cloud_sync.py (.../cloud_sync.py) (revision cb3e00ce874f5c9e0d01f76701542dcd8752c221) +++ cloud_sync.py (.../cloud_sync.py) (revision 8526ff48b8707a6ee883e3931dcbca0630ff3e15) @@ -212,8 +212,6 @@ # END - REGISTRATION ENDPOINTS -# START - TESTING ENDPOINTS -# END - TESTING ENDPOINTS def main(): Index: cloudsync/utils/globals.py =================================================================== diff -u -r34a18ebe349364c4e0462d876d4d191bf3df8939 -r8526ff48b8707a6ee883e3931dcbca0630ff3e15 --- cloudsync/utils/globals.py (.../globals.py) (revision 34a18ebe349364c4e0462d876d4d191bf3df8939) +++ cloudsync/utils/globals.py (.../globals.py) (revision 8526ff48b8707a6ee883e3931dcbca0630ff3e15) @@ -68,7 +68,7 @@ # UI2CS VALUES UI2CS_FILE_CHANNELS_PATH = "/media/sd-card/cloudsync" # PATH for running off device -UI2CS_FILE_CHANNELS_PATH = "data/busses" +# UI2CS_FILE_CHANNELS_PATH = "data/busses" # TREATMENT REPORT SECTIONS Index: cs.py =================================================================== diff -u -r34a18ebe349364c4e0462d876d4d191bf3df8939 -r8526ff48b8707a6ee883e3931dcbca0630ff3e15 --- cs.py (.../cs.py) (revision 34a18ebe349364c4e0462d876d4d191bf3df8939) +++ cs.py (.../cs.py) (revision 8526ff48b8707a6ee883e3931dcbca0630ff3e15) @@ -30,29 +30,17 @@ if cs_proc: print("CloudSync app already running") else: - print(f"Starting CloudSync app with logging level {logging_level}") + print("Starting CloudSync app with logging level {0}".format(logging_level)) + time.sleep(DELAY) Popen(['python3', 'cloud_sync.py', str(logging_level)]) - # Keep the main process running - while True: - # Check if the subprocess is still running or perform other periodic checks - time.sleep(60) # Adjust the sleep time as needed def stop(): cs_proc_pid = get_pid() if cs_proc_pid: print("Stopping CloudSync app...") time.sleep(DELAY) - try: - os.kill(int(cs_proc_pid), signal.SIGKILL) - print(f"Successfully killed process {cs_proc_pid}") - except PermissionError: - print( - f"Permission denied when trying to kill process {cs_proc_pid}") - except ProcessLookupError: - print(f"No process with PID {cs_proc_pid}") - except Exception as e: - print(f"Error killing process {cs_proc_pid}: {str(e)}") + os.kill(int(cs_proc_pid), signal.SIGKILL) else: print("CloudSync app is not running.")