Update main.c add gps check

pi-sensors-auto-gps
Alan Johnston 4 days ago committed by GitHub
parent 4d79943e55
commit 3df3728426
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -342,6 +342,20 @@ int main(int argc, char * argv[]) {
fprintf(stderr, "Unable to open UART: %s\n -> Did you configure /boot/config.txt and /boot/cmdline.txt?\n", strerror(errno)); fprintf(stderr, "Unable to open UART: %s\n -> Did you configure /boot/config.txt and /boot/cmdline.txt?\n", strerror(errno));
} }
gps_status = OFF;
FILE *gps_read = sopen("python3 /home/pi/CubeSatSim/gps_client.py"); // python sensor polling function
if (gps_read != NULL) {
fgets(cmdbuffer, 1000, gps_read);
fprintf(stderr, "gps read: %s\n", gps_read);
if cmdbuffer[0] != '-')
{
gps_status = ON;
fprintf(stderr, "Pi GPS enabled");
}
fclose(gps_read);
}
sensor_setup(); sensor_setup();
if ((i2c_bus3 == OFF) || (sim_mode == TRUE)) { if ((i2c_bus3 == OFF) || (sim_mode == TRUE)) {

Loading…
Cancel
Save

Powered by TurnKey Linux.