Getting closer, command_wrapper needs work

newFW
Jeremiah K 2023-11-26 16:35:21 -06:00
rodzic cabca66846
commit f19ce7b703
2 zmienionych plików z 9 dodań i 9 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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
python3 /home/mesh/app/command_wrapper.py
python3 /home/mesh/app/conf_wrapper.py
python3 /home/mesh/app/main.py