1

if GPS-module disconnected, or if GPS antenna gets moved into building, I wan't to know the last available location.

I tried to log location every 10 or so seconds with systemd-timers; However, exactly when log-file is updating every 10 sec, there is an instance cat -ing log-file returns empty. This needs to be robust as possible, since inexperienced user will be operating the system.

Are there anything tools within GPSD tools that provide this?

Garid Z.
  • 500
  • 2
  • 12
  • 1
    Instead of just cat-ing the log file, have you tried checking if the logfile is empty and sleeping until it isn't? e.g. something like `until [ -s "/path/to/logfile" ] ; do sleep 0.01 ; done` before the `cat` (note: the quotes around the logfile path aren't necessary unless the path contains whitespace etc, or the path is in a variable). In bash, the `-s` test is *True if file exists and is not empty.* See `help test`. If that helps solve your problem, please write it up as a detailed answer, you can accept your own answer in a day or so. – cas Apr 01 '22 at 07:13

0 Answers0