Update main.c only start rpitx at start

beta-extra-2
Alan Johnston 1 year ago committed by GitHub
parent 345dfd6c05
commit f8cd4c4c5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -45,6 +45,8 @@ int main(int argc, char * argv[]) {
fprintf(stderr, "Pi Zero 2 detected\n");
pi_zero_2_offset = 500;
if (uptime_sec < 30.0) {
FILE * rpitx_stop = popen("sudo systemctl start rpitx", "r");
pclose(rpitx_stop);
fprintf(stderr, "Sleep 5 sec");
sleep(5); // try sleep at start to help boot
}
@ -63,6 +65,8 @@ int main(int argc, char * argv[]) {
}
}
if (uptime_sec < 30.0) {
FILE * rpitx_stop = popen("sudo systemctl start rpitx", "r");
pclose(rpitx_stop);
fprintf(stderr,"Sleep 10 sec");
sleep(10);
}
@ -125,8 +129,7 @@ int main(int argc, char * argv[]) {
// FILE * rpitx_stop = popen("sudo systemctl stop rpitx", "r");
// FILE * rpitx_stop = popen("sudo systemctl restart rpitx", "r");
FILE * rpitx_stop = popen("sudo systemctl start rpitx", "r");
pclose(rpitx_stop);
// FILE * cc_start = popen("/home/pi/CubeSatSim/command &", "r");
// pclose(cc_start);

Loading…
Cancel
Save

Powered by TurnKey Linux.