ich habe eine Frage, und zwar: mit dem Befehl
Code: Alles auswählen
gpspipe -d -l -r -o track.txtDanke im voraus,
Fussel132
Code: Alles auswählen
gpspipe -d -l -r -o track.txtCode: Alles auswählen
#!/usr/bin/env python
import subprocess
import time
from datetime import datetime as dt
# Terminate existing gpsd instances, start gpsd and sleep a few seconds
subprocess.call('sudo killall gpsd', shell=True)
subprocess.call('sudo /usr/sbin/gpsd /dev/ttyAMA0 -F /var/run/gpsd.sock', shell=True)
time.sleep(30)
# Refresh the local time
subprocess.call('sudo service ntp restart', shell=True)
time.sleep(3)
#output file name with actual date
filename = "/home/pi/gpstrack-" + dt.now().strftime("%Y%m%d-%H%M%S") + ".txt"
# start gpspipe and output the GPS Data as NMEA to file
subprocess.call('gpspipe -d -l -r -o '+ filename +' ', shell=True)
Code: Alles auswählen
#!/bin/sh
# Terminate existing gpsd instances, start gpsd and sleep a few seconds
sudo killall gpsd
sudo /usr/sbin/gpsd /dev/ttyAMA0 -F /var/run/gpsd.sock
sleep 30
# Refresh the local time.
sudo service ntp restart
sleep 3
# Output file name with current timestamp.
filename="/home/pi/gpstrack-$(date +%Y%m%d-%H%M%S).txt"
# Start gpspipe and output the GPS Data as NMEA to file.
gpspipe -d -l -r -o "$filename"