Différences entre versions de « Galileo-Terminal »

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche
Ligne 2 : Ligne 2 :
  
 
== Using the Terminal ==
 
== Using the Terminal ==
 +
{{bloc-etroit|text=Ce qui rend Galileo vraiment unique c'est le fait qu'il y a un système Linux sous le capot. Vous pouvez interagir avec l'OS Linux par l'intermédiaire d'un terminal, exécutant de simples commande par l'intermédiaire d'une interface en ligne de commande. En comparaison avec le téléversement d'un sketch/croquis Arduino, interagir avec la ligne de commande Linux est une compétence nettement plus avancée mais c'est aussi un bon point de départ pour apprendre quelque-chose.
  
What makes the Galileo truly unique is the fact that it has Linux running under the hood. You can interact with the Linux OS through the terminal, executing simple commands through a command-line interface. In comparison to uploading Arduino sketches, interacting with the Linux command line is a much more advanced skill, but this is as good a place as any to start learning.
+
Il y a deux façons différentes de se connecter sur le terminal Linux:
 +
# via la prise stéréo  3.5mm (qui est un port RS-232)
 +
# via USB.  
  
There are two different ways to connect to the Linux terminal: over the 3.5mm stereo jack RS-232 port or over USB. The former requires a special cable (or two), and the latter requires you to upload a special Arduino sketch. We’ll cover both on this page, there are pros and cons to each approach.
+
La première méthode nécessite un câble spécial (ou deux)... et la deuxième nécessite le téléversement d'une sketch/croquis Arduino spécial.  
  
Both of these methods require that you have a terminal emulator installed on your computer.  
+
Nous allons aborder les deux méthodes dans cette page mais sachez qu'il y a des plus et des moins à chacune de ces approches.
 +
 
 +
Ces deux méthodes nécessite l'usage d'un émulateur de terminal qui doit être installé sur votre ordinateur.}}
  
 
== Terminal RS-232 ==
 
== Terminal RS-232 ==

Version du 13 avril 2014 à 20:44


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.

Using the Terminal

Ce qui rend Galileo vraiment unique c'est le fait qu'il y a un système Linux sous le capot. Vous pouvez interagir avec l'OS Linux par l'intermédiaire d'un terminal, exécutant de simples commande par l'intermédiaire d'une interface en ligne de commande. En comparaison avec le téléversement d'un sketch/croquis Arduino, interagir avec la ligne de commande Linux est une compétence nettement plus avancée mais c'est aussi un bon point de départ pour apprendre quelque-chose.

Il y a deux façons différentes de se connecter sur le terminal Linux:

  1. via la prise stéréo 3.5mm (qui est un port RS-232)
  2. via USB.

La première méthode nécessite un câble spécial (ou deux)... et la deuxième nécessite le téléversement d'une sketch/croquis Arduino spécial.

Nous allons aborder les deux méthodes dans cette page mais sachez qu'il y a des plus et des moins à chacune de ces approches.

Ces deux méthodes nécessite l'usage d'un émulateur de terminal qui doit être installé sur votre ordinateur.

Terminal RS-232

This method is safer, and easier, but it does require that you have some extra cables. The terminal interface on the Galileo is a 3.5mm stereo jack, like what you might plug headphones into. The three contacts on this connector break out ground, RX and TX. A specialized 3.5mm to DB9 RS-232 cable can help move the interface to a more common connector, and (assuming your computer doesn’t have an archaic serial port) you may need a RS-232 to USB cable on top of that to interface the board with your computer.

Once the board is connected to your computer, open up a serial terminal program (like Tera Term for Windows or Cool Term for Mac). Set the serial port number, and change the baud rate to 115200 bps.

Check out the section below if you’re not sure what to do with Linux.

Custom Arduino Sketch

If you don’t have the weird 3.5mm RS-232 interface cables, never fear! You can upload an Arduino sketch to access the Linux terminal.

One warning here: this sketch does mess with some of the basic workings of the Galileo. You won’t be able to upload another Arduino sketch unless you reset the board or run the few lines at the end of this section.

Copy the code below into your Arduino IDE. Then upload just as you did the Blink sketch. This is a slightly modified version of the code found in Intel’s example code samples.

void setup() 
{
  system("cp /etc/inittab /etc/inittab.bak");  // Back up inittab
  // Replace all "S:2345" with "S0:2345"'s (switching serial ports):
  system("sed -i 's/S:2345/S0:2345/g' /etc/inittab");
  // Replace all "ttyS1" with "ttyGS0"'s (switching serial ports):
  system("sed -i 's/ttyS1/ttyGS0/g' /etc/inittab");
  // Replace all "grst" with "#grst"'s to comment that line out:
  system("sed -i 's/grst/#grst/g' /etc/inittab");
  // Replace all "clld" with "#clld"'s to comment that line out:
  system("sed -i 's/clld/#clld/g' /etc/inittab");
  system("kill -SIGHUP 1");
}
void loop() 
{

}

Once that’s uploaded, you’ll need to open up a separate serial terminal program (not the Serial Monitor). Set the serial port to the same as your Galileo, and set the baud rate to 115200. See the below section for help using Linux.

Once you’re done using this version of the serial terminal, send this trio of commands to revert back to “Arduino mode”:

rm /sketch/sketch.elf
cp /etc/inittab.bak /etc/inittab
kill -SIGHUP 1

Those will remove your terminal “Arduino sketch”, revert back to the old init procedure, and reboot the init process. Your Galileo will revert back to the way it was, and you can upload an Arduino sketch once again.

Utiliser le Terminal Linux

When you first open your Linux terminal, press enter. You’ll the be prompted to log in, use the user name root (no password, by default). Welcome to the shell!

Galileo-Terminal-00.jpg

From here, the you can perform a variety of basic Linux commands. You can list directory contents with ls. Navigate directories with cd. Make directories with mkdir or create files with touch. There are, of course, more advanced Linux utilities to discover as well.

Galileo-Terminal-01.jpg

There are a wide range of Linux commands made available to the Galileo.

Note

If you’re feeling handicapped by some of the Linux commands that may be missing, check over to the next page, where we’ll install the "bigger Linux image". The bigger Linux image boots the Galileo off an SD card, and provides access to useful tools like SSH, Python, node.js, and OpenCV.


Source: Intel Galileo, crédit: Arduino.cc, licence Creative Common Attribution ShareAlike. Diverses documentations publiées par Intel(R), Crédit Intel(R)

Traduit et augmenté par Meurisse D pour MCHobby.be

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.