Go Down

Topic: GPS strings (Read 365 times) previous topic - next topic

rdeans

Hi

I just uploaded the following code to my gps receiver <ftp://imall.iteadstudio.com/IM120417017_Arduino_GPS_shield/DS_IM120417017_ArduinoGPSshield.pdf>
I would like to have it output my latitude and longitude on the serial monitor
The code compiles and uploads, but I get these lines in the serial monitor:

)ànfª*+ºJÊ(+ºEª¬Je?¨^UÊ¢VD˨^T?.%JTê¬nd?(¡²4)àjf«¨%¢ji,©¢*?j¥³Zªj%¢*ìªN?
bAfT?ªV²e?ªVeª,-JdɪZD©l¥ºÍièr?(ʨV?ª¬/Rª[Êj¥¢K?l/R?Ël­²¥?ª^²jË(¡?4)àv³?Ê(%ª{Ëh/R?Êl/VªKÊ襲KÊ,+VeÊ,/¥¢{K¦n.l¥²U?¨V?ʬRe?,-VE©¨Re?,¯²KÊh¥²eªî5B.dJUª%¢Ì(+ºEª¬?Re©(+ª+?ê.ÉReͨ¨ CHARS=249 SENTENCES=0 CSUM ERR=3
)ànfª*«ºJÊ(+ºEª¬Je?¨^UÊ¢VD˨RT?.%JTê¬nd?(¡?4)àjf«¨%¢ji,©¢*?j¥³Zª*%¢*ìjN?
bAfT?ªV²e?ªVeª,/JdɪZD©,¥ºÕièrÜÌh«ª*?¨fD?¨^U˦RU?û?.)J¥?h%BEièr?³ëɤRReͨR4¨àÂ)ànfª*«ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨVT?.%JTê¬nd?(¡ª4)àjf«¨%¢ji,©¢*?j¥³Zªj%¢*ìªN?
bAfT?ªV²e?ªVeª,-R²+ɪ^D?,¥º¥ièrÜÌh«ª??¨fD?¨^U˦RU?û?.)J¥?h%BEièr?³ëɤRReͨR4¨à CHARS=558 SENTENCES=0 CSUM ERR=11


I am running the serial monitor at a 115200 baud rate, and the gps at 4800

here is the code:

Code: [Select]
#include <SoftwareSerial.h>
#include "TinyGPS.h"

/* This sample code demonstrates the normal use of a TinyGPS object.
   It requires the use of SoftwareSerial, and assumes that you have a
   4800-baud serial GPS device hooked up on pins 3(rx) and 4(tx).
*/

TinyGPS gps;
SoftwareSerial ss(3, 4);

void setup()
{
  Serial.begin(115200);
  ss.begin(4800);
 
  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;

  // For one second we parse GPS data and report some key values
  for (unsigned long start = millis(); millis() - start < 1000;)
  {
    while (ss.available())
    {
      char c = ss.read();
      Serial.write(c); // uncomment this line if you want to see the GPS data flowing
      if (gps.encode(c)) // Did a 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);
}


Any help would be appreciated..

thanks in advance

:D

rdeans

sorry.. here are some more lines that appear in the serial monitor( the previous ones did not all appear)


Code: [Select]
)ànfª*+ºJÊ(+ºEª¬Je?¨^UÊ¢VD˨^T?.%JTê¬nd?(¡²4)àjf«¨%¢ji,©¢*?j¥³Zªj%¢*ìªN?
bAfT?ªV²e?ªVeª,-JdɪZD©l¥ºÍièr?(ʨV?ª¬/Rª[Êj¥¢K?l/R?Ël­²¥?ª^²jË(¡?4)àv³?Ê(%ª{Ëh/R?Êl/VªKÊ襲KÊ,+VeÊ,/¥¢{K¦n.l¥²U?¨V?ʬRe?,-VE©¨Re?,¯²KÊh¥²eªî5B.dJUª%¢Ì(+ºEª¬?Re©(+ª+?ê.ÉReͨ¨ CHARS=249 SENTENCES=0 CSUM ERR=3
)ànfª*«ºJÊ(+ºEª¬Je?¨^UÊ¢VD˨RT?.%JTê¬nd?(¡?4)àjf«¨%¢ji,©¢*?j¥³Zª*%¢*ìjN?
bAfT?ªV²e?ªVeª,/JdɪZD©,¥ºÕièrÜÌh«ª*?¨fD?¨^U˦RU?û?.)J¥?h%BEièr?³ëɤRReͨR4¨àÂ)ànfª*«ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨVT?.%JTê¬nd?(¡ª4)àjf«¨%¢ji,©¢*?j¥³Zªj%¢*ìªN?
bAfT?ªV²e?ªVeª,-R²+ɪ^D?,¥º¥ièrÜÌh«ª??¨fD?¨^U˦RU?û?.)J¥?h%BEièr?³ëɤRReͨR4¨à CHARS=558 SENTENCES=0 CSUM ERR=11
)ànfª*+ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨVT?.%JTê¬nd?(¡¢4)àjf«¨%¢ji,©¢*?j¥³Zªª%¢*ìjN?
bAfT?ªV²e?ªVeª,-R²+ɪ^D?,¥º¥ièrÜÌh«ª*?¨fD?¨^U˦RU?û?.)J¥?h%BUièr?³ëɤRReͨR4¨à CHARS=713 SENTENCES=0 CSUM ERR=14
)ànfª*+ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨVT?.%JTê¬nd?(¡¢4)àjf«¨%¢ji,©¢*?j¥³Zªê%¢*ì*N?
bAfT?ªV²e?ªVeª,-R²+ɪ^D?,¥º¥ièrÜÌh«ªu?¨fD?¨^U˦RU?û?.)J¥?h%BUièr?³ëɤRReͨR4¨à CHARS=868 SENTENCES=0 CSUM ERR=19
)ànfª*«ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨVT?.%JTê¬nd?(¡ª4)àjf«¨%¢ji,©¢*?j¥³Zªª%¢*ì*§J??f̪R?ªl+V??,+R²zɬJ?˨VT©n)B.¢Ù?Ê(%ªkËê-Veª¬)RE©¨R?Ël­²­?ª^²jË(¡²4)àv³?Ê(%ª{Ëh/ReÊl/VªKÊ襲KÊ,+VeÊ,/¥¢{J¦n.l¥²U?¨V?ʬRe?,-VE?¬Re?,¯²KÊh¥²e¨êB.dJUª%¢Ì(+ºEª¬ÊRe©(+ª+?èÉReͨR)ànfª*«ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨVT?.%JTê¬nd?(¡ª4)àjf«¨%¢ji,©¢*?j¥³Zªê%¢*ìj§J??f̪R?ªl+V??,+R²zɬJ?˨VT©n)B.dJUªê%¢*Ì(+ºEª¬Je?¨^UÊ¢RRe©(+ª+?èB.àJɤRReͨR4¨à CHARS=1271 SENTENCES=0 CSUM ERR=26
)ànfª*+%¢*«¨%¢ji,©¢*?j¥³eÊl%²Zê¬ndªn%JD?(Z%?"EjD?¨^U˦RU?û?j©²K?lBµièr?f̪R?ªl+V??,+R²zɬJ?˨VT©n)B.dJUª*%¢*Ì(+ºEª¬Je?¨^UÊ¢RRe©(+ª+?âB.àJɤRReͨR4¨à CHARS=1426 SENTENCES=0 CSUM ERR=31
)ànfª*+%¢*«¨%¢ji,©¢*?j¥³eÊl%²Zê¬ndªn%JD?(Z%?"EjD?¨^U˦RU?û?j©²K?lB½ièr?f̪R?ªl+V??,+R²zɬJ?˨VT©n)B.dJUªj%¢*Ì(+ºEª¬Je?¨^UÊ¢RRe©(+ª+?àB.àJɤRReͨR4¨àÂ)ànfª*-ºJÊ(+ºEª¬Je?¨^UÊ¢VD˨RT?.%JTê¬nd?(¡¢4)àjf«¨%¢ji,©¢*?j¥³Zª(%¢*ìj§J??f̪R?Êl+Veª,-JdÉl%%º+ê(V??"ÅfDªª©RE ¬)¢{ªªjDª(%¢­),%¢+?h«² ?$J?èͬYnD?¨jD?lB?4 CHARS=1733 SENTENCES=0 CSUM ERR=39
)ànfª*-ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨVT?.%JTê¬nd?(¡ª4)àjf«¨%¢ji,©¢*?j¥³Zªh%¢*ì*§J??f̪R?ªl+V??,+R²zɬJ?˨VT©n)B.¢Ù?Ê(%ªkËê-Veª¬)RE©¨R?Ël­²­?ª^²jË衪4)àv³?Ê(%ª{Ëh/ReÊl/VªKË襲KÊ,+VeÊ,/¥¢{K¦n.l¥²U?¨V?ʬRe?,-VE?ªRe?,¯²KÊh¥²e¨âB.dJUª%¢Ì(+ºEª¬ÊRe©(+ª+?èÉReͨR CHARS=1981 SENTENCES=0 CSUM ERR=43
)ànfª*­ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨVT?.%JTê¬nd?(¡¢4)àjf«¨%¢ji,©¢*?j¥³Zª(%¢*ì*N?
bAfT?ªV²e?ªVeª,-R²+ɪ^D?,¥º¥ièrÜÌh«¢*?¨fD?¨^U˦RU?û?.)J¥?h%BUièr?³ëɤRReͨR4¨àÂ)ànfª*­ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨVT?.%JTê¬nd?(¡¢4)àjf«¨%¢ji,©¢*?j¥³Zªh%¢*ìjN?
bAfT?ªV²e?ªVeª,-R²+ɪ^D?,¥º¥ièrÜÌh«¢??¨fD?¨^U˦RU?û?.)J¥?h%BUièr?³ëɤRReͨR4¨à CHARS=2291 SENTENCES=0 CSUM ERR=51
)ànfª*-ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨRT?.%JTê¬nd?(¡¢4)àjf«¨%¢ji,©¢*?j¥³Zª¨%¢*ìªN?
bAfT?ªV²e?ªVeª,-R²+ɪ^D©,¥ºÅièrÜÌh«¢*?¨fD?¨^U˦RU?û?.)J¥?h%BEièr?³ëɤRReͨR4¨à CHARS=2446 SENTENCES=0 CSUM ERR=54
)ànfª*-ºJÊ(+ºEª¬Je?¨^UÊ¢VD˨RT?.%JTê¬nd?(¡¢4)àjf«¨%¢ji,©¢*?j¥³Zªè%¢*ìjN?
bAfT?ªVeªl)R?ª¬JdɪVDÉl%ºÅièrÜÌh«¢u?¨fD?¨^U˦RU?û?.)J¥?h%BEièr?³ëɤRReͨR4¨à CHARS=2598 SENTENCES=0 CSUM ERR=58
)ànfª*­ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨRT?.%JTê¬nd?(¡ª4)àjf«¨%¢ji,©¢*?j¥³Zª¨%¢*ìªN?
bAfT?ªV²e?ªVeª,-R²+ɪ^D©,¥ºÅièr?(ʨV?ª¬/Rª[Êj¥¢K?l-R?Ël­²¥?ª^²jË(¡?4)àv³?Ê(%ª{Ëh/ReÊl/VªKË襲KÊ,)VeÊ,/¥¢{K¦n.l¥²U?¨V?ʬRe?,-VEÉj%¢K«¬Re?,)¥^&?"ÅfDªª­RE ¬)¢{ªªjDª(%¢­),%¢+?h«² ª$J?èͬYnD???4)ànfª*­ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨRT?.%JTê¬nd?(¡ª4)àjf«¨%¢ji,©¢*?j¥³Zªè%¢*ìêN?
bAfT?ªV²e?ªVeª,-R²+ɪ^D©,¥ºÅièrÜÌh«¢ºJÊ Z­ë(©²)Ê*©^UÊ¢RRe©(+ª+?êB.àJɤRReͨR4¨à CHARS=3016 SENTENCES=0 CSUM ERR=64
)ànfª*-%¢*«¨%¢ji,©¢*?j¥³eÊl¥²Zê¬ndªn%JD?(Z??"EjD?¨^U˦RU?û?j)²K?lB­ièr?f̪R?ªl+V??,+R²zɬJ?˨RT©n1B.dJUª(%¢*Ì(+ºEª¬Je?¨^UÊ¢RRe©(+ª+?ìB.àJɤRReͨR4¨à CHARS=3171 SENTENCES=0 CSUM ERR=68
)ànfª*-%¢*«¨%¢ji,©¢*?j¥³eÊl¥²Zê¬ndªn%JD?(Z&?"EjD?¨^U˦RU?û?j)²K?lB¥ièr?f̪R?ªl+V??,+R²zɬJ?˨RT©n1B.dJUªh%¢*Ì(+ºEª¬Je?¨^UÊ¢RRe©(+ª+?ìB.àJɤRReͨR4¨à CHARS=3326 SENTENCES=0 CSUM ERR=72
)ànfª*/ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨRT?.%JTê¬nd?(¡¢4)àjf«¨%¢ji,©¢*?j¥³Zª(%¢*ì*§J??f̪R?ªl+V??,+R²zɬJ?˨RT©n1B.dJUª(%¢*Ì(+ºEª¬Je?¨^UÊ¢RRe©(+ª+?èB.àJɤRReͨR4¨àÂ)ànfª*/ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨRT?.%JTê¬nd?(¡¢4)àjf«¨%¢ji,©¢*?j¥³Zªh%¢*ìj§J??f̪R?ªl+V??,+R²zɬJ?˨RT©n1B.¢Ù?Ê(%ªkËê-Veª¬)RE©ªR?Ël­²¥?ª^²jË(¡?4)àv³?Ê(%ª{Ëh/R²e©ªVªKË襲KÊ,)VeÊ,/¥¢{K¦n.l¥²U?¨V?ʬR²­?ªVEÉj%¢K«¬Re?,)¥^%?"ÅfDªê«RE ¬)¢{ªªjDª(%¢­),%¢+?h«² ?$J?èͬYnD?¨j??4 CHARS=3746 SENTENCES=0 CSUM ERR=80
)ànfª*¯ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨRT?.%JTê¬nd?(¡ª4)àjf«¨%¢ji,©¢*?j¥³Zª(%¢*ìjN?
bAfT?ªV²e?ªVeª,-R²+ɪ^D©,¥ºÅièrÜÌh«¢*?¨fD?¨^U˦RU?û?.)J¥?h%BUièr?³ëɤRReͨR4¨à CHARS=3901 SENTENCES=0 CSUM ERR=83
)ànfª*¯ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨRT?.%JTê¬nd?(¡ª4)àjf«¨%¢ji,©¢*?j¥³Zªh%¢*ì*N?
bAfT?ªV²e?ªVeª,-R²+ɪ^D©,¥ºÅièrÜÌh«¢??¨fD?¨^U˦RU?û?.)J¥?h%BUièr?³ëɤRReͨR4¨àÂ)ànfª*/ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨRT?.%JTê¬nd?(¡¢4)àjf«¨%¢ji,©¢*?j¥³Zª¨%¢*ìjN?
bAfT?ªV²e?ªVeª,-R²+ɪ^D©,¥ºÅièrÜÌh«¢*?¨fD?¨^U˦RU?û?.)J¥?h%BEièr?³ëɤRReͨR4¨à CHARS=4211 SENTENCES=0 CSUM ERR=91
)ànfª*/ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨRT?.%JTê¬nd?(¡¢4)àjf«¨%¢ji,©¢*?j¥³Zªè%¢*ìªN?
bAfT?ªV²e?ªVeª,-R²+ɪ^D©,¥ºÅièrÜÌh«¢u?¨fD?¨^U˦RU?û?.)J¥?h%BEièr?³ëɤRReͨR4¨à CHARS=4366 SENTENCES=0 CSUM ERR=95
)ànfª*¯ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨRT?.%JTê¬nd?(¡ª4)àjf«¨%¢ji,©¢*?j¥³Zª¨%¢*ìêN?
bAfT?ªV²e?ªVeª,-R²+ɪ^D©,¥ºÅièr?(ʨV?ª¬/RªKÊj¥¢K?l-R?Ël­²¥?ª^²jË(¡ª4)àv³?Ê(%ª{Ëh/R²e©ªVªKË襲KÊ,)VeÊ,/¥¢{K¦n.l¥²U?¨V?ʬR²­?ªVEÉj%¢K«¬Re?,)¥^%?"ÅfDªê­RE ¬)¢{ªªjDª(%¢­),%¢+?h«² ª$J?èͬYnD?¨j?4)ànfª*¯ºJÊ(+ºEª¬Je?¨^UÊ¢VDʨRT?.%JTê¬nd?(¡ª4)àjf«¨%¢ji,©¢*?j¥³Zªè%¢*ìªN?
bAfT?ªV²e?ªVeª,-R²+ɪ^D©,¥ºÅièrÜÌh«¢ºJÊ Z­ë(©²)Ê*©^UÊ¢RRe©(+ª+?êB.àJɤRReͨR4¨à CHARS=4785 SENTENCES=0 CSUM ERR=101
)ànfª*/%¢*«¨%¢ji,©¢*?j¥³eÊl¥²Zê¬ndªn%JD?(Z&?"EjD?¨^U˦RU?û?j)²K?lB¥ièr?f̪R?ªl+V??,+R²zɬJ?˨RT©n1B.dJUª(%¢*Ì(+ºEª¬Je?¨^UÊ¢RRe©(+ª+?ìB.àJɤRReͨR4¨à CHARS=4940 SENTENCES=0 CSUM ERR=105
)ànfª*/%¢*«¨%¢ji,©¢*?j¥³eÊl¥²Zê¬ndªn%JD?(Z??"EjD?¨^U˦RU?û?j)²K?lB­ièr?f̪R?ªl+V??,+R²zɬJ?˨RT©n1B.dJUªh%¢*Ì(+ºEª¬Je?¨^UÊ¢RRe©(+ª+?ìB.àJɤRReͨR4¨à CHARS=5095 SENTENCES=0 CSUM ERR=109
)ànfªj)ºJÊ(+ºEª¬Je?¨^UÊ¢VD˨RT?.%JTê¬nd?(¡¢4)àjf«¨%¢ji,©¢*?j¥³Zª(%¢*ìjN?
bAfT?ªVeªl)R?ª¬JdɪVDÉl%ºÅièrÜÌh«¢*?¨fD?¨^U˦RU?û?.)J¥?h%BEièr?³ëɤRReͨR4¨àÂ)ànfªj)ºJÊ(+ºEª¬Je?¨^UÊ¢VD˨RT?.%JTê¬nd?(¡¢4)àjf«¨%¢ji,©¢*?j¥³Zªh%¢*ìªN?
bAfT?ªVeªl)R?ª¬JdɪVDÉl%ºÅièr?(ʨV?ª¬/RªKÊj¥¢K?l-R?Ël­²Z?ª^²jË(¡?4)àv³?Ê(%ª{Ëh/R²e©ªVªKÊ襲KÊ,+VeÊ,/¥ª{J¦n.l¥²U?¨V?ʬR²­?ªVEÉj%¢K«¬Re?,)¥^%?"ÅfDª*«RE ¬)¢{ªªjª%¢­),%¢?h«²?$J?èͬYnD???4 CHARS=5505 SENTENCES=0 CSUM ERR=116
)ànfªj©ºJÊ(+ºEª¬Je?¨^UÊ¢VD˨^T?.%JTê¬nd?(¡²4)àjf«¨%¢ji,©¢*?j¥³Zª(%¢*ìêN?
bAfT?ªV²e?ªVeª,-JdɪZD©l¥ºÍièrÜÌh«¢*?¨fD?¨^U˦RU?û?.)J¥?h%BUièr?³ëɤRReͨR4¨à CHARS=5659 SENTENCES=0 CSUM ERR=118
)ànfªj©ºJÊ(+ºEª¬Je?¨^UÊ¢VD˨RT?.%JTê¬nd?(¡ª4)àjf«¨%¢ji,©¢*?j¥³Zªh%¢*ìªN?
bAfT?ªVeªl)R?ª¬JdɪVDÉl%ºÅièrÜÌh«¢??¨fD?¨^U˦RU?û?.)J¥?h%BUièr?³ëɤRReͨR4¨àÂ)ànfªj)ºJÊ(+ºEª¬Je?¨^UÊ¢VD˨RT?.%JTê¬nd?(¡¢4)àjf«¨%¢ji,©¢*?j¥³Zª¨%¢*ì*§J??f̪R?Êl+Veª,-JdÉl%%º+ê(V??"ÅfDª*­RE ¬)¢{ªªjDª(%¢­),%¢+?h«² ?$J?èͬYnD?¨jD?lB?4 CHARS=5964 SENTENCES=0 CSUM ERR=125

Quick5pnt0

Do you have your serial monitor set to the same baud speed (115200) as the sketch?

rdeans

hi

thanks for your help

Yes, i have the same baud rate on the serial monitor as in the sketch

thanks

el_supremo

Does your GPS output at 4800 baud?
Mine outputs at 9600.

Pete

rdeans

hi pete

i changed the baud rate of the gps to 9600 and everything seems to be working fine....

Thank you so much for your help

:D


zoomkat

Is the output of your GPS rs232 or TTL?
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

Go Up