issue148:tutoriel1
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue148:tutoriel1 [2019/09/02 11:46] – créée auntiee | issue148:tutoriel1 [2019/09/06 08:25] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Years ago, many screen-less devices did not usually have access to any kind of dedicated network. Ubiquitous WiFi was not yet a thing, nor was Bluetooth. Some of the more expensive printers did have Ethernet cards, as did servers, but in many cases, to set up the device or to regain control in the case of a crash, access was made through a serial connection. | + | **SETTING UP A SERIAL TERMINAL SERVER** |
- | Flash forward to modern times, and the serial port has disappeared altogether from most computers – though some servers and professional-grade routers still retain them as standard. The major use-case as of now is probably access to automobile onboard electronics, | + | METTRE EN PLACE TERMINAL SERVER VIA UN PORT SERIE |
- | The hardware | + | **Years ago, many screen-less devices did not usually have access to any kind of dedicated network. Ubiquitous WiFi was not yet a thing, nor was Bluetooth. Some of the more expensive printers did have Ethernet cards, as did servers, but in many cases, to set up the device or to regain control in the case of a crash, access was made through a serial connection.** |
- | I picked up the hardware required for this experiment online, and for a mere 10 euros obtained: two USB-to-serial dongles, and one 1.8 meter null-modem cable. One of the dongles will be needed to equip my (modern) computer with a serial port, in this case with the DB-9 male connector. The other dongle will be used on a Raspberry Pi. Although this small board already has two possibilities as regards serial connections, the onboard electronic circuits work only with TTL (Transistor-transistor level) voltages of about 0 V (for a logic 0), and about +5 V (for a logic 1) which, incidentally, is also the case for the Arduino. The usual serial connection for computers, on the other hand, obeys the RS-232 norm and works with inverted voltages of about +12 V (for a logic 0), and -12 V (for a logic 1). Specific integrated circuits (such as the MAX 232) are available to do conversion; however, for the Raspberry Pi it is simpler and more convenient to use a standard USB to serial dongle. | + | Il y a plusieurs années, de nombreux dispositifs sans écran n' |
- | The null-modem cable is a very simple cable to connect two serial devices, that in our case has a female DB-9 connector at each end. It performs two main functions. One is as an electrical bus, where Signal Ground on both devices are connected together, and each device’s TX (transmission) pin is connected | + | **Flash forward to modern times, and the serial port has disappeared altogether from most computers – though some servers and professional-grade routers still retain them as standard. |
+ | A notre ère, le port série a complètement disparu de la plupart des ordinateurs - bien que certains serveurs et routeurs professionnels en disposent encore en standard. Aujourd’hui, | ||
- | Setting up a serial terminal service | + | **The hardware** |
- | From the software point of view, it is fairly difficult to find up-to-date documentation on setting up a serial terminal server on a modern GNU/Linux distribution. The basic program –the getty utility– is usually already installed. But, most tutorials were written in a period when system services were configured using init or upstart, including community documentation found today at https:// | + | Le matériel |
- | I will be following | + | **I picked up the hardware required for this experiment online, and for a mere 10 euros obtained: two USB-to-serial dongles, and one 1.8 meter null-modem cable. One of the dongles will be needed to equip my (modern) computer with a serial port, in this case with the DB-9 male connector. The other dongle |
- | The first thing we will need to do is verify our existing system on the server. Let us start by seeing if getty is actually installed – as, indeed, it should be, to give up access to that standard VT (Virtual Terminals) that usually are activated on GNU/Linux systems: | + | J'ai acheté, en ligne, le matériel nécessaire à cette expérience et, pour seulement 10 euros, j’ai obtenu : deux dongles USB-à-série, |
+ | |||
+ | **The null-modem cable is a very simple cable to connect two serial devices, that in our case has a female DB-9 connector at each end. It performs two main functions. One is as an electrical bus, where Signal Ground on both devices are connected together, and each device’s TX (transmission) pin is connected to the other device’s RX (reception) pin. The second function, which is implemented in most well-built null-modem cables, is to deactivate hardware control pins on both interfaces. Back in the day, these were used to control traffic between two modems, but this function is not really necessary for a short cable with no active electronics.** | ||
+ | |||
+ | Le câble null-modem est un câble très basique pour connecter deux machines via le port série ; dans notre cas, il a un connecteur DB-9 femelle à chaque extrémité. Il remplit deux fonctions principales, | ||
+ | |||
+ | **Setting up a serial terminal service** | ||
+ | |||
+ | Mise en place du service de terminal série | ||
+ | |||
+ | **From the software point of view, it is fairly difficult to find up-to-date documentation on setting up a serial terminal server on a modern GNU/Linux distribution. The basic program –the getty utility– is usually already installed. But, most tutorials were written in a period when system services were configured using init or upstart, including community documentation found today at https:// | ||
+ | |||
+ | Du point de vue logiciel, il est assez difficile de trouver une documentation à jour sur la configuration d'un serveur de terminaux « série » sur une distribution GNU/Linux récente. Le programme de base - l' | ||
+ | |||
+ | **I will be following this note https:// | ||
+ | |||
+ | Je vais suivre cette documentation https:// | ||
+ | |||
+ | **The first thing we will need to do is verify our existing system on the server. Let us start by seeing if getty is actually installed – as, indeed, it should be, to give up access to that standard VT (Virtual Terminals) that usually are activated on GNU/Linux systems:** | ||
+ | |||
+ | La première chose que nous devons faire consiste à vérifier le système existant côté serveur. Commençons par voir si getty est réellement installé – car nécessaire pour avoir accès à la fonction VT (Virtual Terminals) standard qui est habituellement activée sur les systèmes GNU/ | ||
# getty --version | # getty --version | ||
getty from util-linux 2.29.2 | getty from util-linux 2.29.2 | ||
- | This looks good. If getty is not installed on your system, get it using your package manager of choice. Now, let us test the hardware. Plug the dongle into any available USB port, and check the kernel messages: | + | **This looks good. If getty is not installed on your system, get it using your package manager of choice. Now, let us test the hardware. Plug the dongle into any available USB port, and check the kernel messages:** |
+ | |||
+ | Ça a l'air bon. Si getty n'est pas installé sur votre système, utilisez le gestionnaire de paquets (de logiciels) de votre distribution pour l’installer. Maintenant, testons le matériel. Branchez le dongle sur n' | ||
# dmesg | grep ttyUSB | # dmesg | grep ttyUSB | ||
[ 2507.371545] usb 1-1.4: ch341-uart converter now attached to ttyUSB0 | [ 2507.371545] usb 1-1.4: ch341-uart converter now attached to ttyUSB0 | ||
- | So far, so good: our USB dongle has been recognized by the kernel’s USB subsystem, and configured as / | + | **So far, so good: our USB dongle has been recognized by the kernel’s USB subsystem, and configured as / |
- | Next, become root (using the su or sudo commands), and navigate to the directory / | + | Jusqu' |
+ | |||
+ | **Next, become root (using the su or sudo commands), and navigate to the directory / | ||
+ | |||
+ | Ensuite, passez en « root » (en utilisant la commande su, ou sudo), et naviguez vers le répertoire / | ||
[Unit] | [Unit] | ||
Ligne 38: | Ligne 65: | ||
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
- | The main line here is the one beginning with “ExecStart”. In this, we invoke getty with the correct device and line speed; we will thus need to get it right. Substitute your real device name here, it may or not be ttyUSB0, depending on your precise setup. As for line speed, most devices will run along happily at 115200 baud (bits / second). If yours does not, try lowering the speed to 28800 or even 9600 for testing purposes. | + | **The main line here is the one beginning with “ExecStart”. In this, we invoke getty with the correct device and line speed; we will thus need to get it right. Substitute your real device name here, it may or not be ttyUSB0, depending on your precise setup. As for line speed, most devices will run along happily at 115200 baud (bits / second). If yours does not, try lowering the speed to 28800 or even 9600 for testing purposes.** |
- | Once we are happy with our configuration, | + | |
+ | La ligne principale ici est celle qui commence par « ExecStart ». Ici, nous invoquons getty avec le bon dispositif et la vitesse correcte de transmission ; nous devrons donc le faire scrupuleusement. Donnez ici le nom réel de votre dispositif, ça peut être ttyUSB0 ou pas, en fonction de votre configuration/ | ||
+ | |||
+ | **Once we are happy with our configuration, | ||
+ | |||
+ | Une fois que nous sommes satisfaits de notre configuration, | ||
# systemctl daemon-reload | # systemctl daemon-reload | ||
- | Finally, we need to flag this service as enabled, so systemd will activate it each time the computer is booted: | + | **Finally, we need to flag this service as enabled, so systemd will activate it each time the computer is booted:** |
+ | |||
+ | Enfin, nous devons signaler que ce service est activé, afin que systemd l' | ||
# systemctl enable ttyUSB0.service | # systemctl enable ttyUSB0.service | ||
Created symlink / | Created symlink / | ||
- | In theory, we should now have a working setup on our server. The original authors of these instructions indicate they like to reboot the server computer to make sure the new configuration is in place, and, indeed, this can do no harm. | + | **In theory, we should now have a working setup on our server. The original authors of these instructions indicate they like to reboot the server computer to make sure the new configuration is in place, and, indeed, this can do no harm.** |
- | Once our getty service is up and running, let us turn to the client computer from which we intend to connect to the server. On a GNU/Linux system, there are very many serial terminal programs available. One that should already be installed is screen: | + | En théorie, nous devrions maintenant avoir une configuration opérationnelle côté serveur. Les auteurs à l’origine de cette documentation indiquent qu'ils préfèrent redémarrer le serveur pour s' |
+ | |||
+ | **Once our getty service is up and running, let us turn to the client computer from which we intend to connect to the server. On a GNU/Linux system, there are very many serial terminal programs available. One that should already be installed is screen:** | ||
+ | |||
+ | Une fois notre service getty opérationnel, | ||
$ screen / | $ screen / | ||
- | Connect the two devices and the null-modem cable. You may need to hit the Enter key a couple of times on the client screen to activate the connection. You have also obtained some “strange characters” due to bit-rate errors, but they should disappear when the next login message comes up from the server. You can quit the screen command with key combination Ctrl+A and then an uppercase letter K. | + | **Connect the two devices and the null-modem cable. You may need to hit the Enter key a couple of times on the client screen to activate the connection. You have also obtained some “strange characters” due to bit-rate errors, but they should disappear when the next login message comes up from the server. You can quit the screen command with key combination Ctrl+A and then an uppercase letter K.** |
+ | |||
+ | Connectez les deux machines avec le câble null-modem. Vous devrez peut-être appuyer plusieurs fois sur la touche Entrée du clavier côté client afin d’activer la connexion. Vous avez peut-être obtenu quelques « caractères étranges » dus à des erreurs de bit-rate, mais ils devraient disparaître lors du prochain message de connexion provenant du serveur. Vous pouvez quitter la commande screen avec la combinaison de touches Ctrl+A et ensuite la lettre majuscule K. | ||
+ | |||
+ | **If this does not work, perhaps a better choice would be either of cu or minicom. Install either using the standard commands:** | ||
- | If this does not work, perhaps a better choice would be either of cu or minicom. | + | Si cela ne fonctionne pas, peut-être faut-il essayer avec l’utilitaire |
$ sudo apt install cu | $ sudo apt install cu | ||
$ sudo apt install minicom | $ sudo apt install minicom | ||
- | Then connect, e.g. with cu: | + | **Then connect, e.g. with cu:** |
+ | |||
+ | Ensuite connectez-vous, | ||
$ cu -l / | $ cu -l / | ||
Ligne 71: | Ligne 115: | ||
pi@raspberrypi: | pi@raspberrypi: | ||
- | As before, a couple of Enter keys may be necessary to get to the login prompt. You can quit cu using command “~.” | + | **As before, a couple of Enter keys may be necessary to get to the login prompt. You can quit cu using command “~.”** |
+ | |||
+ | Comme précédemment, | ||
- | Similar connections should be rather easy to set up on clients with a Mac OS or a Microsoft operating system, using the appropriate tools in either case. Even a very old or low-spec computer should be well up to the task of working as a serial terminal – even one with a rather ancient Intel 80386 to Pentium IV processor. If you still have one lying around, it could even come with a serial port on the motherboard known in the BIOS or MS-DOS as COM1: or COM2:, and in Linux as /dev/ttyS0 or /dev/ttyS1 . These can easily be found by examining the rear panel of the computer body for a 9-pin connector: see (a) in the following image. In such a case, you will not even need to acquire a USB dongle. | + | **Similar connections should be rather easy to set up on clients with a Mac OS or a Microsoft operating system, using the appropriate tools in either case. Even a very old or low-spec computer should be well up to the task of working as a serial terminal – even one with a rather ancient Intel 80386 to Pentium IV processor. If you still have one lying around, it could even come with a serial port on the motherboard known in the BIOS or MS-DOS as COM1: or COM2:, and in Linux as /dev/ttyS0 or /dev/ttyS1 . These can easily be found by examining the rear panel of the computer body for a 9-pin connector: see (a) in the following image. In such a case, you will not even need to acquire a USB dongle.** |
- | Enjoy! | + | Des connexions similaires devraient être assez faciles à mettre en place sur des clients avec un système d' |
+ | **Enjoy!** | ||
+ | Amusez-vous bien ! |
issue148/tutoriel1.1567417618.txt.gz · Dernière modification : 2019/09/02 11:46 de auntiee