From 2a7e8cffd369a64c6939475ee5a3c29fcba518d3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 1 Sep 2024 09:24:00 -0400 Subject: [PATCH] Update main.c restart rpitx if tcp connection refused --- main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 7c73f2a4..2c6d792b 100644 --- a/main.c +++ b/main.c @@ -1830,7 +1830,9 @@ void get_tlm_fox() { printf("\nConnection Failed \n"); printf("Error: %s \n", strerror(errno)); error = 1; - // sleep(1.0); // sleep if socket connection refused + FILE * rpitx_restartf = popen("sudo systemctl restart rpitx", "r"); + pclose(rpitx_restartf); + sleep(5.0); // sleep if socket connection refused } } if (error == 1)