GPRS

GPRS

Postby Manuel Valdenebro » Mon Oct 31, 2011 5:10 am

Necesito instalar en un server Linux, un módulo que recoja la traza que le envian unos GPS y la guarde en una MySql. Si alguien tiene algo funcionando, le agradecería se pusiera en contacto conmigo, para ponernos de acuerdo.

Mi correo valdenebro@mixmail.com
Un saludo

Manuel
User avatar
Manuel Valdenebro
 
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Re: GPRS

Postby JmGarcia » Thu Nov 03, 2011 7:58 am

¿ La traza que envia el GPS es de este tipo ?

Code: Select all  Expand view
$GPGLL,4318.958920,N,159.220420,W,190540.000,V,N*50
$GPRMC,190540.000,V,4998.958920,N,00229.220420,W,0.000,0.00,260109,,,N*5B
$GPVTG,0.00,T,,M,0.000,N,0.000,K,N*32
$GPZDA,190540.000,26,01,2009,,*51
$GPGLL,4318.994200,N,159.181240,W,190611.000,A,A*4E
$GPRMC,190611.000,A,4998.994200,N,00229.181240,W,3.227,0.00,260109,,,A*41
$GPVTG,0.00,T,,M,3.227,N,5.976,K,A*34
$GPZDA,190611.000,26,01,2009,,*56
$GPGLL,4318.915420,N,159.311920,W,190641.000,A,A*40
$GPRMC,190641.000,A,4998.915420,N,00229.311920,W,11.358,0.00,260109,,,A*75
$GPVTG,0.00,T,,M,11.358,N,21.035,K,A*36
$GPZDA,190641.000,26,01,2009,,*53
$GPGLL,4318.896580,N,159.422080,W,190711.000,A,A*41

Es decir: formato NMEA.
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.
FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013
User avatar
JmGarcia
 
Posts: 654
Joined: Mon May 29, 2006 3:14 pm
Location: Madrid - ESPAÑA

Re: GPRS

Postby Manuel Valdenebro » Sun Nov 06, 2011 10:28 pm

Estas son tres trazas:

STX356895036474164 b$GPRMC,185831.000,A,3644.7997,N,00429.6903,W,0.00,,281011,,,A*69,214,19,0BBC,25AA,22,84,1000,Store;04

STX356895036474164 b$GPRMC,180417.000,A,3643.2580,N,00425.7742,W,0.00,,061111,,,A*67,214,19,0BBC,25AA,22,84,1000,Timer;1C

STX356895036474164 b$GPRMC,185828.000,A,3644.7997,N,00429.6903,W,0.00,,281011,,,A*61,214,19,0BBC,25AA,22,84,1000,Store;04


Este es el protocolo tipo:

$GPRMC,101053.000,A,2232.7607,N,11404.7669,E,0.00,,231110,,,A*7F
STX + Referencia interna de cada trackers
Sentence $GPRMC
UTC Time 101053.000 hhmmss.sss
Status A A = Valid, V = Invalid
Latitude 2232.7607 ddmm.mmmm
N/S Indicator N N = North, S = South
Longitude 11404.7669 dddmm.mmmm
E/W Indicator E E = East, W = West
Speed over ground 0.00 Knots
Course over ground Degrees
UTC Date 231110 DDMMYY
Magnetic variation Degrees
Magnetic variation E = East, W = West
Checksum *7F
460,00,2795,0E6A,14,94,1000,0000,91,Timer;
Un saludo

Manuel
User avatar
Manuel Valdenebro
 
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Re: GPRS

Postby JmGarcia » Mon Nov 07, 2011 10:14 pm

Pues con el formato de datos del tipo de mensaje $GPRMC tienes todos los datos de posición ¿ no ?

Las trazas de este tipo que mencionas:
STX356895036474164 b$GPRMC,185831.000,A,3644.7997,N,00429.6903,W,0.00,,281011,,,A*69,214,19,0BBC,25AA,22,84,1000,Store;04
...contienen los mensajes NMEA.

El resto de datos "STX356895036474164 b" y ",214,19,0BBC,25AA,22,84,1000,Store;04" son particulares del aparato que los envía y tendrías que saber su contenido.

No entiendo pues tu pregunta.
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.
FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013
User avatar
JmGarcia
 
Posts: 654
Joined: Mon May 29, 2006 3:14 pm
Location: Madrid - ESPAÑA

Re: GPRS

Postby Manuel Valdenebro » Tue Nov 08, 2011 9:02 pm

Pues que no tengo un modulo-listener para instalar en el Servidor (es un hosting externo) y que recoja la traza y la guarde en una MySql. Me imagino que será algo programado en Java, PHP o Phyton. ¿Tu tienes algo parecido ya funcionando?.
Si me puedes echar una mano, te lo agradecería.
Un saludo

Manuel
User avatar
Manuel Valdenebro
 
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Re: GPRS

Postby JmGarcia » Wed Nov 09, 2011 12:29 pm

Pues para procesar la parte de la trama que es sentencia NMEA desarrolle un programa (en Windows XP) que las recibía por puerto serie.

Te dejo la parte del código fuente que procesa las sentanccias NMEA:
Code: Select all  Expand view
// "Texto" es la variable que contiene el string con la sentencia NMEA del tipo:
// $GPGGA,235947.000,0000.0000,N,00000.0000,E,0,00,0.0,0.0,M,,,,0000*00
// $GPGGA,092204.999,4250.5589,S,14718.5084,E,1,04,24.4,19.7,M,,,,0000*1F
// etc...

************************************************************** SENTENCIAS NMEA
*----------------------------------------------------------------- Seleccion()
function Seleccion(Texto)
do case
   case left(Texto,7)="$GPGGA,"
      ComandoGGA(Texto)
   case left(Texto,7)="$GPGSA,"
      ComandoGSA(Texto)
   case left(Texto,7)="$GPGSV,"
      ComandoGSV(Texto)
   case left(Texto,7)="$GPRMC,"
      ComandoRMC(Texto)
   case left(Texto,7)="$GPVTG,"
      ComandoVTG(Texto)
   otherwise
      ComandoOTROS(Texto)
endcase
return nil
*-------------------------------------------------------------- ComandoOTROS()
function ComandoOTROS(Texto)
if Texto=""
   return nil
endif
Texto:=substr(Texto,8)
return nil
*---------------------------------------------------------------- ComandoGGA()
function ComandoGGA(Texto) && Global positioning system fixed data
* $GPGGA Sentence (Fix data)
* Ejemplos $GPGGA,235947.000,0000.0000,N,00000.0000,E,0,00,0.0,0.0,M,,,,0000*00
*          $GPGGA,092204.999,4250.5589,S,14718.5084,E,1,04,24.4,19.7,M,,,,0000*1F
* ID $GPGGA
* Hora UTC Time 092204.999 hhmmss.sss
* Latitud 4250.5589 ddmm.mmmm
* Indicador N/S N=Norte, S=Sur
* Longitud 14718.5084 dddmm.mmmm
* Indicador E/W E=Este, W=Oeste
* Posicion fijada 0=Invalido, 1=Valido SPS, 2=Valido DGPS, 3=Valido PPS
* Satelites Vistos (0-12)
* Horizontal dilution of precision(HDOP)
* Altura en metros segun elipsoide WGS84
* Unidades altura M=metros
* Separacion geoide en metros segun elipsoide WGS84
* Unidades separación M=Metros
* Antigüedad de los datos DGPS en segundos
* ID estacion DGPS
* Checksum
* Terminador CR/LF  
*---
if Texto=""
   return nil
endif
Texto:=substr(Texto,8)
*--- Hora (hhmmss.sss)
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGGAhora:=left(cCampo,2)+":"+substr(cCampo,3,2)+":"+substr(cCampo,5,6)
*--- Latitud (ggmm.mmmm)
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGGAlat:=left(cCampo,2)+"º"+substr(cCampo,3,2)+"'"+str((val(substr(cCampo,6,4))/10000)*60,6,3)
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGGAlatNS:=cCampo
*--- Longitud (gggmm.mmmm)
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGGAlon:=left(cCampo,3)+"º"+substr(cCampo,4,2)+"'"+str((val(substr(cCampo,7,4))/10000)*60,6,3)
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGGAlonEW:=cCampo
*--- Posicion fijada
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGGAfix:=cCampo
*--- Satelites Vistos
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGGAsat:=cCampo
*--- Horizontal dilution of precision(HDOP)
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGGAhdop:=cCampo
*--- Altura en metros segun elipsoide WGS84
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGGAalt:=cCampo
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGGAualt:=cCampo
*--- Separacion geoide en metros segun elipsoide WGS84
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGGAsep:=cCampo
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGGAusep:=cCampo
*--- Antigüedad de los datos DGPS en segundos
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGGAseg:=cCampo
*--- ID estacion DGPS
cCampo:=left(Texto,at("*",Texto)-1)
Texto:=substr(Texto,at("*",Texto)+1)
cGGAdgps:=cCampo
*--- Checksum
cGGAcheck:=left(Texto,2)
*---
return nil
*---------------------------------------------------------------- ComandoGSA()
function ComandoGSA(Texto) && GNSS DOP and active satellites
* $GPGSA Sentence (Active satellites)
* Ejemplos:$GPGSA,A,1,,,,,,,,,,,,,0.0,0.0,0.0*30
*          $GPGSA,A,3,01,20,19,13,,,,,,,,,40.4,24.4,32.2*0A
* ID $GPGSA  
* Mode A=Auto 2D/3D, M=Forced 2D/3D
* Mode 1=No fix, 2=2D, 3=3D
* Satelite en uso  1
* Satelite en uso  2
* Satelite en uso  3
* Satelite en uso 12
* PDOP Position dilution of precision
* HDOP Horizontal dilution of precision
* VDOP Vertical dilution of precision
* Checksum
* Terminator CR/LF  
*---
if Texto=""
   return nil
endif
Texto:=substr(Texto,8)
*--- Mode 1
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSAmode1:=cCampo
*--- Mode 2
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSAmode2:=cCampo
*--- Satelite en uso 1-12
for Indice=1 to 12
   cCampo:=left(Texto,at(",",Texto)-1)
   Texto:=substr(Texto,at(",",Texto)+1)
   cGSAsat[Indice]:=cCampo
next Indice
*--- PDOP Position dilution of precision
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSApdop:=cCampo
*--- HDOP Horizontal dilution of precision
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSAhdop:=cCampo
*--- VDOP Vertical dilution of precision
cCampo:=left(Texto,at("*",Texto)-1)
Texto:=substr(Texto,at("*",Texto)+1)
cGSAvdop:=cCampo
*--- Checksum
cGSAcheck:=left(Texto,2)
*---
return nil
*---------------------------------------------------------------- ComandoGSV()
function ComandoGSV(Texto) && GNSS satellites in view
* $GPGSV Sentence (Satellites in view)
* Ejemplos: $GPGSV,1,1,01,21,00,000,*4B
*           $GPGSV,3,1,10,20,78,331,45,01,59,235,47,22,41,069,,13,32,252,45*70
* ID $GPGSV  
* Number of messages 3 Number of messages in complete message (1-3)
* Sequence number, Sequence number of this entry (1-3)
* Satellites in view
* Satellite ID 1 Range is 1-32
*           Elevation 1 Elevation in degrees (0-90)
*           Azimuth 1 Azimuth in degrees (0-359)
*           SNR 1 Signal to noise ration in dBHZ (0-99)
* Satellite ID 2 Range is 1-32
*           Elevation 2 Elevation in degrees (0-90)
*           Azimuth 2 Azimuth in degrees (0-359)
*           SNR 2 Signal to noise ration in dBHZ (0-99)
* Satellite ID 3 Range is 1-32
*           Elevation 3 Elevation in degrees (0-90)
*           Azimuth 3 Azimuth in degrees (0-359)
*           SNR 3 Signal to noise ration in dBHZ (0-99)
* Satellite ID 4 Range is 1-32
*           Elevation 4 Elevation in degrees (0-90)
*           Azimuth 4 Azimuth in degrees (0-359)
*           SNR 4 Signal to noise ration in dBHZ (0-99)
* Checksum
* Terminator CR/LF
*---
if Texto=""
   return nil
endif
*--- Number of messages
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVnum:=cCampo
*--- Sequence number
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVorden:=cCampo
*---
if cGSVorden="1"
   afill(nGanSat,0)
endif
*---
nOffSet:=iif(cGSVorden="1",0,iif(cGSVorden="2",4,iif(cGSVorden="3",8,0)))
*--- Satellites in view
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVsat:=cCampo
*--- Satellite ID 1
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVid1:=cCampo
*--- Elevation 1
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVelev1:=cCampo
*--- Azimuth 1
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVaci1:=cCampo
*--- SNR 1
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVdbhz1:=cCampo
*--- Satellite ID 2
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVid2:=cCampo
*--- Elevation 2
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVelev2:=cCampo
*--- Azimuth 2
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVaci2:=cCampo
*--- SNR 2
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVdbhz2:=cCampo
*--- Satellite ID 3
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVid3:=cCampo
*--- Elevation 3
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVelev3:=cCampo
*--- Azimuth 3
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVaci3:=cCampo
*--- SNR 3
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVdbhz3:=cCampo
*--- Satellite ID 4
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVid4:=cCampo
*--- Elevation 4
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVelev4:=cCampo
*--- Azimuth 4
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cGSVaci4:=cCampo
*--- SNR 4
cCampo:=left(Texto,at("*",Texto)-1)
Texto:=substr(Texto,at("*",Texto)+1)
cGSVdbhz4:=cCampo
*--- Checksum
cGSVcheck:=left(Texto,2)
*---
nGanSat[val(cGSVid1)+1]:=val(cGSVdbhz1)
nGanSat[val(cGSVid2)+1]:=val(cGSVdbhz2)
nGanSat[val(cGSVid3)+1]:=val(cGSVdbhz3)
nGanSat[val(cGSVid4)+1]:=val(cGSVdbhz4)
*---
return nil
*---------------------------------------------------------------- ComandoRMC()
function ComandoRMC(Texto) && Recommended minimum specific GNSS data
* $GPRMC Sentence (Position and time)
* Ejemplos $GPRMC,235947.000,V,0000.0000,N,00000.0000,E,,,041299,,*1D
*          $GPRMC,092204.999,A,4250.5589,S,14718.5084,E,0.00,89.68,211200,020.3,E*25
* ID $GPRMC  
* Hora UTC 092204.999 hhmmss.sss
* Status A A = Valido, V = Invalido
* Latitud 4250.5589 ggmm.mmmm
* Indicador N/S N=Norte, S=Sur
* Longitud 14718.5084 gggmm.mmmm
* Indicador E/W E=Este, W=Oeste
* Velocidad respecto del suelo 0.00 nudos (1nudo=1854mts)
* Rumbo sobre el suelo 0.00 Grados
* Día UTC 211200 DDMMAA
* Magnetic variation 020.3 Grados
* Magnetic variation E=Este, W=Oeste
* Checksum
* Terminador CR/LF  
*---
if Texto=""
   return nil
endif
Texto:=substr(Texto,8)
*--- Hora (hhmmss.sss)
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cRMChora:=left(cCampo,2)+":"+substr(cCampo,3,2)+":"+substr(cCampo,5,6)
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cRMCstatus:=cCampo
*--- Latitud (ggmm.mmmm)
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cRMClat:=left(cCampo,2)+"º"+substr(cCampo,3,2)+"'"+str((val(substr(cCampo,6,4))/10000)*60,6,3)
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cRMClatNS:=cCampo
*--- Longitud (gggmm.mmmm)
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cRMClon:=left(cCampo,3)+"º"+substr(cCampo,4,2)+"'"+str((val(substr(cCampo,7,4))/10000)*60,6,3)
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cRMClonEW:=cCampo
*--- Velocidad
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cRMCvelo:=cCampo
*--- Rumbo
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cRMCrumbo:=cCampo
*--- Día DDMMAA
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cRMCdia:=left(cCampo,2)+"/"+cTxtMeses[val(substr(cCampo,3,2))]+"/"+substr(cCampo,5,2)
*--- Declinación magnetica
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cRMCdecli:=cCampo
cCampo:=left(Texto,at("*",Texto)-1)
Texto:=substr(Texto,at("*",Texto)+1)
cRMCdecliEW:=cCampo
*--- Checksum
cRMCcheck:=left(Texto,2)
*---
return nil
*---------------------------------------------------------------- ComandoVTG()
function ComandoVTG(Texto) && Course over ground and ground speed
* $GPVTG Sentence (Course over ground)
* Ejemplos: $GPVTG,,T,,M,,N,,K*4E
*           $GPVTG,89.68,T,,M,0.00,N,0.0,K*5F
* Sentence ID   $GPVTG   
* Course    Course in degrees
* Reference T = True heading
* Course    Course in degrees
* Reference M=Magnetic heading
* Speed 0.00    Horizontal speed
* Units N   N=Knots
* Speed 0.00    Horizontal speed
* Units K   K=KM/h
* Mode indicator (A=Autonomous, D=Differential, E=Estimated, N=Data not valid)
* Checksum
* Terminator CR/LF 
*---
if Texto=""
   return nil
endif
Texto:=substr(Texto,8)
*--- Course
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cVTGrumbT:=cCampo
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cVTGrefT:=cCampo
*--- Course
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cVTGrumbM:=cCampo
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cVTGrefM:=cCampo
*--- Speed
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cVTGvelN:=cCampo
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cVTGunitN:=cCampo
*--- Speed
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cVTGvelK:=cCampo
cCampo:=left(Texto,at(",",Texto)-1)
Texto:=substr(Texto,at(",",Texto)+1)
cVTGunitK:=cCampo
*--- Mode indicator
cCampo:=left(Texto,at("*",Texto)-1)
Texto:=substr(Texto,at("*",Texto)+1)
cVTGmode:=cCampo
*--- Checksum
cVTGcheck:=left(Texto,2)
*---
return nil
*------------------------------------------------------------ Otras sentencias
* $GPGLL,4916.45,N,12311.12,W,225444,A*23 && Geographic position - latitude / longitude
*    4916.46,N    Latitude 49 deg. 16.45 min. North
*    12311.12,W   Longitude 123 deg. 11.12 min. West
*    225444       Fix taken at 22:54:44 UTC
*    A            Data valid or V (void)
*    *23          checksum data
*---
* $GPAPB,A,A,0.10,R,N,V,V,011,M,DEST,011,M,011,M*82*23 && Autopilot format "B"
*    A       Loran-C blink/SNR warning, general warning
*    A       Loran-C cycle warning
*    0.10    cross-track error distance
*    R       steer Right to correct (or L for Left)
*    N       cross-track error units - nautical miles (K for kilometers)
*    V       arrival alarm - circle
*    V       arrival alarm - perpendicular
*    011,M   magnetic bearing, origin to destination
*    DEST    destination waypoint ID
*    011,M   magnetic bearing, present position to destination
*    011,M   magnetic heading to steer (bearings could True as 033,T)
*    *23     checksum data
*---
* $GPBWC,225444,4917.24,N,12309.57,W,051.9,T,031.6,M,001.3,N,004*29 && Bearing and Distance to Waypoint, Great Circle
*    225444       UTC time of fix 22:54:44
*    4917.24,N    Latitude of waypoint
*    12309.57,W   Longitude of waypoint
*    051.9,T      Bearing to waypoint, degrees true
*    031.6,M      Bearing to waypoint, degrees magnetic
*    001.3,N      Distance to waypoint, Nautical miles
*    004          Waypoint ID
*    *29          checksum
*---
* $GPXTE,A,A,0.67,L,N*07 && Cross-Track Error, Measured
*    A            General warning flag V = warning
*                         (Loran-C Blink or SNR warning)
*    A            Not used for GPS (Loran-C cycle lock flag)
*    0.67         cross track error distance
*    L            Steer left to correct error (or R for right)
*    N            Distance units - Nautical miles
*    *07          checksum
*---
* $GPHDT,056.2,T*07 && Heading True
* Actual vessel heading in degrees Ture produced by any device or system producing true heading.
*    x.x Heading, degrees True
*    T = True
*    *07 checksum
*---
* $GPHDM,056.2,M*07 && Heading magnetic
*    x.x Heading, degrees magnetic
*    M = Magnetic
*    *07 checksum
*---
* $GPVWR,040,L,10.0,N,00.0,M,00.0,K*07 && Relative wind direction and speed
*
*------------------------------------------------------ NUEVAS DE GARMIN GPS12
* $GPBOD,045.,T,023.,M,DEST,STRAT,*47 && Bearing, origin to destination
*    045.,T bearing 045 degrees True from "START" to "DEST"
*    023.,M breaing 023 degrees Magnetic from "START" to "DEST"
*    DEST   destination waypoint ID
*    STRAT  origin waypoint ID
*    *47 checksum
*---
* $GPRTE,1,1,c,0*07 && Routes
* $GPRTE,2,1,c,0,PBRCPK,PBRTO,PTELGR,PPLAND,PYAMBU,PPFAIR,PWARRN*73 && Routes
* $GPRTE,2,2,c,0,PCRESY,GRYRIE,GCORIO,GWERR,GWESTG,7FED*34
*        1 2 3 4 5 ..
* Number of sentences in sequence
* Sentence number
* 'c' = Current active route, 'w' = waypoint list starts with destination waypoint
* Name or number of the active route
* onwards, Names of waypoints in Route
*---
* $GPRMB,A,0.66,L,003,004,4917.24,N,12309.57,W,001.3,052.5,000.5,V*0B && Recommended minimum navigation info
*    A            Data status A = OK, V = warning
*    0.66,L       Cross-track error (nautical miles, 9.9 max.), steer Left to correct (or R = right)
*    003          Origin waypoint ID
*    004          Destination waypoint ID
*    4917.24,N    Destination waypoint latitude 49 deg. 17.24 min. N
*    12309.57,W   Destination waypoint longitude 123 deg. 09.57 min. W
*    001.3        Range to destination, nautical miles
*    052.5        True bearing to destination
*    000.5        Velocity towards destination, knots
*    V            Arrival alarm  A = arrived, V = not arrived
*    *0B          checksum
*---
* $PGRME,15.0,M,45.0,M,25.0,M*22 && Estimated Position Error (solo Garmin)
*    15.0,M       Estimated horizontal position error in metres (HPE)
*    45.0,M       Estimated vertical error (VPE) in metres
*    25.0,M       Overall spherical equivalent position error
*    *22          checksum
*---
* $PGRMZ,93,f,3*21 && Altitude Information
*    93,f Altitude in feet (f=feet)
*    3    Position fix dimensions 2=user altitude, 3=GPS altitude
*    This sentence shows in feet, regardless of units shown on the display.
*---
* $PGRMM,WGS 84*06 && Map Datum (solo Garmin)
* $PGRMM,Astrln Geod '66*51
* $PGRMM,NAD27 Canada*2F
* Currently active horizontal datum
*---
* $PSLIB && Control de baliza receptora (solo Garmin)
* Las correcciones de DGPS se aceptan en formato RTCM-104 versión 2.1
*---
* $GPR00,EGLL,EGLM,EGTB,EGUB,EGTK,MBOT,EGTB,,,,,,,*58 && List of waypoint IDs in currently active route
* List of waypoints. This alternates with $GPWPL cycle which itself cycles waypoints.
*---
* $GPWPL,4917.16,N,12310.64,W,003*65 && Waypoint location
*    4917.16,N    Latitude of waypoint
*    12310.64,W   Longitude of waypoint
*    003          Waypoint ID
*    When a route is active, this sentence is sent once for each
*    waypoint in the route, in sequence. When all waypoints have
*    been reported, GPR00 is sent in the next data set. In any
*    group of sentences, only one WPL sentence, or an R00
*    sentence, will be sent.
*-----------------------------------------------------------------------------
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.
FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013
User avatar
JmGarcia
 
Posts: 654
Joined: Mon May 29, 2006 3:14 pm
Location: Madrid - ESPAÑA

Re: GPRS

Postby Manuel Valdenebro » Thu Nov 10, 2011 3:08 pm

Muchisimas gracias JM, pero yo creo que me he expresado mal.

Creo que este código lo estas usando en un servidor propio, que recibe la información por socket. Pero mi servidor es un hosting en internet, normal y corriente. Por tanto, creo que necesita un "listener" para escuchar los puertos y una vez leida la traza, entonces "passearla" y grabarla en la base de datos.

Por lo que he leido, esto se hace normalmente con Java, Phyton o PHP.

Daniel Garcia me comento que tiene un servidor dedicado, donde si puede colocar un socket y trabajarlo con Harbour/xHarbour. Pero yo tengo un hosting normal y corriente (mas economico) y ahi creo que es necesario otro tipo de programación. Ojalá esté equivocado.

Tus comentarios se agradecen.
Un saludo

Manuel
User avatar
Manuel Valdenebro
 
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Re: GPRS

Postby JmGarcia » Thu Nov 10, 2011 9:21 pm

Manuel Valdenebro wrote:Creo que este código lo estas usando en un servidor propio, que recibe la información por socket...

Mi aplicación lee de un puerto serie directamente.



Manuel Valdenebro wrote:...Pero mi servidor es un hosting en internet, normal y corriente...

La conexión es TCP o UDP (multicast)
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.
FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013
User avatar
JmGarcia
 
Posts: 654
Joined: Mon May 29, 2006 3:14 pm
Location: Madrid - ESPAÑA

Re: GPRS

Postby Manuel Valdenebro » Thu Nov 10, 2011 10:08 pm

La conexión es TCP
Un saludo

Manuel
User avatar
Manuel Valdenebro
 
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Re: GPRS

Postby JmGarcia » Sat Nov 12, 2011 4:27 pm

Conexión TCP.

"cIPhostTCP" es la dirección IP del servidor y "nPuertoTCP" el número de puerto TCP. "INetSetTimeout(pSocket,5000)" es el tiempo de espera de las funciones de captura como "INetRecv" para que no se quede colgada la aplicación si no recibe nada.
Iniciar sesión:
Code: Select all  Expand view
INetInit()
pSocket:=INetConnectIP(cIPhostTCP,nPuertoTCP)
if INetErrorCode(pSocket)<>0
   MsgAlert("Socket error:"+;
            INetErrorDesc(pSocket)+;
            " ("+alltrim(str(INetErrorCode(pSocket)))+")","¡ AVISO !")
   INetClose(pSocket)
   quit
endif
INetSetTimeout(pSocket,5000)


"nBytes" número de bytes recibidos, "cBuffer" contenedor de caracteres recibidos.
Lectura de datos:
Code: Select all  Expand view
cBuffer:=space(1500)
nBytes:=INetRecv(pSocket,@cBuffer)
cBuffer:=left(cBuffer,nBytes)
Esto ultimo puede estar metido en un bucle de captura.

Cerrar sesión:
Code: Select all  Expand view
INetClose(pSocket)
INetCleanUp()


P.D.: Esto es como yo lo hago para Windows-XP.
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.
FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013
User avatar
JmGarcia
 
Posts: 654
Joined: Mon May 29, 2006 3:14 pm
Location: Madrid - ESPAÑA

Re: GPRS

Postby Manuel Valdenebro » Sat Nov 12, 2011 11:08 pm

Muchas Gracias JM
Un saludo

Manuel
User avatar
Manuel Valdenebro
 
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España


Return to FiveWin para Pocket PC

Who is online

Users browsing this forum: No registered users and 7 guests