Ich verwende jetzt diesen Code:
// tested on an Arduino Uno using pins 2 for RXd & 3 for TXd
// Connect the GPS Power pin to 3.3V
// Connect the GPS Ground pin to ground
// Connect the GPS VBAT pin to 3.3V if no battery is used
// Connect the GPS TX (transmit) pin to Digital 11
// Connect the GPS RX (receive) pin to Digital 12
// For 3.3V only modules such as the UP501, connect a 10K
// resistor between digital 12 and GPS RX and a 10K resistor
// from GPS RX to ground. (Must divide voltage into module as it only takes 3.3V)
#include <SoftwareSerial.h>;
#define PMTK_SET_NMEA_UPDATE_1HZ "$PMTK220,1000*1F"
#define PMTK_SET_NMEA_UPDATE_5HZ "$PMTK220,200*2C"
#define PMTK_SET_NMEA_UPDATE_10HZ "$PMTK220,100*2F"
#define PMTK_SET_NMEA_OUTPUT_RMCONLY "$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29"
#define PMTK_SET_NMEA_OUTPUT_ALLDATA "$PMTK314,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28"
int rxPin = 2;
int txPin = 3;
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
void setup()
{
Serial.begin(57600);
Serial.println("UP501 NMEA test!");
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
mySerial.begin(9600);
// uncomment this line to turn on only the "minimum recommended" data for high update rates!
mySerial.println(PMTK_SET_NMEA_OUTPUT_RMCONLY);
// uncomment this line to turn on all the available data - for 9600 baud you'll want 1 Hz rate
//mySerial.println(PMTK_SET_NMEA_OUTPUT_ALLDATA);
// Set the update rate
// 1 Hz update rate
mySerial.println(PMTK_SET_NMEA_UPDATE_1HZ);
// 5 Hz update rate- for 9600 baud you'll have to set the output to RMC only (see above)
//mySerial.println(PMTK_SET_NMEA_UPDATE_5HZ);
//10 Hz update rate - for 9600 baud you'll have to set the output to RMC only (see above)
//mySerial.println(PMTK_SET_NMEA_UPDATE_10HZ);
}
void loop()
{
if (mySerial.available())
Serial.print((char)mySerial.read());
if (Serial.available())
mySerial.print((char)Serial.read());
}
bekomme auch Werte, aber die Werte die ich bekomme, stimmen nicht ganz.
Hier ist ein Wert den ich bekomme:
$GPRMC,203343.000,A,2938.7544,N,00834.6560,E,0.35,318.96,160113,,,A*67
daraus extrahiere ich diese Informationen:
Jetzt habe ich nur ein Problem, dass ich ca. 43km Luftlinie entfernt sitze :-(
Zu meinem Standpunkt, ich sitze direkt am Fenster im Dachgeschoss.
Die Werte ändern sich auch nicht, wenn ich bei diesen Minusgraden auf den Balkon gehe und unter freiem Himmel die Daten logge.
Auch ändert sich meine Position nicht, wenn ich den Logger über eine Stunde laufen lasse..
Woran kann das Liegen?