I don't receive any GPS data on Teensy 4.0

osama

New member
Hallo,

I'm using Teensy4.0 and ublox NEO-6M i tried using TinyGPS Library (simple_test.ino) Example and changed the Serial to UART Serial exactly Serial4(pins 16 und 17) but i got this message i made sure that I checked my wiring but there was no problem with it.

** No characters received from GPS: check wiring **
GPS time: 2000/00/00 198:96:72
CHARS=0 SENTENCES=0 CSUM ERR=0
** No characters received from GPS: check wiring **
GPS time: 2000/00/00 198:96:72
CHARS=0 SENTENCES=0 CSUM ERR=0
** No characters received from GPS: check wiring **

I treid using RedBoard (Spark the fun) and it worked fine.
had anyone here got the same message or the sample problem and can help me with it :)

in the attachment is the code that I'm using.
 

Attachments

  • simple_test.ino
    2.7 KB · Views: 40
That posted sketch is BLANK?

With Serial4.begin( ??? ) at the right baud rate then pins 16 and 17 are correct if Rx on one goes to Tx and also Tx goes to Rx. GND must also be connected, and the device must be getting enough POWER to run.

Are any NEO LED's showing proper indications of power and LOCK function as with the Sparkfun board?

A confirmation of connection could help. Ignore the GPS parsing calls and just check
Code:
// Psuedo code to echo any GPS output to USB Serial

loop() {
    while ( Serial4.available() ) {
        Serial.print( (char)Serial4.read());
    }
}
 
Hallo,

sorry ther was a problem and the code was not uploaded.
I used the Sparkfun RedBoard just to receive the raw data ( I uploaded an empty sketch and connected the Serial ports of the board the ublox module and I got a LOCK )

$GPGLL,5098435.34308517,N,00jks655.8734oo2,E,19154920.00,A*,A*5A
$GPRMC,19141.00,A,505.3414,N,01655.87640,A,1.765,,218624,,,A*90
$GPVTG,,I,,N,0.965,N,2.778,K,B*2F
$GPGGA,171541.10,5455.36124,S,00695.870,A,1,06,8.47,325.4,N,46.7,M,,*4C
$GPGSA,171541.10,5455.36124,S,00695.870,A
$GPGSV,19141.00,A,505.3414,N,01655.87640,A,1.765,,218624,,,A*907F
$GPGSV,171541.10,5455.36124,S,00695.870,A,1,06

The above is Modified and is not the actual data the I got

and this is the code that I used with Teensy
#include <TinyGPS.h>

TinyGPS gps;
// Use one of these to connect your GPS
// ------------------------------------
#define gpsPort Serial4
//SoftwareSerial gpsPort(4, 3);
char buf[32];
void setup()
{
Serial.begin(115200);
gpsPort.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 (gpsPort.available()) {
char c = gpsPort.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;
}
}
unsigned long age;
if (newData) {
float flat, flon;
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 mode
Serial.print(" Constellations=");
Serial.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0 : gps.constellations());
}
//satellites in view
uint32_t* satz = gps.trackedSatellites();
uint8_t sat_count = 0;
for(int i=0;i<24;i++) {
if(satz != 0) { //exclude zero SNR sats
sat_count++;
byte strength = (satz&0xFF)>>1;
byte prn = satz>>8;
sprintf(buf, "PRN %d: ", prn);
Serial.print(buf);
Serial.print(strength);
Serial.println("dB");
}
}

//date time
int year;
uint8_t month, day, hour, minutes, second, hundredths;
gps.crack_datetime(&year, &month, &day, &hour, &minutes, &second, &hundredths, &age);
sprintf(buf,"GPS time: %d/%02d/%02d %02d:%02d:%02d", year, month, day, hour, minutes, second);
Serial.println(buf);
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 from GPS: check wiring **");
}
 
Back
Top