-
Notifications
You must be signed in to change notification settings - Fork 1
/
schnittstellen.html
180 lines (171 loc) · 7.61 KB
/
schnittstellen.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!--
8"""8 8"""" 8"""8 8""""8 8""""8 8 8 8""""8 8""""
8 8 8 8 8 8 8 8 8 8 8 8 8 8
8e 8 8eeee 8eee8e 8e 8 8eeee8ee 8e 8 8e 8 8eeee
88 8 88 88 8 88 8 88 8 88 8 88 8 88
88 8 88 88 8 88 8 88 8 88 8 88 8 88
88 8 88eee 88 8 88eee8 88eeeee8 88ee8 88eee8 88eee
[website] https://www.nerdbude.com
[mail] post@nerdbude.com
[twitter] @PH_0x17
[github] https://www.github.com/nerdbude
-->
<!DOCTYPE html>
<html>
<head>
<title>NERDBUDE</title>
<meta charset="utf-8" />
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@PH_0x17">
<meta property="og:url" content="https://www.nerdbude.com/schnittstellen.html">
<meta property="og:title" content="Serielle Schnittstellen">
<meta property="og:description" content="Hat es vier unverlötete PINs auf dem PCB kann man es hacken!">
<meta property="og:image" content="https://www.nerdbude.com/images/fav.png">
<link rel="icon" type="image/png" href="https://www.nerdbude.com/images/fav.png">
<link rel="alternate" href="https://nerdbude.com/rss/rss.xml" type="application/rss+xml" title="NERDBUDE"/>
<link rel="stylesheet" type="text/css" href="css/style.css" media="screen">
</head>
<body>
<!--- HEADER -->
<header>
<div id="headerimage">
<h1 id="terminal"><a href="https://www.nerdbude.com" class="front">NERDBUDE</a></h1>
<h3>[ code. keyboards. terminals. cyber. ]</h3>
<table>
<tr>
<th><a href="https://www.nerdbude.com/readme.html" class="front">[HOWTO]</a></th>
<th><a href="https://www.nerdbude.com/about.html" class="front">[WHOAMI]</a></th>
<th><a href="https://www.nerdbude.com/podcast/index.html" class="front">[PODCAST]</a></th>
<th><a href="https://www.nerdbude.com/frankenswitches.html" class="front">[FRANKENSWITCHES]</a></th>
<th><a href="https://www.nerdbude.com/en/en_schnittstellen.html" class="front">[ENGLISH]</a></th>
</tr>
</table>
</div>
</header>
<div id="content">
<!-- ARTIKLE START -->
<h2>mit schnittstellen sprechen (usb -- ttl)</h2>
<time>2020-04-19</time><br><br>
Es gibt verschiedene Gründe warum man mit seriellen Schnittstellen reden möchte.
<br>
<br>
Eine serielle Console ermöglicht bspw. das konfigurieren des RaspberryPi ohne ihn an ein Display oder ans Netzwerk anschließen zu müssen oder man halt alte Hardware wie Router und ähnliches zu Hause rumliegen und möchte wissen was da drinnen vor sich geht. Mit ein wenig Glück gibt es eine versteckte serielle Schnittstelle die eigentlich nicht dafür gedacht ist sie als "Normal User" zu benutzen.
<br>
<br>
Eins vorweg, das öffnen und modifizieren von Geräten lässt euch mit ziemlicher Sicherheit die Garantie verlieren, sollte noch eine auf dem Gerät sein. Das andere macht das nur bei Geräten die euch gehören. Wer Sachen aufschraubt die ihm nicht gehören und zu Kasse gebeten wird soll nicht behaupten ich hätte nichts gesagt.
<br>
<br>
Was brauchen wir also um loszulegen?
<br>
<br>
Als erstes einen USB <-> TTL Adapter
<br>
<br>
<img src="http://nerdbude.com/images/usb_ttl.png" alt=""/>
<br>
<br>
Den Adapter (s. Bild) gibt es von 3,00€ - 30,00€ im Netz. Er hat in diesem fall einen USB-2.0-Typ-A Stecker der in den Rechner kommt und 6 Pins die mit unserer seriellen Schnittstelle verkabelt werden. Zum verkabeln sind Jumper-Cables zu empfehlen, die lassen sich einfach auf die Pins des Adapters stecken und auf eventuell vorhandene Pins an der Schnittstelle. Sollten an der Schnittstelle keine Pins vorhanden sein sondern nur Lötpunkte könnt ihr die Jumper-cables einfach kürzen und auflöten. Jumper-Cables gibt es in verschiedenen Farben und die sollte man auch nutzen um den Überblick nicht zu verlieren.
<br>
<br>
<img src="http://nerdbude.com/images/jumper_cable.png" alt="jumper_cable"/>
<br>
<br>
Was es noch braucht ist natürlich ein Gerät mit einer seriellen Schnittstelle. Die meisten Router haben eine, aber genau so auch andere Geräte auf denen irgendein OS (meist Linux) läuft. Wie erkennt man die Schnittstelle? Verdächtig sind hier zum Beispiel Lötpunkte die nicht benutzt werden. In manchen Fällen haben die Schnittstellen aber auch Pins wie unser Adapter. Das macht es natürlich deutlich einfacher da man hier die Jumper-Cables nur aufstecken muss anstatt sie ein zu löten.
<br>
<br>
<img src="http://nerdbude.com/images/serielle.png" alt="serielle"/>
<br>
<br>
Da ich hier momentan kein Gerät habe das ich zerlegen will bzw. kein Gerät mit Schnittstelle, können wir das ganz an einem Raspberry Pi ausprobieren. Die meisten sollten einen daheim rumliegen haben um damit zu experimentieren. Wir nehmen hier das Standart OS Raspian. Das sollte allerdings auch mit jedem anderem unterstützten OS funktionieren. Das OS schreiben wir wie beim Raspberry Pi üblich auf die SD Karte und schieben diese ein.
<br>
<br>
<img src="http://nerdbude.com/images/raspi.png" alt="raspberry_pi" />
<br>
<br>
Jetzt müssen wir die Pins unseres Adapters mit den GPIO Pins des Raspberry verbinden. Dafür brauchen wir am Adapter und am Pi folgende 3 Pins:
<br>
<br>
<ul>
<li>GND (Ground)</li>
<li>RXD (receive data)</li>
<li>TXD (transmit data)</li>
</ul>
<br>
<br>
Die GPIO Pin Belegung des Raspberry Pi findet ihr im Netz. Achtet dabei auf das Modell, da sich die Pinbelegung bei verschiedenen Modellen unterscheidet.
<br>
<br>
<img src="http://nerdbude.com/images/pi_ttl.png" alt="pi_ttl"/>
<br>
<br>
Jetzt muss der Adapter nur noch an den Rechner. Welcher Rechner das ist, ist prinzipiell egal. Jedes OS kann grundsätzlich mit dem Raspberry Pi über die serielle Schnittstelle reden. Bei Windows braucht es das Tool PuTTy und unter Linux und macOS nehmen wir das Terminal Tool "screen" (ist bei Linux und macOS vorinstalliert).
<br>
<br>
Benutzt wird es wie folgt:
<br>
<br>
Linux / macOS
<br>
<br>
<span class="label">shell</span>
<div id="cssyn">
<span class="unixshell">screen -h</span>
</div>
<br>
<br>
Doch bevor man mit "screen" arbeiten kann, brauchen wir die Hardwareadresse das Adapters.
<br>
<br>
macOS / Linux:
<br>
<br>
<span class="label">shell</span>
<div id="cssyn">
<span class="unixshell">ls -l /dev/tty.*</span>
</div>
<br>
<br>
<span class="label">shell</span>
<div id="cssyn">
<span class="unixshell">crw-rw-rw- 1 root wheel 33, 2 3 Feb 06:59 /dev/tty.Bluetooth-Modem<br>
crw-rw-rw- 1 root wheel 33, 0 3 Feb 06:59 /dev/tty.Bluetooth-PDA-Sync<br>
crw-rw-rw- 1 root wheel 33, 8 3 Feb 11:28 /dev/tty.PL2303-00001004<br></span>
</div>
<br>
<br>
Gehen wir davon aus, dass ein PL2303 Chipsatz von Prolific verbaut ist, dementsprechend ist die letztere, die Adresse die wir suchen.
Nun können wir per screen die serielle Schnittstelle über den Adapter ansprechen und zwar mit folgendem Befehl:
<br>
<br>
<span class="label">shell</span>
<div id="cssyn">
<span class="unixshell">screen /dev/tty.PL2303-00001004 115200</span>
</div>
<br>
<br>
115200 legt hier die Baudrate fest - sprich die Übertragungsgeschwindigkeit.
<br>
<br>
Jetzt noch Strom an den Raspberry Pi legen und schon solltet ihr im Terminal die Bootsequenz des Raspberry Pi sehen bzw. euch auf ihm einloggen können.
<br>
<br>
Das ist natürlich erstmal nur die Basis für viele Spielereien die mit der seriellen Schnittstelle möglich sind. Die Grenze ist nur die Fantasie und das vorhanden sein der Schnittstelle.
<br>
<br>
Viel Spaß beim ausprobieren.
<br>
<br>
<!-- ARTIKEL ENDE -->
<br>
<br>
<br>
<br>
<p>//EOF</p>
</div>
<!-- Footer -->
<div id="footer">
<a href="https://www.nerdbude.com/impressum.html">./impressum </a>
<a target="_blank" href="https://www.nerdbude.com/datenschutz.html">./datenschutz </a>
</div>
</body>
</html>