RASP-GPS-ULTIME-Brancher

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

Introduction

La manière la plus simple de commencer est d'utiliser un câble convertisseur convertisseur USB vers TTL série (outil abordable) avec votre module GPS.

Il est bien entendu possible d'utiliser directement l'UART Matériel de votre Pi, mais comme vous le constaterez sur ce tutoriel d'AdaFruit (Freeing UART on the Pi), c'est un peu plus compliqué d'autant qu'utiliser un adaptateur USB ne porte pas à conséquence.

Dans ce tutoriel, nous partons du principe que vous utilisez:

  1. Le convertisseur "USB vers TTL Série" mentionné ci-dessus,
  2. Que vous avez Occidentalis ou Rasbian utilisant le superbe WebIDE.

Occidentalis & Rasbian disposent déjà des pilotes pour les convertisseurs à base de PL2303, ce qui signifie que vous avez juste besoin de le brancher et il devrait apparaître comme /dev/ttyUSB0.

Brancher le Breakout

La première étape à réaliser est de brancher votre breakout GPS Ultime (Ultimate GPS) sur votre PI à l'aide de l'adaptateur "USB vers TTL série". Le diagramme ci-dessous montre comment procéder, l'essentiel est de connecter les câbles de même couleur ensemble.

RASP-GPS-ULTIME-Brancher-01.jpg

Même si le module GPS Ultime dispose d'une antenne exceptionnellement sensible, permettant une utilisation à couvert et à l'intérieur, vous pourriez également opter pour une antenne GPS externe et un câble adaptateur SMA vers uFL/u.FL/IPX/IPEX RF pour une utilisation à l'interieur/à couvert/indoor. Cela permet d'utiliser un Pi et le GPS en les gardant à l’intérieur d'un véhicule et de passer l'antenne par la fenêtre (ou près de celle-ci) pour améliorer la fiabilité et l'intégrité du signal.

Configurer l'adaptateur USB

Once you plug the USB cable into the Pi, the adapter should show up as /dev/ttyUSB0 (though the '0' may be different if you have other ttyUSB adapters present).

You can see a list of all ttyUSB devices by entering the following into the console (I'm using the 'terminal' feature in Adafruit's browser-based WebIDE here for convenience sake!):

ls /dev/ttyUSB*

RASP-GPS-ULTIME-Brancher-10.png

If you have any problems, you can enter the following command to see the USB devices on your Pi:

sudo lsusb

Which should show you the USB adapter (Prolific PL2303), as follows:

RASP-GPS-ULTIME-Brancher-11.png

If you just want to do a quick check to see what data is coming out of the GPS, you can enter the following command, following by CTRL+ to quit:

sudo cat /dev/ttyUSB0

Installing a GPS Daemon (gpsd)

The next step is installing some software on your Raspberry Pi that understands the serial data that your GPS module is providing via /dev/ttyUSB0. Thankfully other people have already done all the hard work for you of properly parsing the raw GPS data, and we can use (amongst other options) a nice little package named 'gpsd', which essentially acts as a layer between your applications and the actual GPS hardware, gracefully handling parsing errors, and providing a common, well-defined interfaces to any GPS module.

To install gpsd, simply run the following commands from the console:

sudo apt-get install gpsd gpsd-clients python-gps

... which will install the required packages (an internet connection will be required for this step!)

sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock

... which will point the gps daemon to our GPS device on the USB to TTY adapter cable (simply substitute '/dev/ttyUSB0' for another destination if required).

Testing it Out

After a few seconds, gpsd should open up the proper socket and if the GPS is locked we should be able to get some data from the GPS module.

To test this, we can use the following command:

cgps -s

If you have a fix, you'll see something like the following information in the terminal window:


RASP-GPS-ULTIME-Brancher-12.png

sudo killall gpsd
sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock

Source: Adafruit Ultimate GPS on the Raspberry Pi écrit par Kevin Townsend pour Adafruit Industrie
Traduction réalisée par Meurisse D pour MCHobby.be.

Créé par Kevin Townsend pour AdaFruit Industries.

Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : «  Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.

L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.

Traduit avec l'autorisation d'AdaFruit Industries - Translated with the permission from Adafruit Industries - www.adafruit.com