Page 1 sur 1

[Gps] Exporter parcours montre Garmin

Publié : lun. 08 août 2016, 11:16
par AchilleFraisse
Bonjour,

J'ai une montre Garmin 310XT. J'ai également un embout qu'on branche au port USB ANT+.
Lorsque je le branche, j'ai /dev/ttyUSB0 qui apparait.

J'essaie donc de lire ce qu'il y a dessus :

Code : Tout sélectionner

#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <sys/fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
 
int readMessage(int file, unsigned int nCountMax)
{
    int i,j;
	ssize_t bytes_read;
 
    if(file != -1)
    {
	    i = 0;
	    char data[1] = "";
 
		while(i<nCountMax)
		{
			bytes_read = read(file, data, sizeof(data));
			if(bytes_read > 0)
			{
			   	printf("%c", data[0]);
			   	i += bytes_read;
			}
		}

	    return 1;
    }
    else
        return 0;
};

void read_Serial_Port(const char* DEVICE_PORT)
{
	int file;
	struct termios options;
	unsigned int nCountMax = 60;
	int b;
 
	file = open(DEVICE_PORT, O_RDONLY | O_NOCTTY | O_NDELAY);
 
	if(file == -1)
        perror("Unable to open the serial port\n");

	printf("Serial port open successful !\n");
 
	tcgetattr(file, &options); 			
	cfsetispeed(&options, B9600); 					
	cfsetospeed(&options, B9600); 					
	options.c_cflag |= (CLOCAL | CREAD); 			  
	options.c_cflag |= PARENB; 					
	options.c_cflag |= PARODD; 						 					
	options.c_cflag &= ~CSIZE; 						
	options.c_cflag |= CS8;			
 
	printf("Reading serial port ...\n\n"); 
	b = readMessage(file, nCountMax);
 
	if(b == 0)
        printf("Error while reading serial port\n");
	else
        printf("\nSerial port read successful\n");
 
	close(file);
	printf("Serial port closed\n");
};

int main()
{
    const char port[] = "/dev/ttyUSB0";

    read_Serial_Port(port);

    return 0;
}
Mais ca ne m'affiche rien.

Comment puis-je exporter mes parcours .gpx sur mon PC à partir de ma montre ?

Re: [Gps] Exporter parcours montre Garmin

Publié : lun. 08 août 2016, 12:11
par waitnsea
Bonjour,
gvfs est bien installé ?

Re: [Gps] Exporter parcours montre Garmin

Publié : lun. 08 août 2016, 14:08
par AchilleFraisse
Oui :/
Je ne sais pas trop comment m'y prendre, mais je pense qu'il faut établir une socket entre ma montre Garmin et ANT+...

Re: [Gps] Exporter parcours montre Garmin

Publié : mar. 09 août 2016, 07:55
par AchilleFraisse
Personne ?

Re: [Gps] Exporter parcours montre Garmin

Publié : mar. 09 août 2016, 10:00
par doudou196
Salut Réponse rapide ,
Essaye de ce coté la
GitHub : https://github.com/xonel/GFrun
- Web : http://gfrun.fr.nf
- Forum (FR) : http://forum.ubuntu-fr.org/viewtopic.php?id=1267521
Pour ma part ca a fonctionné quelques fois, mais pas encore approfondi ... :)

Re: [Gps] Exporter parcours montre Garmin

Publié : mar. 09 août 2016, 12:02
par AchilleFraisse
J'ai essayé GFrun, mais je n'arrive pas à installer garminplugin

Re: [Gps] Exporter parcours montre Garmin

Publié : mar. 09 août 2016, 18:54
par doudou196
Gfrun te servira uniquement a rapatrier les fichier data en suite tu peut importer dans garminexpress ... si mes souvenir sont bon :)

Re: [Gps] Exporter parcours montre Garmin

Publié : mar. 09 août 2016, 20:05
par AchilleFraisse
Pour installer GFrun, il faut avoir installé garminplugin, mais je n'arrive pas à l'installer.