-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.html
374 lines (269 loc) · 17.6 KB
/
install.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Installation — Braubar 0.1 Dokumentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="top" title="Braubar 0.1 Dokumentation" href="index.html"/>
<link rel="next" title="Projekt Structure" href="structure.html"/>
<link rel="prev" title="Hardware Requirements" href="Hardware.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> Braubar
<img src="_static/braubar_logo.png" class="logo" />
</a>
<div class="version">
0.1
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="Hardware.html">Hardware Requirements</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Installation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#raspberry-pi">Raspberry Pi</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#debian-and-packages">Debian and Packages</a></li>
<li class="toctree-l3"><a class="reference internal" href="#x-window-system">X Window System</a></li>
<li class="toctree-l3"><a class="reference internal" href="#auto-login">Auto Login</a></li>
<li class="toctree-l3"><a class="reference internal" href="#braubar-installation">Braubar installation</a></li>
<li class="toctree-l3"><a class="reference internal" href="#install-and-configure-dnsmasq">Install and configure dnsmasq</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-braubar-start-with-supervisor">Config Braubar start with Supervisor</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#arduino">Arduino</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#geting-started">Geting started</a></li>
<li class="toctree-l3"><a class="reference internal" href="#functionality">Functionality</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="structure.html">Projekt Structure</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Braubar</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li>Installation</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/install.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="installation">
<span id="installation"></span><h1>Installation<a class="headerlink" href="#installation" title="Link zu dieser Überschrift">¶</a></h1>
<p>This installation guide will lead you through the whole process of installation and starting up your personal Braubar.</p>
<div class="section" id="raspberry-pi">
<span id="raspberry-pi"></span><h2>Raspberry Pi<a class="headerlink" href="#raspberry-pi" title="Link zu dieser Überschrift">¶</a></h2>
<p>A common and small distribution is the raspbian image. Download it and copy it to your sd card. For the copy enshure that the device is not mounted. You need to be root.</p>
<pre class="code highlight bash literal-block">
dd <span class="nv">bs</span><span class="o">=</span>4M <span class="k">if</span><span class="o">=</span>/tmp/2016-03-18-raspbian-jessie-lie.img <span class="nv">of</span><span class="o">=</span>/dev/mmcblk0 <span class="o">&&</span> sync
</pre>
<p><code class="docutils literal"><span class="pre">sync</span></code>enshures that all data will be written to the sd card.
You can find the appropriate image on <a class="reference external" href="https://www.raspberrypi.org/downloads/">https://www.raspberrypi.org/downloads/</a></p>
<p>After you finished with sync, mount your sd card under <code class="docutils literal"><span class="pre">/mnt</span></code></p>
<p>Open <code class="docutils literal"><span class="pre">/mnt/boot/config.txt</span></code> and add the following lines at the end</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1"># rotate display</span>
<span class="n">lcd_rotate</span><span class="o">=</span><span class="mi">2</span>
</pre></div>
</div>
<p>For IP settings modify <code class="docutils literal"><span class="pre">/mnt/etc/dhcpdc.conf</span></code> to configure your network settings.</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>interface eth0
static ip_address=192.168.3.100
static routers=192.168.3.1
static domain_server=8.8.8.8
</pre></div>
</div>
<p>Adjust IP settings to your needs. Now unmount your sd card and get your Pi running. Afterwards you need to get access to the Pi, my favorite is ssh.</p>
<p>Open <code class="docutils literal"><span class="pre">raspi-conf</span></code> and select entry <code class="docutils literal"><span class="pre">Expand</span> <span class="pre">Filesystem</span></code> to expand the image to the full size of your sd card and reboot. Othervise there is not enough space left.</p>
<div class="section" id="debian-and-packages">
<span id="debian-and-packages"></span><h3>Debian and Packages<a class="headerlink" href="#debian-and-packages" title="Link zu dieser Überschrift">¶</a></h3>
<p>The following software will be installed:</p>
<ul class="simple">
<li>supervisor</li>
<li>python3</li>
<li>pip</li>
<li>iceweasel</li>
<li>xinit</li>
<li>matchbox</li>
</ul>
<p>Debian 8:
After boot run a update and then install the required software</p>
<pre class="code highlight bash literal-block">
apt-get update <span class="o">&&</span> apt-get install supervisor python3 python3-pip iceweasel xinit matchbox
</pre>
</div>
<div class="section" id="x-window-system">
<span id="x-window-system"></span><h3>X Window System<a class="headerlink" href="#x-window-system" title="Link zu dieser Überschrift">¶</a></h3>
<p>create <code class="docutils literal"><span class="pre">.xinitrc</span></code> file in <code class="docutils literal"><span class="pre">home</span></code> folder</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>matchbox-window-manager &
exec /usr/bin/iceweasel http://localhost:5000
</pre></div>
</div>
<p>To start iceweasel in fullscreen mode it is neccesary to start it one, enter fullscreen mode and exit. Then it it will be saved in your profile. Another option is to create your own profile, but I won’t handle that here.</p>
</div>
<div class="section" id="auto-login">
<span id="auto-login"></span><h3>Auto Login<a class="headerlink" href="#auto-login" title="Link zu dieser Überschrift">¶</a></h3>
<p>Edit file at <code class="docutils literal"><span class="pre">/etc/systemd/system/getty.target.wants/getty@tty1.service</span></code> and change <code class="docutils literal"><span class="pre">ExecStart=</span></code> line in section <code class="docutils literal"><span class="pre">[Service]</span></code> to this</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>ExecStart=-/sbin/agetty -a pi %I $TERM
</pre></div>
</div>
<p>To get X with iceweasel started automatically add the following snippet to the end of <code class="docutils literal"><span class="pre">~/.bash_login</span></code></p>
<div class="highlight-python"><div class="highlight"><pre><span></span>[[ -z $DISPLAY && $(tty) == /dev/tty1 ]] && exec startx
</pre></div>
</div>
<p>Since we have no window manager which runs in systemd it is neccesary to set <code class="docutils literal"><span class="pre">multi-user.target</span></code> as default</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>systemctl set-default multi-user.target
</pre></div>
</div>
<p>But be careful, now you can’t login to anything other than the iceweasel application. Except you do a remote login.</p>
</div>
<div class="section" id="braubar-installation">
<span id="braubar-installation"></span><h3>Braubar installation<a class="headerlink" href="#braubar-installation" title="Link zu dieser Überschrift">¶</a></h3>
<p>Download braubar-pi to you Pi</p>
<pre class="code highlight bash literal-block">
wget https://github.com/braubar/braubar-pi/archive/master.zip
</pre>
<p>and unzip it e.g. to your home folder</p>
<pre class="code highlight bash literal-block">
unzip master.zip <span class="o">&&</span> rm master.zip <span class="o">&&</span> <span class="nb">cd</span> braubar-pi-master
</pre>
<p>to install the needed python requirements run as root</p>
<pre class="code highlight bash literal-block">
pip3 install -r requirements.txt
</pre>
</div>
<div class="section" id="install-and-configure-dnsmasq">
<span id="install-and-configure-dnsmasq"></span><h3>Install and configure dnsmasq<a class="headerlink" href="#install-and-configure-dnsmasq" title="Link zu dieser Überschrift">¶</a></h3>
<p>If there is a DHCP Server already running then please change IP settings and ignore this section.</p>
<p>First install dnsmasq on your system.</p>
<pre class="code highlight bash literal-block">
apt-get install dnsmasq
</pre>
<p>There is a preconfigured file for dnsmasq for Braubar. <code class="docutils literal"><span class="pre">$BRAUBAR_HOME/install/dnsmasq.conf</span></code></p>
<pre class="code highlight bash literal-block">
mv /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
ln -s /home/pi/braubar-pi-master/install/dnsmasq.conf /etc/dnsmasq.conf
</pre>
</div>
<div class="section" id="config-braubar-start-with-supervisor">
<span id="config-braubar-start-with-supervisor"></span><h3>Config Braubar start with Supervisor<a class="headerlink" href="#config-braubar-start-with-supervisor" title="Link zu dieser Überschrift">¶</a></h3>
<p>Adjust paths to your configuration!</p>
<p>Create link to config in /etc/supervisor/conf.d/braubar.conf</p>
<pre class="code highlight bash literal-block">
ln -s <span class="nv">$BRAUBAR_HOME</span>/install/braubar.conf /etc/supervisor/conf.d/braubar.conf
</pre>
<pre class="code highlight ini literal-block">
<span class="k">[program:braubar]</span>
<span class="na">command</span><span class="o">=</span><span class="s">/home/pi/braubar-pi-master/bin/braubar</span>
<span class="na">directory</span><span class="o">=</span><span class="s">/home/pi/braubar-pi-master/bin</span>
<span class="na">loglevel</span><span class="o">=</span><span class="s">warning</span>
<span class="na">process_name</span><span class="o">=</span><span class="s">%(program_name)s</span>
<span class="na">autostart</span><span class="o">=</span><span class="s">true</span>
<span class="na">autorestart</span><span class="o">=</span><span class="s">unexpected</span>
<span class="na">startsecs</span><span class="o">=</span><span class="s">10</span>
<span class="na">startretries</span><span class="o">=</span><span class="s">3</span>
<span class="na">stopasgroup</span><span class="o">=</span><span class="s">true</span>
<span class="na">redirect_stderr</span><span class="o">=</span><span class="s">false</span>
<span class="na">stdout_logfile</span><span class="o">=</span><span class="s">/home/pi/braubar-pi-master/log/braubar.log</span>
<span class="na">stdout_logfile_maxbytes</span><span class="o">=</span><span class="s">1MB</span>
<span class="na">stdout_logfile_backups</span><span class="o">=</span><span class="s">10</span>
<span class="na">stdout_capture_maxbytes</span><span class="o">=</span><span class="s">1MB</span>
<span class="na">stdout_events_enabled</span><span class="o">=</span><span class="s">false</span>
<span class="na">stderr_logfile</span><span class="o">=</span><span class="s">/home/pi/braubar-pi-master/log/braubar.err</span>
<span class="na">stderr_logfile_maxbytes</span><span class="o">=</span><span class="s">1MB</span>
<span class="na">stderr_logfile_backups</span><span class="o">=</span><span class="s">10</span>
<span class="na">stderr_capture_maxbytes</span><span class="o">=</span><span class="s">1MB</span>
<span class="na">stderr_events_enabled</span><span class="o">=</span><span class="s">false</span>
<span class="na">serverurl</span><span class="o">=</span><span class="s">AUTO</span>
</pre>
<p>reread and restart supervisr and show status
<code class="docutils literal"><span class="pre">supervisorctl</span> <span class="pre">reread</span> <span class="pre">&&</span> <span class="pre">supervisorctl</span> <span class="pre">reload</span> <span class="pre">&&</span> <span class="pre">supervisorctl</span> <span class="pre">status</span></code></p>
<p>control log in <code class="docutils literal"><span class="pre">/var/log/supervisor/supervisor.log</span></code></p>
</div>
</div>
<div class="section" id="arduino">
<span id="arduino"></span><h2>Arduino<a class="headerlink" href="#arduino" title="Link zu dieser Überschrift">¶</a></h2>
<p>In Braubar the Arduino acts as a temperature sensor.</p>
<div class="section" id="geting-started">
<span id="geting-started"></span><h3>Geting started<a class="headerlink" href="#geting-started" title="Link zu dieser Überschrift">¶</a></h3>
<p>It is required to have an running Arduino environment. Then you can either upload the program to your Arduino within Arduino Studio or with the shipped Makefile, which is recommended.
Before running Make you shoud have a look at the Makefile to ensuhre your Serial Port is mapped to the right device.
To upload the compiled program to your Arduino run:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>make clean && make && make upload
</pre></div>
</div>
<p>After running successfully it will request an IP from your DHCP server and start sending broadcast packages all over your local network. To avoid broadcasting, please enter the desired IP for <code class="docutils literal"><span class="pre">IPAddress</span> <span class="pre">server</span></code> in <code class="docutils literal"><span class="pre">braubar_temp.ino</span></code> file.
Also it is possible to change the port from 50505 to your wish.</p>
</div>
<div class="section" id="functionality">
<span id="functionality"></span><h3>Functionality<a class="headerlink" href="#functionality" title="Link zu dieser Überschrift">¶</a></h3>
<p>It sends a package every second with the current temperature value, the id of the sensor and a start and end sequence consistion of <code class="docutils literal"><span class="pre">0xF0FF</span></code> and a end sequence with the same sync bits.</p>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="structure.html" class="btn btn-neutral float-right" title="Projekt Structure" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="Hardware.html" class="btn btn-neutral" title="Hardware Requirements" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2016, Oliver Fesseler.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.1',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/translations.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>