Bonjour à tous.
Je suis bloqué par un probleme : un module GPS TRIMBLE Copernicus II
Je n arrive pas à recevoir la moindre trame.
J ai bien une antenne amplifié sur ce boitier branché.
Ce module possede Deux Ports . Y aurait il un protocole differents sur les deux ports.
pour info j utilise le port A.
Ce modèle de boitier est renommé pour sa synchronisation rapide.
merci de vos commentaires.
J utilise ce programme suivant.
*/
#include <string.h> #include <ctype.h>
int ledPin = 13; // LED test pin
int rxPin = 0; // RX PIN
int txPin = 1; // TX TX
int byteGPS=-1;
char linea[300] = "";
char comandoGPR[7] = "$GPRMC";
int cont=0;
int bien=0;
int conta=0;
int indices[13];
void setup() {
pinMode(ledPin, OUTPUT); // Initialize LED pin
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
Serial.begin(4800);
for (int i=0;i<300;i++){ // Initialize a buffer for received data
linea*=' ';*
} * } void loop() {
digitalWrite(ledPin, HIGH);*
byteGPS=Serial.read(); // Read a byte of the serial port*
if (byteGPS == -1) { // See if the port is empty yet*
delay(100);*
} else {*
linea[conta]=byteGPS; // If there is serial port data, it is put in the buffer*
conta++; *
Serial.print(byteGPS, BYTE);*
if (byteGPS==13){ // If the received byte is = to 13, end of transmission*
digitalWrite(ledPin, LOW);*
cont=0;*
bien=0;*
for (int i=1;i<7;i++){ // Verifies if the received command starts with $GPR*
_ if (linea*==comandoGPR[i-1]){_
_ bien++;_
_ }_
_ }_
_ if(bien==6){ // If yes, continue and process the data*_ * for (int i=0;i<300;i++){* _ if (linea*==','){ // check for the position of the "," separator*
* indices[cont]=i; cont++; } if (linea==''){ // ... and the "" indices[12]=i; cont++; } } Serial.println(""); // ... and write to the serial port* * Serial.println(""); Serial.println("---------------"); for (int i=0;i<12;i++){ switch(i){ case 0 :Serial.print("Time in UTC (HhMmSs): ");break; case 1 :Serial.print("Status (A=OK,V=KO): ");break; case 2 :Serial.print("Latitude: ");break; case 3 :Serial.print("Direction (N/S): ");break; case 4 :Serial.print("Longitude: ");break; case 5 :Serial.print("Direction (E/W): ");break; case 6 :Serial.print("Velocity in knots: ");break; case 7 :Serial.print("Heading in degrees: ");break; case 8 :Serial.print("Date UTC (DdMmAa): ");break; case 9 :Serial.print("Magnetic degrees: ");break; case 10 :Serial.print("(E/W): ");break; case 11 :Serial.print("Mode: ");break; case 12 :Serial.print("Checksum: ");break; } for (int j=indices;j<(indices[i+1]-1);j++){ Serial.print(linea[j+1]); } Serial.println(""); } Serial.println("---------------"); } conta=0; // Reset the buffer* * for (int i=0;i<300;i++){ // linea=' '; } } } }*_
==> Vérifie bien si les trames envoyées sont correctes :
C'est peut-être ce que tu envoi qui n'est pas correcte...
Essaie de vérifier les trames que tu envoi avec un logiciel de monitoring RS232.
Je te conseille de télécharger docklight, puis tu scan le port usb de ton arduino et tu verras dans la fenêtre de droite toutes les trames envoyées.
Ce qui permettra bien de voir si c'est bien du ASCII qui est envoyé.
==> C'est peut être la vitesse en baud qui n'est pas correcte ? Tu l'as lu quelque part qu'il faut mettre 4800 bauds?
du texte arrive mais c est du n importe quoi : " @@ Fààd ÿ à ààbh"
et j en passe et des meilleurs.
Je me suis mal fait comprendre je crois.
Oui j'ai vu ça ...
Mais j'aimerai savoir si tu l'as lu quelque part dans la doc ou bien tu as pris le code quelque part et tu as laissé comme ça. Ou bien tu as mis ça au pif...
Essaie ce que t'as dit Jean-François (post juste au dessus), c'est surement la vitesse du port série qui n'est pas correcte.