ehz – Baudrate in “Autostart”

Um die Baudrate für den Lesekopf im Artikel http://blog.bubux.de/?p=89 beim Start des Raspi automatisch zu setzen, kann der stty-Befehl in der Datei /etc/rc.local eingefügt werden.

Das schaut dann z.B. so aus:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

sudo stty -F /dev/ttyUSB1 1:0:8bd:0:3:1c:7f:15:4:5:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

exit 0

Bei jedem Neustart des Raspi wird die Baudrate für den Lesekopf, der im Beispiel das Device “ttyUSB1” ist, nun automatisch gesetzt. Das Device muss natürlich ggf. angepaßt werden.

Gruß Chris