Keine Daten vom GPS-Modul - erledigt!


ich verzeifel bald! und bitte um hilfe.
der sketch läuft, doch das modul sendet oder ich empfange keine gps-daten!
das modul blinkt munter vor sich hin, hat es doch empfang?
anzeige im serielle monitor
** no characters received gps: check wiring **
chars=0 sentences=0 csum err=0

die verbindung 4/3 hab ich auch schon getauscht, doch ohne erfolg.
hardware:
uno nano v3.0
ublox neo-6m gps module
gps-modul a4 rx /a3 tx und 3,3v, gnd vom arduino
folgender sketch:
simply_test

code: [select]
#include <softwareserial.h>

#include <tinygps.h>

/* sample code demonstrates normal use of tinygps object.
  requires use of softwareserial, , assumes have a
  4800-baud serial gps device hooked on pins 4(rx) , 3(tx).
*/

tinygps gps;
softwareserial ss(4, 3);

void setup()
{
 serial.begin(9600);
 ss.begin(9600);
 
 serial.print("simple tinygps library v. "); serial.println(tinygps::library_version());
 serial.println("by mikal hart");
 serial.println();
}

void loop()
{
 bool newdata = false;
 unsigned long chars;
 unsigned short sentences, failed;

 // 1 second parse gps data , report key values
 for (unsigned long start = millis(); millis() - start < 2000;)
 {
   while (ss.available())
   {
     char c = ss.read();
     // serial.write(c); // uncomment line if want see gps data flowing
     if (gps.encode(c)) // did new valid sentence come in?
       newdata = true;
   }
 }

 if (newdata)
 {
   float flat, flon;
   unsigned long age;
   gps.f_get_position(&flat, &flon, &age);
   serial.print("lat=");
   serial.print(flat == tinygps::gps_invalid_f_angle ? 0.0 : flat, 6);
   serial.print(" lon=");
   serial.print(flon == tinygps::gps_invalid_f_angle ? 0.0 : flon, 6);
   serial.print(" sat=");
   serial.print(gps.satellites() == tinygps::gps_invalid_satellites ? 0 : gps.satellites());
   serial.print(" prec=");
   serial.print(gps.hdop() == tinygps::gps_invalid_hdop ? 0 : gps.hdop());
 }
 
 gps.stats(&chars, &sentences, &failed);
 serial.print(" chars=");
 serial.print(chars);
 serial.print(" sentences=");
 serial.print(sentences);
 serial.print(" csum err=");
 serial.println(failed);
 if (chars == 0)
   serial.println("** no characters received gps: check wiring **");
}


serial.begin(9600);
  ss.begin(9600);


softwareserial ist bereits bei 9600 baud vollkommen unbrauchbar, wenn es gleichzeitig mit hardwareserial betrieben werden soll.

wenn du dir das trauerspiel falsch empfangener daten mal testweise auf einem board mit nur einer einzigen hardwareserial-schnittstelle ansehen möchtest, verwende diese loop-funktion in deinem test-sketch:
code: [select]
void loop() 
{
  while(ss.available())
    serial.write(ss.read());
}


und wenn du genug gesehen hast, verwende lieber die altsoftserial-library anstelle von softwareserial!


Arduino Forum > International > Deutsch (Moderator: uwefed) > Keine Daten vom GPS-Modul - erledigt!


arduino

Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support