FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Pocket PC GPRS
Posts: 711
Joined: Thu Oct 06, 2005 09:57 PM
GPRS
Posted: Mon Oct 31, 2011 05: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
Posts: 654
Joined: Mon May 29, 2006 03:14 PM
Re: GPRS
Posted: Thu Nov 03, 2011 07:58 AM
驴 La traza que envia el GPS es de este tipo ?

Code (fw): Select all Collapse
$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
Posts: 711
Joined: Thu Oct 06, 2005 09:57 PM
Re: GPRS
Posted: 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,,,A7F
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
Posts: 654
Joined: Mon May 29, 2006 03:14 PM
Re: GPRS
Posted: 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
Posts: 711
Joined: Thu Oct 06, 2005 09:57 PM
Re: GPRS
Posted: Tue Nov 08, 2011 09: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
Posts: 654
Joined: Mon May 29, 2006 03:14 PM
Re: GPRS
Posted: 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 (fw): Select all Collapse
// "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
Posts: 711
Joined: Thu Oct 06, 2005 09:57 PM
Re: GPRS
Posted: Thu Nov 10, 2011 03: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
Posts: 654
Joined: Mon May 29, 2006 03:14 PM
Re: GPRS
Posted: Thu Nov 10, 2011 09: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
Posts: 711
Joined: Thu Oct 06, 2005 09:57 PM
Re: GPRS
Posted: Thu Nov 10, 2011 10:08 PM

La conexi贸n es TCP

Un saludo



Manuel
Posts: 654
Joined: Mon May 29, 2006 03:14 PM
Re: GPRS
Posted: Sat Nov 12, 2011 04: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 (fw): Select all Collapse
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 (fw): Select all Collapse
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 (fw): Select all Collapse
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
Posts: 711
Joined: Thu Oct 06, 2005 09:57 PM
Re: GPRS
Posted: Sat Nov 12, 2011 11:08 PM

Muchas Gracias JM

Un saludo



Manuel

Continue the discussion