|
|
(8 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) |
Zeile 1: |
Zeile 1: |
− | {{BenutzerSeitenNichtVeraendernWarnung|rdiez}}
| + | #REDIRECT [[Benutzer:Rdiez/PageRemoved]] |
− | | + | |
− | = Serial Port Tips for Linux =
| + | |
− | | + | |
− | Set the default configuration with stty to 9600 bps, 8N1, no flow control:
| + | |
− | | + | |
− | stty -F /dev/serial_port cs8 -parenb -cstopb -clocal raw speed 9600
| + | |
− |
| + | |
− | # What the arguments mean:
| + | |
− | # cs8: 8 data bits
| + | |
− | # -parenb: No parity (because of the '-')
| + | |
− | # -cstopb: 1 stop bit (because of the '-')
| + | |
− | # -clocal: Disable modem control signals
| + | |
− | | + | |
− | == No exclusive lock when accessing serial ports ==
| + | |
− | | + | |
− | I was surprised to learn that several Linux processes can open a given serial port at the same time. This usually makes a mess of the data. If you make a mistake and try to use the same port from several concurrent scripts, it may take a while to figure out why the data is getting chopped and mixed up in random ways.
| + | |
− | | + | |
− | There is no exclusive lock when opening serial port files, like there is under Windows. As far as I know, there is no way to enforce such a protection against concurrent access at system level. If you do know how to achieve that, please [[Benutzer:rdiez|drop me a line]]!
| + | |