Go Down

Topic: GPS LACT.DE UG-200 (Read 2495 times) previous topic - next topic

amignec

Hello to everybody,
I am trying to read gps datas from my old pda gps receiver, LACT.DE UG-200 but without success.
I am using the TinyGPS library but it is not working, reading from the rx pin I have a string made from integers numbers like:
167
149
147
167
157
141
159
167
and so on..

I think the GPS receiver is working but I dont know how to parse that numbers.
Any idea?

Thank you in advance..


PaulS

Quote
I think the GPS receiver is working but I dont know how to parse that numbers.
Any idea?

Oooh, oooh. I have an idea. How about you post some code?

amignec

Quote
I have an idea. How about you post some code?


I used TinyGPS example and also this code:

#include <NewSoftSerial.h>
#include <TinyGPS.h>

// Si definiscono i pin usati per la comunicazione con Arduino ed il baud rate del modulo GPS
#define RXPIN 3
#define TXPIN 2
#define GPSBAUD 4800

// Viene creata un'istanza all'oggetto TinyGPS
TinyGPS gps;
// Si inizializza la libreria NewSoftSerial utilizzata per la comunicazione con il modulo GPS
NewSoftSerial uart_gps(RXPIN, TXPIN);

// Si dichiara un prototipo per la funzione della libreria TinyGPS.
void getgps(TinyGPS &gps);

void setup()
{
// Si inizializza il modulo UART per la comunicazione con il PC.
Serial.begin(115200);
// Si imposta il baud rate per il modulo GPS
uart_gps.begin(GPSBAUD);

// Testo iniziale inviato dallo sketch verso il PC
Serial.println("");
Serial.println("GPS Shield QuickStart Example Sketch v12");
Serial.println("       ...waiting for lock...           ");
Serial.println("");
}


// Il loop principale semplicemente aspetta l'arrivo di una sentenza valida dal modulo GPS
// quindi ne estrae le sotto stringhe richieste e le invia al PC

void loop()
{
while(uart_gps.available())     // Aspetta l'arrivo di dati validi
{
int c = uart_gps.read();    // Carica i dati ricevuti nella variabile c
if(gps.encode(c))      // Verifica congruenza dati
{
getgps(gps);         // Estrapola le sottostringhe di dati e le invia al PC
}
}
}


void getgps(TinyGPS &gps)
{

// Richiama la funzione che estrapola dalla sentenza i dati relativi alla posizione
float latitude, longitude;
gps.f_get_position(&latitude, &longitude);

// Invia al PC i dati estrapolati
Serial.print("Lat/Long: ");
Serial.print(latitude,5);
Serial.print(", ");
Serial.println(longitude,5);

// Richiama la funzione che estrapola dalla sentenza i dati relativi alla data
int year;
byte month, day, hour, minute, second, hundredths;
gps.crack_datetime(&year,&month,&day,&hour,&minute,&second,&hundredths);

// Invia al PC i dati estrapolati
Serial.print("Date: "); Serial.print(month, DEC); Serial.print("/");
Serial.print(day, DEC); Serial.print("/"); Serial.print(year);
Serial.print("  Time: "); Serial.print(hour, DEC); Serial.print(":");
Serial.print(minute, DEC); Serial.print(":"); Serial.print(second, DEC);
Serial.print("."); Serial.println(hundredths, DEC);

// Si può usare una sintassi diretta per inviare al PC i dati estratti
Serial.print("Altitude (meters): "); Serial.println(gps.f_altitude()); 
Serial.print("Course (degrees): "); Serial.println(gps.f_course());
Serial.print("Speed(kmph): "); Serial.println(gps.f_speed_kmph());
Serial.println();

// Here you can print statistics on the sentences.
unsigned long chars;
unsigned short sentences, failed_checksum;
gps.stats(&chars, &sentences, &failed_checksum);
//Serial.print("Failed Checksums: ");Serial.print(failed_checksum);
//Serial.println(); Serial.println();
}

And using:  Serial.println(uart_gps.read());  I checked what I was reading from the gps module: integers numbers.
As I can see in the code:  int c = uart_gps.read(); so the code is waiting for integers numbers but blocked here:  if(gps.encode(c))

PaulS

Do you have a link to the GPS?

amignec

Quote
Do you have a link to the GPS?


I found this links on the net:
http://www.icpdas.com/products/GSM_GPRS/wireless/UG-200-RS232.htm
and
http://www.freewtc.com/products/gps-mouse-receiver-rs232-or-usb-1570-61296.htm
and
http://www.freewtc.com/products/gps-mouse-receiver-rs232-or-usb-1570-61296.htm

mine is RS232 version, it use LS4000 gps detector. It work on my pda, maybe there is some problem with the protocol.. :(

PaulS

Quote
mine is RS232 version, it use LS4000 gps detector. It work on my pda, maybe there is some problem with the protocol..

More likely, it is a problem with voltage levels. RS232 is +/- 12V. The Arduino is TTL (0/5V) which is also inverted. You possibly need a MAX232 chip in between.

amignec

Quote
problem with voltage levels. RS232


Thank you very much, you could be right, I was not thinking about this problem.
I opend the gps box and i found this chip: http://www.datasheetcatalog.org/datasheet/sipex/SP385EET.pdf
my tx and rx cables are connected to his pins  9 and 8 so I thought to solder 2 cables to pins 12 and 13 of that chip to catch the ttl levels as you can see in the datasheet. We will see if I will be lucky.

Thank you again PaulS.

amignec

well, I soldered  to pin 12 and 13 of that chip so I suppose now I have ttl signals but I have again numbers.. integers numbers that TinyGps doesn't like.   :~ :~ :~ :~

PaulS

Quote
so I suppose now I have ttl signals

Without actually measuring anything, you're just guessing. Sooner or later, you are going to burn up the Arduino. Then, it won't matter what your GPS is outputting.

Quote
but I have again numbers.. integers numbers that TinyGps doesn't like.

Need to see the code (use the # icon!) and some sample output.

amignec

Quote
Without actually measuring anything, you're just guessing. Sooner or later, you are going to burn up the Arduino.

I checked with oscilloscope and now the output signal from the pin13 of that chip is 3.3 V but still reading numbers without no sense maybe.
Quote
Need to see the code (use the # icon!) and some sample output.


Code: [Select]

#include <NewSoftSerial.h>
#include <TinyGPS.h>

// Si definiscono i pin usati per la comunicazione con Arduino ed il baud rate del modulo GPS
#define RXPIN 3
#define TXPIN 2
#define GPSBAUD 4800

// Viene creata un'istanza all'oggetto TinyGPS
TinyGPS gps;
// Si inizializza la libreria NewSoftSerial utilizzata per la comunicazione con il modulo GPS
NewSoftSerial uart_gps(RXPIN, TXPIN);

// Si dichiara un prototipo per la funzione della libreria TinyGPS.
void getgps(TinyGPS &gps);

void setup()
{
// Si inizializza il modulo UART per la comunicazione con il PC.
Serial.begin(115200);
// Si imposta il baud rate per il modulo GPS
uart_gps.begin(GPSBAUD);

// Testo iniziale inviato dallo sketch verso il PC
Serial.println("");
Serial.println("GPS Shield QuickStart Example Sketch v12");
Serial.println("       ...waiting for lock...           ");
Serial.println("");
}


// Il loop principale semplicemente aspetta l'arrivo di una sentenza valida dal modulo GPS
// quindi ne estrae le sotto stringhe richieste e le invia al PC

void loop()
{
while(uart_gps.available())     // Aspetta l'arrivo di dati validi
{
int c = uart_gps.read();    // Carica i dati ricevuti nella variabile c
if(gps.encode(c))      // Verifica congruenza dati
{
getgps(gps);         // Estrapola le sottostringhe di dati e le invia al PC
}
}
}


void getgps(TinyGPS &gps)
{

// Richiama la funzione che estrapola dalla sentenza i dati relativi alla posizione
float latitude, longitude;
gps.f_get_position(&latitude, &longitude);

// Invia al PC i dati estrapolati
Serial.print("Lat/Long: ");
Serial.print(latitude,5);
Serial.print(", ");
Serial.println(longitude,5);

// Richiama la funzione che estrapola dalla sentenza i dati relativi alla data
int year;
byte month, day, hour, minute, second, hundredths;
gps.crack_datetime(&year,&month,&day,&hour,&minute,&second,&hundredths);

// Invia al PC i dati estrapolati
Serial.print("Date: "); Serial.print(month, DEC); Serial.print("/");
Serial.print(day, DEC); Serial.print("/"); Serial.print(year);
Serial.print("  Time: "); Serial.print(hour, DEC); Serial.print(":");
Serial.print(minute, DEC); Serial.print(":"); Serial.print(second, DEC);
Serial.print("."); Serial.println(hundredths, DEC);


Serial.print("Altitude (meters): "); Serial.println(gps.f_altitude());
Serial.print("Course (degrees): "); Serial.println(gps.f_course());
Serial.print("Speed(kmph): "); Serial.println(gps.f_speed_kmph());
Serial.println();

// Here you can print statistics on the sentences.
unsigned long chars;
unsigned short sentences, failed_checksum;
gps.stats(&chars, &sentences, &failed_checksum);
//Serial.print("Failed Checksums: ");Serial.print(failed_checksum);
//Serial.println(); Serial.println();
}


PaulS

Quote
Need to see the code (use the # icon!) and some sample output.

amignec

Quote
and some sample output.

Yes, sorry, I forgot to paste it..
from gps module using: Serial.println(uart_gps.read()); i get this numbers:

230
24
158
152
120
230
120
6
207
12
240
24
248
24
231
24
158
24
158
152
224
24
231
24
158
152
120
6
240
12
207
24
224
152
230
152
230
24
158
24
and so on...  :(

PaulS

The only other thing that might be happening is that the data is inverted. Fortunately, the NewSoftSerial class can un-invert the data for you, if you set the (optional) 3rd argument to true.

wayneft

It could also be the GPS is in binary output mode instead of NMEA ouput.
I2C GPS Shield

Checkout my Open Source GPS Tracker on Kickstarter

amignec


The only other thing that might be happening is that the data is inverted. Fortunately, the NewSoftSerial class can un-invert the data for you, if you set the (optional) 3rd argument to true.

Tryed.... nothing... still numbers.. differents but still only numbers without a way to parse them.


It could also be the GPS is in binary output mode instead of NMEA ouput.

If you are right is there ia easy way to read the data?

Thank you..

maybe it is the time to think to buy a new gps module..

Go Up