Reply To: RTC on Berry GPS-IMU

Home Forums Forums General discussion RTC on Berry GPS-IMU Reply To: RTC on Berry GPS-IMU


Hi Jon,

I had to programmatically synchronize the rpi clock.
A periodic task gets the gps time and call a the system date command

In Java, that’s:

Date date1 = new SimpleDateFormat("ddMMyyHHmmss")
.parse(gpsDate.stringValue() + gpsTime.stringValue());
cmd[0] = "/bin/date";
cmd[1] = String.format("-s %s", date1);
ProcessBuilder processBuilder = new ProcessBuilder(cmd);

I hope it helps.

Blip, blop, bloop…