diff --git a/app/command_wrapper.py b/app/command_wrapper.py index 941f2d1..295183c 100644 --- a/app/command_wrapper.py +++ b/app/command_wrapper.py @@ -5,8 +5,10 @@ import time def execute_meshtastic_command(options): """Execute a meshtastic command with the given options.""" command = ["meshtastic", "--host", "mmrelaydevice", "--port", "4403"] + options.split() - subprocess.run(command) - time.sleep(30) # Pause for 30 seconds + print(f"Executing command: {' '.join(command)}") # Add this line for debugging + result = subprocess.run(command, capture_output=True, text=True) + print(result.stdout) # Add this line to print the output + time.sleep(15) # Pause for 30 seconds # Loop through environment variables in sequence index = 1 @@ -16,7 +18,4 @@ while True: execute_meshtastic_command(command) index += 1 else: - break - -# Finally, run the main Meshtastic process (or whatever process you want to keep the container running) -subprocess.run(["meshtastic"]) + break \ No newline at end of file diff --git a/app/entrypoint.sh b/app/entrypoint.sh index a12d2fd..bcc7daf 100755 --- a/app/entrypoint.sh +++ b/app/entrypoint.sh @@ -1,5 +1,6 @@ #!/bin/bash +printenv /home/mesh/.local/bin/wait-for-it.sh mmrelaydevice:4403 -t 60 -python3 command_wrapper.py -python3 conf_wrapper.py -python3 main.py \ No newline at end of file +python3 /home/mesh/app/command_wrapper.py +python3 /home/mesh/app/conf_wrapper.py +python3 /home/mesh/app/main.py \ No newline at end of file