GPSロガー設定
こちらのページを参考にさせていただきました。
gpxloggerのオプション
pi@raspberrypi:~ $ gpxlogger --help Usage: gpxlogger [OPTIONS] [server[:port:[device]]] -? Show this help, then exit --daemonize Daemonize --debug LVL Set debug level. --export EXPORTMETHOD Default dbus --exports List available exports, then exit --help Show this help, then exit --interval TIMEOUT Create new track after TIMEOUT seconds. Default 5 --minmove MINMOVE Minimum move in meters to log --output FILNAME Send output to file FILENAME --reconnect Retry when gpsd loses the fix. --version Show version, then exit -D LVL Set debug level. -d Daemonize -e EXPORTMETHOD Default dbus -f FILENAME Send output to file FILENAME -h Show this help, then exit -i TIMEOUT Create new track after TIMEOUT seconds. Default 5 -l List available exports, then exit -m MINMOVE Minimum move in meters to log -r Retry when gpsd loses the fix. -V Show version and exit
サービス化します
sudo nano /etc/systemd/system/gpxlogger.service
[Unit] Description=gpxlogger service After=gpsd.socket # 保存先USBメディアが使用可能になるのを待つ RequiresMountsFor=/media/usb0 [Service] ExecStart=/bin/bash -c '/usr/bin/gpxlogger -f /media/usb0/gps_$$(date +%%Y%%m%%d%%H%%M%%S).gpx -m 20' ExecStop=/bin/kill ${MAINPID} Restart=always Type=simple User=pi Group=pi [Install] WantedBy=multi-user.target
ラズパイ起動時に実行されるように設定します。
pi@raspberrypi:~ $ sudo systemctl daemon-reload pi@raspberrypi:~ $ sudo systemctl enable gpxlogger.service Created symlink /etc/systemd/system/multi-user.target.wants/gpxlogger.service → /etc/systemd/system/gpxlogger.service.
今日はここまでです。