I implemented the following code:

gps = microstacknode.hardware.gps.l80gps.L80GPS()
while True:
    data = gps.get_gprmc()
    print(data.keys(), data.values())

After some time it starts to output data with a time delay which increases with time. Here I am talking about 10 min delay in a 30-min run. It seems that the problem is coming from the serial port where all the data are buffered and I am getting not the latest data but whatever came to the port first. Has anyone had similar issue and what is the best solution to overcome this problem?

  • Do you mean that after 30 minutes, it takes 10 minutes to print the next line? Or do you mean that the first line has a timestamp T, and the line which appears after 30 minutes has a timestamp T+20min? – Dmitry Grigoryev Mar 28 '18 at 9:33
  • Not Pi specific. Personally I would read the device more often. – joan Mar 28 '18 at 10:11
  • I save data to the file with two timestamps: one from RPi T_rpi and one provided from GPS T_gps. At the beggining of the file T_rpi = T_gps, and after 30 min the last line shows T_gps = T_rpi - 10 min – Nataliia Sergiienko Mar 28 '18 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.