Ligne 27 : |
Ligne 27 : |
| Note vous devriez voir '''console=serial0,115200''' ou '''console=ttyS0,115200''' et retirer cet élément s'il est visible sur la ligne. | | Note vous devriez voir '''console=serial0,115200''' ou '''console=ttyS0,115200''' et retirer cet élément s'il est visible sur la ligne. |
| | | |
− | == Etape 2: modifier /etc/inittab == | + | == Etape 2 == |
| + | |
| + | === Raspbian Wheezy uniquement === |
| + | Nous allons modifier le script de démarrage présent dans {{fname|/etc/inittab}} |
| | | |
| Saisissez la commande suivante dans une console/terminal: | | Saisissez la commande suivante dans une console/terminal: |
Ligne 40 : |
Ligne 43 : |
| | | |
| '''#Spawn a getty on Raspberry Pi serial line<br />#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100''' | | '''#Spawn a getty on Raspberry Pi serial line<br />#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100''' |
| + | |
| + | === Raspbian Jessie (et suivant) === |
| + | {{traduction}} |
| + | |
| + | For the '''Raspberry Pi 1 or 2''' (but NOT the 3!) Run the following two commands to stop and disable the tty service: |
| + | |
| + | <nowiki>sudo systemctl stop serial-getty@ttyAMA0.service |
| + | sudo systemctl disable serial-getty@ttyAMA0.service</nowiki> |
| + | |
| + | However for the '''Raspberry Pi 3''' you need to use the '''/dev/ttyS0''' port since that is what is normally connected to the GPIO serial port pins. Use these two commands instead: |
| + | |
| + | <nowiki>sudo systemctl stop serial-getty@ttyS0.service |
| + | sudo systemctl disable serial-getty@ttyS0.service</nowiki> |
| + | |
| + | == Etape 3: Raspberry Pi 3 uniquement == |
| + | {{traduction}} |
| + | '''For the Raspberry Pi 3''' you need to explicitly enable the serial port on the GPIO pins. The reason for this is a change with the Pi 3 to use the hardware serial port for Bluetooth and instead use a slightly different software serial port for the GPIO pins. A side effect of this change is that the serial port will actually change speed as the Pi CPU clock throttles up and down--this will unfortunately cause problems for most serial devices like GPS receivers! |
| + | |
| + | Luckily there's an easy fix detailed in [http://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3 this excellet blog post] to force the Pi CPU into a fixed frequency which prevents speed changes on the serial port. The Pi might not perform as well but it will have a stable serial port speed. |
| + | |
| + | To make this change edit the '''/boot/config.txt''' file by running: |
| + | |
| + | sudo nano /boot/config.txt |
| + | |
| + | At the very bottom of the file add this on a new line: |
| + | |
| + | enable_uart=1 |
| + | |
| + | Save the file (press '''Ctrl-O''', then enter) and exit (press '''Ctrl-X'''). You're all set! |
| | | |
| == Etape 3: Rebooter votre Pi == | | == Etape 3: Rebooter votre Pi == |