www.a-netz.dehttps://www.a-netz.de/blog/2020-05-24T00:00:00+08:00Rules are there to make you think before you break them.Using Letsencrypt SSL Certificates2020-05-24T00:00:00+08:002020-05-24T00:00:00+08:00andreastag:www.a-netz.de,2020-05-24:/blog/2020/05/using-letsencrypt-ssl-certificates.html<p>This post is a short summary about how to configure <a href="https://certbot.eff.org/">certbot</a> to automatically
retrieve and renew SSL certificates for your domains from <a href="https://letsencrypt.org/">LetsEncrypt</a>. The
commands apply to the current Ubuntu version 20.04.</p>
<h1 id="install-certbot">Install Certbot</h1>
<p>First, install <code>certbot</code>, which handles retrieving and renewing certificates for
you:</p>
<div class="highlight"><pre><span></span><code>sudo apt install certbot …</code></pre></div><p>This post is a short summary about how to configure <a href="https://certbot.eff.org/">certbot</a> to automatically
retrieve and renew SSL certificates for your domains from <a href="https://letsencrypt.org/">LetsEncrypt</a>. The
commands apply to the current Ubuntu version 20.04.</p>
<h1 id="install-certbot">Install Certbot</h1>
<p>First, install <code>certbot</code>, which handles retrieving and renewing certificates for
you:</p>
<div class="highlight"><pre><span></span><code>sudo apt install certbot
</code></pre></div>
<h1 id="use-certbot-to-get-certificates">Use Certbot to Get Certificates</h1>
<p>Now you (in fact <code>certbot</code>) must prove to LetsEncrypt, that you really own the
domain for which you apply a certificate. This is done by placing a file with
some secret content into the web root directory of your domain. The procedure is
like this:</p>
<ol>
<li><code>certbot</code> connects to LetsEncrypt and applies for a new certificate.</li>
<li>LetsEncrypt sends back some random data.</li>
<li><code>certbot</code> puts the random data into a file in the web root directory of your
webserver. </li>
<li>LetsEncrypt makes a web request to your domain and the file in the web root
directory. </li>
<li>If LetsEncrypt can retrieve the file and the random data it will issue the
certificate including the private key and send it back to <code>certbot</code></li>
</ol>
<p>So to request a new certificate, run the following command:</p>
<div class="highlight"><pre><span></span><code>sudo certbot certonly <span class="se">\</span>
--webroot --webroot-path /var/www/html <span class="se">\</span>
--agree-tos <span class="se">\</span>
-m E-MAIL_ADDRESS -d DOMAIN ...
</code></pre></div>
<p>This command manually specifies the web root directory (here
<code>/var/www/html</code>). There are other methods available for <code>certbot</code> to
automatically configure Apache. But as my Apache configuration is a bit
customized, I like more to update the configuration manually.</p>
<p>When installing <code>certbot</code>, it will automatically set up a cron job to regularly
renew all certificates for you. You can find it in <code>/etc/cron.d/certbot</code>.</p>
<h2 id="configure-apache">Configure Apache</h2>
<p>After <code>certbot</code> was successful, it will store the certificates under
<code>/etc/letsencrypt/live/DOMAIN/</code>. So to configure a virtual host, you add the
following lines to refer to the certificate files:</p>
<div class="highlight"><pre><span></span><code><span class="nb">SSLCertificateFile</span> <span class="sx">/etc/letsencrypt/live/DOMAIN/cert.pem</span>
<span class="nb">SSLCertificateKeyFile</span> <span class="sx">/etc/letsencrypt/live/DOMAIN/privkey.pem</span>
<span class="nb">SSLCertificateChainFile</span> <span class="sx">/etc/letsencrypt/live/DOMAIN/fullchain.pem</span>
</code></pre></div>
<p>You will need to add more lines to activate and configure SSL for apache
correctly, but that will go into another post...</p>Code Snippets for Django Development2020-05-10T00:00:00+08:002020-05-10T00:00:00+08:00andreastag:www.a-netz.de,2020-05-10:/blog/2020/05/code-snippets-for-django-development.html<p>This post contains a few code snippets I came up with when starting development
of a <a href="https://www.djangoproject.com/">Django</a> web application.</p>
<div class="toc"><span class="toctitle">Table of Contents</span><ul>
<li><a href="#using-django-with-jinja-templates">Using Django with Jinja Templates</a></li>
<li><a href="#logging-setup">Logging Setup</a></li>
<li><a href="#dockerfile-for-django-project">Dockerfile for Django Project</a></li>
<li><a href="#application-start-script-respecting-ctrl-c">Application Start Script respecting CTRL-C</a></li>
<li><a href="#creating-an-admin-user-at-first-start">Creating an Admin User at First Start</a></li>
</ul>
</div>
<h1 id="using-django-with-jinja-templates">Using Django with Jinja Templates …</h1><p>This post contains a few code snippets I came up with when starting development
of a <a href="https://www.djangoproject.com/">Django</a> web application.</p>
<div class="toc"><span class="toctitle">Table of Contents</span><ul>
<li><a href="#using-django-with-jinja-templates">Using Django with Jinja Templates</a></li>
<li><a href="#logging-setup">Logging Setup</a></li>
<li><a href="#dockerfile-for-django-project">Dockerfile for Django Project</a></li>
<li><a href="#application-start-script-respecting-ctrl-c">Application Start Script respecting CTRL-C</a></li>
<li><a href="#creating-an-admin-user-at-first-start">Creating an Admin User at First Start</a></li>
</ul>
</div>
<h1 id="using-django-with-jinja-templates">Using Django with Jinja Templates</h1>
<p>By default Django uses its own template engine to generate HTML output. While it
might be fast and sufficient for most tasks, I think it lacks one really useful
feature: macros. Macros in <a href="https://jinja.palletsprojects.com/">Jinja</a> are parameterized templates which can be
"called" in other templates. This helps very much to ensure a consistent
structure and layout of the HTML.</p>
<p>To enable the Jinja template engine in addition to the Django template engine
(you will stil need this, e.g. for admin pages, etc.), you need to update your
sessings file and additionally write a function to provide the Environment
instance to Jinja:</p>
<p>Here's the settings file:</p>
<div class="highlight"><pre><span></span><code><span class="n">TEMPLATES</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span>
<span class="c1"># Configuration for Django templates</span>
<span class="s1">'BACKEND'</span><span class="p">:</span> <span class="s1">'django.template.backends.jinja2.Jinja2'</span><span class="p">,</span>
<span class="s1">'DIRS'</span><span class="p">:</span> <span class="p">[</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">BASE_DIR</span><span class="p">,</span> <span class="s1">'loc/templates'</span><span class="p">)],</span>
<span class="s1">'APP_DIRS'</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
<span class="s1">'OPTIONS'</span><span class="p">:</span> <span class="p">{</span>
<span class="s1">'environment'</span><span class="p">:</span> <span class="s1">'dbloc.jinja2.environment'</span><span class="p">,</span>
<span class="s1">'context_processors'</span><span class="p">:</span> <span class="p">[</span>
<span class="s1">'django.template.context_processors.debug'</span><span class="p">,</span>
<span class="s1">'django.template.context_processors.request'</span><span class="p">,</span>
<span class="s1">'django.contrib.auth.context_processors.auth'</span><span class="p">,</span>
<span class="s1">'django.contrib.messages.context_processors.messages'</span><span class="p">,</span>
<span class="p">],</span>
<span class="p">},</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="c1"># Configuration for Jinja2 templates</span>
<span class="s1">'BACKEND'</span><span class="p">:</span> <span class="s1">'django.template.backends.django.DjangoTemplates'</span><span class="p">,</span>
<span class="s1">'DIRS'</span><span class="p">:</span> <span class="p">[],</span>
<span class="s1">'APP_DIRS'</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
<span class="s1">'OPTIONS'</span><span class="p">:</span> <span class="p">{</span>
<span class="s1">'context_processors'</span><span class="p">:</span> <span class="p">[</span>
<span class="s1">'django.template.context_processors.debug'</span><span class="p">,</span>
<span class="s1">'django.template.context_processors.request'</span><span class="p">,</span>
<span class="s1">'django.contrib.auth.context_processors.auth'</span><span class="p">,</span>
<span class="s1">'django.contrib.messages.context_processors.messages'</span><span class="p">,</span>
<span class="p">],</span>
<span class="p">},</span>
<span class="p">},</span>
<span class="p">]</span>
</code></pre></div>
<p>The line <code>'environment': 'dbloc.jinja2.environment',</code> references a function
which supplies the Jinja environment. I have implemented it in a file
<code>jinja2.py</code> in my project directory (here called <code>dbloc</code>):</p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">django.templatetags.static</span> <span class="kn">import</span> <span class="n">static</span>
<span class="kn">from</span> <span class="nn">django.urls</span> <span class="kn">import</span> <span class="n">reverse</span>
<span class="kn">from</span> <span class="nn">jinja2</span> <span class="kn">import</span> <span class="n">Environment</span>
<span class="k">def</span> <span class="nf">environment</span><span class="p">(</span><span class="o">**</span><span class="n">options</span><span class="p">):</span>
<span class="n">env</span> <span class="o">=</span> <span class="n">Environment</span><span class="p">(</span><span class="o">**</span><span class="n">options</span><span class="p">)</span>
<span class="n">env</span><span class="o">.</span><span class="n">globals</span><span class="o">.</span><span class="n">update</span><span class="p">({</span>
<span class="s1">'static'</span><span class="p">:</span> <span class="n">static</span><span class="p">,</span>
<span class="s1">'url'</span><span class="p">:</span> <span class="n">reverse</span><span class="p">,</span>
<span class="p">})</span>
<span class="k">return</span> <span class="n">env</span>
</code></pre></div>
<h1 id="logging-setup">Logging Setup</h1>
<p>As I run my web application inside a Docker container, I came up with the
following setup for logging. All messages are logged to STDOUT, so they are
captured by the docker daemon. And I decided to colorize messages, so especially
during debugging sessions it is easier to distinguish a flood of debug messages
from any important warning or error messages. For colored logs to work you need
to install the <code>colorlog</code> package.</p>
<p>Here's the fragment from the Django project settings related to logging setup:</p>
<div class="highlight"><pre><span></span><code><span class="n">LOGGING</span> <span class="o">=</span> <span class="p">{</span>
<span class="s1">'version'</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
<span class="s1">'disable_existing_loggers'</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s1">'formatters'</span><span class="p">:</span> <span class="p">{</span>
<span class="c1"># verbose log message formatter</span>
<span class="s1">'verbose'</span><span class="p">:</span> <span class="p">{</span>
<span class="s1">'()'</span><span class="p">:</span> <span class="s1">'colorlog.ColoredFormatter'</span><span class="p">,</span>
<span class="s1">'format'</span><span class="p">:</span> <span class="s1">'[</span><span class="si">{asctime}</span><span class="s1">] </span><span class="si">{log_color}{levelname:<8}{reset}</span><span class="s1"> </span><span class="si">{name}</span><span class="s1">.</span><span class="si">{funcName}</span><span class="s1">:</span><span class="si">{lineno}</span><span class="s1"> </span><span class="si">{message}</span><span class="s1">'</span><span class="p">,</span>
<span class="s1">'datefmt'</span><span class="p">:</span> <span class="s1">'%Y-%m-</span><span class="si">%d</span><span class="s1"> %H:%M:%S'</span><span class="p">,</span>
<span class="s1">'style'</span><span class="p">:</span> <span class="s1">'{'</span><span class="p">,</span>
<span class="p">},</span>
<span class="c1"># simple log message format, currently not in use</span>
<span class="s1">'simple'</span><span class="p">:</span> <span class="p">{</span>
<span class="s1">'format'</span><span class="p">:</span> <span class="s1">'</span><span class="si">{levelname}</span><span class="s1"> </span><span class="si">{message}</span><span class="s1">'</span><span class="p">,</span>
<span class="s1">'style'</span><span class="p">:</span> <span class="s1">'{'</span><span class="p">,</span>
<span class="p">},</span>
<span class="p">},</span>
<span class="s1">'handlers'</span><span class="p">:</span> <span class="p">{</span>
<span class="c1"># log messages to console (stdout)</span>
<span class="s1">'console'</span><span class="p">:</span> <span class="p">{</span>
<span class="s1">'class'</span><span class="p">:</span> <span class="s1">'logging.StreamHandler'</span><span class="p">,</span>
<span class="s1">'formatter'</span><span class="p">:</span> <span class="s1">'verbose'</span><span class="p">,</span>
<span class="p">},</span>
<span class="c1"># Handler to log everything up to DEBUG level to file with log</span>
<span class="c1"># rotation. Currently not in use, as docker container handles log data</span>
<span class="c1"># written to console</span>
<span class="s1">'file'</span><span class="p">:</span> <span class="p">{</span>
<span class="s1">'level'</span><span class="p">:</span> <span class="s1">'DEBUG'</span><span class="p">,</span>
<span class="s1">'class'</span><span class="p">:</span> <span class="s1">'logging.handlers.RotatingFileHandler'</span><span class="p">,</span>
<span class="s1">'filename'</span><span class="p">:</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">BASE_DIR</span><span class="p">,</span> <span class="s1">'log'</span><span class="p">,</span> <span class="s1">'varweb.log'</span><span class="p">)),</span>
<span class="s1">'formatter'</span><span class="p">:</span> <span class="s1">'verbose'</span><span class="p">,</span>
<span class="s1">'maxBytes'</span><span class="p">:</span> <span class="mi">1024</span> <span class="o">*</span> <span class="mi">1024</span> <span class="o">*</span> <span class="mi">5</span><span class="p">,</span> <span class="c1"># 5 MB</span>
<span class="s1">'backupCount'</span><span class="p">:</span> <span class="mi">5</span><span class="p">,</span>
<span class="p">},</span>
<span class="p">},</span>
<span class="c1"># root logger catches all log messages. Everything warning and above is sent</span>
<span class="c1"># to the console and to the log file. Change the level e.g. to 'DEBUG' for</span>
<span class="c1"># the development settings</span>
<span class="s1">'root'</span><span class="p">:</span> <span class="p">{</span>
<span class="s1">'handlers'</span><span class="p">:</span> <span class="p">[</span><span class="s1">'console'</span><span class="p">],</span>
<span class="s1">'level'</span><span class="p">:</span> <span class="s1">'WARNING'</span><span class="p">,</span>
<span class="p">},</span>
<span class="c1"># Loggers below the django hierarchy log to console with warning level, but</span>
<span class="c1"># do not propagate to the root logger</span>
<span class="s1">'loggers'</span><span class="p">:</span> <span class="p">{</span>
<span class="s1">'django'</span><span class="p">:</span> <span class="p">{</span>
<span class="s1">'handlers'</span><span class="p">:</span> <span class="p">[</span><span class="s1">'console'</span><span class="p">],</span>
<span class="s1">'level'</span><span class="p">:</span> <span class="n">os</span><span class="o">.</span><span class="n">getenv</span><span class="p">(</span><span class="s1">'DJANGO_LOG_LEVEL'</span><span class="p">,</span> <span class="s1">'WARNING'</span><span class="p">),</span>
<span class="s1">'propagate'</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="p">},</span>
<span class="p">},</span>
<span class="p">}</span>
</code></pre></div>
<h1 id="dockerfile-for-django-project">Dockerfile for Django Project</h1>
<p>Here's and example to package your Django project into a Docker container based
on Alpine linux. This leads to nice small container images.</p>
<p>Here's the <code>Dockerfile</code>:</p>
<div class="highlight"><pre><span></span><code><span class="k">FROM</span> <span class="s">python:3.8-alpine</span>
<span class="k">ENV</span> PYTHONUNBUFFERED <span class="m">1</span>
<span class="k">ENV</span> APP_DIR /usr/src/app
<span class="c"># Patches for apk and pip to use Chinese mirrors</span>
<span class="k">COPY</span> tools/patches/pip.conf /etc/xdg/pip/pip.conf
<span class="k">RUN</span> sed -i <span class="s1">'s/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g'</span> /etc/apk/repositories
<span class="c"># Install nginx</span>
<span class="k">RUN</span> apk update <span class="se">\</span>
<span class="o">&&</span> apk --no-cache add nginx <span class="se">\</span>
<span class="o">&&</span> mkdir /run/nginx
<span class="k">COPY</span> tools/nginx.conf /etc/nginx/conf.d/default.conf
<span class="k">RUN</span> mkdir -p <span class="si">${</span><span class="nv">APP_DIR</span><span class="si">}</span> <span class="si">${</span><span class="nv">APP_DIR</span><span class="si">}</span>/media
<span class="k">WORKDIR</span><span class="s"> /${APP_DIR}</span>
<span class="c"># Install python packages (needs -dev packages for building, can be removed later)</span>
<span class="k">ADD</span> requirements <span class="si">${</span><span class="nv">APP_DIR</span><span class="si">}</span>/requirements
<span class="k">RUN</span> apk --no-cache add build-base jpeg-dev zlib-dev musl-dev <span class="se">\</span>
<span class="o">&&</span> python3 -m pip install --no-cache-dir -r requirements/prod.txt <span class="se">\</span>
<span class="o">&&</span> apk --no-cache del build-base jpeg-dev zlib-dev musl-dev <span class="se">\</span>
<span class="o">&&</span> apk --no-cache add musl zlib jpeg <span class="se">\</span>
<span class="o">&&</span> rm -rf /var/cache/apk/*
<span class="c"># Add the application</span>
<span class="k">ADD</span> . <span class="si">${</span><span class="nv">APP_DIR</span><span class="si">}</span>
<span class="k">RUN</span> python3 manage.py collectstatic --no-input
<span class="k">EXPOSE</span><span class="s"> 80</span>
<span class="k">CMD</span> <span class="p">[</span><span class="s2">"./tools/start-server.sh"</span><span class="p">]</span>
</code></pre></div>
<p>As I'm living in China, I patch the package sources for <code>apk</code> (the Alpine Linux
package manager) and <code>pip</code> to fetch packages from fast Chinese mirrors, as the
default sources are extremely slow when accessed from the Chinese internet.</p>
<p>In this example I have <code>Pillow</code>, the Python image library, as one
dependency. When it is installed for Alpine Linux, it is built from source
(parts of it are implemented in C). To be able to do this while building the
container image, I have one RUN command with these steps:</p>
<ul>
<li>
<p>first install all build dependencies (<code>apt add jpeg-dev zlib-dev ...</code>),</p>
</li>
<li>
<p>then install the required Python packages with <code>python3 -m pip install ...</code>,</p>
</li>
<li>
<p>then remove the build dependencies (<code>apk del build-base ...</code>) and replace
them by the corresponding runtime libraries (<code>apt add musl zlib jpeg</code>)</p>
</li>
</ul>
<p>I did not fully trust the <code>--no-cache</code> option to <code>apk</code> and still remove the
complete cache directory at the end.</p>
<p>Currently with Python 3.8 and a very simple Django application, the Docker image
size is 154MB.</p>
<h1 id="application-start-script-respecting-ctrl-c">Application Start Script respecting CTRL-C</h1>
<p>Initially I had some trouble to set up the Docker container, so that I can easily
terminate it with <code>Ctrl-C</code>. Most of the time the container waits for ca. 10
seconds before (I guess forcefully) terminating the application.</p>
<p>To fix this, there are two things to observe:</p>
<ul>
<li>
<p>The <code>CMD</code> line in the <code>Dockerfile</code> must use the Javascript array notation
<code>["..."]</code>.</p>
</li>
<li>
<p>The actual start script, a shell script in my case, must use <code>exec</code>.</p>
</li>
</ul>
<p>This ensures that the main process of your application is the one receiving
signals like SIGTERM or SIGINT (which is sent when you press <code>Ctrl-C</code>) instead
of any wrapper process or a shell instance.</p>
<p>Here's the <code>start-server.sh</code> script I use:</p>
<div class="highlight"><pre><span></span><code><span class="ch">#!/usr/bin/env sh</span>
<span class="c1">#</span>
<span class="c1"># Start script for running inside docker container</span>
<span class="c1">#</span>
<span class="c1"># Set up database</span>
python3 manage.py migrate
<span class="c1"># Create admin user (password is shown during startup in the logs)</span>
python3 manage.py initadmin
<span class="c1"># If nothing else is set already, we run the testing config for the container</span>
<span class="k">if</span> <span class="o">[</span> -z <span class="s2">"</span><span class="si">${</span><span class="nv">DJANGO_SETTINGS_MODULE</span><span class="si">}</span><span class="s2">"</span> <span class="o">]</span>
<span class="k">then</span>
<span class="nb">export</span> <span class="nv">DJANGO_SETTINGS_MODULE</span><span class="o">=</span>dbloc.settings.testing
<span class="k">fi</span>
<span class="c1"># Start nginx for serving static and media files and act as a reverse proxy for</span>
<span class="c1"># gunicorn. It starts as a daemon automatically.</span>
nginx -c /etc/nginx/nginx.conf
<span class="nb">exec</span> gunicorn dbloc.wsgi
</code></pre></div>
<h1 id="creating-an-admin-user-at-first-start">Creating an Admin User at First Start</h1>
<p>Usually you use the <code>manage.py createsuperuser</code> command to create the first
user with admin rights for your application. I wanted to automate this, so I
created an additional command for <code>manage.py</code> to automatically create and admin
user with a random password. The user is only created if no users exist in the
database yet.</p>
<div class="highlight"><pre><span></span><code><span class="sd">'''Admin command implementation for 'initadmin' command.'''</span>
<span class="kn">import</span> <span class="nn">random</span>
<span class="kn">import</span> <span class="nn">string</span>
<span class="kn">from</span> <span class="nn">django.core.management.base</span> <span class="kn">import</span> <span class="n">BaseCommand</span>
<span class="kn">from</span> <span class="nn">django.contrib.auth.models</span> <span class="kn">import</span> <span class="n">User</span>
<span class="k">def</span> <span class="nf">gen_password</span><span class="p">(</span><span class="n">length</span><span class="o">=</span><span class="mi">8</span><span class="p">):</span>
<span class="sd">'''Generate a random password.'''</span>
<span class="c1"># we use upper and lower case letters and digits for the password</span>
<span class="n">letters</span> <span class="o">=</span> <span class="n">string</span><span class="o">.</span><span class="n">ascii_letters</span> <span class="o">+</span> <span class="n">string</span><span class="o">.</span><span class="n">digits</span>
<span class="k">return</span> <span class="s1">''</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">random</span><span class="o">.</span><span class="n">choices</span><span class="p">(</span><span class="n">letters</span><span class="p">,</span> <span class="n">k</span><span class="o">=</span><span class="n">length</span><span class="p">))</span>
<span class="k">class</span> <span class="nc">Command</span><span class="p">(</span><span class="n">BaseCommand</span><span class="p">):</span>
<span class="sd">'''Admin command to create an admin user with random password.</span>
<span class="sd"> The admin user is only created if no other users are already in the</span>
<span class="sd"> database.</span>
<span class="sd"> '''</span>
<span class="k">def</span> <span class="nf">handle</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">options</span><span class="p">):</span>
<span class="k">if</span> <span class="n">User</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">count</span><span class="p">()</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">'No users yet in database. Creating admin user.'</span><span class="p">)</span>
<span class="n">username</span> <span class="o">=</span> <span class="s1">'admin'</span>
<span class="n">email</span> <span class="o">=</span> <span class="s1">'admin@localhost'</span>
<span class="n">password</span> <span class="o">=</span> <span class="n">gen_password</span><span class="p">(</span><span class="mi">8</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">'Creating account for </span><span class="si">%s</span><span class="s1"> (</span><span class="si">%s</span><span class="s1">)'</span> <span class="o">%</span> <span class="p">(</span><span class="n">username</span><span class="p">,</span> <span class="n">email</span><span class="p">))</span>
<span class="n">admin</span> <span class="o">=</span> <span class="n">User</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">create_superuser</span><span class="p">(</span>
<span class="n">email</span><span class="o">=</span><span class="n">email</span><span class="p">,</span>
<span class="n">username</span><span class="o">=</span><span class="n">username</span><span class="p">,</span>
<span class="n">password</span><span class="o">=</span><span class="n">password</span><span class="p">)</span>
<span class="n">admin</span><span class="o">.</span><span class="n">is_active</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">admin</span><span class="o">.</span><span class="n">is_admin</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">admin</span><span class="o">.</span><span class="n">save</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">"Account crated with password '</span><span class="si">{0}</span><span class="s2">'."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">password</span><span class="p">))</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">"Please change password immediately."</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">'Admin accounts can only be initialized if no Accounts exist'</span><span class="p">)</span>
</code></pre></div>
<p>When starting the application the first time, you can see the initial admin
password in the log output. Of course you should immediately change it.</p>Table of Contents for Pelican Posts2020-02-29T00:00:00+08:002020-02-29T00:00:00+08:00andreastag:www.a-netz.de,2020-02-29:/blog/2020/02/table-of-contents-for-pelican-posts.html<div class="toc"><span class="toctitle">Table of Contents</span><ul>
<li><a href="#enable-markdown-extension">Enable Markdown Extension</a></li>
<li><a href="#define-css-style">Define CSS Style</a></li>
<li><a href="#add-a-toc-to-your-posts">Add a TOC to your Posts</a></li>
</ul>
</div>
<p>Here's a short post to show you how to insert a table of contents (TOC) into
posts on a website generated with <a href="https://getpelican.com">Pelican</a>. You can see an example of the TOC
at the beginning of …</p><div class="toc"><span class="toctitle">Table of Contents</span><ul>
<li><a href="#enable-markdown-extension">Enable Markdown Extension</a></li>
<li><a href="#define-css-style">Define CSS Style</a></li>
<li><a href="#add-a-toc-to-your-posts">Add a TOC to your Posts</a></li>
</ul>
</div>
<p>Here's a short post to show you how to insert a table of contents (TOC) into
posts on a website generated with <a href="https://getpelican.com">Pelican</a>. You can see an example of the TOC
at the beginning of this post.</p>
<p>Adding a table of contents can be done in three easy steps:</p>
<ul>
<li>Enable the markdown extension in the configuration</li>
<li>Add CSS styling to your theme</li>
<li>Add the TOC tag to your articles</li>
</ul>
<h1 id="enable-markdown-extension">Enable Markdown Extension</h1>
<p>Edit your <code>pelicanconf.py</code> configuration file and add the setting to enable the
Markdown TOC extension like this:</p>
<div class="highlight"><pre><span></span><code><span class="n">MARKDOWN</span> <span class="o">=</span> <span class="p">{</span>
<span class="s1">'extension_configs'</span><span class="p">:</span> <span class="p">{</span>
<span class="c1"># Needed for code syntax highlighting</span>
<span class="s1">'markdown.extensions.codehilite'</span><span class="p">:</span> <span class="p">{</span>
<span class="s1">'css_class'</span><span class="p">:</span> <span class="s1">'highlight'</span>
<span class="p">},</span>
<span class="s1">'markdown.extensions.extra'</span><span class="p">:</span> <span class="p">{},</span>
<span class="s1">'markdown.extensions.meta'</span><span class="p">:</span> <span class="p">{},</span>
<span class="c1"># This is for enabling the TOC generation</span>
<span class="s1">'markdown.extensions.toc'</span><span class="p">:</span> <span class="p">{</span>
<span class="s1">'title'</span><span class="p">:</span> <span class="s1">'Table of Contents'</span><span class="p">,</span>
<span class="p">},</span>
<span class="p">},</span>
<span class="s1">'output_format'</span><span class="p">:</span> <span class="s1">'html5'</span><span class="p">,</span>
<span class="p">}</span>
</code></pre></div>
<p>This code enables the extension and defines the title above the table of
contents. You can modify the title if you want.</p>
<h1 id="define-css-style">Define CSS Style</h1>
<p>It's not strictly required to add CSS to format the TOC, but with some CSS the
TOC looks much more nice. Here's the formatting for my website.</p>
<div class="highlight"><pre><span></span><code><span class="p">.</span><span class="nc">toc</span> <span class="p">{</span>
<span class="k">font-size</span><span class="p">:</span> <span class="kc">small</span><span class="p">;</span>
<span class="k">display</span><span class="p">:</span> <span class="kc">table</span><span class="p">;</span>
<span class="k">width</span><span class="p">:</span> <span class="kc">auto</span><span class="p">;</span>
<span class="p">}</span>
<span class="c">/* TOC heading in bold */</span>
<span class="p">.</span><span class="nc">toc</span> <span class="p">.</span><span class="nc">toctitle</span> <span class="p">{</span>
<span class="k">font-weight</span><span class="p">:</span> <span class="kc">bold</span><span class="p">;</span>
<span class="p">}</span>
<span class="c">/* No bullets for toc list, indentation of nested lists 1em */</span>
<span class="p">.</span><span class="nc">toc</span> <span class="nt">ul</span> <span class="p">{</span>
<span class="k">list-style-type</span><span class="p">:</span> <span class="kc">none</span><span class="p">;</span>
<span class="k">padding-left</span><span class="p">:</span> <span class="mi">1</span><span class="kt">rem</span><span class="p">;</span>
<span class="p">}</span>
<span class="c">/* Top level list has no indentation */</span>
<span class="p">.</span><span class="nc">toc</span> <span class="o">></span> <span class="nt">ul</span> <span class="p">{</span>
<span class="c">/* no indentation */</span>
<span class="k">padding-left</span><span class="p">:</span> <span class="mi">0</span><span class="p">;</span>
<span class="k">margin-top</span><span class="p">:</span> <span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
</code></pre></div>
<h1 id="add-a-toc-to-your-posts">Add a TOC to your Posts</h1>
<p>This is quite simple. Just add the <code>[TOC]</code> tag where you want the table of
contents to appear.</p>Thoughts on Pluralsight2020-02-26T00:00:00+08:002020-02-26T00:00:00+08:00andreastag:www.a-netz.de,2020-02-26:/blog/2020/02/thoughts-on-pluralsight.html<p>It's now roughly two and a half years I since I have signed up with
<a href="https://www.pluralsight.com">Pluralsight</a>. So I think now is a good time to draw some conclusions. Here are
a few thoughts and my experience with watching trainings on Pluralsight.</p>
<h1 id="motivation">Motivation</h1>
<p>I'm in general interested in IT technology. So …</p><p>It's now roughly two and a half years I since I have signed up with
<a href="https://www.pluralsight.com">Pluralsight</a>. So I think now is a good time to draw some conclusions. Here are
a few thoughts and my experience with watching trainings on Pluralsight.</p>
<h1 id="motivation">Motivation</h1>
<p>I'm in general interested in IT technology. So I want (and also need for my job)
to stay up to date about which technologies exist, evolve and how they work.</p>
<p>Often I start to learn about some technology, because I read about it on Twitter
or some blog. When I read more often about the same topic, I perhaps get
interested and start investigating details. But this approach is mostly not
directed towards any goal. There are some issues with this approach:</p>
<ul>
<li>
<p><strong>Efficiency</strong>: It's too easy to get distracted. (Isn't this the main
purpose of social media platforms?) So discovery and learning happens by
chance and very slowly.</p>
</li>
<li>
<p><strong>Discovery:</strong> This works more or less well on Twitter. I follow enough
persons, so that new or interesting topics often pop up. As long as the
interesting topics pass into my filter bubble. E.g. for things related to IT
security, this works well. Finding out about other topics, e.g. related to
containerization or mechanical CAD design, this does not work at all for
me. Even if I try, it's extremely hard to escape your personal filter
bubble, both on Twitter and Youtube.</p>
</li>
<li>
<p><strong>No broad overview:</strong> It's not obvious if you get a broad overview of a
topic or just a very slim detail. Sometimes that's exactly what I'm
interested in, but more often it leads to unconnected fragments of
knowledge. </p>
</li>
</ul>
<p>Especially when I noticed that I was often browsing Twitter or Youtube,
sometimes for hours, in the hope to find something new or interesting, I felt
that my approach had to change. After hearing about Pluralsight (on Twitter...)
and some investigation and , I decided to give it a try.</p>
<h1 id="pluralsight">Pluralsight</h1>
<p>Pluralsight offers <a href="https://www.pluralsight.com/browse">trainings</a> mainly focussed on IT and technology. Courses
in Pluralsight are usually between one and a few hours long. There are also
shorter videos of about 20 to 30 Minutes to give a broader overview about some
topic (<em>the big picture</em> courses). Courses are divided into modules, which
handle one topic or aspect and are usually 15 to 45 minutes long. Depending on
the topic, the courses contain theoretical learning sections, where you see a
presentation and demo sections to show something in practice, e.g. how to use
some tool.</p>
<p>They provide certificates for every course you complete. The certificates show
that you have completed a course by watching the complete set of videos. There
is no exam.</p>
<p>Courses are sometimes combined to <a href="https://www.pluralsight.com/product/paths">learning paths</a>. This is a collection of a few
courses, usually starting at beginner level and with increasing level covering
one topic extensively.</p>
<h1 id="results-so-far">Results so far</h1>
<p>I signed up with Pluralsight in August 2017 for a 10 hour free trial and then a
monthly plan for ca. 30 USD. I feel that the courses are presented in a way that
makes me enjoy watching them. I do not feel like this is work. It does not feel
for me like much effort to learn something, but often more like a good
alternative to watching videos on Youtube. I watch because I am interested. It's
out of curiosity and not so much with the clear goal to accumulate knowledge.</p>
<p>After a few month with the monthly plan I changed to a yearly subscription for
ca. 300 USD (they often have special offers with reduced price when signing
up). Since August 2017 I have now watched a bit more than 100 courses, i.e. it's
a bit less than one course per week.</p>
<p>I see that there are times, e.g. when there is much work to do in office and I
am tired in the evening, that I do not use Pluralsight much. But that's ok, as
so far I do this only in my free time and not with a clear purpose or goal,
e.g. to advance my career. But as soon as I have some more free time, I again
like to watch courses.</p>
<p>The bigger topics and areas that I covered in the last 2.5 years are these:</p>
<ul>
<li>
<p><strong>Basics of CAD design, especially with Fusion 360</strong> - I am a computer
scientist working in automotive embedded systems design, so both software and
hardware are part of my daily job. But I never got a connection to mechanical
design yet. This changed when I got a 3D printer...</p>
</li>
<li>
<p><strong>Docker and containerization</strong> - This also was a completely new topic for me
and without starting with the training courses I would not have put it to use
so soon.</p>
</li>
<li>
<p><strong>Linux system administration</strong> - I use Linux for a long time and think I know
many details, but getting the perspective of a professional systems
administration is still different.</p>
</li>
<li>
<p><strong>Git</strong> - I already used it for some time, but the courses helped me to
understand many more details and internals.</p>
</li>
<li>
<p><strong>Python</strong> - As I use Python very frequently, I knew already many of the
things presented in the courses. Still I could learn about some details and
underlying concepts.</p>
</li>
<li>
<p><strong>Many smaller topics</strong> - E.g. how to use Wireshark, ARP and ICMP protocol,
MongoDB, Block chain, Web Assembly, ...</p>
</li>
</ul>
<h1 id="conclusion">Conclusion</h1>
<p>Many of the things I learned do now give me some advantage at work. Even if I do
not put everything to use, I have a broader understanding now. Other things I
only started to use at work (e.g. git and docker), because I learned enough
about it to put these tools to good use from the beginning.</p>
<p>So far I think it was definitely worth to invest the money and the time for
learning. </p>TS100 Soldering Iron - First Impression2020-02-24T00:00:00+08:002020-02-24T00:00:00+08:00andreastag:www.a-netz.de,2020-02-24:/blog/2020/02/ts100-soldering-iron-first-impression.html<div class="toc"><span class="toctitle">Table of Contents</span><ul>
<li><a href="#unboxing">Unboxing</a></li>
<li><a href="#first-impression">First Impression</a></li>
<li><a href="#original-firmware">Original Firmware</a></li>
<li><a href="#open-source-firmware">Open Source Firmware</a><ul>
<li><a href="#usage">Usage</a></li>
</ul>
</li>
<li><a href="#conclusion">Conclusion</a></li>
</ul>
</div>
<p>After reading some good reviews about the TS100 soldering iron, I decided to buy
one by myself. Here's my first impression.</p>
<p>The TS100 is produced by the Chinese company <a href="http://www.miniware.com.cn">Miniware</a>. Have a look at the
<a href="http://www.miniware.com.cn/product/ts100-soldering-iron-b2-tip-hot-air-soldering-station/">product page …</a></p><div class="toc"><span class="toctitle">Table of Contents</span><ul>
<li><a href="#unboxing">Unboxing</a></li>
<li><a href="#first-impression">First Impression</a></li>
<li><a href="#original-firmware">Original Firmware</a></li>
<li><a href="#open-source-firmware">Open Source Firmware</a><ul>
<li><a href="#usage">Usage</a></li>
</ul>
</li>
<li><a href="#conclusion">Conclusion</a></li>
</ul>
</div>
<p>After reading some good reviews about the TS100 soldering iron, I decided to buy
one by myself. Here's my first impression.</p>
<p>The TS100 is produced by the Chinese company <a href="http://www.miniware.com.cn">Miniware</a>. Have a look at the
<a href="http://www.miniware.com.cn/product/ts100-soldering-iron-b2-tip-hot-air-soldering-station/">product page</a> for overview. From my point of view the interesting features are
these:</p>
<ul>
<li>
<p><strong>Tips: </strong> The electronics and tips are separate. The tips contain the
heating element, which makes them heat up very fast. Also good for quick
regulation when much heat is drained from the tip. This is helpfil e.g. when
starting to solder on a copper ground plane or a thick cable.</p>
</li>
<li>
<p><strong>Electronics:</strong> Integrated electronics based on an STM32
microcontroller. Schematics and bootloader interface are published, so it's
possible to create alternative firmware.</p>
</li>
<li>
<p><strong>Display:</strong> Small OLED display to show current tip temperature and status.</p>
</li>
<li>
<p><strong>Weight:</strong> Very light-weight and easy to handle.</p>
</li>
<li>
<p><strong>Powering:</strong> Can be powered by a standard power-supply, starting from 12V up
to 24V, but also e.g. with a LiIon battery pack. This is nice, if you're out
and having to repair something where no power socket is available.</p>
</li>
</ul>
<p>Official firmware and related files (manual, schematics (!), etc.) can be
downloaded from the Miniware <a href="http://www.minidso.com/forum.php?mod=viewthread&tid=892">discussion board</a>. The first post in the linked
thread seems to be updated with links to the most recent version of firmware and
documents.</p>
<h1 id="unboxing">Unboxing</h1>
<p>Here are a few pictures from unboxing. I ordered these items from <a href="https://m.tb.cn/h.VdDCwqk?sm=3d69c8">Taobao</a> for
RMB 407,- in total (ca. EUR 53,50):</p>
<ul>
<li>TS100 soldering iron with pointy type I tip (there are other tips available,
too)</li>
<li>Wire stand / rest</li>
<li>Power supply 19V, 2.25A</li>
<li>XT60 cable for powering with LiIon battery pack</li>
</ul>
<figure>
<a href="https://www.a-netz.de/blog/2020/02/images/ts100-order.jpg">
<img src="https://www.a-netz.de/blog/2020/02/images/ts100-order.jpg"
title="Order from Taobao arived :-D"
alt="Order from Taobao arived :-D">
</a>
<figcaption>Order from Taobao arived :-D</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2020/02/images/ts100-box.jpg">
<img src="https://www.a-netz.de/blog/2020/02/images/ts100-box.jpg"
title="The TS100 comes nicely packaged in a small
box. As handle and tip are separated, this is not convenient for later
storage."
alt="The TS100 comes nicely packaged in a small
box. As handle and tip are separated, this is not convenient for later
storage.">
</a>
<figcaption>The TS100 comes nicely packaged in a small
box. As handle and tip are separated, this is not convenient for later
storage.</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2020/02/images/ts100-separate.jpg">
<img src="https://www.a-netz.de/blog/2020/02/images/ts100-separate.jpg"
title="Handle with electronics and tip with heading
element still separated."
alt="Handle with electronics and tip with heading
element still separated.">
</a>
<figcaption>Handle with electronics and tip with heading
element still separated.</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2020/02/images/ts100-rest.jpg">
<img src="https://www.a-netz.de/blog/2020/02/images/ts100-rest.jpg"
title="The rest is just a piece of bent wire, which is
clipped on."
alt="The rest is just a piece of bent wire, which is
clipped on.">
</a>
<figcaption>The rest is just a piece of bent wire, which is
clipped on.</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2020/02/images/ts100-connector.jpg">
<img src="https://www.a-netz.de/blog/2020/02/images/ts100-connector.jpg"
title="Connector polarity is clearly indicated. On
top is a small screw for attaching ESD protection / ground cable. "
alt="Connector polarity is clearly indicated. On
top is a small screw for attaching ESD protection / ground cable. ">
</a>
<figcaption>Connector polarity is clearly indicated. On
top is a small screw for attaching ESD protection / ground cable. </figcaption>
</figure>
<h1 id="first-impression">First Impression</h1>
<p>The soldering iron is really small and light. It feels much like a normal pen. I
ordered the "I" type pointy tip and can imaging that it's really useful to
solder small SMD components.</p>
<figure>
<a href="https://www.a-netz.de/blog/2020/02/images/ts100-size.jpg">
<img src="https://www.a-netz.de/blog/2020/02/images/ts100-size.jpg"
title="The TS100 is really slim and small"
alt="The TS100 is really slim and small">
</a>
<figcaption>The TS100 is really slim and small</figcaption>
</figure>
<p>The power supply, some no-name supply with 19V, 2.25A, has a nice flexible
cable, which additionally helps to do precision work.</p>
<p>Overall build quality seems really good.</p>
<h1 id="original-firmware">Original Firmware</h1>
<p>When powering the soldering iron, it shows the installed firmware version. Mine
had version 2.18. The official firmware works without flaw. Usage is a bit
difficult, because there are only two buttons to control everything.</p>
<p>I did not try it in too much detail, because I have already plans to flash an
alternative open source firmware.</p>
<p>When connecting the soldering iron by USB, it emulates a USB drive with a
<code>config.txt</code> file. In this file you can configure some parameters like
undervoltage shutdown (useful for operation with batteries), etc.</p>
<h1 id="open-source-firmware">Open Source Firmware</h1>
<p>On Github you can find the <a href="https://github.com/Ralim/ts100">Ralim TS100</a> firmware. <a href="https://github.com/Ralim/ts100/wiki/Upgrading-Firmware">Flashing</a> is done in a few
steps, as described here for Linux:</p>
<ul>
<li>
<p>Download the recent firmware release. There are many translations available, I
took the English version <code>TS100_EN.hex</code></p>
</li>
<li>
<p>Download the bash <a href="https://raw.githubusercontent.com/Ralim/ts100/master/Flashing/flash_ts100_linux.sh">flash helper script</a></p>
</li>
<li>
<p>Press the <code>A</code> button (close to the tip) and while holding it, connect the
USB cable. The soldering iron stays now in bootloader mode for flashing and
displays <code>DFU ...</code>.</p>
</li>
<li>
<p>Run the flash helper script with the firmware as parameter.</p>
</li>
</ul>
<p>When connecting the soldering iron while pressing the <code>A</code> button, it will enter
bootloader mode. In this mode, a USB mass storage device is emulated (like a USB
stick). Copying the firmware to the device starts the flash process. When
finished, the file extension appears to be renamed from <code>.HEX</code> to either <code>.ERR</code>
(flashing failed) or <code>.RDY</code> (flashing successful).</p>
<p>It seems this procedure is not 100% stable. I needed two tries to get the
firmware flashed. This is also mentioned in
the [documentation][Flashing with Linux].</p>
<h2 id="usage">Usage</h2>
<p>I do not yet have a detailed understanding of all the features of the
firmware. So here just some overview.</p>
<p>The Ralim firmware does not support emulating a USB drive for
configuration. Instead all settings can be made through the menu system of the
soldering iron itself.</p>
<p>After playing with the configuration settings, I now have the display showing
the current tip temperature, the supply voltage and the power used for heating.</p>
<figure>
<a href="https://www.a-netz.de/blog/2020/02/images/ts100-display.jpg">
<img src="https://www.a-netz.de/blog/2020/02/images/ts100-display.jpg"
title="Main screen showing tip temperature, set
temperature and voltage."
alt="Main screen showing tip temperature, set
temperature and voltage.">
</a>
<figcaption>Main screen showing tip temperature, set
temperature and voltage.</figcaption>
</figure>
<p>Pressing one of the buttons powers on the soldering iron. Then you can set the
tip temperature. Heating up is really fast. After power-on the tip heats up in a
ca. 15 seconds from room temperature to 330 degree celsius when using the 19V
power supply. Lower supply voltage makes it slower.</p>
<figure>
<video witdth="480" height="320" controls>
<source src="https://www.a-netz.de/blog/2020/02/images/ts100-heating-up.mp4" type="video/mp4" />
Video not supported by your browser.
</video>
<figcaption>Heating up to 330 degree celsius</figcaption>
</figure>
<p>After some time the soldering iron goes into standby mode and reduces the tip
temperature. It returns to normal operation as soon as you move it. It seems to
have integrated a motion sensor. This is also used to always orient the display
contents in the right way.</p>
<h1 id="conclusion">Conclusion</h1>
<p>So far I'm really happy with the TS100 and would recommend to buy it. I would
even say it can replace even a much more expensive professional soldering
station in some cases.</p>Custom Errorpage for Pelican Blog2020-02-23T00:00:00+08:002020-02-23T00:00:00+08:00andreastag:www.a-netz.de,2020-02-23:/blog/2020/02/custom-errorpage-for-pelican-blog.html<p>When a visitor clicks a link to a page on your website, which does not exist,
the webserver will generate a 404 error response and usually show a default
error page. After migrating my website to <a href="https://getpelican.com">Pelican</a>, my goal is to inform
visitors about the restructuring and give some help …</p><p>When a visitor clicks a link to a page on your website, which does not exist,
the webserver will generate a 404 error response and usually show a default
error page. After migrating my website to <a href="https://getpelican.com">Pelican</a>, my goal is to inform
visitors about the restructuring and give some help to find the content they are
looking for. That's why I have set up a custom 404 error page for this website.</p>
<p>There are two steps needed:</p>
<ul>
<li>Configure Apache to serve a custom error page for the <em>404 Not Found</em> error.</li>
<li>Create a suitable error page (with Pelican)</li>
</ul>
<h1 id="set-up-apache">Set up Apache</h1>
<p>First we need to tell the webserver to serve a custom error page. For this, you
can either modify the main apache configuration or - as I have done - put the
new setting into an <code>.htaccess</code> file in the <code>/blog</code> subdirectory, where my
website is stored.</p>
<p>Then you need just one line to tell Apache, which page to send out, if a
non-existent URL is requested. Ensure that you use an abolute path for the error
page (not filesystem path, but path in the URL).</p>
<div class="highlight"><pre><span></span><code><span class="c"># Page to show on 404 error. You cannot specify relative paths here!</span>
<span class="nb">ErrorDocument</span> <span class="m">404</span> <span class="sx">/blog/pages/error-404.html</span>
</code></pre></div>
<h1 id="create-the-error-page">Create the Error Page</h1>
<p>I put a file named
<code>error-404.md</code> into the <code>content/pages</code> directory of my Pelican project and
added some text, including some links, e.g. to my About page. The result is this <a href="https://www.a-netz.de/blog/pages/error-404.html">error page</a>.</p>
<p>Then I realized, that there is one issue. I want to add links to the error
page. Pelican generates links as relative links. But the error page is served
for each non-existing URL! So if someone tries to access the URL
<code>https://www.a-netz.de/blog/a/b/c/d/e</code>, the error page is served under this
URL. If the error page now contains a link to ../../pages/about.html, this will
not work, because the browser will now request
<code>https://www.a-netz.de/blog/a/b/c/pages/about.html</code>, which also does not
exist. So relative links on this page do not work.</p>
<h1 id="simple-workaround">Simple Workaround</h1>
<p>The simple workaround would be to just put absolute links in the error page. As
I use the development server when writing content, the pages are served from
<code>http://localhost:8000</code>. And on my blog, they are served from
<code>https://www.a-netz.de/blog</code>. So absolute links to not work for both use cases.</p>
<h1 id="better-solution">Better Solution</h1>
<p>I realized, that Pelican already knows about the root location of my website. It
has the <a href="https://docs.getpelican.com/en/stable/settings.html#SITEURL">SITEURL</a> setting! Now how to put this automatically into the
<code>error-404.md</code> page? That must be possible with the <a href="https://github.com/getpelican/pelican-plugins/tree/master/jinja2content">jinja2content</a> plugin.</p>
<p>But unfortunately, this plugin does not provide any context when processing the
page content with <a href="https://palletsprojects.com/p/jinja">Jinja</a>. So I cannot access the <code>SITEURL</code> value. One small
modification to the <code>read(...)</code> method later, the plugin knows about all Pelican
settings...</p>
<div class="highlight"><pre><span></span><code> <span class="k">def</span> <span class="nf">read</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">source_path</span><span class="p">):</span>
<span class="n">prefix</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">settings</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'JINJA2CONTENT_PREFIX'</span><span class="p">,</span> <span class="s1">''</span><span class="p">)</span>
<span class="k">with</span> <span class="n">pelican_open</span><span class="p">(</span><span class="n">source_path</span><span class="p">)</span> <span class="k">as</span> <span class="n">text</span><span class="p">:</span>
<span class="n">content</span> <span class="o">=</span> <span class="n">prefix</span> <span class="o">+</span> <span class="n">text</span>
<span class="c1"># Pass the settings dictionary as context to Jinja</span>
<span class="n">content</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="o">.</span><span class="n">from_string</span><span class="p">(</span><span class="n">content</span><span class="p">)</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="o">**</span><span class="bp">self</span><span class="o">.</span><span class="n">settings</span><span class="p">)</span>
<span class="k">with</span> <span class="n">NamedTemporaryFile</span><span class="p">(</span><span class="n">delete</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">content</span><span class="o">.</span><span class="n">encode</span><span class="p">())</span>
<span class="n">f</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
<span class="n">content</span><span class="p">,</span> <span class="n">metadata</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="n">f</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">f</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
<span class="k">return</span> <span class="n">content</span><span class="p">,</span> <span class="n">metadata</span>
</code></pre></div>
<p>Now I can create links in the error page like this:</p>
<div class="highlight"><pre><span></span><code>{{ SITEURL }}/pages/about.html
</code></pre></div>
<p>The link will correctly adjust when I access the page on the Pelican
devserver. And also adjusts when deploying content to my main webserver.</p>
<p><strong>Note:</strong> I'm planning to contribute my changes to the <code>jinja2content</code> plugin
back to the Pelican project. If you're lucky, you can soon use an unmodified
version of the plugin for this.</p>Using Jinja Templates in Pelican Posts2020-02-23T00:00:00+08:002020-02-23T00:00:00+08:00andreastag:www.a-netz.de,2020-02-23:/blog/2020/02/using-jinja-templating-in-pelican-posts.html<p>When <a href="https://www.a-netz.de/blog/2020/02/from-wordpress-to-pelican.html">changing from Wordpress to Pelican</a>, I found one thing that I did not
like. When inserting images in a post, the image would be inserted as a simple
<code>img</code> tag in the HTML output. I would like to use figures, like e.g. in
scientific papers, with captions and …</p><p>When <a href="https://www.a-netz.de/blog/2020/02/from-wordpress-to-pelican.html">changing from Wordpress to Pelican</a>, I found one thing that I did not
like. When inserting images in a post, the image would be inserted as a simple
<code>img</code> tag in the HTML output. I would like to use figures, like e.g. in
scientific papers, with captions and a frame around.</p>
<p>After some research, I found that</p>
<ul>
<li>HTML 5 supports the <code>figure</code> and <code>figcaption</code> tags. This is exactly what I
want!</li>
<li>I can embed any HTML code in the markdown content for Pelican.</li>
<li>I do not like to mix Markdown and HTML in the content. It's error-prone and
much to type.</li>
</ul>
<p>After some talking to Google and browsing the webs, I found that there is the
<a href="https://github.com/getpelican/pelican-plugins/tree/master/jinja2content">jinja2content</a> plugin for Pelcian to support <a href="https://palletsprojects.com/p/jinja/">Jinja</a> template code inside the
post content. Around this plugin I set up a nice solution for adding figures to
my posts. The idea is the following:</p>
<ul>
<li>Use <code>jinja2content</code> to be able to use Jinja template code in posts</li>
<li>Import a file with Jinja macros into every post</li>
<li>Write a Jinja macro to generate HTML code for a figure with caption.</li>
</ul>
<h1 id="set-up-the-jinja2content-plugin">Set up the Jinja2Content Plugin</h1>
<p>The plugin is part of the <a href="https://getpelican.com">Pelican</a> <a href="https://github.com/getpelican/pelican-plugins">plugin repository</a> on Github. It's easy to
set up:</p>
<ul>
<li>Clone the <a href="https://github.com/getpelican/pelican-plugins">plugin repository</a></li>
<li>Copy the <code>jinja2content</code> folder into the <code>plugins</code> folder of your Pelican
project.</li>
<li>Update <code>pelicanconf.py</code> to enable the plugin like this:</li>
</ul>
<div class="highlight"><pre><span></span><code><span class="c1"># pelicanconf.py</span>
<span class="n">PLUGIN_PATHS</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'plugins'</span><span class="p">]</span>
<span class="n">PLUGINS</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'jinja2content'</span><span class="p">]</span>
</code></pre></div>
<p>Now you can use <a href="https://palletsprojects.com/p/jinja/">Jinja</a> template code in your posts.</p>
<h1 id="adding-support-for-figures">Adding Support for Figures</h1>
<p>By default, the <code>jinja2content</code> plugin searches for templates in the theme
template folder. So you can include or import templates from there. So I create
a template file called <code>macros.html</code> with a macro to generate HTML code for a
figure and put it into my theme <code>templates</code> folder.</p>
<p><strong>Note:</strong> In the following code examples, all Jinja start and end tags <code>{{
... }}</code>, <code>{% ... %}</code> and <code>{# ... #}</code> are replaced with square
brackets <code>[[ ... ]]</code>, <code>[% ... %]</code> and [# ... #]`. Otherwith the Jinja template
engine would try to interpret them in this post. When copy & pasting this code,
you need to replace the braces accordingly!</p>
<div class="highlight"><pre><span></span><code>[# Macro to add a figure with caption to a post. #]
[% macro figure(src, caption='') -%]
<span class="p"><</span><span class="nt">figure</span><span class="p">></span>
<span class="p"><</span><span class="nt">a</span> <span class="na">href</span><span class="o">=</span><span class="s">"[[ '{' ]]attach[[ '}' ]]images/[[ src ]]"</span><span class="p">></span>
<span class="p"><</span><span class="nt">img</span> <span class="na">src</span><span class="o">=</span><span class="s">"[[ '{' ]]attach[[ '}' ]]images/[[ src ]]"</span>
<span class="na">title</span><span class="o">=</span><span class="s">"[[ caption ]]"</span>
<span class="na">alt</span><span class="o">=</span><span class="s">"[[ caption ]]"</span><span class="p">></span>
<span class="p"></</span><span class="nt">a</span><span class="p">></span>
[% if caption %]
<span class="p"><</span><span class="nt">figcaption</span><span class="p">></span>[[ caption ]]<span class="p"></</span><span class="nt">figcaption</span><span class="p">></span>
[% endif %]
<span class="p"></</span><span class="nt">figure</span><span class="p">></span>
[%- endmacro %]
</code></pre></div>
<p>Now in every post, I need one line of Jinja code to import the macro:</p>
<div class="highlight"><pre><span></span><code>[% import 'macros.html` as m %]
</code></pre></div>
<p>Then I can add figures in the post like this:</p>
<div class="highlight"><pre><span></span><code>[[ m.figure('jinja-macro-for-figure.png', 'Screenshot of the original code of
the `figure` macro.') ]]
</code></pre></div>
<p>The result looks like this:</p>
<figure>
<a href="https://www.a-netz.de/blog/2020/02/images/jinja-macro-for-figure.png">
<img src="https://www.a-netz.de/blog/2020/02/images/jinja-macro-for-figure.png"
title="Screenshot of the original code of
the macro to embed figures in posts."
alt="Screenshot of the original code of
the macro to embed figures in posts.">
</a>
<figcaption>Screenshot of the original code of
the macro to embed figures in posts.</figcaption>
</figure>
<h1 id="support-for-jinja2_prefix-setting">Support for JINJA2_PREFIX setting</h1>
<p>Now writing posts with figures is already easier. But it's still annoying to
include the <code>import</code> statement at the top of every post.</p>
<p>So I have modified the code of <code>jinja2content.py</code> to support a post prefix
setting. The <code>read(...)</code> method now gets the <code>JINJA2CONTENT_PREFIX</code> variable
from the settings and prepends its content to every post.</p>
<div class="highlight"><pre><span></span><code><span class="k">def</span> <span class="nf">read</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">source_path</span><span class="p">):</span>
<span class="n">prefix</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">settings</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'JINJA2CONTENT_PREFIX'</span><span class="p">,</span> <span class="s1">''</span><span class="p">)</span>
<span class="k">with</span> <span class="n">pelican_open</span><span class="p">(</span><span class="n">source_path</span><span class="p">)</span> <span class="k">as</span> <span class="n">text</span><span class="p">:</span>
<span class="n">content</span> <span class="o">=</span> <span class="n">prefix</span> <span class="o">+</span> <span class="n">text</span>
<span class="n">content</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="o">.</span><span class="n">from_string</span><span class="p">(</span><span class="n">content</span><span class="p">)</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="o">**</span><span class="bp">self</span><span class="o">.</span><span class="n">settings</span><span class="p">)</span>
<span class="k">with</span> <span class="n">NamedTemporaryFile</span><span class="p">(</span><span class="n">delete</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">content</span><span class="o">.</span><span class="n">encode</span><span class="p">())</span>
<span class="n">f</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
<span class="n">content</span><span class="p">,</span> <span class="n">metadata</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="n">f</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">f</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
<span class="k">return</span> <span class="n">content</span><span class="p">,</span> <span class="n">metadata</span>
</code></pre></div>
<p>Now I can add the following setting in <code>pelicanconf.py</code> to automatically import
the <code>macros.html</code> file to all posts:</p>
<div class="highlight"><pre><span></span><code><span class="c1"># pelicanconf.py</span>
<span class="c1"># prefix for all articles</span>
<span class="n">JINJA2CONTENT_PREFIX</span><span class="o">=</span><span class="s2">"{</span><span class="si">% i</span><span class="s2">mport 'macros.html' as m %}"</span>
</code></pre></div>
<p>As this string is prepended to each post, it is prepended before the metadata
section. So you can use jinja code to even generate metadata. On the other hand,
you should not generate any other content, especially no blank lines, as this
would terminate the metadata section.</p>Web Server Configuration Tests2020-02-22T00:00:00+08:002020-02-22T00:00:00+08:00andreastag:www.a-netz.de,2020-02-22:/blog/2020/02/webserver-configuration-tests.html<p>Here's an overview of the online check tools I have used to check my webserver
configuration. In the last days I was curious about optimizing the caching
behavior and the related HTTP headers sent from my webserver. And I also checked
the SSL configuration and content readability.</p>
<h1 id="ssl-configuration">SSL Configuration</h1>
<p>The …</p><p>Here's an overview of the online check tools I have used to check my webserver
configuration. In the last days I was curious about optimizing the caching
behavior and the related HTTP headers sent from my webserver. And I also checked
the SSL configuration and content readability.</p>
<h1 id="ssl-configuration">SSL Configuration</h1>
<p>The checker from <a href="https://www.ssllabs.com/ssltest/index.html">SSL Labs</a> provides a very detailed analysis of the SSL
configuration, including supported SSL / TLS protocol versions, supported
ciphers and protocol negotiation results for various browsers and versions.</p>
<p>Based on the results I have now disabled old TLS protocol versions 1.0 and 1.1
on my Apache webserver and now get an A+ rating from them.</p>
<p>You can see the report for this server here: <a href="https://www.ssllabs.com/ssltest/analyze.html?d=www.a-netz.de">SSL Labs Test Report</a></p>
<figure>
<a href="https://www.a-netz.de/blog/2020/02/images/webcheck-ssllabs-report.png">
<img src="https://www.a-netz.de/blog/2020/02/images/webcheck-ssllabs-report.png"
title="Report from SSL Labs. After tweaking
the webserver configuration, the server reaches A+ level."
alt="Report from SSL Labs. After tweaking
the webserver configuration, the server reaches A+ level.">
</a>
<figcaption>Report from SSL Labs. After tweaking
the webserver configuration, the server reaches A+ level.</figcaption>
</figure>
<h1 id="caching-and-website-speed">Caching and Website Speed</h1>
<p>The speed check on <a href="https://tools.pingdom.com/">pingdom</a> provides a an overview about how fast a web page is
loading and checks for general topics like expiration headers. Based on the
results from these pages I have added the <a href="https://www.a-netz.de/blog/2020/02/http-expires-headers.html">HTTP Expires Header</a>.</p>
<figure>
<a href="https://www.a-netz.de/blog/2020/02/images/webcheck-pingdom-report.png">
<img src="https://www.a-netz.de/blog/2020/02/images/webcheck-pingdom-report.png"
title="Report from pingdom"
alt="Report from pingdom">
</a>
<figcaption>Report from pingdom</figcaption>
</figure>
<p><a href="https://redbot.org">redbot</a> has a focus on the HTTP headers.</p>
<figure>
<a href="https://www.a-netz.de/blog/2020/02/images/webcheck-redbot-report.png">
<img src="https://www.a-netz.de/blog/2020/02/images/webcheck-redbot-report.png"
title="Report from redbot"
alt="Report from redbot">
</a>
<figcaption>Report from redbot</figcaption>
</figure>
<h1 id="readability">Readability</h1>
<p>I think speed is not only about the technical speed of the web server and
browser. I think it also matters if visitors can easily read my content. So I
also ran a test for readability: <a href="https://www.webfx.com/tools/read-able">WebFX Readability Test</a></p>
<p>Here's an example result: <a href="https://www.webfx.com/tools/read-able/check.php?tab=Test+By+Url&uri=https%3A%2F%2Fwww.a-netz.de%2Fblog%2F2020%2F02%2Fhttp-expires-headers.html">WebFX Report</a></p>
<figure>
<a href="https://www.a-netz.de/blog/2020/02/images/webcheck-webfx-report.png">
<img src="https://www.a-netz.de/blog/2020/02/images/webcheck-webfx-report.png"
title="Readability check results from WebFX"
alt="Readability check results from WebFX">
</a>
<figcaption>Readability check results from WebFX</figcaption>
</figure>HTTP Expires Headers2020-02-20T00:00:00+08:002020-02-20T00:00:00+08:00andreastag:www.a-netz.de,2020-02-20:/blog/2020/02/http-expires-headers.html<p>After <a href="https://www.a-netz.de/blog/2020/02/from-wordpress-to-pelican.html">changing from Wordpress to Pelican</a>, I ran the test on <a href="https://tools.pingdom.com">Pingdom Website
Speed Test</a>. One of the test findings was, that my webserver does not send an
<code>Expires</code> header. I had no idea about this, so I investigated and here are the
results.</p>
<p>The <code>Expires</code> header is send with …</p><p>After <a href="https://www.a-netz.de/blog/2020/02/from-wordpress-to-pelican.html">changing from Wordpress to Pelican</a>, I ran the test on <a href="https://tools.pingdom.com">Pingdom Website
Speed Test</a>. One of the test findings was, that my webserver does not send an
<code>Expires</code> header. I had no idea about this, so I investigated and here are the
results.</p>
<p>The <code>Expires</code> header is send with the HTTP response header is sent from the
webserver to the browser. It tells the browser, how long the requested resource
(e.g. a HTML file, a picture, some javascript, etc.) is valid for caching in the
browser cache. A typical Expires header can look like this:</p>
<div class="highlight"><pre><span></span><code>Expires: Fri, 06 Mar 2020 03:57:23 GMT
</code></pre></div>
<p>his header tells the browser, that it does not need to check with the webserver
again, if the requested resource has changed until March 6th. After that the
browser has to check again to see if there was some modification.</p>
<p>If this header is not present (or if the date is in the past), the next time the
browser needs the requested data, it has to contact the webserver again, either
to download the resource or at least check its <code>ETag</code> header (similar like a
checksum) to ensure there was no server-side modification of the resource.</p>
<p>To learn more about this header, you can have a look at the documentation in the
<a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires">Mozilla Developer Network</a>.</p>
<h1 id="apache-configuration">Apache Configuration</h1>
<p>If you have a website which is generated server-side, like e.g. when using
Wordpress, it totally makes sense that the your browser asks the server for
modifications every time a resource is loaded. But when you serve static files,
like I'm doing now with the [Pelican] generated HTML files, some CSS and JS
files and pictures, we can tell the browser to use cached data for a long time
before checking again with the server.</p>
<p>When using the Apache webserver, this can either be configured in the main
server configuration file or separately for some directory by using an
<code>.htaccess</code> file.</p>
<p>As this website is stored in the <code>/blog</code> subdirectory, I use a <code>.htaccess</code> file
with this content:</p>
<div class="highlight"><pre><span></span><code><span class="nb">RewriteEngine</span> <span class="k">On</span>
<span class="c"># This path is prepended to all rewritten URLs.</span>
<span class="nb">RewriteBase</span> <span class="s2">"/blog/"</span>
<span class="c"># Only rewrite URLs, which do not point to an existing filename or directory</span>
<span class="nb">RewriteCond</span> %{REQUEST_FILENAME} !-f
<span class="nb">RewriteCond</span> %{REQUEST_FILENAME} !-d
<span class="nb">RewriteRule</span> <span class="s2">"^(\d{4}\/\d{2}/[^.]+)\/?$"</span> <span class="s2">"$1.html"</span> [R=301,L]
<span class="c"># Page to show on 404 error. You cannot specify relative paths here!</span>
<span class="nb">ErrorDocument</span> <span class="m">404</span> <span class="sx">/blog/pages/error-404.html</span>
<span class="c"># Add HTTP Expires headers</span>
<span class="nt"><IfModule</span> <span class="s">mod_expires.c</span><span class="nt">></span>
<span class="nb">ExpiresActive</span> <span class="k">on</span>
<span class="nb">ExpiresDefault</span> <span class="s2">"access plus 30 seconds"</span>
<span class="nb">ExpiresByType</span> text/html <span class="s2">"access plus 1 day"</span>
<span class="nb">ExpiresByType</span> text/css <span class="s2">"access plus 7 days"</span>
<span class="nb">ExpiresByType</span> image/jpeg <span class="s2">"access plus 7 days"</span>
<span class="nb">ExpiresByType</span> image/png <span class="s2">"access plus 7 days"</span>
<span class="nb">ExpiresByType</span> application/javascript <span class="s2">"access plus 7 days"</span>
<span class="nt"></IfModule></span>
</code></pre></div>
<p>You can see, that I use the Apache <code>rewrite</code> module to redirect former Wordpress
URLs to the corresponding files for Pelican and configure a custom 404 error
page. But the interesting part for this post is in the <code>IfModule mod_expires.c</code>
section.</p>
<p>Setting expiration headers only works, if the <code>expires</code> module is enabled in
Apache. You can do this on the server by running</p>
<div class="highlight"><pre><span></span><code>a2enmod expires
</code></pre></div>
<p>I configure the expiration headers as follows:</p>
<ul>
<li>A default expiration time of 30 seconds.</li>
<li>HTML files with 1 day, as the <code>index.html</code> and <code>archives.html</code> update with
every new post</li>
<li>7 days for CSS, Javascript and pictures.</li>
</ul>
<p>The time is measured from access time of the browser.</p>
<p>For configuration details, please check the module documentation for
<a href="http://httpd.apache.org/docs/current/mod/mod_expires.html">mod_expires</a> on the Apache website.</p>
<h1 id="does-it-work">Does it work?</h1>
<p>I can see a huge difference for my website, as the internet connection from my
home in Shanghai to the web server in USA is quite slow. Now for many resources,
the browser does not start a network request anymore, but directly takes the
data from its cache.</p>
<p>You can see this e.g. in Firefox, if you open the developer tools (press F12 to
show them) and change to the <em>Networking</em> tab.</p>
<p>When loading the page the first time, you can see in the <em>Transferred</em> column
the data sent over the network. If you reload the page with F5 (not Shift+F5, as
this disables caching), you can see many lines with <em>cached</em> in this column.</p>
<figure>
<a href="https://www.a-netz.de/blog/2020/02/images/http-expires-firefox-devtools.png">
<img src="https://www.a-netz.de/blog/2020/02/images/http-expires-firefox-devtools.png"
title="In the developer tools of
Firefox, you can see how many resources are cached now."
alt="In the developer tools of
Firefox, you can see how many resources are cached now.">
</a>
<figcaption>In the developer tools of
Firefox, you can see how many resources are cached now.</figcaption>
</figure>From Wordpress to Pelican2020-02-17T00:00:00+08:002020-02-17T00:00:00+08:00andreastag:www.a-netz.de,2020-02-17:/blog/2020/02/from-wordpress-to-pelican.html<div class="toc"><span class="toctitle">Table of Contents</span><ul>
<li><a href="#why-not-wordpress-anymore">Why not Wordpress anymore?</a></li>
<li><a href="#getting-started">Getting Started</a></li>
<li><a href="#theme">Theme</a></li>
</ul>
</div>
<p>Since a long time now I have used <a href="https://wordpress.org">Wordpress</a> for my website. And while I do not
have any major thing to complain about, I have now taken the step to change to a
new platform: <a href="https://getpelican.com">Pelican</a>.</p>
<h1 id="why-not-wordpress-anymore">Why not Wordpress …</h1><div class="toc"><span class="toctitle">Table of Contents</span><ul>
<li><a href="#why-not-wordpress-anymore">Why not Wordpress anymore?</a></li>
<li><a href="#getting-started">Getting Started</a></li>
<li><a href="#theme">Theme</a></li>
</ul>
</div>
<p>Since a long time now I have used <a href="https://wordpress.org">Wordpress</a> for my website. And while I do not
have any major thing to complain about, I have now taken the step to change to a
new platform: <a href="https://getpelican.com">Pelican</a>.</p>
<h1 id="why-not-wordpress-anymore">Why not Wordpress anymore?</h1>
<p>There are a few things with Wordpress which I do not like so much anymore.</p>
<ul>
<li>
<p><strong>The editor:</strong> In the last years I've got used to write much of my notes
and documentation in emacs either in rest or markdown format. This is quite
fast and efficient for me. Any editor requiring me to click on icons to
format text now seems a bit slow and akward.</p>
</li>
<li>
<p><strong>Security:</strong> While I never had any security issues with Wordpress (at least
none I am aware of), I always feel the software is too big and complex, so
it is likely that there are some security issues with it or its plugins,
that an attacker could use.</p>
</li>
<li>
<p><strong>UI Speed:</strong> While I still live in China, the connection to my web server (currently
located in the Amazon AWS cloud in USA) is a bit slow. This makes using the
Wordpress web interface quite slow and annoying.</p>
</li>
<li>
<p><strong>Version Control:</strong> I enjoy using git for version control. And so it seems
like a good idea also to track the content of my website and all its changes
in git.</p>
</li>
</ul>
<p>So I had a look for a new tool for maintaining my website, especially for static
site generators like <code>Hugo</code> and <code>Pelican</code>.</p>
<h1 id="getting-started">Getting Started</h1>
<p>As I do much software delevopment with <a href="https://www.python.org">Python</a> and also had already used the
<a href="https://palletsprojects.com/p/jinja">Jinja2</a> templating system, I had a detailed look at Pelican and immediately
liked it.</p>
<p>The concept is quite easy to understand and setting up a website takes only a
few minutes. If you want to know more about how to get started, have a look at
the <a href="https://docs.getpelican.com/en/stable/quickstart.html">Quickstart</a> section of the Pelican documentation.</p>
<p>The themes are based on a few standard HTML pages (article.html, page.html,
archives.html, tags.html, ...), which make use of the Jinja2 template language
to generate all pages. From this, pelican generates static pages, i.e. the
result is plain HTML files, which do not need any server-side processing.</p>
<h1 id="theme">Theme</h1>
<p>One of the more difficult things to do was selecting a theme for the
website. The main requirements were</p>
<ul>
<li>
<p>Clean, modern and simple layout (ok, this very much depends on my taste)</p>
</li>
<li>
<p>Mobile-friendly</p>
</li>
</ul>
<p>I could not find a theme in the huge Pelican <a href="https://github.com/getpelican/pelican-themes">theme repository</a> which I really
liked. But after some searching and browsing for other websites using Pelican, I
found a website with a nice theme at <a href="https://parbhatpuri.com">parbhatpuri.com</a> and the theme source code
published as open-source on <a href="https://github.com/Parbhat/pelican-blue.git">github</a>.</p>
<p>I have now created a copy of that theme to implement a few modifications. The
result will soon be published on Github again.</p>Software Development in China2019-11-30T00:00:00+08:002019-11-30T00:00:00+08:00andreastag:www.a-netz.de,2019-11-30:/blog/2019/11/software-development-in-china.html<p>How to use mirror servers in China to speed up access to repositories
used for software development.</p><p>Developing software in China (as I am sometimes doing as I live in Shanghai),
can be frustrating. While the internet inside of China is mostly extremely fast,
access to services and websites outside of China is almost impossible (because
some websites are blocked) or most of the time awfully slow.</p>
<p>The instructions below make use of the <code>https://mirrors.tuna.tsinghua.edu.cn</code>
mirror, as that is very fast and serves repositories for much open source
software. Check the website to find a list of all mirrored repositories and also
some usage instructions (in Chinese, but you can mostly guess the relevant
commands).</p>
<p>Update 2020-02-29: There is another mirror from another univerity at
<code>http://mirrors.ustc.edu.cn</code> available with almost the same mirrored projects.</p>
<h1 id="python-package-index-pypi">Python Package Index (pypi)</h1>
<p>The mirror for Python packages is <code>https://pypi.tuna.tsinghua.edu.cn/simple</code>. If
you use pip for installing software, specify the mirror like this:</p>
<div class="highlight"><pre><span></span><code>pip install -i https://pypi.tuna.tsinghua.edu.cn/simple PACKAGE
</code></pre></div>
<p>For pipenv, you can either set an environment variable</p>
<div class="highlight"><pre><span></span><code><span class="nb">export</span> <span class="nv">PIPENV_PYPI_MIRROR</span><span class="o">=</span>https://pypi.tuna.tsinghua.edu.cn/simple
</code></pre></div>
<p>or you can edit the Pipfile to specify the mirror as the package source:</p>
<div class="highlight"><pre><span></span><code><span class="k">[[source]]</span>
<span class="na">url</span> <span class="o">=</span> <span class="s">"https://pypi.tuna.thinghua.edu.cn/simple"</span>
<span class="na">verify_ssl</span> <span class="o">=</span> <span class="s">true</span>
<span class="na">name</span> <span class="o">=</span> <span class="s">"pypi"</span>
<span class="k">[packages]</span>
<span class="na">pelican</span> <span class="o">=</span> <span class="s">""</span>
<span class="na">markdown</span> <span class="o">=</span> <span class="s">""</span>
<span class="na">...</span>
</code></pre></div>
<h1 id="ubuntu-and-armbian">Ubuntu and Armbian</h1>
<p>For Ubuntu, edit <code>/etc/apt/sources.list</code> and replace the repository server name
<code>http://archive.ubuntu.com</code> or similar with the mirror name:</p>
<div class="highlight"><pre><span></span><code>deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-updates main restricted
[...]
</code></pre></div>
<h2 id="armbian">Armbian</h2>
<p>As Armbian is based on Ubuntu (yes, there’s also an Armbian Debian variant, but
I did not check that), you need to do a similar update as above in
<code>/etc/apt/sources.list</code>. Main difference is, that you do not refer to the standard
Ubuntu packages for PC, but to the ports repository:</p>
<div class="highlight"><pre><span></span><code><span class="na">deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ eoan main restricted universe multiverse</span>
<span class="c1">#deb-src http://ports.ubuntu.com/ eoan main restricted universe multiverse</span>
<span class="na">deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ eoan-security main restricted universe multiverse</span>
<span class="c1">#deb-src http://ports.ubuntu.com/ eoan-security main restricted universe multiverse</span>
<span class="na">deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ eoan-updates main restricted universe multiverse</span>
<span class="c1">#deb-src http://ports.ubuntu.com/ eoan-updates main restricted universe multiverse</span>
<span class="na">deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ eoan-backports main restricted universe multiverse</span>
<span class="c1">#deb-src http://ports.ubuntu.com/ eoan-backports main restricted universe multiverse</span>
</code></pre></div>
<p>Additionally you need to update the packe source for Armbian specific packages
in <code>/etc/apt/sources.list.d/armbian.list</code></p>
<div class="highlight"><pre><span></span><code>deb http://mirrors.tuna.tsinghua.edu.cn/armbian eoan main eoan-utils eoan-desktop
</code></pre></div>3D Printing Stands for Traxxas TRX-42019-10-07T01:52:00+08:002019-10-07T01:52:00+08:00andreastag:www.a-netz.de,2019-10-07:/blog/2019/10/3d-printing-stands-for-traxxas-trx-4.html<p>After getting a <a href="https://www.traxxas.com">Traxxas</a> <a href="https://traxxas.com/products/models/electric/trx-4-kit">TRX-4 Kit</a> with the Defender body some time ago,
I learned that it's not good to let the car sit on its tires in the shelve all
the time, because the tires will get flat spots.</p>
<figure>
<a href="https://www.a-netz.de/blog/2019/10/images/traxxas_trx4.jpg">
<img src="https://www.a-netz.de/blog/2019/10/images/traxxas_trx4.jpg"
title="Traxxas TRX-4 Defender"
alt="Traxxas TRX-4 Defender">
</a>
<figcaption>Traxxas TRX-4 Defender</figcaption>
</figure>
<p>So a good opportunity to get into …</p><p>After getting a <a href="https://www.traxxas.com">Traxxas</a> <a href="https://traxxas.com/products/models/electric/trx-4-kit">TRX-4 Kit</a> with the Defender body some time ago,
I learned that it's not good to let the car sit on its tires in the shelve all
the time, because the tires will get flat spots.</p>
<figure>
<a href="https://www.a-netz.de/blog/2019/10/images/traxxas_trx4.jpg">
<img src="https://www.a-netz.de/blog/2019/10/images/traxxas_trx4.jpg"
title="Traxxas TRX-4 Defender"
alt="Traxxas TRX-4 Defender">
</a>
<figcaption>Traxxas TRX-4 Defender</figcaption>
</figure>
<p>So a good opportunity to get into 3D printing again and design stands to put
under the car.</p>
<p>I did the design in <a href="https://www.autodesk.com/products/fusion-360/overview">Fusion 360</a> (which is free for hobbyists) and then printed
on my cheap Prusa i3 MK2 style printer from Taobao. Here's the result:</p>
<figure>
<a href="https://www.a-netz.de/blog/2019/10/images/traxxas_trx4_stands_01.jpg">
<img src="https://www.a-netz.de/blog/2019/10/images/traxxas_trx4_stands_01.jpg"
title="Detail view of the stand"
alt="Detail view of the stand">
</a>
<figcaption>Detail view of the stand</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2019/10/images/traxxas_trx4_stands_02.jpg">
<img src="https://www.a-netz.de/blog/2019/10/images/traxxas_trx4_stands_02.jpg"
title="The tires are above ground to prevent
flat spots."
alt="The tires are above ground to prevent
flat spots.">
</a>
<figcaption>The tires are above ground to prevent
flat spots.</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2019/10/images/traxxas_trx4_stands_03.jpg">
<img src="https://www.a-netz.de/blog/2019/10/images/traxxas_trx4_stands_03.jpg"
title="The stand is pushing against the axle,
so the springs and dampers are still under load."
alt="The stand is pushing against the axle,
so the springs and dampers are still under load.">
</a>
<figcaption>The stand is pushing against the axle,
so the springs and dampers are still under load.</figcaption>
</figure>
<p>Here you can download the design (Fusion 360 file and STL files for the
components): <a href="https://www.a-netz.de/blog/2019/10/files/Traxas_TRX-4_Stand.zip">Traxas TRX-4 Stand</a></p>
<p>And for anyone interested, here's the toolchain I used:</p>
<ul>
<li><strong>Fusion 360</strong> for 3D design and STL export</li>
<li><strong>Slic3r</strong> for slicing, i.e. converting the STL 3D model to GCODE printer
control command</li>
<li><strong>Pronterface</strong> to control the printer and to send the GCODE</li>
</ul>Archiving Documents2019-09-19T03:05:00+08:002019-09-19T03:05:00+08:00andreastag:www.a-netz.de,2019-09-19:/blog/2019/09/archiving-documents.html<p>Some years ago (since ca. 2010) I decided to start archiving my documents
(invoices, letters, certificates, manuals, and much more...) in electronic
form. At first mostly for convenience, but now also as the main backup of the
paper versions.</p>
<p>In this post I describe my approach and the thoughts behind …</p><p>Some years ago (since ca. 2010) I decided to start archiving my documents
(invoices, letters, certificates, manuals, and much more...) in electronic
form. At first mostly for convenience, but now also as the main backup of the
paper versions.</p>
<p>In this post I describe my approach and the thoughts behind some of the
decisions.</p>
<h1 id="goals">Goals</h1>
<p>Before going into the details, here are the goals or requirements related to
archiving my documents.</p>
<ul>
<li>
<p>Use open-source tools and open standards for reading, writing, handling,
managing and processing the documents. This point applies to both each single
document file as also to the document archive itself.</p>
<p>I think this helps to make sure that the archive is readable for a long time
and I will not be locked in with some proprietary tools or file formats,
which might not be supported in future anymore.</p>
</li>
<li>
<p>Documents should be stored as simple files.</p>
<p>If the data structure of the archiving software breaks down, the single
files shall still be available as files.</p>
</li>
<li>
<p>I want to prevent modification and deletion of documents.</p>
<p>It's the purpose of an archive, to preserve the state of a document. It
should mostly be write-once and then read-one.</p>
</li>
<li>
<p>It should be easy to back up the whole archive by copying / synchronizing it
to another computer.</p>
<p>I keep a backup of the archive on at least one other computer. </p>
<p>Regulary copying the whole archive takes too much time, so there must be a
way to easily synchronize changes to the backup system.</p>
</li>
<li>
<p>I would like to be able to trace any change or modification to archive
files, i.e. get the log of modifications.</p>
</li>
</ul>
<h1 id="file-format">File Format</h1>
<p>Allmost all documents are stored in PDF files. If I receive PDF files e.g. from
a company by mail, I directly archive the file as is. If it is a paper document,
I scan the file and then convert it to PDF, trying to comply with PDF/A with one
embedded image per page, usually in JPEG format.</p>
<p><a href="https://www.pdfa.org/pdfa-faq">PDF/A</a> is a restricted PDF variant specifically intended for archiving. It does
e.g. not allow any interactive features (embedded javascript), references to
external source (often used for fonts, etc.), no forms, so it is very likely
that the document can still be read in the future without issues.</p>
<p>Currently I do not use OCR yet to make the PDF contents searchable. This is
something on my todo list, but not high priority yet.</p>
<h1 id="file-naming">File Naming</h1>
<p>I try to restrict filenames to only use ASCII characters for file naming, as far
as possible the subset <code>a-z A-Z 0-9 - _</code>, so that I do not run into any trouble
with character set encoding issues or tools failing to handle special
characters.</p>
<p>Allmost all filenames start with a date in ISO format, i.e. <code>yyyy-mm-dd</code>, so they
can easily be sorted chronologically. </p>
<p>Next part of the filename usually is the creator, e.g. the company creating or
sending the document. After that follows some description of the content.</p>
<p>Here's a simple example:</p>
<div class="highlight"><pre><span></span><code>2019-07-03 Amazon AWS Invoice.pdf
</code></pre></div>
<h1 id="directory-structure">Directory Structure</h1>
<p>This is the directory tree for sorting the document. The top-level directories
are the main categories of documents like education, finances, insurance,
invoices, identdata (scans of passports, ID cards, drivers license, etc.), work,
etc.</p>
<p>Below each of these top level folders I have further, more or less complex
directory structures. But over time I realized, that the more complex the
structure gets, the more difficult it is to find the right place to store a
document. </p>
<p>In any way, I usually search documents using <code>find</code> and <code>grep</code> on the
command-line. So now I try to keep the directory structure as simple as
possible.</p>
<h1 id="scanner-hardware">Scanner Hardware</h1>
<p>The scanners are not specifically related to arhiving documents. It's just the
hardware I currently have and use. </p>
<p>The hardware for scanning is quite basic. I use an old Canon Lide 110 flatbed
scanner and a Brother ADW-1500 document scanner. Both are supported well under
Linux (currently Xubuntu 19.10).</p>
<p>The Brother scanner has integrated Wifi and a small display with touchscreen for
configuration. But it seems the humid climate in Shanghai damaged the
touchscreen, so now I can only use it by connecting to USB.</p>
<h1 id="software-for-scanning">Software for Scanning</h1>
<p>For a long time, I experimented with using the <code>sane</code> command-line tools for
scanning documents. From time to time I re-created or reworked some shell
scripts to improve the scanning process, adjust image processing with
<code>ImageMagick</code> and conversion to PDF. But I never reached a state where I had a
really well working script. At some point I was just annoyed, that for almost
every document to scan I first had to do some shell scripting and some retries
until the document was successfully scanned. </p>
<p>So I had a look for other available tools. And found a really simple one:
<code>simple-scan</code> is a very basic GUI-based scanning application. It scans pages,
adjust brightness and contrast, use either color or grayscale mode and saves the
result as a PDF or a set of JPEG files. </p>
<h1 id="archiving">Archiving</h1>
<p>Over the last years, the system to archive documents changed a bit. The first
approach used for many year based on <code>encfs</code>. Since some time now I changed to
<code>git</code>. </p>
<h2 id="encfs">EncFS</h2>
<p><code>encfs</code> is a FUSE (filesystem in userspace) filesystem driver, which encrypts a
directory. This means your data is stored in a directory structure with
encrypted files. Even file and directory names are encrypted. When mounting the
file system, you enter a password and the data becomes accessible decrypted in
another directory. Any modification of this data is immediately encrypted and
reflected in the encrypted directory tree. </p>
<p>When I run my computer, the data is not mounted, so I cannot access any files in
the archive. I wrote two simple scripts called <code>encm</code> and <code>encu</code> to mount or
unmount the archive data. </p>
<p>So during normal operation, archive data is not easily accessible. When I need
access, I mount the filesystem with <code>encm</code>, access or modify the files and later
run <code>encu</code> to unmount it again. </p>
<p>I backup the encrypted files to another computer by running <code>rsync</code>. </p>
<p>This setup worked fine for me for many years. Still roughly one year ago I
stopped using it, because it has a few disadvantages.</p>
<ul>
<li>
<p>It seems that <code>encfs</code> is not further maintained and has a few security
issues. </p>
</li>
<li>
<p>Backup is difficult. I do not want to use the <code>--delete</code> flag with
<code>rsync</code>. This means whenever I rename or remove a file, the old file stays in
the backup. So over time the backup became out of sync with the main data and
I could not easily resolve this anymore. </p>
</li>
<li>
<p>I'm not protected against modification of files and I cannot trace changes
at all.</p>
</li>
</ul>
<h2 id="git">Git</h2>
<p>After I extracted all files from the encrypted archive, I kept them as a normal
directory structure on my computer for some time and started searching for
another solution. And along comes <code>git</code>.</p>
<p>I had already used <code>git</code> for many years for software development, but never
considered it for handling my document archive. But it seems a quite good fit,
as allmost all my requirements seem to be fulfilled. </p>
<p>I have a working copy of the archive on my computer, so all the files are
accessible as plain files. If something goes wrong with the git data structures,
at least the files are all still accessible. </p>
<p>When I commit files, the committed version cannot be changed anymore and I can
even go back to any older version of every file. I can also trace all
modifications of the archive in the <code>git log</code>. </p>
<p>Creating backups is fun and easy, as I now just have to push the repository to
another computer. All changes are automatically synchronized and I do not have
and hassle with duplicate files, etc. anymore. </p>
<p>As i run a [gitea] server, I even have a nice web interface for browsing the
archive. </p>
<p>So far, I'm really happy with this solution. </p>
<h1 id="statistics">Statistics</h1>
<p>Currently the archive has ca. 2500 files. It's size (including the <code>.git</code>
folder) is 4.1GB.</p>Tasmota Firmware for Sonoff S20 Wifi Switches2019-06-09T10:15:00+08:002019-06-09T10:15:00+08:00andreastag:www.a-netz.de,2019-06-09:/blog/2019/06/tasmota-firmware-for-sonoff-s20-wifi-switches.html<p>I have bought two <a href="https://www.itead.cc/smart-home/smart-socket.html">Sonoff S20</a> wifi switches. One to control a lamp in our
bedroom, the other one for "playing". Ordering them on Taobao was not
expensive - if I remember right, they were ca. 60 RMB (less than 10 Euro) per
piece.</p>
<p>From the beginning I was not so …</p><p>I have bought two <a href="https://www.itead.cc/smart-home/smart-socket.html">Sonoff S20</a> wifi switches. One to control a lamp in our
bedroom, the other one for "playing". Ordering them on Taobao was not
expensive - if I remember right, they were ca. 60 RMB (less than 10 Euro) per
piece.</p>
<p>From the beginning I was not so happy with the way these switches are controlled
over mobile phone. You need to install an APP called eWelink, register with your
phone number and then use a cloud service to control the switches. I like it
more if I have full control over my own devices and data.</p>
<p>So now I found the time to flash the switches with the open source <a href="(https://github.com/arendst/Sonoff-Tasmota)">Tasmota</a>
firmware. The basic procedure is quite simple:</p>
<ul>
<li>Open the switch to get access to the serial port</li>
<li>(Optional) back up the current firmware</li>
<li>Erase the current firmware</li>
<li>Flash the Tasmota firmware</li>
</ul>
<p>How this is done is described in detail in the <a href="https://tasmota.github.io/docs/#/devices/Sonoff-S20">Tasmota docs</a> for all but the
Chinese version of the S20 switch. So I will not repeat the general instructions
here.</p>
<p>But there is one difficult part: The Chinese (CN) version of the switches seems
to use a different PCB than EU, UK and US versions. These versions have the
power sockets separated from a small PCB. The CN version has a larger PCB where
the contacts of the power sockets are directly soldered onto the PCB.</p>
<figure>
<a href="https://www.a-netz.de/blog/2019/06/images/tasmota_socket.jpg">
<img src="https://www.a-netz.de/blog/2019/06/images/tasmota_socket.jpg"
title="Chinese version of the Sonoff socket."
alt="Chinese version of the Sonoff socket.">
</a>
<figcaption>Chinese version of the Sonoff socket.</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2019/06/images/tasmota_serial_conn.jpg">
<img src="https://www.a-netz.de/blog/2019/06/images/tasmota_serial_conn.jpg"
title="Sonoff socket connected to a
UART-USB-Adapter to flash new firmware."
alt="Sonoff socket connected to a
UART-USB-Adapter to flash new firmware.">
</a>
<figcaption>Sonoff socket connected to a
UART-USB-Adapter to flash new firmware.</figcaption>
</figure>Wordpress behind a Web Proxy2019-01-02T06:00:00+08:002019-01-02T06:00:00+08:00andreastag:www.a-netz.de,2019-01-02:/blog/2019/01/wordpress-behind-web-proxy-not-reverse-proxy.html<p>As I spent some time to search for a solution, here a short note on running a
Wordpress site behind a web proxy, like e.g. in a company network needed to
access the internet (I'm not talking about a reverse proxy setup here).</p>
<p>A few days ago, a Wordpress …</p><p>As I spent some time to search for a solution, here a short note on running a
Wordpress site behind a web proxy, like e.g. in a company network needed to
access the internet (I'm not talking about a reverse proxy setup here).</p>
<p>A few days ago, a Wordpress setup at my company stopped installing updates. As
internet access is only possible through a web proxy, I assumed that this caused
the issue (already know the trouble from many other tools...).</p>
<p>Wordpress still displays information, that there are updates available, but
install fails with the message "Download failed". I could not figure out what
was going on. After some more research I found that there are two things to
observe:</p>
<p>First, set up Wordpress by configuring the proxy server in the <code>wp-config.php</code>
file like this:</p>
<div class="highlight"><pre><span></span><code><span class="cp"><?php</span>
<span class="nb">define</span><span class="p">(</span><span class="s1">'WP_PROXY_HOST'</span><span class="p">,</span> <span class="s1">'proxy-host.company.com'</span><span class="p">);</span>
<span class="nb">define</span><span class="p">(</span><span class="s1">'WP_PROXY_PORT'</span><span class="p">,</span> <span class="s1">'3128'</span><span class="p">);</span>
<span class="c1"># Use the following two lines, if you need to log in to the</span>
<span class="c1"># proxy service with username and password.</span>
<span class="nb">define</span><span class="p">(</span><span class="s1">'WP_PROXY_USERNAME'</span><span class="p">,</span> <span class="s1">''</span><span class="p">);</span>
<span class="nb">define</span><span class="p">(</span><span class="s1">'WP_PROXY_PASSWORD'</span><span class="p">,</span> <span class="s1">''</span><span class="p">);</span>
<span class="c1"># define hosts that should he accessed without proxy</span>
<span class="nb">define</span><span class="p">(</span><span class="s1">'WP_PROXY_BYPASS_HOSTS'</span><span class="p">,</span> <span class="s1">'localhost'</span><span class="p">);</span>
</code></pre></div>
<p>This is the easy part and described on many other websites, too. But this alone
is not sufficient.</p>
<p>Second, the important, and in my case missing part is th following: You need to
make sure, that the PHP <code>curl</code> module is installed on your webserver (at this
time <code>php7.2-curl</code>), because <code>curl</code> is used to download plugins and updates.</p>
<p>It seems after an update of PHP from version 7.1 to 7.2, the <code>curl</code> module was
not automatically installed, which caused the updated to fail. </p>Setting up a Banana Pi M2 with Armbian2016-11-19T05:55:00+08:002016-11-19T05:55:00+08:00andreastag:www.a-netz.de,2016-11-19:/blog/2016/11/setting-up-a-banana-pi-m2-with-armbian.html<p>Since some time I have a <a href="https://en.wikipedia.org/wiki/Banana_Pi#Banana_Pi_M2">Banana Pi M2</a> sitting in the storage room used as a
server for files and media. I do not exactly remember where I got the installed
Linux, but it was something based on Raspbian, which is not really suitable for
the A31 processor. So …</p><p>Since some time I have a <a href="https://en.wikipedia.org/wiki/Banana_Pi#Banana_Pi_M2">Banana Pi M2</a> sitting in the storage room used as a
server for files and media. I do not exactly remember where I got the installed
Linux, but it was something based on Raspbian, which is not really suitable for
the A31 processor. So some days ago I decided to re-install it from scratch with
<a href="http://www.armbian.com">Armbian</a>. The following are some notes related to setting things up.</p>
<h1 id="armbian">Armbian</h1>
<p>Installing Armbian was quite straight-forward: Download the image for the Banana
Pi M2 and write it to the SD card with dd:</p>
<div class="highlight"><pre><span></span><code>dd <span class="k">if</span><span class="o">=</span>./Armbian_5.14_Bananapim2_Ubuntu_xenial_4.6.2.7z <span class="nv">of</span><span class="o">=</span>/dev/mmcblk0
</code></pre></div>
<p>For the first boot, I attached keyboard and monitor. The BPi rebooted once to
extend the file system to the whole SD card and when logging in with the root
account with default password 1234, it forced me to change the password.</p>
<figure>
<a href="https://www.a-netz.de/blog/2016/11/images/armbian_login.png">
<img src="https://www.a-netz.de/blog/2016/11/images/armbian_login.png"
title="Armbian login message of the day"
alt="Armbian login message of the day">
</a>
<figcaption>Armbian login message of the day</figcaption>
</figure>
<p>So until now the experience with Armbian is really great. Everything works
flawlessly.</p>
<h1 id="basic-setup">Basic Setup</h1>
<p>From all the Raspberry Pis I have installed, I found some basic things that I
always need to configure after installing the OS in the same way:</p>
<ul>
<li>Create a new user account</li>
<li>Add this account to the sudo group to be able to do administration tasks</li>
<li>Copy my SSH public key to the <code>.ssh/authorized_keys</code> file</li>
<li>Set up capability to send mail with <code>ssmtp</code></li>
<li>Set up <code>unattended-upgrades</code></li>
</ul>
<p>The first three steps to set up a user account are really standard. If you do
not know it, follow the link to read more about <a href="https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server">SSH Public Key Authentication</a>.</p>
<h1 id="setting-up-mail-sending">Setting up Mail Sending</h1>
<p>As the Banana Pi and also the Raspberries all run headless, I need some other
way to let them talk to me and send status updates. So my preferred way is to
set up a very simple mail server to send out mail. For this I use the <code>ssmtp</code>
package. As a client tool for sending mail from the command-line I use
<code>bsd-mailx</code>:</p>
<div class="highlight"><pre><span></span><code>apt-get install ssmtp bsd-mailx
</code></pre></div>
<p><code>ssmtp</code> is not really a mail server, because it cannot queue the mails. Instead,
whenever you send a mail, it directly connects to another mail service for
sending. If the mail service is not reachable, sending the mail fails and is not
retried later.</p>
<p>For setup, you just configure <code>ssmtp</code> by its configuration file <code>ssmtpd.conf</code> in
<code>/etc/ssmtpd</code>. My file looks similar to this:</p>
<div class="highlight"><pre><span></span><code><span class="c1">#</span>
<span class="c1"># Config file for sSMTP sendmail</span>
<span class="c1">#</span>
<span class="c1"># The person who gets all mail for userids < 1000</span>
<span class="c1"># Make this empty to disable rewriting.</span>
<span class="na">root</span><span class="o">=</span><span class="s">myrootaddress@mymailserver.de</span>
<span class="c1"># The place where the mail goes. The actual machine name is required no</span>
<span class="c1"># MX records are consulted. Commonly mailhosts are named mail.domain.com</span>
<span class="na">mailhub</span><span class="o">=</span><span class="s">mymailserver.de:587</span>
<span class="c1"># Where will the mail seem to come from?</span>
<span class="c1">#rewriteDomain=</span>
<span class="c1"># The full hostname</span>
<span class="na">hostname</span><span class="o">=</span><span class="s">bpi1.fritz.box</span>
<span class="c1"># Are users allowed to set their own From: address?</span>
<span class="c1"># YES - Allow the user to specify their own From: address</span>
<span class="c1"># NO - Use the system generated From: address</span>
<span class="c1">#FromLineOverride=YES</span>
<span class="na">AuthUser</span><span class="o">=</span><span class="s">xxx</span>
<span class="na">AuthPass</span><span class="o">=</span><span class="s">xxx</span>
<span class="na">UseTLS</span><span class="o">=</span><span class="s">yes</span>
<span class="na">UseStartTLS</span><span class="o">=</span><span class="s">yes</span>
</code></pre></div>
<p>Depending on the mail service you use, the configuration needs perhaps to be
adapted. At least the mail server, user name and password need to be set
correctly.</p>
<p>To test sending mail, use the <code>mail</code> command like this (please use your own
e-mail address for this...):</p>
<div class="highlight"><pre><span></span><code>mail -v mytestaddress@mymailserver.de
</code></pre></div>
<p>It asks for the recipient. After that, you can enter text. A dot (.) in a
separate line ends the entered text and the e-mail gets send out.</p>
<h1 id="unattended-upgrades">Unattended Upgrades</h1>
<p>When having only one or two Raspberry Pis, it's fun to keep them
up-to-date. Until some time ago I used the <code>apticron</code> package to send e-mail
notifications when updates are available. But at some point it got too much to
always log in by SSH to various computers to install the updates. So now I
switched to use the <code>unattended-upgrades</code> package. If it's not yet installed,
install it like this:</p>
<div class="highlight"><pre><span></span><code>apt-get install unattended-upgrades
</code></pre></div>
<p>After that, you need to edit the configuration file <code>50unattended-upgrades</code> in
<code>/etc/apt/apt.conf.d</code>. I changed the default to send status mails to root
(<code>ssmtp</code> later translates this to my real mail address) and to reboot if this is
required. Finally you need to enable the unattended upgrades like this:</p>
<div class="highlight"><pre><span></span><code>dpkg-reconfigure -plow unattended-upgrades
</code></pre></div>
<p>For Armbian, you need to adapt the standard configuration for allowed package
sources, from which packages are installed unattended. This is stored in
<code>/etc/apt/apt.conf.d/50unattended-upgrades</code>:</p>
<div class="highlight"><pre><span></span><code>// Automatically upgrade packages from these (origin:archive) pairs
Unattended-Upgrade::Allowed-Origins {
"<span class="cp">${</span><span class="n">distro_id</span><span class="cp">}</span>:<span class="cp">${</span><span class="n">distro_codename</span><span class="cp">}</span>";
"<span class="cp">${</span><span class="n">distro_id</span><span class="cp">}</span>:<span class="cp">${</span><span class="n">distro_codename</span><span class="cp">}</span>-security";
"<span class="cp">${</span><span class="n">distro_id</span><span class="cp">}</span>:<span class="cp">${</span><span class="n">distro_codename</span><span class="cp">}</span>-updates";
"<span class="cp">${</span><span class="n">distro_id</span><span class="cp">}</span>:<span class="cp">${</span><span class="n">distro_codename</span><span class="cp">}</span>-proposed";
"<span class="cp">${</span><span class="n">distro_id</span><span class="cp">}</span>:<span class="cp">${</span><span class="n">distro_codename</span><span class="cp">}</span>-backports";
"Armbian:<span class="cp">${</span><span class="n">distro_codename</span><span class="cp">}</span>";
};
</code></pre></div>
<p>With this configuration, all available new packages from Ubuntu and Armbian
repositories are installed automatically.</p>
<p>After installing the package, I recommend to monitor the log file at
<code>/var/log/unattended-upgrades/unattended-upgrades.log</code> for a few days to see if
everything is running fine. For a more detailed explanation of this package, you
can have a look at the <a href="https://wiki.debian.org/UnattendedUpgrades">Debian</a> website.</p>Opening Mifon IPTV 4K Box HG680-J2016-06-26T11:32:00+08:002016-06-26T11:32:00+08:00andreastag:www.a-netz.de,2016-06-26:/blog/2016/06/opening-mifon-iptv-4k-box-hg680-j.html<p>Today I had some time and while tidying up, I found a set-top box we got some
time ago from our Internet provider. It came with a contract for combined 50Mbps
fiber connection and IPTV.</p>
<p>The guy who installed the IPTV box (labeled FiberHome HG680-J) showed us that it
worked …</p><p>Today I had some time and while tidying up, I found a set-top box we got some
time ago from our Internet provider. It came with a contract for combined 50Mbps
fiber connection and IPTV.</p>
<p>The guy who installed the IPTV box (labeled FiberHome HG680-J) showed us that it
worked, but afterward we tried once and did not get it to work, because it did
not want to connect to the network. We lost interest and since then it's sitting
next to the TV and is not used. So today I got curious about the contents of
this little box and decided to open it and share the findings with you.</p>
<p>That's the box and the connections on four sides:</p>
<figure>
<a href="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_front.jpg">
<img src="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_front.jpg"
title="Front with LEDs and IR Receiver"
alt="Front with LEDs and IR Receiver">
</a>
<figcaption>Front with LEDs and IR Receiver</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_ports_1.jpg">
<img src="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_ports_1.jpg"
title="Back with various connections"
alt="Back with various connections">
</a>
<figcaption>Back with various connections</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_ports_3.jpg">
<img src="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_ports_3.jpg"
title="SD-Card slot"
alt="SD-Card slot">
</a>
<figcaption>SD-Card slot</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_ports_2.jpg">
<img src="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_ports_2.jpg"
title="USB Ports"
alt="USB Ports">
</a>
<figcaption>USB Ports</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_label.jpg">
<img src="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_label.jpg"
title="Label on the bottom side"
alt="Label on the bottom side">
</a>
<figcaption>Label on the bottom side</figcaption>
</figure>
<ul>
<li>Front: Power LED, Network Led, IR Receiver</li>
<li>Left: Micro SD Card slot</li>
<li>Right: Two USB connectors, one blue, so perhaps USB 3</li>
<li>Back: Ethernet RJ45, SPDIF, AV 3.5mm connector, HDMI, DC 12V and power switch</li>
</ul>
<p>But now the more interesting part about what's inside. You can easily open the
box. There are four screws under the rubber feet. Remove the feet and the
screws and you can pry open the lid.</p>
<figure>
<a href="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_inside.jpg">
<img src="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_inside.jpg"
title="Overview of the PCB"
alt="Overview of the PCB">
</a>
<figcaption>Overview of the PCB</figcaption>
</figure>
<p>Here two pictures with the labeled main components on the PCB.</p>
<figure>
<a href="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_inside_2_annotated.jpg">
<img src="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_inside_2_annotated.jpg"
title="PCB Part 1"
alt="PCB Part 1">
</a>
<figcaption>PCB Part 1</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_inside_1_annotated.jpg">
<img src="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_inside_1_annotated.jpg"
title="PCB Part 2"
alt="PCB Part 2">
</a>
<figcaption>PCB Part 2</figcaption>
</figure>
<p>I think it's really interesting to see how this box has a very similar design to
most of the small Arm-based SBCs (Single Board Computers) available now, like
the Raspberry Pi, Banana Pi, etc. You can see that it's a highly integrated CPU,
additional flash memory and RAM (probably two times 256MB guessed from the IC
marking NANYA NT5CB256M16CP) and a separate wifi chip RTL8192EU.</p>
<p>Sadly the heatsink is glued to the CPU, so I cannot find any hint at the moment
about the type of CPU used in this box. If the one blue USB connector really
speaks USB3, I guess this indicates that the used CPU is a bit more fast that a
Raspberry Pi.</p>
<p>Near to the CPU and flash there are five test points labeled NC, GND, RX, TX and
VCC. This looks very much like a serial console connector. And I have neither a
UART level converter not an oscilloscope available here to have a look at the
signals. :-(</p>
<p>The bottom side of the PCB does not contain any interesting things:</p>
<figure>
<a href="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_bottom.jpg">
<img src="https://www.a-netz.de/blog/2016/06/images/iptv_bpx_bottom.jpg"
title="Bottom view of the PCB."
alt="Bottom view of the PCB.">
</a>
<figcaption>Bottom view of the PCB.</figcaption>
</figure>E-Mail Notification for Windows Updates2016-04-16T09:08:00+08:002016-04-16T09:08:00+08:00andreastag:www.a-netz.de,2016-04-16:/blog/2016/04/e-mail-notification-for-windows-updates.html<p>Sometimes I have to deal with a Windows server. But I do not log in regularly,
so I wanted to be informed about available Windows updates by e-mail. Some short
research in the internet indicated, that this is not possible out-of-the-box.</p>
<p>So I enjoyed hacking a bit of Python to …</p><p>Sometimes I have to deal with a Windows server. But I do not log in regularly,
so I wanted to be informed about available Windows updates by e-mail. Some short
research in the internet indicated, that this is not possible out-of-the-box.</p>
<p>So I enjoyed hacking a bit of Python to create a script that triggers the check
for new Windows updates and send out an e-mail with the result. You can find the
script on <a href="https://github.com/motlib/email-win-updates">Github</a>.</p>
<p>The <a href="https://github.com/motlib/email-win-updates">README</a> explains how to set it up in detail. Basically, after cloning the
script, you copy the configuration file template and add your e-mail address and
SMTP server name. Then you can e.g. add the script to the Windows Scheduler and
run it once per day.</p>
<p>Here is an example e-mail sent by the script:</p>
<div class="highlight"><pre><span></span><code>Subject: Windows Update check for mydomain\myhost
Windows Update check for mydomain\myhost
The following windows updates are available:
* CRITICAL: Security Update for Windows 7 for x64-based Systems
(KB3146963)
A security issue has been identified in a Microsoft software product
that could affect your system. You can help protect your system by
installing this update from Microsoft. For a complete listing of the
issues that are included in this update, see the associated
Microsoft Knowledge Base article. After you install this update, you
may have to restart your system.
* IMPORTANT: Security Update for Windows 7 for x64-based Systems
(KB3146706)
A security issue has been identified in a Microsoft software product
that could affect your system. You can help protect your system by
installing this update from Microsoft. For a complete listing of the
issues that are included in this update, see the associated
Microsoft Knowledge Base article. After you install this update, you
may have to restart your system.
--
Generated by email-win-updates.py See
http://github.com/motlib/email-win-updates for more info.
</code></pre></div>In Memory of DaTou2015-06-14T14:52:00+08:002015-06-14T14:52:00+08:00andreastag:www.a-netz.de,2015-06-14:/blog/2015/06/in-memory-of-datou.html<p>In Memory of DaTou (大头, "big head"), one of the compound cats, who often sat
at the gate in the morning, watching us when we were leaving for office.</p>
<figure>
<a href="https://www.a-netz.de/blog/2015/06/images/datou.jpg">
<img src="https://www.a-netz.de/blog/2015/06/images/datou.jpg"
title="大头"
alt="大头">
</a>
<figcaption>大头</figcaption>
</figure>GNU Terry Pratchett2015-03-17T12:56:00+08:002015-03-17T12:56:00+08:00andreastag:www.a-netz.de,2015-03-17:/blog/2015/03/gnu-terry-pratchett.html<p>In memory of <a href="http://en.wikipedia.org/wiki/Terry_Pratchett">Terry Pratchett</a>, this server added a <a href="http://www.gnuterrypratchett.com">X-Clacks-Overhead</a> HTTP
header.</p>Raspberry Pi service startup scripts2015-03-11T10:10:00+08:002015-03-11T10:10:00+08:00andreastag:www.a-netz.de,2015-03-11:/blog/2015/03/rpi-service-startup-scripts.html<p>Sometimes you want to run your own scripts or tools on a Raspberrry Pi a service
or daemon . That is a program running in the background which is usually
automatically started when Linux boots and which is shut down when Linux shuts
down.</p>
<p>The idea is to put a shell …</p><p>Sometimes you want to run your own scripts or tools on a Raspberrry Pi a service
or daemon . That is a program running in the background which is usually
automatically started when Linux boots and which is shut down when Linux shuts
down.</p>
<p>The idea is to put a shell script to the directory <code>/etc/init.d</code> which can start
and stop your daemon. This script accepts standard command line options like
<code>start</code>, <code>stop</code>, <code>restart</code> (restart the service by stoping and then starting it)
and <code>reload</code> (reload and apply the configuration while the service keeps
running). Then you tell the system to set up everything to call the script with
the right parameter during boot or shutdown.</p>
<h1 id="now-the-details">Now the Details</h1>
<p>First you create a script in the directory <code>/etc/init.d</code> with the following
content and adapt it to your needs:</p>
<div class="highlight"><pre><span></span><code><span class="ch">#! /bin/sh</span>
<span class="c1">### BEGIN INIT INFO</span>
<span class="c1"># Provides:</span>
<span class="c1"># Required-Start: $all</span>
<span class="c1"># Required-Stop:</span>
<span class="c1"># Default-Start: 2 3 4 5</span>
<span class="c1"># Default-Stop: 0 1 6</span>
<span class="c1"># Short-Description: Manage my cool stuff</span>
<span class="c1">### END INIT INFO</span>
<span class="nv">PATH</span><span class="o">=</span>/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin
. /lib/init/vars.sh
. /lib/lsb/init-functions
<span class="c1"># If you need to source some other scripts, do it here</span>
<span class="k">case</span> <span class="s2">"</span><span class="nv">$1</span><span class="s2">"</span> in
start<span class="o">)</span>
log_begin_msg <span class="s2">"Starting my super cool service"</span>
<span class="c1"># do something, start the service</span>
log_end_msg <span class="nv">$?</span>
<span class="nb">exit</span> <span class="m">0</span>
<span class="p">;;</span>
stop<span class="o">)</span>
log_begin_msg <span class="s2">"Stopping the coolest service ever unfortunately"</span>
<span class="c1"># do something to kill the service or cleanup or nothing</span>
log_end_msg <span class="nv">$?</span>
<span class="nb">exit</span> <span class="m">0</span>
<span class="p">;;</span>
*<span class="o">)</span>
<span class="nb">echo</span> <span class="s2">"Usage: /etc/init.d/ {start|stop}"</span>
<span class="nb">exit</span> <span class="m">1</span>
<span class="p">;;</span>
<span class="k">esac</span>
</code></pre></div>
<p>You can see in the header of the script some structured comments which describe
the script, its runlevels for start and stop and its dependencies to other
services. If you have no special dependencies (like e.g. networking, a database
service, etc.) you can keep everything at the default values.</p>
<p>After adapting the script and saving it in <code>/etc/init.d</code>, you change to the
<code>/etc/init.d</code> directory and then call</p>
<div class="highlight"><pre><span></span><code>update-rc.d MyServiceScript defaults
</code></pre></div>
<p>You can take a look at other scripts in the <code>/etc/init.d</code> directory for
inspiration how to exactly deal with starting or stopping the service.</p>
<p>Update: Just found a page in the <a href="http://blog.scphillips.com/2013/07/getting-a-python-script-to-run-in-the-background-as-a-service-on-boot/">scphillips blog</a> explaining this in a much
more detailed way. So perhaps have a look there, too.</p>Heiraten in China2014-12-02T06:15:00+08:002014-12-02T06:15:00+08:00andreastag:www.a-netz.de,2014-12-02:/blog/2014/12/heiraten-in-china.html<p>Hier eine kurze Zusammenfassung der notwendigen bürokratischen Schritte, um als
Deutscher in China zu heiraten. Stand der Infos ist Juni bis
November 2014. Alles bezieht sich auf den Wohnort Düsseldorf bzw. Shanghai. Alle
Angaben ohne Gewähr. Genauere bzw. aktuelle Infos gibt es hier: <a href="http://www.china.diplo.de">Deutsche
Botschaft in China</a>.</p>
<h1 id="meldebescheinigung">Meldebescheinigung</h1>
<p>Das ist …</p><p>Hier eine kurze Zusammenfassung der notwendigen bürokratischen Schritte, um als
Deutscher in China zu heiraten. Stand der Infos ist Juni bis
November 2014. Alles bezieht sich auf den Wohnort Düsseldorf bzw. Shanghai. Alle
Angaben ohne Gewähr. Genauere bzw. aktuelle Infos gibt es hier: <a href="http://www.china.diplo.de">Deutsche
Botschaft in China</a>.</p>
<h1 id="meldebescheinigung">Meldebescheinigung</h1>
<p>Das ist der Nachweis, dass man ledig ist und somit heiraten darf. Gibt es für
EUR 6,- beim lokalen Bürgeramt. Das geht natürlich nur, wenn man noch in
Deutschland gemeldet ist. Wenn nicht, weiss ich auch nicht.</p>
<h1 id="beglaubigung-der-meldebescheinigung">Beglaubigung der Meldebescheinigung</h1>
<p>Die Beglaubigung wird von der Bezirksregierung <a href="http://www.openstreetmap.org/?mlat=51.25421&mlon=6.76841&zoom=15&layers=M">
📌</a> durchgeführt. Das ist die Bestätigung, dass die Meldebescheinigung echt und
gültig ist. Kostet keine Gebühren.</p>
<div class="highlight"><pre><span></span><code>Bezirksregierung Düsseldorf
Am Bonneshof 35
40474 Düsseldorf
</code></pre></div>
<p><a href="http://www.brd.nrw.de">Bezirksregierung NRW</a></p>
<h1 id="uberbeglaubigung-der-meldebescheinigung">Überbeglaubigung der Meldebescheinigung</h1>
<p>Beim Bundesverwaltungsamt in Köln <a href="http://www.openstreetmap.org/?mlat=50.94392&mlon=6.88896&zoom=15&layers=M">
📌</a> lässt man
die Meldebescheinigung überbeglaubigen, also bestätigen, dass die
Meldebescheinigung und deren Beglaubigung vom Deutschen Staat als gültig
anerkannt wird. Kostet EUR 25,-.</p>
<div class="highlight"><pre><span></span><code>Bundesverwaltungsamt
Eupener Str. 125
50933 Köln
</code></pre></div>
<p><a href="http://www.bva.bund.de">Bundesverwaltungsamt</a></p>
<h1 id="legalisierung-der-meldebescheinigung">Legalisierung der Meldebescheinigung</h1>
<p>Beim Chinesischen Generalkonsulat <a href="http://www.openstreetmap.org/?mlat=50.09842&mlon=8.67098&zoom=15&layers=M">
📌</a> lässt man
die Meldebescheinigung für EUR 10,- legalisieren, d.h. man bekommt eine
Bestätigung, dass auch der Chinesische Staat das Dokument als gültig anerkennt.</p>
<div class="highlight"><pre><span></span><code>Generalkonsulat der VR China
Stresemannallee 19-23
60596 Frankfurt a. M.
</code></pre></div>
<p><a href="http://frankfurt.china-consulate.org/det">Chinesisches Generalkonsulat</a></p>
<p>Als ich da war, wurden nur deutsche EC-Karten zur Bezahlung der Gebühr
akzeptiert, kein Bargeld und keine Kreditkarten! Außerdem sollte man von allen
Dokumenten genügend Kopien dabei haben. Ansonsten frisst der Kopierer dort alles
Kleingeld auf. Wenn man keins hat, steht man (so wie ich...) erstmal ziemlich
dumm da.</p>
<h1 id="ubersetzung-der-meldebescheinigung">Übersetzung der Meldebescheinigung</h1>
<p>Da in China kaum jemand eine Deutsche Meldebescheinigung versteht, muss sie von
einem zertifizierten Übersetzer übersetzt werden. Das kann man bei der Shanghai
Interpreters Association <a href="http://www.openstreetmap.org/?mlat=31.23059&mlon=121.4466&zoom=15&layers=M">
📌</a> machen
lassen. Kostet ca. RMB 250,- (ca. EUR 30,-). Einfach vorbeigehen und die
Meldebescheinigung mitbringen. Die Übersetzung ist zwei, drei Tage später fertig
und kann abgeholt werden. Am besten dort direkt korrekturlesen, Tippfehler im
Namen könnten sonst später Probleme bereiten.</p>
<div class="highlight"><pre><span></span><code>Shanghai Interpreters Association
Room 1602
1277 Beijing West Road
Shanghai 200040
</code></pre></div>
<h1 id="heiraten">Heiraten</h1>
<p>Die Eheschließung findet im <em>Marriage Registration Center</em> <a href="http://www.openstreetmap.org/?mlat=31.16897&mlon=121.42365&zoom=15&layers=M">
📌</a> in Shanghai statt und ist kostenlos. Man kann wohl ohne Termin
einfach vorbeigehen. Evtl. ist es aber sinnvoll, vorher einmal alle Dokumente
dort prüfen zu lassen und einen Termin zu vereinbaren.</p>
<div class="highlight"><pre><span></span><code>Marriage Registration Center of Shanghai Civil Affairs Bureau
3/F, Wing E
Everbright Exhibition Center
82 Caobao Road
Shanghai
</code></pre></div>
<p>Dort kann man auch direkt eine Heiratsurkunde zur Anerkennung der Ehe in
Deutschland bestellen. Dauert ca. 10 Tage und kostet RMB 280,- (ca. EUR 35,-).</p>
<h1 id="anerkennung-der-ehe-in-deutschland">Anerkennung der Ehe in Deutschland</h1>
<p>Die chinesische Heiratsurkunde kann man in Shanghai übersetzen und die
Übersetzung beim Konsulat beglaubigen lassen. Soweit ich gehört habe, ist dieses
Dokument dann auch direkt in Deutschland als offizielle Heiratsurkunde
gültig. Um mögliche Probleme auszuschliessen, kann man die Ehe in Deutschland
beim Standesamt eintragen lassen.</p>
<h1 id="hinweise">Hinweise</h1>
<p>Falls es schnell gehen muss, die notwendigen Dokumente in Deutschland zu
besorgen, zum Beispiel weil der Aufenthalt in Deutschland nur kurz ist: Wenn man
in Düsseldorf wohnt, schafft man es in einem Tag, beim Bürgeramt, bei der
Bezirksregierung und beim Bundesverwaltungsamt vorbeizuschauen. Am nächsten Tag
kann man dann nach Frankfurt zum chinesischen Konsulat fahren. Bei mir kam die
legalisierte Meldebescheinigung etwa eine Woche später per Post (in Deutschland)
an. Wahrscheinlich kann man sich die Dokumente aber auch nach China schicken
lassen. Danach sind die Dokumente in China für 6 Monate gültig.</p>Just married2014-12-02T04:36:00+08:002014-12-02T04:36:00+08:00andreastag:www.a-netz.de,2014-12-02:/blog/2014/12/just-married.html<p>Since 2014-11-29 I am married to my wonderful wife Yao Yi :-)</p>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_just_married.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_just_married.jpg"
title="Just married!"
alt="Just married!">
</a>
<figcaption>Just married!</figcaption>
</figure>
<p>Here are a few pictures and infos of the wedding day.</p>
<h1 id="breakfast">Breakfast</h1>
<p>Every good day starts with a good breakfast, so we went to Wagas <a href="http://www.openstreetmap.org/?mlat=31.21633&mlon=121.3824&zoom=15&layers=M">
📌</a>. </p>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_breakfast_1.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_breakfast_1.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_breakfast_2.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_breakfast_2.jpg"
title=""
alt="">
</a>
</figure>
<h1 id="marriage">Marriage</h1>
<p>Then we went to the <em>Marriage Registration Center of Shanghai Civil …</em></p><p>Since 2014-11-29 I am married to my wonderful wife Yao Yi :-)</p>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_just_married.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_just_married.jpg"
title="Just married!"
alt="Just married!">
</a>
<figcaption>Just married!</figcaption>
</figure>
<p>Here are a few pictures and infos of the wedding day.</p>
<h1 id="breakfast">Breakfast</h1>
<p>Every good day starts with a good breakfast, so we went to Wagas <a href="http://www.openstreetmap.org/?mlat=31.21633&mlon=121.3824&zoom=15&layers=M">
📌</a>. </p>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_breakfast_1.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_breakfast_1.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_breakfast_2.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_breakfast_2.jpg"
title=""
alt="">
</a>
</figure>
<h1 id="marriage">Marriage</h1>
<p>Then we went to the <em>Marriage Registration Center of Shanghai Civil Affairs
Bureau</em> <a href="http://www.openstreetmap.org/?mlat=31.16897&mlon=121.42365&zoom=15&layers=M">
📌</a> in Caobao Lu, something like the
<em>Standesamt</em> in Germany, for the offical part. Each one filling and signing a
form, getting read the obligations of marriage and as the final result getting
handed over the small red booklets which in China prove that you are married.</p>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_rings.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_rings.jpg"
title="Our wedding rings"
alt="Our wedding rings">
</a>
<figcaption>Our wedding rings</figcaption>
</figure>
<p>Here are a some pictures of the registration office. We were the only couple
there at the time.</p>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_office_1.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_office_1.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_office_2.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_office_2.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_office_3.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_office_3.jpg"
title=""
alt="">
</a>
</figure>
<h1 id="tian-ai-lu">Tian Ai Lu</h1>
<p>Yao Yi had suggested that after the ceremony we go to <a href="http://www.topchinatravel.com/china-attractions/shanghai-tianai-road.htm">Tian'ai Lu</a> <a href="http://www.openstreetmap.org/?mlat=31.27004&mlon=121.47952&zoom=15&layers=M">
📌</a>, the name meaning something like <em>sweet love
street</em>. There is an old story related to that street and it brings luck and a
happy marriage to every couple walking along this street holding hands. Along
the way we had some coffee and cake (at the same time the birthday cake for Yao
Yi) in the Tian'ai lounge. And scratched our names in the wall there (as many
other couples already have done).</p>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_tian_ai_lu_1.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_tian_ai_lu_1.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_tian_ai_lu_2.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_tian_ai_lu_2.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_tian_ai_lu_3.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_tian_ai_lu_3.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_tian_ai_lu_4.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_tian_ai_lu_4.jpg"
title=""
alt="">
</a>
</figure>
<p>There we also wrote letters to each other, which we got stamped with a special
stamp in a post office nearby and then put them into the "love" mailbox. Yao Yi
wrote in Chinese, I wrote in German. She will sure be able to very soon
understand my letter. I will need much more time to decipher hers.</p>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_letter_1.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_letter_1.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_letter_2.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_letter_2.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_letter_3.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_letter_3.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_letter_4.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_letter_4.jpg"
title=""
alt="">
</a>
</figure>
<p>In the evening, we went to the french restaurant <a href="http://www.franck.com.cn/">Francks bistro</a> and had a very
nice candle-light dinner (due to the candle-light the photos are a bit dark...)</p>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_dinner_1.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_dinner_1.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_dinner_2.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_dinner_2.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_dinner_3.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_dinner_3.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_dinner_4.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_dinner_4.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_dinner_5.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_dinner_5.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/12/images/marriage_dinner_6.jpg">
<img src="https://www.a-netz.de/blog/2014/12/images/marriage_dinner_6.jpg"
title=""
alt="">
</a>
</figure>Chili on the Balcony2014-10-06T07:03:00+08:002014-10-06T07:03:00+08:00andreastag:www.a-netz.de,2014-10-06:/blog/2014/10/chili-on-the-balcony.html<p>Yao Yi planted chili plants in spring on the balcony. This is the result.</p>
<figure>
<a href="https://www.a-netz.de/blog/2014/10/images/chili_02.jpg">
<img src="https://www.a-netz.de/blog/2014/10/images/chili_02.jpg"
title="Chili plant on the balcony"
alt="Chili plant on the balcony">
</a>
<figcaption>Chili plant on the balcony</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/10/images/chili_03.jpg">
<img src="https://www.a-netz.de/blog/2014/10/images/chili_03.jpg"
title="Chili plant detail"
alt="Chili plant detail">
</a>
<figcaption>Chili plant detail</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/10/images/chili_04.jpg">
<img src="https://www.a-netz.de/blog/2014/10/images/chili_04.jpg"
title="Chilis!"
alt="Chilis!">
</a>
<figcaption>Chilis!</figcaption>
</figure>
<p>I will update the post as soon as I tried them and know how spicy they are...</p>
<p>Ok, here's the update: The chilis are medium spicy. So …</p><p>Yao Yi planted chili plants in spring on the balcony. This is the result.</p>
<figure>
<a href="https://www.a-netz.de/blog/2014/10/images/chili_02.jpg">
<img src="https://www.a-netz.de/blog/2014/10/images/chili_02.jpg"
title="Chili plant on the balcony"
alt="Chili plant on the balcony">
</a>
<figcaption>Chili plant on the balcony</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/10/images/chili_03.jpg">
<img src="https://www.a-netz.de/blog/2014/10/images/chili_03.jpg"
title="Chili plant detail"
alt="Chili plant detail">
</a>
<figcaption>Chili plant detail</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/10/images/chili_04.jpg">
<img src="https://www.a-netz.de/blog/2014/10/images/chili_04.jpg"
title="Chilis!"
alt="Chilis!">
</a>
<figcaption>Chilis!</figcaption>
</figure>
<p>I will update the post as soon as I tried them and know how spicy they are...</p>
<p>Ok, here's the update: The chilis are medium spicy. So we tried to prepare chili
sauce by frying them with much oil and garlic. But we did not take care and the
sauce tasted burned :-( Next year we try again!</p>Introduce our cats2014-10-06T04:33:00+08:002014-10-06T04:33:00+08:00andreastag:www.a-netz.de,2014-10-06:/blog/2014/10/introduce-our-cats.html<p>My blog was inactive for a long time now and had ended with the previous post
about arriving in Shanghai one and a half year ago. So this is my new effort to
write posts more regularly and catch up with the things that have happened in
the meantime.</p>
<p>So …</p><p>My blog was inactive for a long time now and had ended with the previous post
about arriving in Shanghai one and a half year ago. So this is my new effort to
write posts more regularly and catch up with the things that have happened in
the meantime.</p>
<p>So let's start with our cats, because everyone on the internet loves pictures of
cute cats :-)</p>
<figure>
<a href="https://www.a-netz.de/blog/2014/10/images/cats_1.jpg">
<img src="https://www.a-netz.de/blog/2014/10/images/cats_1.jpg"
title="Our first cat, called Spot."
alt="Our first cat, called Spot.">
</a>
<figcaption>Our first cat, called Spot.</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2014/10/images/cats_2.jpg">
<img src="https://www.a-netz.de/blog/2014/10/images/cats_2.jpg"
title="Our second cat "Snow" likes to climb."
alt="Our second cat "Snow" likes to climb.">
</a>
<figcaption>Our second cat "Snow" likes to climb.</figcaption>
</figure>
<p>He is called Snow, because he was found in winter on the street in Shanghai,
while it was snowing. (Yes, that's possible in Shanghai).</p>Umzug nach Shanghai2013-02-22T10:13:00+08:002013-02-22T10:13:00+08:00andreastag:www.a-netz.de,2013-02-22:/blog/2013/02/umzug-nach-shanghai.html<p>Der Abreisetermin ist schneller da, als gedacht. Aber nun sitze ich zuhause auf
gepackten Koffern und warte darauf, dass mein Vater mich abholt. Dann gehen wir
noch essen und dann bringt er mich zum Bahnhof.</p>
<p>Von dort geht es nach Frankfurt zum Flughafen und dann nach Shanghai, meinem
neuen Zuhause …</p><p>Der Abreisetermin ist schneller da, als gedacht. Aber nun sitze ich zuhause auf
gepackten Koffern und warte darauf, dass mein Vater mich abholt. Dann gehen wir
noch essen und dann bringt er mich zum Bahnhof.</p>
<p>Von dort geht es nach Frankfurt zum Flughafen und dann nach Shanghai, meinem
neuen Zuhause für die nächsten zwei Jahre. Dort werde ich in der
Elektronik-Entwicklung von <a href="http://www.kostal.com">Kostal</a> arbeiten.</p>
<p>Die Bahnfahrt von Düsseldorf nach Frankfurt und der Flug nach Shanghai Pudong
waren ziemlich ereignislos, daher einen Tag fast-forward.</p>
<p>Bin gestern gegen Mittag gut in Shanghai angekommen. Vom Flughafen hat mich ein
Fahrer von Kostal abgeholt und zu meiner Wohnung gebracht - einem kleinen
serviced apartment, nah an der Innenstadt und mit den Haltestellen für U-Bahn
und Bus zur Arbeit direkt vor dem Haus <a href="http://www.openstreetmap.org/?mlat=31.21658&mlon=121.38356&zoom=15&layers=M">
📌</a> ziemlich
praktisch für mich.</p>
<p>Außerdem habe ich von meinem Wohnzimmerfenster eine ziemlich schöne Aussicht,
nämlich nicht so wie bei den meisten Wohnungen in Shanghai mit dem Blick auf das
Nachbarhochhaus, sondern aus dem 17. Stock auf den Sportplatz und Park einer
Privatschule.</p>
<figure>
<a href="https://www.a-netz.de/blog/2013/02/images/shanghai_01.jpg">
<img src="https://www.a-netz.de/blog/2013/02/images/shanghai_01.jpg"
title="Blick aus meiner Wohnung"
alt="Blick aus meiner Wohnung">
</a>
<figcaption>Blick aus meiner Wohnung</figcaption>
</figure>
<p>Heute war ich mit meinem Kollegen Olaf und seiner Frau erst im Bastiaan's
<a href="http://www.openstreetmap.org/?mlat=31.19298&mlon=121.38242&zoom=15&layers=M">
📌</a> Frühstücken und dann im Carré Four (wird
das so geschrieben?) einkaufen. Alles auch in China kein Problem, viele Lebensmittel
sind auch auf English beschriftet oder man erkennt sowieso, was es ist. Ein
größeres Problem ist die Auswahl. Ich wollte Reis und Sojasauce kaufen. Beides
gibt es aber in zig, wenn nicht hunderten von Varianten, vom kleinen Fläschchen
mit einigen ml Sauce bis zum großen Kanister bzw. der 25kg Familenpackung
Reis. Also noch viele Gelegenheiten zum ausprobieren :-)</p>
<p>Weiß eigentlich jemand, ob heute ein für die Chinesen ein besonderer Tag ist?
Überall in der Stadt gibt es Feuerwerk, im Moment gerade auch direkt neben
meinem Wohnblock - ziemlicher Radau, aber auch schön anzusehen :-)</p>Read-only Root Filesystem2013-02-09T17:53:00+08:002013-02-09T17:53:00+08:00andreastag:www.a-netz.de,2013-02-09:/blog/2013/02/read-only-root-filesystem.html<p>In my previous posts about <a href="https://www.a-netz.de/blog/2013/02/ramdisks-for-the-raspberry.html">ramdisks</a> and <a href="https://www.a-netz.de/blog/2013/02/persistent-storage-with-ramdisks.html">persistent storage</a> on my
<a href="http://www.raspberrypi.org">Raspberry Pi</a>, I explained my goal to reduce write access to the sd card as far
as possible.</p>
<p>The last step is to mount the sd card read-only, so its filesystems can almost
never get damaged. This is the …</p><p>In my previous posts about <a href="https://www.a-netz.de/blog/2013/02/ramdisks-for-the-raspberry.html">ramdisks</a> and <a href="https://www.a-netz.de/blog/2013/02/persistent-storage-with-ramdisks.html">persistent storage</a> on my
<a href="http://www.raspberrypi.org">Raspberry Pi</a>, I explained my goal to reduce write access to the sd card as far
as possible.</p>
<p>The last step is to mount the sd card read-only, so its filesystems can almost
never get damaged. This is the expected behaviour of most embedded devices. You
can power-cycle them and do no damage to their internal storage.</p>
<p>First, you need to edit your <code>/etc/fstab</code> file to configure the root and boot
filesystems to be mounted read-only. To do this, you change the option field
(the 4th field) of the lines starting with <code>/dev/mmcblk0p0</code> and <code>/dev/mmcblk0p1</code>
from <code>defaults</code> to <code>ro</code>:</p>
<div class="highlight"><pre><span></span><code>proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat ro 0 2
/dev/mmcblk0p2 / ext4 ro 0 1
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0
tmpfs /var/lock tmpfs defaults,noatime,mode=0755 0 0
tmpfs /home/andreas/rrd tmpfs defaults,noatime,mode=0777 0 0
</code></pre></div>
<p>With the next reboot, both your root and boot filesystems are write-protected
and cannot be modified by the system. In my case, I needed to do some more
changes, so that all system services run without errors.</p>
<p>If you log in to your system and want to change something, e.g. change a
configuration file, then you can re-enable the write access with the following
command:</p>
<div class="highlight"><pre><span></span><code>mount / -o remount,rw
</code></pre></div>
<p>and disable write access again with</p>
<div class="highlight"><pre><span></span><code>mount / -o remount,ro
</code></pre></div>
<h1 id="nginx">nginx</h1>
<p>My raspberry is executing the <a href="http://nginx.org/en">nginx</a> webserver to process and deliver some PHP
files. The PHP scripts are processed by the <code>FastCGI</code> module of nginx. This
module sometimes tries to create temporary files in <code>/var/lib/nginx/fastcgi</code>. To
disable this, edit the <code>/etc/nginx/nginx.conf</code> file and add this line to the
http-section:</p>
<div class="highlight"><pre><span></span><code>fastcgi_temp_path /tmp/fastcgi_temp 1 2;
</code></pre></div>
<p>Then all temporary files get stored in the <code>/tmp</code> directory mounted as a
ramdisk.</p>
<h1 id="fake-hwclock">fake-hwclock</h1>
<p>The raspberry does not have a realtime clock. During startup it gets the current
time and date by querying a <a href="http://en.wikipedia.org/wiki/Network_Time_Protocol">NTP</a> server. To prevent the time jumping back to
start of 1970 if the ntp server does not answer (e.g. due to network problems),
the file <code>/etc/fake-hwclock.data</code> is written once per hour with the current
time. During startup this time is restored to the system.</p>
<p>My raspberry is always connected to the network, so I can disable the
fake-hwclock mechanism. Simply comment out all lines in
<code>/etc/cron.hourly/fake-hwclock</code> by prepending a <code>#</code> character. Then reload the
cron configuration with</p>
<div class="highlight"><pre><span></span><code>service cron reload
</code></pre></div>
<h1 id="persistent-ramdisk-storage">Persistent Ramdisk Storage</h1>
<p>As described <a href="https://www.a-netz.de/blog/2013/02/persistent-storage-with-ramdisks.html">here</a>, I use a ramdisk for working data which
is regularly (once per night) and during shutdown backed up to the sd card. For
this to work, I added two lines to the init script managing the backup which
enables write access to the sd card, then does the backup and then disables
write access again:</p>
<div class="highlight"><pre><span></span><code>mount / -o remount,rw
rsync --quiet --archive --delete --recursive --force <span class="si">${</span><span class="nv">RAMDISK</span><span class="si">}</span>/ <span class="si">${</span><span class="nv">PERSIST_STORE</span><span class="si">}</span>
mount / -o remount,ro
</code></pre></div>
<p>This is a bit dangerous, because for a short time, the write access to the sd
card is enabled and data is written. Only once per day and during shutdown. But
it might happen that the power is switched off too early during shutdown and the
filesystem could be damaged. Because of that I currently think about sending the
ramdisk contents to another system over the network, so I never need to enable
write access to the sd card.</p>
<h1 id="sudo">sudo</h1>
<p>Sudo tries to write a timestamp to the directory <code>/var/lib/sudo</code> everytime you
use it. I have not yet found a solution to disable this, so sudo will print out
an error message, but anyhow lets you execute your command under the root
account.</p>
<h1 id="logrotate">logrotate</h1>
<p>Logrotate is a tool to prevent logfiles from growing indefinitely. By default,
every week it compresses the logfiles to gziped files and discards compressed
files older than 4 weeks. Logrotate writes internal info to a state file which
is stored under <code>/var/lib/logrotate</code>. To move this file to a writeable location,
edit the cron script <code>/etc/cron.daily/logrotate</code> and add the option <code>--state
/var/log/logrotate.state</code>:</p>
<div class="highlight"><pre><span></span><code><span class="ch">#!/bin/sh</span>
<span class="nb">test</span> -x /usr/sbin/logrotate <span class="o">||</span> <span class="nb">exit</span> <span class="m">0</span>
/usr/sbin/logrotate --state /var/log/logrotate.state /etc/logrotate.conf
</code></pre></div>
<h1 id="man-db">man-db</h1>
<p>Every week an index of the <a href="http://en.wikipedia.org/wiki/Man_page">man pages</a> installed on the raspberry is built. This
does not work on a read-only filesystem, so I disabled it by adding the line
<code>exit 0</code> to the beginning of the scripts <code>/etc/cron.weekly/man.db</code> and
<code>/etc/cron.daily/man.db</code>. This is no important change, but my raspberry keeps
sending me mails as long as the <code>man-db</code> scripts fails to update the index.</p>
<h1 id="package-update-check">Package Update Check</h1>
<p><a href="https://www.a-netz.de/blog/2012/12/check-for-updates-in-raspbian.html">Here</a> I described how the raspberry could automatically
check for <a href="http://www.raspbian.org">Raspbian</a> updates. This also does not work on a read-only
filesystem. As an intermediaty solution I added the <code>mount / -o remount,rw</code> and
<code>mount / -o remount,ro</code> commands before and after the <code>apt-get update</code> call and
run the script only once per week (sundays at 3am) to reduce the risk of
damaging the filesystem. This is no optimal solution, but I have no better one
yet.</p>Persistent storage with ramdisks2013-02-09T15:30:00+08:002013-02-09T15:30:00+08:00andreastag:www.a-netz.de,2013-02-09:/blog/2013/02/persistent-storage-with-ramdisks.html<p>As written in the last post about <a href="https://www.a-netz.de/blog/2013/02/ramdisks-for-the-raspberry.html">ramdisks</a>, it is good to reduce the
number of write cycles to the sd card of the <a href="http://www.raspberrypi.org">Raspberry Pi</a>, to prevent damage
to the filesystem and the sd card. But what to do with data that is regularly
written and that you want …</p><p>As written in the last post about <a href="https://www.a-netz.de/blog/2013/02/ramdisks-for-the-raspberry.html">ramdisks</a>, it is good to reduce the
number of write cycles to the sd card of the <a href="http://www.raspberrypi.org">Raspberry Pi</a>, to prevent damage
to the filesystem and the sd card. But what to do with data that is regularly
written and that you want to preserve over a reboot or a power loss. Here is a
way to create a kind of persistent ramdisk storage.</p>
<p>The idea is to let your software work in a ramdisk as long as the raspberry is
running. During startup, data is copied from the sd card to the ramdisk and
during shutdown it is backed up to the sd card. Additionally there is a cron job
that regulary creates a backup of the ramdisk data, so that in case of a power
loss not too much data is lost. My Raspberry stores temperature data in a
<a href="http://oss.oetiker.ch/rrdtool/">rrdtool</a> database on a ramdisk and backs it up this way.</p>
<p>First, you create two directories somewhere on the sd card. One is the backup
location for the data on the sd card (<code>/home/andreas/persist</code>). The other is the
mount point of the ramdisk (<code>/home/andreas/rrd</code>). Set this up by editing
<code>/etc/fstab</code>. How to create the ramdisk you can
<a href="https://www.a-netz.de/blog/2013/02/ramdisks-for-the-raspberry.html">read here</a>.</p>
<p>Then we need a script to backup and restore the ramdisk data. We use an init
script called <code>persist-ramdist</code>, because we want to do this during startup and
shutdown:</p>
<div class="highlight"><pre><span></span><code><span class="ch">#!/bin/bash</span>
<span class="c1">#</span>
<span class="c1">### BEGIN INIT INFO</span>
<span class="c1"># Provides: persist-ramdisk</span>
<span class="c1"># Default-Start: 2 3 4 5</span>
<span class="c1"># Default-Stop: 0 1 6</span>
<span class="c1"># Required-Start: </span>
<span class="c1"># Required-Stop: </span>
<span class="c1"># Short-Description: Backup / restore ram disk contents during boot / shutdown.</span>
<span class="c1"># Description: Backup / restore ram disk contents during boot / shutdown.</span>
<span class="c1">### END INIT INFO</span>
<span class="nv">PERSIST_STORE</span><span class="o">=</span>/home/andreas/persist
<span class="nv">RAMDISK</span><span class="o">=</span>/home/andreas/rrd
<span class="k">case</span> <span class="s2">"</span><span class="nv">$1</span><span class="s2">"</span> in
start<span class="o">)</span>
<span class="nb">echo</span> <span class="s2">"Restoring ramdisk contents"</span>
rsync --quiet --archive <span class="si">${</span><span class="nv">PERSIST_STORE</span><span class="si">}</span>/ <span class="si">${</span><span class="nv">RAMDISK</span><span class="si">}</span>
<span class="p">;;</span>
sync<span class="p">|</span>stop<span class="o">)</span>
<span class="nb">echo</span> <span class="s2">"Persisting ramdisk contents"</span>
rsync --quiet --archive --delete --recursive --force <span class="si">${</span><span class="nv">RAMDISK</span><span class="si">}</span>/ <span class="si">${</span><span class="nv">PERSIST_STORE</span><span class="si">}</span>
<span class="p">;;</span>
*<span class="o">)</span>
<span class="nb">echo</span> <span class="s2">"Usage: /etc/init.d/ramdisk {start|stop|sync}"</span>
<span class="nb">exit</span> <span class="m">1</span>
<span class="p">;;</span>
<span class="k">esac</span>
<span class="nb">exit</span> <span class="m">0</span>
</code></pre></div>
<p>The script can be called with three different parameters: <code>start</code>, <code>stop</code> and
<code>sync</code>. <code>start</code> copies the data from the sd card to the ramdisk (the ramdisk has
to be mounted before the script is called). The parameters <code>stop</code> and <code>sync</code>
copy the data from the ramdisk back to the sd card.</p>
<p>Both copy operations are done by <code>rsync</code>. Rsync does not copy all files but does
a synchronization and skips files that are already present in the destination
and not changed. So there are as few write operations to the sd card as
possible.</p>
<p>The init script can be installed by copying (or linking) it to <code>/etc/init.d</code> and
calling</p>
<div class="highlight"><pre><span></span><code>update-rc.d prepare-dirs defaults <span class="m">02</span> <span class="m">98</span>
</code></pre></div>
<p>For more info on init scripts, see <a href="https://www.a-netz.de/blog/2013/02/ramdisks-for-the-raspberry.html">my post here</a>.</p>
<p>Now the ramdisk is initialized with data during startup and the data is backed
up during shutdown. But my Raspberry has uptimes of a few weeks, so the data
would be only backed up every few weeks and huge parts would be lost if the
power is switched off without shutting the Raspberry down correctly.</p>
<p>Therefor we need a mechanism to regulary back up the data with <a href="http://en.wikipedia.org/wiki/Cron">cron</a>. Add a
file (the filename does not matter) to <code>/etc/cron.d</code> with the following
contents:</p>
<div class="highlight"><pre><span></span><code>17 2 * * * root /usr/sbin/service persist-ramdisk sync > /dev/null
</code></pre></div>
<p>and run <code>service cron reload</code> to make cron reload its configuration.</p>
<p>The first 5 fields tell <code>cron</code> when to execute the command, at 2:17 am every day
in this case. It is executed as the user <code>root</code>. Cron calls the init script with
the <code>service</code> tool and discards all console output of the script by redirecting
it to <code>/dev/null</code>. If the output is not discarded, cron will try to e-mail it to
root, so if you have set up the Raspberry for <a href="https://www.a-netz.de/blog/2012/12/sending-mail-with-the-raspberry-pi.html">sending mail</a>, you would get a
mail with the text " persisting ramdisk contents" every night at 2:17am.</p>Measuring temperature with the Raspberry Pi2013-02-06T17:48:00+08:002013-02-06T17:48:00+08:00andreastag:www.a-netz.de,2013-02-06:/blog/2013/02/measuring-temperature-with-the-raspberry-pi.html<p>One of my <a href="http://www.raspberrypi.org">Raspberry Pi</a> is running as a headless device measuring the room
temperature. It uses a <a href="http://datasheets.maximintegrated.com/en/ds/DS18S20.pdf">DS1820</a> sensor, which is directly attached to
the i/o connector of the raspberry and uses the <a href="http://en.wikipedia.org/wiki/1-Wire">1-Wire</a> bus.</p>
<figure>
<a href="https://www.a-netz.de/blog/2013/02/images/sens_ds1820.jpg">
<img src="https://www.a-netz.de/blog/2013/02/images/sens_ds1820.jpg"
title="The temperature sensor connected to the 1-wire
bus"
alt="The temperature sensor connected to the 1-wire
bus">
</a>
<figcaption>The temperature sensor connected to the 1-wire
bus</figcaption>
</figure>
<p>The measured temperature values can …</p><p>One of my <a href="http://www.raspberrypi.org">Raspberry Pi</a> is running as a headless device measuring the room
temperature. It uses a <a href="http://datasheets.maximintegrated.com/en/ds/DS18S20.pdf">DS1820</a> sensor, which is directly attached to
the i/o connector of the raspberry and uses the <a href="http://en.wikipedia.org/wiki/1-Wire">1-Wire</a> bus.</p>
<figure>
<a href="https://www.a-netz.de/blog/2013/02/images/sens_ds1820.jpg">
<img src="https://www.a-netz.de/blog/2013/02/images/sens_ds1820.jpg"
title="The temperature sensor connected to the 1-wire
bus"
alt="The temperature sensor connected to the 1-wire
bus">
</a>
<figcaption>The temperature sensor connected to the 1-wire
bus</figcaption>
</figure>
<p>The measured temperature values can be accessed by a website served by a
webserver running on the raspberry.</p>
<h1 id="hardware">Hardware</h1>
<p>The 1-wire sensor is directly connected to the 26 pin (newer models have 40
pins) i/o connector of the raspberry. The 1-wire bus needs a supply voltage
(3.3V), a ground connection and a data line, which is pulled high by a 4.7 kOhm
resistor. This is the schematic:</p>
<figure>
<a href="https://www.a-netz.de/blog/2013/02/images/sens_schematics.jpg">
<img src="https://www.a-netz.de/blog/2013/02/images/sens_schematics.jpg"
title="The 1-wire bus only needs a pullup resistor and
the connection to the temperature sensor"
alt="The 1-wire bus only needs a pullup resistor and
the connection to the temperature sensor">
</a>
<figcaption>The 1-wire bus only needs a pullup resistor and
the connection to the temperature sensor</figcaption>
</figure>
<p>You can add more sensors to the bus by connecting them in parallel to the first
sensor. The pullup resistor is only needed once for the whole bus.</p>
<figure>
<a href="https://www.a-netz.de/blog/2013/02/images/sens_connector.jpg">
<img src="https://www.a-netz.de/blog/2013/02/images/sens_connector.jpg"
title="The RPi side of the 1-wire bus connection"
alt="The RPi side of the 1-wire bus connection">
</a>
<figcaption>The RPi side of the 1-wire bus connection</figcaption>
</figure>
<h1 id="drivers">Drivers</h1>
<p>The <a href="http://www.raspbian.org">Raspbian</a> linux distribution already has all necessary kernel modules
installed for accessing the 1-wire bus. For first tests you can manually load
them with modprobe:</p>
<div class="highlight"><pre><span></span><code>modprobe w1_gpio
modprobe w1_therm
</code></pre></div>
<h1 id="reading-temperature">Reading temperature</h1>
<p>If the 1-wire bus and a temperature sensor is connected, you can now read the
sensor temperature by accessing the file <code>w1_slave</code> in the
<code>/sys/bus/w1/devices</code> directory structure:</p>
<div class="highlight"><pre><span></span><code>cat /sys/bus/devices/10-0008029061ff/w1_slave
</code></pre></div>
<p>The number <code>10-0008029061ff</code> is the id of the temperature sensor which is a
unique serial number and will be different for each sensor. The cat command will
print out something like this:</p>
<div class="highlight"><pre><span></span><code>28 00 4b 46 ff ff 09 10 6c : crc=6c YES
28 00 4b 46 ff ff 09 10 6c t=20187
</code></pre></div>
<p>This means that the sensor has been triggered and it responded with a data block
with correct crc and the temperature 20.187 degree celsius.</p>
<h1 id="hints">Hints</h1>
<p>To automatically load all modules needed for 1-wire access, you can add the
module names to the file <code>/etc/modules</code> in separate lines.</p>
<p>If you want to read from more than 10 sensors (or other 1-wire devices), you
need to configure a module parameter for the <code>wire</code> module. This module is
automatically loaded when the <code>w1_gpio</code> module is loaded. If you load it
manually before loading <code>w1_gpio</code>, you can add the parameter
<code>max_slave_count</code> to the modprobe command line:</p>
<div class="highlight"><pre><span></span><code>modprobe wire <span class="nv">max_slave_count</span><span class="o">=</span><span class="m">20</span>
</code></pre></div>
<p>To apply module parameters during startup, you can create a file
<code>/etc/modprobe.d/1-wire.conf</code> (the name is not important, but it must end with
<code>.conf</code>) with one line:</p>
<div class="highlight"><pre><span></span><code>options wire max_slave_count=20
</code></pre></div>Ramdisks for the Raspberry2013-02-04T09:55:00+08:002013-02-04T09:55:00+08:00andreastag:www.a-netz.de,2013-02-04:/blog/2013/02/ramdisks-for-the-raspberry.html<p>If you use your <a href="http://www.raspberrypi.org">Raspberry Pi</a> as a standalone (headless) device, e.g. to
measure and log the room temperature, there is no need to write all log files
etc. to the SD card. Instead you can mount ramdisks into the relevant
directories. This reduces the number of write accesses …</p><p>If you use your <a href="http://www.raspberrypi.org">Raspberry Pi</a> as a standalone (headless) device, e.g. to
measure and log the room temperature, there is no need to write all log files
etc. to the SD card. Instead you can mount ramdisks into the relevant
directories. This reduces the number of write accesses to the memory card and
does not wear out its flash memory.</p>
<figure>
<a href="https://www.a-netz.de/blog/2013/02/images/rpi_standalone_tempsens.jpg">
<img src="https://www.a-netz.de/blog/2013/02/images/rpi_standalone_tempsens.jpg"
title="Stand-alone Raspberry with DS1820
temperature sensor."
alt="Stand-alone Raspberry with DS1820
temperature sensor.">
</a>
<figcaption>Stand-alone Raspberry with DS1820
temperature sensor.</figcaption>
</figure>
<p>A standalone raspberry can be powered off without shutting down Linux by calling
<code>halt</code> or <code>shutdown -h now</code>. If there is a write access to the sd card during
power off, it might damage the internal filesystem structure and if you are
really unlucky (as has happened to me...), the filesystem is damaged in a way
that the Raspberry cannot boot anymore. Keep in mind to regulary create backups
of your sd card!</p>
<p>At least the following directories are written to by the linux system, so they
should be mounted to ramdisks:</p>
<ul>
<li><code>/var/log</code>: System logfiles</li>
<li><code>/var/lock</code>: Lock files for active processes</li>
<li><code>/tmp</code>: Temporary files</li>
</ul>
<p>You can do this by adding lines to the file <code>/etc/fstab</code>:</p>
<div class="highlight"><pre><span></span><code>proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0
tmpfs /var/lock tmpfs defaults,noatime,mode=0755 0 0
</code></pre></div>
<p>The lines starting with <code>tmpfs</code> are the important ones that mount ramdisks to
the specified directories. The <code>tmpfs</code> filesystem implements a ramdisk that
adapts its memory usage to the space needed in the ramdisk. So you do not need
to specify its size in the options of <code>/etc/fstab</code> and consume only as much ram
as is needed by the files in the ramdisk.</p>
<p>If you use a webserver like <code>apache</code> or <code>nginx</code> on the Raspberry, you need to
take care of the directory where the server stores its logfiles. This is
<code>/var/log/apache</code> or <code>/var/log/nginx</code>. Both webservers do not create this
directory if it is missing and do not start. So you need a solution to create
this log directory, before the webserver process is started.</p>
<p>Therefore I have written an init script named <code>prepare-dirs</code> that creates this
directory, in my case for the nginx webserver.</p>
<div class="highlight"><pre><span></span><code><span class="ch">#!/bin/bash</span>
<span class="c1">#</span>
<span class="c1">### BEGIN INIT INFO</span>
<span class="c1"># Provides: prepare-dirs</span>
<span class="c1"># Default-Start: 2 3 4 5</span>
<span class="c1"># Default-Stop: 0 1 6</span>
<span class="c1"># Required-Start: </span>
<span class="c1"># Required-Stop: </span>
<span class="c1"># Short-Description: Create /var/log/nginx directory on tmpfs at startup</span>
<span class="c1"># Description: Create /var/log/nginx directory on tmpfs at startup</span>
<span class="c1">### END INIT INFO</span>
<span class="nv">DIR</span><span class="o">=</span>/var/log/nginx
<span class="c1">#</span>
<span class="c1"># main()</span>
<span class="c1">#</span>
<span class="k">case</span> <span class="s2">"</span><span class="si">${</span><span class="nv">1</span><span class="k">:-</span><span class="s1">''</span><span class="si">}</span><span class="s2">"</span> in
start<span class="o">)</span>
<span class="c1"># create the /var/log/nginx needed by webserver</span>
<span class="k">if</span> <span class="o">[</span> ! -d <span class="si">${</span><span class="nv">DIR</span><span class="si">}</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
mkdir <span class="si">${</span><span class="nv">DIR</span><span class="si">}</span>
chmod <span class="m">755</span> <span class="si">${</span><span class="nv">DIR</span><span class="si">}</span>
<span class="k">fi</span>
<span class="p">;;</span>
stop<span class="o">)</span>
<span class="p">;;</span>
restart<span class="o">)</span>
<span class="p">;;</span>
reload<span class="p">|</span>force-reload<span class="o">)</span>
<span class="p">;;</span>
status<span class="o">)</span>
<span class="p">;;</span>
*<span class="o">)</span>
<span class="nb">echo</span> <span class="s2">"Usage: </span><span class="nv">$SELF</span><span class="s2"> start"</span>
<span class="nb">exit</span> <span class="m">1</span>
<span class="p">;;</span>
<span class="k">esac</span>
</code></pre></div>
<p>The script should be put into <code>/etc/init.d</code> and enabled in the boot process by
calling</p>
<div class="highlight"><pre><span></span><code>update-rc.d prepare-dirs defaults <span class="m">01</span> <span class="m">99</span>
</code></pre></div>
<p>This creates links in the <code>/etc/rcX.d</code> directories and makes sure that the
script is called with the <code>start</code> or <code>stop</code> parameter when entering or leaving
the corresponding runlevels. If you want to know more about the boot procedure
on <a href="http://www.raspbian.org">Raspbian</a>, see the <a href="http://upstart.ubuntu.com">Upstart Website</a> or the <a href="http://en.wikipedia.org/wiki/Upstart">Upstart Wikipedia entry</a>.</p>
<p>The numbers 01 and 99 tell update-rc.d to place the execution of the script at
the beginning of the boot process and and the end of the shutdown process. The
nginx webserver e.g. has the boot priority 02 by default, so it is started after
the prepare-dirs script has been executed.</p>
<p>After editing <code>/etc/fstab</code> and setting up the init script, you should reboot the
raspberry, so the ramdisks get mounted. You can check if everything works
correctly by calling <code>mount</code>. It should print out a list with all mounted
filesystems as specified in <code>/etc/fstab</code>.</p>
<p>With this setup you can prevent most of the write accesses to the sd card. To
guarantee that the root filesystem (the one containing the data on the sd card)
is never modified, it should be to mounted read-only, so that it cannot be
damaged in any way. I hope to have enough time in the next days to try that out.</p>
<h1 id="update-2015-03-17">Update (2015-03-17)</h1>
<p>Here the improved script from Tom, so there are no problems with copy and
pasting and the quotation marks modified by wordpress:</p>
<div class="highlight"><pre><span></span><code><span class="ch">#!/bin/bash</span>
<span class="c1">#</span>
<span class="c1">### BEGIN INIT INFO</span>
<span class="c1"># Provides: prepare-dirs</span>
<span class="c1"># Default-Start: 2 3 4 5</span>
<span class="c1"># Default-Stop: 0 1 6</span>
<span class="c1"># Required-Start:</span>
<span class="c1"># Required-Stop:</span>
<span class="c1"># Short-Description: Create needed directories on /var/log/ for tmpfs at startup</span>
<span class="c1"># Description: Create needed directories on /var/log/ for tmpfs at startup</span>
<span class="c1">### END INIT INFO</span>
<span class="c1"># needed Dirs</span>
DIR<span class="o">[</span><span class="m">0</span><span class="o">]=</span>/var/log/apt
DIR<span class="o">[</span><span class="m">1</span><span class="o">]=</span>/var/log/fsck
DIR<span class="o">[</span><span class="m">2</span><span class="o">]=</span>/var/log/lighttpd
PRM<span class="o">[</span><span class="m">2</span><span class="o">]=</span><span class="s2">"www-data.www-data"</span>
DIR<span class="o">[</span><span class="m">3</span><span class="o">]=</span>/var/log/stunnel4
PRM<span class="o">[</span><span class="m">3</span><span class="o">]=</span><span class="s2">"stunnel4.stunnel4"</span>
<span class="k">case</span> <span class="s2">"</span><span class="si">${</span><span class="nv">1</span><span class="k">:-</span><span class="si">}</span><span class="s2">"</span> in
start<span class="o">)</span>
<span class="nb">typeset</span> -i <span class="nv">i</span><span class="o">=</span><span class="m">0</span> <span class="nv">max</span><span class="o">=</span><span class="k">$(</span><span class="nb">echo</span> <span class="s2">"</span><span class="si">${</span><span class="p">!DIR[*]</span><span class="si">}</span><span class="s2">"</span> <span class="p">|</span> tr <span class="s2">" "</span> <span class="s2">"\n"</span> <span class="p">|</span> sort -nr <span class="p">|</span> head -n1<span class="k">)</span>
<span class="k">while</span> <span class="o">((</span> i <<span class="o">=</span> max <span class="o">))</span><span class="p">;</span><span class="k">do</span>
<span class="k">if</span> <span class="o">[</span> -n <span class="s2">"</span><span class="si">${</span><span class="nv">DIR</span><span class="p">[</span><span class="nv">$i</span><span class="p">]</span><span class="si">}</span><span class="s2">"</span> <span class="o">]</span><span class="p">;</span><span class="k">then</span>
mkdir -p <span class="si">${</span><span class="nv">DIR</span><span class="p">[</span><span class="nv">$i</span><span class="p">]</span><span class="si">}</span>
chmod <span class="m">755</span> <span class="si">${</span><span class="nv">DIR</span><span class="p">[</span><span class="nv">$i</span><span class="p">]</span><span class="si">}</span>
<span class="k">fi</span>
<span class="nv">i</span><span class="o">=</span>i+1
<span class="k">done</span>
<span class="c1"># set rights</span>
<span class="nb">typeset</span> -i <span class="nv">i</span><span class="o">=</span><span class="m">0</span> <span class="nv">max</span><span class="o">=</span><span class="k">$(</span><span class="nb">echo</span> <span class="s2">"</span><span class="si">${</span><span class="p">!PRM[*]</span><span class="si">}</span><span class="s2">"</span> <span class="p">|</span> tr <span class="s2">" "</span> <span class="s2">"\n"</span> <span class="p">|</span> sort -nr <span class="p">|</span> head -n1<span class="k">)</span>
<span class="k">while</span> <span class="o">((</span> i <<span class="o">=</span> max <span class="o">))</span><span class="p">;</span><span class="k">do</span>
<span class="k">if</span> <span class="o">[</span> -n <span class="s2">"</span><span class="si">${</span><span class="nv">PRM</span><span class="p">[</span><span class="nv">$i</span><span class="p">]</span><span class="si">}</span><span class="s2">"</span> <span class="o">]</span><span class="p">;</span><span class="k">then</span>
chown -R <span class="si">${</span><span class="nv">PRM</span><span class="p">[</span><span class="nv">$i</span><span class="p">]</span><span class="si">}</span> <span class="si">${</span><span class="nv">DIR</span><span class="p">[</span><span class="nv">$i</span><span class="p">]</span><span class="si">}</span>
<span class="k">fi</span>
<span class="nv">i</span><span class="o">=</span>i+1
<span class="k">done</span>
<span class="p">;;</span>
stop<span class="o">)</span>
<span class="p">;;</span>
restart<span class="o">)</span>
<span class="p">;;</span>
reload<span class="p">|</span>force-reload<span class="o">)</span>
<span class="p">;;</span>
status<span class="o">)</span>
<span class="p">;;</span>
*<span class="o">)</span>
<span class="nb">echo</span> <span class="s2">"Usage: </span><span class="nv">$SELF</span><span class="s2"> start"</span>
<span class="nb">exit</span> <span class="m">1</span>
<span class="p">;;</span>
<span class="k">esac</span>
</code></pre></div>Automatic check for package updates in Raspbian2012-12-27T14:34:00+08:002012-12-27T14:34:00+08:00andreastag:www.a-netz.de,2012-12-27:/blog/2012/12/check-for-updates-in-raspbian.html<p>Since a few days I have a <a href="http://www.raspberrypi.org">Raspberry Pi</a> continuously running and at the moment
measuring the room temperature. Since I do not log in regularly to the system to
check for operating system (<a href="http://www.raspbian.org">Raspbian</a>) updates, I wanted to get notified by
mail when there are updates available.</p>
<p>There is …</p><p>Since a few days I have a <a href="http://www.raspberrypi.org">Raspberry Pi</a> continuously running and at the moment
measuring the room temperature. Since I do not log in regularly to the system to
check for operating system (<a href="http://www.raspbian.org">Raspbian</a>) updates, I wanted to get notified by
mail when there are updates available.</p>
<p>There is a program which can do this, which is called <code>apticron</code>. But there is a
ploblem if you want to run it on the Raspberry. It needs a mail server
installed. And because the raspberry has not much RAM, I did not want to install
the mail server. So in my article about <a href="https://www.a-netz.de/blog/2012/12/sending-mail-with-the-raspberry-pi.html">sending mail from the raspberry</a> I
describe how to send mail without running a mail server.</p>
<p>To check for available updates I wrote a script which can be called by the
<code>cron</code> regularly, e.g. once per night. If there are updates available it sends a
mail by calling the command line mail client <code>mailx</code>.</p>
<p>You can use the script by putting it into your home directory on the raspberry
and adding a line to a config file for cron like <code>/etc/cron.d/apt-checkupdates</code>:</p>
<div class="highlight"><pre><span></span><code>0 3 * * * root /home/pi/apt-updatecheck.sh --quiet --mailto YourEMail@YourProvider.com
</code></pre></div>
<p>This runs the script under the root account each night at 3am. It updates the
package lists with <code>apt-get update</code> and then calls <code>apt-get -s dist-upgrade</code> to
simulate the installation of available updates. It then parses the output of
<code>apt-get</code> and sends a mail with the results.</p>
<p>For testing you can also call the script in the console. To get help for the
available command line parameters, call it like this:</p>
<div class="highlight"><pre><span></span><code>./apt-updatecheck.sh --help
</code></pre></div>
<p>And here's the script:</p>
<div class="highlight"><pre><span></span><code><span class="ch">#!/bin/bash</span>
<span class="c1"># $Id: apt-updatecheck.sh 17 2012-12-27 13:24:50Z andreas $</span>
<span class="c1">#</span>
<span class="c1"># This script checks for available upgrades on debian-bases systems and prints</span>
<span class="c1"># a message and / or sends a mail. It is intended to be run by cron.</span>
<span class="c1">#</span>
<span class="c1"># Example cron file under /etc/cron.d/apt-updatecheck</span>
<span class="c1"># 0 3 * * * root /opt/scripts/apt-updatecheck --quiet --mailto <email-address></span>
<span class="c1">#</span>
<span class="c1"># Based on the work of these people:</span>
<span class="c1"># Author: http://www.renemoser.net/archives/190</span>
<span class="c1"># Modified by: http://blog.splash.de</span>
<span class="c1">#</span>
<span class="c1"># Default: Show messages on console</span>
<span class="nv">QUIET</span><span class="o">=</span><span class="m">0</span>
<span class="nv">MAIL_TO</span><span class="o">=</span><span class="s2">""</span>
<span class="nv">UPGRADE_MODE</span><span class="o">=</span><span class="s2">"dist-upgrade"</span>
<span class="c1"># check parameters</span>
<span class="k">while</span> <span class="o">[</span> <span class="nv">$#</span> -gt <span class="m">0</span> <span class="o">]</span>
<span class="k">do</span>
<span class="k">case</span> <span class="s2">"</span><span class="nv">$1</span><span class="s2">"</span> in
--quiet<span class="o">)</span>
<span class="nv">QUIET</span><span class="o">=</span><span class="m">1</span>
<span class="p">;;</span>
--mailto<span class="o">)</span>
<span class="c1"># get next param</span>
<span class="nb">shift</span>
<span class="c1"># check at least if it contains @</span>
<span class="k">if</span> <span class="o">[</span> <span class="sb">`</span><span class="nb">echo</span> <span class="nv">$1</span> <span class="p">|</span> awk <span class="s1">'/@/'</span><span class="sb">`</span> <span class="o">]</span>
<span class="k">then</span>
<span class="nv">MAIL_TO</span><span class="o">=</span><span class="nv">$1</span>
<span class="k">else</span>
<span class="nb">echo</span> <span class="s2">"--mailto expects an e-mail"</span>
<span class="nb">exit</span> <span class="m">1</span>
<span class="k">fi</span>
<span class="p">;;</span>
--help<span class="o">)</span>
<span class="nb">echo</span> <span class="s2">"usage: </span><span class="nv">$0</span><span class="s2"> [--quiet] [--mailto email@dot.com]"</span>
<span class="nb">echo</span> <span class="s2">"--quiet [quiet mode, no output to console]"</span>
<span class="nb">echo</span> <span class="s2">"--mailto email@dot.com [send output via email]"</span>
<span class="nb">exit</span> <span class="m">0</span>
<span class="p">;;</span>
<span class="k">esac</span>
<span class="nb">shift</span>
<span class="k">done</span>
<span class="c1"># update package lists</span>
apt-get update <span class="m">2</span>><span class="p">&</span><span class="m">1</span> > /dev/null
<span class="c1"># calculate upgrades and capture output</span>
<span class="nv">OUTPUT</span><span class="o">=</span><span class="sb">`</span>apt-get -s <span class="si">${</span><span class="nv">UPGRADE_MODE</span><span class="si">}</span> <span class="m">2</span>><span class="p">&</span><span class="m">1</span><span class="sb">`</span>
<span class="c1"># calculate number of upgradeable packages</span>
<span class="nv">UPDATES</span><span class="o">=</span><span class="sb">`</span><span class="nb">echo</span> <span class="s2">"</span><span class="nv">$OUTPUT</span><span class="s2">"</span> <span class="p">|</span> grep -E <span class="s1">'^Inst '</span> <span class="p">|</span> wc -l<span class="sb">`</span>
<span class="k">if</span> <span class="o">[</span> <span class="nv">$UPDATES</span> -ne <span class="m">0</span> <span class="o">]</span>
<span class="k">then</span>
<span class="c1"># get list of packages</span>
<span class="nv">PACKAGES</span><span class="o">=</span><span class="sb">`</span><span class="nb">echo</span> <span class="s2">"</span><span class="nv">$OUTPUT</span><span class="s2">"</span> <span class="p">|</span> grep -E <span class="s1">'^Inst'</span> <span class="p">|</span> cut -d <span class="s1">' '</span> -f <span class="m">2</span><span class="sb">`</span>
<span class="c1"># assemble text for message / mail.</span>
<span class="nv">MSG</span><span class="o">=</span><span class="s2">"These </span><span class="si">${</span><span class="nv">UPDATES</span><span class="si">}</span><span class="s2"> packages need an update on host '`hostname`':\n"</span>
<span class="nv">MSG</span><span class="o">=</span><span class="s2">"</span><span class="si">${</span><span class="nv">MSG</span><span class="si">}${</span><span class="nv">PACKAGES</span><span class="si">}</span><span class="s2">\n\n"</span>
<span class="nv">MSG</span><span class="o">=</span><span class="s2">"</span><span class="si">${</span><span class="nv">MSG</span><span class="si">}</span><span class="s2">Please perform ‘apt update && apt upgrade’ as root."</span>
<span class="c1"># if MAIL_TO variable is not empty, send a mail.</span>
<span class="k">if</span> <span class="o">[</span> -n <span class="s2">"</span><span class="nv">$MAIL_TO</span><span class="s2">"</span> <span class="o">]</span>
<span class="k">then</span>
<span class="nb">echo</span> -e <span class="nv">$MSG</span> <span class="p">|</span> mailx -s <span class="s2">"[`hostname`] </span><span class="nv">$UPDATES</span><span class="s2"> update(s) available"</span> <span class="nv">$MAIL_TO</span>
<span class="k">fi</span>
<span class="c1"># if quiet flag is not set, print out message.</span>
<span class="k">if</span> <span class="o">[</span> <span class="nv">$QUIET</span> -eq <span class="m">0</span> <span class="o">]</span>
<span class="k">then</span>
<span class="nb">echo</span> -e <span class="nv">$MSG</span>
<span class="k">fi</span>
<span class="k">fi</span>
<span class="nb">exit</span> <span class="m">0</span>
</code></pre></div>Sending mail with the Raspberry Pi2012-12-22T17:42:00+08:002012-12-22T17:42:00+08:00andreastag:www.a-netz.de,2012-12-22:/blog/2012/12/sending-mail-with-the-raspberry-pi.html<p><a href="http://www.raspbian.org">Raspian</a>, the default linux distribution for the <a href="http://www.raspberrypi.org">Raspberry Pi</a> does not
install a mail server by default, so the raspberry cannot send mails. For
raspberries running headless, i.e. without a monitor attached, mailing would be
a good feauture, e.g. to report pending package updates, etc. So here is …</p><p><a href="http://www.raspbian.org">Raspian</a>, the default linux distribution for the <a href="http://www.raspberrypi.org">Raspberry Pi</a> does not
install a mail server by default, so the raspberry cannot send mails. For
raspberries running headless, i.e. without a monitor attached, mailing would be
a good feauture, e.g. to report pending package updates, etc. So here is a
simple way to enable sending mails from the raspberry without installing a full
featured mail server.</p>
<p>You can install a full-featured mail server like Postfix, but this would consume
too much resources on the raspberry and for sending update notifications you
would not need all its features. A more simple way is to use the mail server of
your internet provider or a service like <a href="http://www.gmx.de">GMX</a> or similar. You only need to tell
the Raspberry to forward the outgoing mails to the correct mail server. This can
be done by installing the packages <code>ssmtp</code> and <code>heirloom-mailx</code>:</p>
<div class="highlight"><pre><span></span><code>apt-get install ssmtp heirloom-mailx
</code></pre></div>
<p>The <code>ssmtp</code> package is used to transport your mails to your provider and needs
to be configured by editing <code>/etc/ssmtp/ssmtp.conf</code>. There you add the name of
your mail server, your username and password and enable TSL to encrypt the
connection to your provider (if it supports encryption). This is my <code>ssmtp.conf</code>
configuration file:</p>
<div class="highlight"><pre><span></span><code><span class="c1"># The person who gets all mail for userids < 1000</span>
<span class="c1"># Make this empty to disable rewriting.</span>
<span class="na">root</span><span class="o">=</span><span class="s">postmaster</span>
<span class="c1"># The place where the mail goes. The actual machine name is required no</span>
<span class="c1"># MX records are consulted. Commonly mailhosts are named mail.domain.com</span>
<span class="na">mailhub</span><span class="o">=</span><span class="s">MyMailServerName</span>
<span class="c1"># Where will the mail seem to come from?</span>
<span class="na">rewriteDomain</span><span class="o">=</span><span class="s">MyMailServerDomain</span>
<span class="c1"># The full hostname</span>
<span class="na">hostname</span><span class="o">=</span><span class="s">raspberry</span>
<span class="c1"># Are users allowed to set their own From: address?</span>
<span class="c1"># YES - Allow the user to specify their own From: address</span>
<span class="c1"># NO - Use the system generated From: address</span>
<span class="c1">#FromLineOverride=YES</span>
<span class="c1"># Use SSL/TLS before starting negotiation</span>
<span class="na">UseTLS</span><span class="o">=</span><span class="s">Yes</span>
<span class="na">UseSTARTTLS</span><span class="o">=</span><span class="s">Yes</span>
<span class="c1"># Username/Password</span>
<span class="na">AuthUser</span><span class="o">=</span><span class="s">MyMailUsername</span>
<span class="na">AuthPass</span><span class="o">=</span><span class="s">SecretPassword</span>
</code></pre></div>
<p>The <code>heirloom-mailx</code> package is installed to be able to send mails on the
command-line. You can test your installation like this:</p>
<div class="highlight"><pre><span></span><code><span class="nb">echo</span> <span class="s2">"mail from your raspberry"</span> <span class="p">|</span> <span class="se">\</span>
mail -s <span class="s2">"Testmail"</span> YourEmail@YourProvider.com
</code></pre></div>
<p>If this does not work, you can call <code>ssmtp</code> directly and get debug output this
way:</p>
<div class="highlight"><pre><span></span><code><span class="nb">echo</span> <span class="s2">"Test"</span> <span class="p">|</span> <span class="se">\</span>
sendmail -v YourEmail@YourProvider.com
</code></pre></div>
<p>This will print out the communication with the mail server of your provider.</p>Bike tour Duisburg Rheinpark2012-07-01T12:42:00+08:002012-07-01T12:42:00+08:00andreastag:www.a-netz.de,2012-07-01:/blog/2012/07/radtour-duisburg-rheinpark.html<p>This post is an overview of one of my last visits to Duisburg Angerpark /
<a href="http://de.wikipedia.org/wiki/Heinrich-Hildebrand-H%C3%B6he">Heinrich-Hildebrand-Höhe</a> <a href="http://www.openstreetmap.org/?mlat=51.37559&mlon=6.73798&zoom=15&layers=M">
📌</a> and <a href="http://de.wikipedia.org/wiki/Rheinpark_Duisburg">Rheinpark</a>
<a href="http://www.openstreetmap.org/?mlat=51.4112&mlon=6.74783&zoom=15&layers=M">
📌</a> by bike. And this is also an experiment to
visualize the GPX track I recorded during the tour.</p>
<p>A comfortable web interface to the <a href="http://connect.garmin.com/activity/194468254">GPS Track</a> is available from Garmin. But I
can …</p><p>This post is an overview of one of my last visits to Duisburg Angerpark /
<a href="http://de.wikipedia.org/wiki/Heinrich-Hildebrand-H%C3%B6he">Heinrich-Hildebrand-Höhe</a> <a href="http://www.openstreetmap.org/?mlat=51.37559&mlon=6.73798&zoom=15&layers=M">
📌</a> and <a href="http://de.wikipedia.org/wiki/Rheinpark_Duisburg">Rheinpark</a>
<a href="http://www.openstreetmap.org/?mlat=51.4112&mlon=6.74783&zoom=15&layers=M">
📌</a> by bike. And this is also an experiment to
visualize the GPX track I recorded during the tour.</p>
<p>A comfortable web interface to the <a href="http://connect.garmin.com/activity/194468254">GPS Track</a> is available from Garmin. But I
can only link to their website - wordpress does not like the iframe tags to
embed their map into this post.</p>
<p>Another possibility is to use the <a href="http://wordpress.org/extend/plugins/osm/">OSM Wordpress Plugin</a> to embed a map from
<a href="http://www.openstreetmap.org">Openstreetmap</a>. It works quite well, but the interaction with the map (panning,
zooming) seems to be a bit slow if the gps track has many points.</p>
<p>(Update 2020-0214: As I switched from Wordpress to Pelican, the plugin cannot be
used here anymore)</p>
<p>And here are a few pictures:</p>
<figure>
<a href="https://www.a-netz.de/blog/2012/07/images/radtour_duisburg_rheinpark.jpg">
<img src="https://www.a-netz.de/blog/2012/07/images/radtour_duisburg_rheinpark.jpg"
title="Overview of the Rheinpark area"
alt="Overview of the Rheinpark area">
</a>
<figcaption>Overview of the Rheinpark area</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2012/07/images/radtour_duisburg_dragon.jpg">
<img src="https://www.a-netz.de/blog/2012/07/images/radtour_duisburg_dragon.jpg"
title="Dragon Grafiti"
alt="Dragon Grafiti">
</a>
<figcaption>Dragon Grafiti</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2012/07/images/radtour_duisburg_tiger_turtle.jpg">
<img src="https://www.a-netz.de/blog/2012/07/images/radtour_duisburg_tiger_turtle.jpg"
title="Tiger & Turtle Sculpture on
Heinrich-Hildebrand-Höhe"
alt="Tiger & Turtle Sculpture on
Heinrich-Hildebrand-Höhe">
</a>
<figcaption>Tiger & Turtle Sculpture on
Heinrich-Hildebrand-Höhe</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2012/07/images/radtour_duisburg_tiger_turtle2.jpg">
<img src="https://www.a-netz.de/blog/2012/07/images/radtour_duisburg_tiger_turtle2.jpg"
title="Tiger & Turtle Sculpture on
Heinrich-Hildebrand-Höhe"
alt="Tiger & Turtle Sculpture on
Heinrich-Hildebrand-Höhe">
</a>
<figcaption>Tiger & Turtle Sculpture on
Heinrich-Hildebrand-Höhe</figcaption>
</figure>Routen für Garmin GPS erstellen2010-07-20T15:42:00+08:002010-07-20T15:42:00+08:00andreastag:www.a-netz.de,2010-07-20:/blog/2010/07/routen-fur-garmin-gps-erstellen.html<p>Bisher habe ich Routen für mein Garmin GPS manuell mit <a href="http://www.gpsbabel.org">gpsbabel</a> konvertiert
und auf das GPS geladen. Da mir das zu aufwendig wurde, habe ich ein kleines
Shell-Script geschrieben, welches mir die Arbeit erleichtert.</p>
<p>Die Vorgehensweise um eine neue Route zu erstellen, ist nun folgende:</p>
<ol>
<li>
<p>Erstellen der Route. Dies kann …</p></li></ol><p>Bisher habe ich Routen für mein Garmin GPS manuell mit <a href="http://www.gpsbabel.org">gpsbabel</a> konvertiert
und auf das GPS geladen. Da mir das zu aufwendig wurde, habe ich ein kleines
Shell-Script geschrieben, welches mir die Arbeit erleichtert.</p>
<p>Die Vorgehensweise um eine neue Route zu erstellen, ist nun folgende:</p>
<ol>
<li>
<p>Erstellen der Route. Dies kann man entweder mit Google Earth machen. Dazu
einen Path zeichen und als kml-Datei speichern. Oder mit dem
<a href="http://www.bikeroutetoaster.com/Course.aspx">Bikeroutetoaster</a> eine neue Route erstellen und diese als GPX
herunterladen. Dabei möglichst die automatische Streckenplanung ausschalten,
da sonst viel zu viele Wegpunkte entstehen und die meisten Garmin-Geräte nur
250 Wegpunkte pro Route verwalten können.</p>
</li>
<li>
<p>Das GPS per USB anschließen und das Script mit dem Dateinamen als einzigen
Parameter aufrufen. Die Datei wird dann automatisch konvertiert und auf das
GPS geladen. Dort ist sie dann unter "Routen" zu finden. Der Name der Route
entspricht dem Dateinamen.</p>
</li>
</ol>
<p>Das Script sieht folgendermaßen aus:</p>
<div class="highlight"><pre><span></span><code><span class="ch">#!/bin/bash</span>
<span class="c1">#</span>
<span class="c1"># Tranfer tracks from kml (Google Earth) or gpx file to a Garmin gps unit.</span>
<span class="c1"># The track is converted to a route.</span>
<span class="c1">#</span>
<span class="c1"># author: Andreas Schroeder</span>
<span class="c1"># date: 2010-07-20</span>
<span class="c1">#</span>
<span class="c1"># Based on idea from Jochen Schmid.</span>
<span class="c1">#</span>
<span class="c1"># maximum number of route points (250 for Garmin GPSMAP 60)</span>
<span class="nv">MAXPOINTS</span><span class="o">=</span><span class="s2">"250"</span>
<span class="c1"># icon for waypoints (does not work at the moment)</span>
<span class="nv">ICON</span><span class="o">=</span><span class="s2">"Flag Red"</span>
<span class="c1"># print help</span>
<span class="k">if</span> <span class="o">[</span> <span class="nv">$#</span> -ne <span class="m">1</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
<span class="nb">echo</span> <span class="s2">"Convert tracks (gpx or kml) to Garmin routes and transfer them to the device."</span>
<span class="nb">echo</span> <span class="s2">"Usage: </span><span class="nv">$0</span><span class="s2"> "</span>
<span class="nb">echo</span> <span class="s2">""</span>
<span class="nb">exit</span> <span class="m">1</span>
<span class="k">fi</span>
<span class="c1"># input file name</span>
<span class="nv">INFILE</span><span class="o">=</span><span class="nv">$1</span>
<span class="c1"># input format (gpx and kml are supported)</span>
<span class="nv">FORMAT</span><span class="o">=</span><span class="sb">`</span><span class="nb">echo</span> <span class="nv">$INFILE</span> <span class="p">|</span> sed -e <span class="s1">'s/^[^\.]*\./'</span><span class="sb">`</span>
<span class="c1"># check input format</span>
<span class="k">if</span> <span class="o">[</span> <span class="si">${</span><span class="nv">FORMAT</span><span class="si">}</span> !<span class="o">=</span> <span class="s2">"gpx"</span> -a <span class="si">${</span><span class="nv">FORMAT</span><span class="si">}</span> !<span class="o">=</span> <span class="s2">"kml"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
<span class="nb">echo</span> <span class="s2">"Unknown file format '</span><span class="si">${</span><span class="nv">FORMAT</span><span class="si">}</span><span class="s2">'. The input filename must end with '.kml' or '.gpx'."</span>
<span class="nb">exit</span> <span class="m">2</span>
<span class="k">fi</span>
<span class="c1"># get route name from filename</span>
<span class="nv">ROUTENAME</span><span class="o">=</span><span class="sb">`</span>basename <span class="nv">$1</span> .<span class="si">${</span><span class="nv">FORMAT</span><span class="si">}</span><span class="sb">`</span>
<span class="c1"># check for number of route points</span>
<span class="nv">NUMPOINTS</span><span class="o">=</span><span class="sb">`</span>gpsbabel -r -i <span class="si">${</span><span class="nv">FORMAT</span><span class="si">}</span> -f <span class="s2">"</span><span class="si">${</span><span class="nv">INFILE</span><span class="si">}</span><span class="s2">"</span> -x transform,rte<span class="o">=</span>trk -o gpx -F - <span class="p">|</span> grep <span class="s2">""</span> <span class="p">|</span> wc -l<span class="sb">`</span>
<span class="k">if</span> <span class="o">[</span> <span class="si">${</span><span class="nv">NUMPOINTS</span><span class="si">}</span> -gt <span class="si">${</span><span class="nv">MAXPOINTS</span><span class="si">}</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
<span class="nb">echo</span> <span class="s2">"Your route contains </span><span class="si">${</span><span class="nv">NUMPOINTS</span><span class="si">}</span><span class="s2"> points. This is more than the maximum"</span>
<span class="nb">echo</span> <span class="s2">"allowed number of points (</span><span class="si">${</span><span class="nv">MAXPOINTS</span><span class="si">}</span><span class="s2">). Please simplify the input data"</span>
<span class="nb">echo</span> <span class="s2">"and try again."</span>
<span class="nb">exit</span> <span class="m">2</span>
<span class="k">fi</span>
<span class="c1"># convert and upload to gps unit</span>
gpsbabel -r -i <span class="si">${</span><span class="nv">FORMAT</span><span class="si">}</span> -f <span class="s2">"</span><span class="si">${</span><span class="nv">INFILE</span><span class="si">}</span><span class="s2">"</span> <span class="se">\</span>
-x transform,rte<span class="o">=</span>trk <span class="se">\</span>
-o gpx -F - <span class="se">\</span>
<span class="p">|</span> sed -e <span class="s2">"s#^ *#&\n </span><span class="si">${</span><span class="nv">ROUTENAME</span><span class="si">}</span><span class="s2">#"</span> -e <span class="s2">"s#^ *# Flag, Red\n&#"</span> <span class="se">\</span>
<span class="p">|</span> gpsbabel -r -i gpx -f - -o garmin -F usb:
<span class="nb">echo</span> <span class="s2">"Route '</span><span class="si">${</span><span class="nv">ROUTENAME</span><span class="si">}</span><span class="s2">' successfully uploaded."</span>
</code></pre></div>Eagle-Lib for AT90USB2010-07-01T00:00:00+08:002010-07-01T00:00:00+08:00andreastag:www.a-netz.de,2010-07-01:/blog/2010/07/eagle-lib-for-at90usb.html<p>Here you can download a device library for the PCB layout program Eagle from
<a href="http://www.cadsoft.de">Cadsoft</a> . It contains the device definition of the <a href="http://www.atmel.com">Atmel</a> AVR
microcontrollers AT90USB646, AT90USB647, AT90USB1286 and AT90USB1287 with USB
interface.</p>
<p>The library is published under the terms of the LGPL. See <a href="http://www.gnu.org">http://www.gnu.org</a>
for more …</p><p>Here you can download a device library for the PCB layout program Eagle from
<a href="http://www.cadsoft.de">Cadsoft</a> . It contains the device definition of the <a href="http://www.atmel.com">Atmel</a> AVR
microcontrollers AT90USB646, AT90USB647, AT90USB1286 and AT90USB1287 with USB
interface.</p>
<p>The library is published under the terms of the LGPL. See <a href="http://www.gnu.org">http://www.gnu.org</a>
for more information about this license.</p>
<p>Download: <a href="https://www.a-netz.de/blog/2010/07/files/at90usb.zip">at90usb.zip</a></p>Eagle-Lib für AT90USB2010-07-01T00:00:00+08:002010-07-01T00:00:00+08:00andreastag:www.a-netz.de,2010-07-01:/blog/2010/07/eagle-lib-fur-at90usb.html<p>Hier gibt es eine Bauteil-Bibliothek für das Platinen-Layout-Programm Eagle von
<a href="http://www.cadsoft.de">Cadsoft</a> für die <a href="http://www.atmel.com">Atmel</a> AVR Mikrocontroller AT90USB646, AT90USB647,
AT90USB1286 und AT90USB1287 mit USB-Interface zum Download.</p>
<p>Die Library wird unter den Bedingungen der LGPL
angeboten. Siehe <a href="http://www.gnu.org">http://www.gnu.org</a> für mehr Informationen zur Lizenz.</p>
<p>Download: <a href="https://www.a-netz.de/blog/2010/07/files/at90usb.zip">at90usb.zip</a></p>Service-Menü für Gigaset S79H2010-06-23T18:20:00+08:002010-06-23T18:20:00+08:00andreastag:www.a-netz.de,2010-06-23:/blog/2010/06/service-menu-fur-gigaset-s79h.html<p>Ich habe letztens ein neues Telefon gebraucht und mir ein <a href="http://gigaset.com/hq/de/product/GIGASETS790.html">Gigaset S790</a>
gekauft. Das Mobilteil heisst S79H. Während ich im Netz gesucht habe, ob es dazu
schon irgendwelche Software für Linux gibt (nach aktuellem Kenntnisstand gibt es
nur die Software QuickSync von Gigaset für Windows und irgendetwas für den Mac …</p><p>Ich habe letztens ein neues Telefon gebraucht und mir ein <a href="http://gigaset.com/hq/de/product/GIGASETS790.html">Gigaset S790</a>
gekauft. Das Mobilteil heisst S79H. Während ich im Netz gesucht habe, ob es dazu
schon irgendwelche Software für Linux gibt (nach aktuellem Kenntnisstand gibt es
nur die Software QuickSync von Gigaset für Windows und irgendetwas für den Mac),
bin ich auf einen Hinweis gestoßen, dass das Mobilteil ein Servicemenü
enthält. Dies hat mir natürlich keine Ruhe gelassen und hier sind die
Ergebnisse.</p>
<p>Vor allen Experimenten: Das ist ein Menü, welches nicht für den Endnutzer
gedacht ist. Eventuell kann man sich damit das Telefon beschädigen oder sonst
irgendwas kaputt machen oder Kosten verursachen! Also alles nur auf eigene
Verantwortung ausprobieren.</p>
<p>Wenn Du irgendwelche Ideen hast, was die einzelnen Ausgaben in den Menüs
bedeuten könnten, schreib bitte einen Hinweis in den Kommentarbereich.</p>
<h1 id="wechsel-ins-servicemenu">Wechsel ins Servicemenü</h1>
<ul>
<li>Mobilteil ausschalten</li>
<li>Tasten 1 und 4 gleichzeitig drücken und wieder einschalten</li>
<li>Nun wird "Service Menu" angezeigt und wenn man auf irgendwelche Tasten
drückt, werden verschiedene Testmuster angezeigt.</li>
<li>Gibt man nun die Ziffern <code>76200</code> ein, landet man im Servicemenü</li>
<li>Um aus dem Servicemenü herauszukommen, einfach auf "Back" drücken. Das
Mobilteil schaltet sich dann aus.</li>
</ul>
<p>Im Servicemenü gibt es folgende Punkte.</p>
<h1 id="sw-service">SW-Service</h1>
<p>Anzeige von SW-Daten</p>
<div class="highlight"><pre><span></span><code>SW: 78.025.03
USER: U:000 I:000
IPUI: XXXXXXXXXX <-- Hex-Zahl, IPUI = International Portable User Identity
IMG: 78.999.99
</code></pre></div>
<h1 id="qs-data">QS-Data</h1>
<div class="highlight"><pre><span></span><code>QS1: XXXXXXXX <-- Hex-Zahl
QS2: XXXXXXXX <-- Hex-Zahl
</code></pre></div>
<h1 id="speechpath-test">Speechpath Test</h1>
<p>Noch nicht getestet</p>
<h1 id="batt-mode">Batt. Mode</h1>
<p>Zyklische Anzeige von drei aufeinander folgenden Hex-Ziffernfolgen</p>
<div class="highlight"><pre><span></span><code>011E2B0F00A0
|||| ||
|||| ++- Strom oder Strom für Display (wenn Display hell, dann ca. 0x80,
|||| wenn Display schwach leuchtet, dann ca. 0x0C)
++++ Ändert sich laufend, eventuell Spannung, evtl. auch zwei getrennte Werte`
02023601028A Nummer ändert sich nicht
030E02005202 Nummer ändert sich nicht
||
++- Sequenznummer, immer 01, 02 oder 03
</code></pre></div>
<h1 id="dsp-parameters">DSP Parameters</h1>
<p>Während Anruf ein Service Info Menü</p>
<h1 id="metering-mode">Metering Mode</h1>
<p>Anzeige im Normalbetrieb:</p>
<div class="highlight"><pre><span></span><code>091.0,06,90,100
||||
|||+ Hier steht mal ein . und mal ein '
+++- Feldstärke in Prozent
</code></pre></div>
<h1 id="measure-time">Measure Time</h1>
<p>Vermutlich Einstellung des Updateintervals der Debug-Infos.</p>
<h1 id="working-time">Working Time</h1>
<p>Betriebsdauer des Mobilteils</p>
<h1 id="apprv-narr-band">Apprv. Narr. Band</h1>
<p>?</p>
<h1 id="apprv-wide-band">Apprv. Wide Band</h1>
<p>?</p>
<h1 id="sar">SAR</h1>
<p>Specific Absorption Ratio (?). Auswahlmöglichkeit: 1 Slot | 1 Slot Low | 2 Slots</p>
<h1 id="handset-reset">Handset Reset</h1>
<p>Zurücksetzen des Mobilteils</p>
<h1 id="sonstiges">Sonstiges</h1>
<p>Einige der Information werden erst nach dem Verlassen und Wiedereinschalten des
Telefons am oberen Rand des Displays angezeigt.</p>
<p>Hier gibt es ein paar infos zur <a href="http://online-hilfe.nec-telefonanlagen.de/tools/ipei-converter.html">IPUI</a>.</p>
<h1 id="info-menu">Info-Menü</h1>
<p>Das Telefon hat außerdem noch ein einfaches verstecktes Info-Menü. Um das
anzuzeigen:</p>
<ul>
<li>Das Hauptmenü öffnen</li>
<li><code>*#06#</code> eingeben</li>
</ul>Buch: Daniel Kehlmann - Die Vermessung der Welt2010-04-10T13:41:00+08:002010-04-10T13:41:00+08:00andreastag:www.a-netz.de,2010-04-10:/blog/2010/04/buch-die-vermessung-der-welt.html<p>Viele der Bücher, die ich lese, kommen aus dem Bereich Fantasy oder
Cyberpunkt. Letztens habe ich dann von einem Bekannten das Buch <em>Die Vermessung
der Welt</em> von <a href="http://de.wikipedia.org/wiki/Daniel_Kehlmann">Daniel Kehlmann</a> empfohlen bekommen und möchte diese Empfehlung
hier uneingeschränkt weitergeben.</p>
<p>Das Buch handelt von den beiden Naturwissenschaftlern <a href="http://de.wikipedia.org/wiki/Alexander_von_Humboldt">Alexander von Humboldt</a>
und <a href="http://de.wikipedia.org/wiki/Carl_Friedrich_Gau%C3%9F">Carl …</a></p><p>Viele der Bücher, die ich lese, kommen aus dem Bereich Fantasy oder
Cyberpunkt. Letztens habe ich dann von einem Bekannten das Buch <em>Die Vermessung
der Welt</em> von <a href="http://de.wikipedia.org/wiki/Daniel_Kehlmann">Daniel Kehlmann</a> empfohlen bekommen und möchte diese Empfehlung
hier uneingeschränkt weitergeben.</p>
<p>Das Buch handelt von den beiden Naturwissenschaftlern <a href="http://de.wikipedia.org/wiki/Alexander_von_Humboldt">Alexander von Humboldt</a>
und <a href="http://de.wikipedia.org/wiki/Carl_Friedrich_Gau%C3%9F">Carl Friedrich Gauß</a>. Kehlmann beschreibt das Leben der beiden - Humboldts
Expedition nach Südamerika und Gauß Arbeit im Bereich der Mathematik und als
Landvermesser - und die völlig unterschiedlichen und auf ihre jeweils eigene Art
verschrobenen Charaktere auf unterhaltsame Weise und mit Humor.</p>
<p>Das Buch endet mit den Treffen der beiden Wissenschaftler auf einem Kongress in
Berlin. Hier werden die völlig unterschiedlichen Einstellungen, die
zurückgezogene und weltabgewandte Lebensweise von Gauß und die offene Art
Humboldts, besonders schön zusammengebracht.</p>
<p>Insgesamt ein unterhaltsamer Roman, der mir viel Spaß gemacht hat.</p>Review: Osram Nightbreaker H7 (Teil 2)2010-04-08T14:17:00+08:002010-04-08T14:17:00+08:00andreastag:www.a-netz.de,2010-04-08:/blog/2010/04/review-osram-nightbreaker-h7-teil-2.html<p>Nach nicht ganz einem Jahr kann ich nun einen abschließenden Bericht zu den
Osram Nightbreaker Lampen liefern: Letzte Woche sind beide auf einmal
gestorben. Motor gestartet, Licht angemacht, es blitzte kurz auf und war wieder
dunkel. Und das nach etwas weniger als einem Jahr. Das ist meiner Meinung nach
wesentlich …</p><p>Nach nicht ganz einem Jahr kann ich nun einen abschließenden Bericht zu den
Osram Nightbreaker Lampen liefern: Letzte Woche sind beide auf einmal
gestorben. Motor gestartet, Licht angemacht, es blitzte kurz auf und war wieder
dunkel. Und das nach etwas weniger als einem Jahr. Das ist meiner Meinung nach
wesentlich zu kurz für Autolampen. Nun bin ich um zwei Erkenntnisse reicher.</p>
<p>Erstens werde ich diese Lampen nicht wieder einbauen. Für den verhältnismäßig
hohen Preis finde ich die Lebensdauer zu kurz. Die Lichtausbeute ist zwar
wirklich höher als bei "normalen" Lampen. Aber das ist es mir nicht
wert. Besonders nicht, wenn man morgens früh im Dunkeln zur Arbeit fahren will
und nicht fahren kann, weil das Auto kein Licht mehr hat. Daher die zweite
Erfahrung:</p>
<p>Immer eine Packung Ersatzlampen im Auto haben. Wie
ich <a href="https://www.a-netz.de/blog/2009/05/review-osram-nightbreaker-h7.html">Review Osram Nightbreaker</a>[im ersten Teil] beschrieben habe, ist das
Auswechseln beim Polo ziemlich einfach. Wenn aber keine Lampen auf Vorrat sind,
nützt das leider gar nichts. Ich musste eben warten, bis es hell genug war, bis
ich losfahren konnte.</p>
<p>Nachmittags war ich dann bei ATU und habe neue Lampen besorgt. Dieses Mal
(relativ) normale - Philips Eco Vision. Mit rund 25 Euro bei ATU leider etwas
teuer, aber was nutzt es, wenn man die Dinger dringend braucht :-(</p>
<p>Die kurze Lebensdauer kann man Osram nicht wirklich vorwerfen. Sie schreiben
immerhin auf ihrer Website in der <a href="http://www.osram.de/osram_de/Tools_%26_Services/Training_%26_Wissen/FAQ/Automobilbeleuchtung/index.html#answ82">FAQ</a> zur Nightbreaker-Serie: "Die
Uhren-Symbole weisen aber auf eine verkürzte Lebensdauer gegenüber
Standardlampen hin."</p>Fehler in OpenStreetmap finden2009-07-12T17:55:00+08:002009-07-12T17:55:00+08:00andreastag:www.a-netz.de,2009-07-12:/blog/2009/07/fehler-in-openstreetmap-finden.html<p>Die Kartendaten des Projekts <a href="http://www.openstreetmap.org">Openstreetmap</a> für Deutschland sind inzwischen
erstaunlich umfangreich und exakt. Trotzdem gibt es noch an vielen Stellen
Verbesserungsbedarf. Insbesondere die Detailinformationen sind manchmal
unvollständig oder nicht ganz korrekt. Das Problem besteht nur darin, diese
Fehler oder fehlenden Informationen zu bemerken oder zu finden.</p>
<p>Natürlich kann man sich …</p><p>Die Kartendaten des Projekts <a href="http://www.openstreetmap.org">Openstreetmap</a> für Deutschland sind inzwischen
erstaunlich umfangreich und exakt. Trotzdem gibt es noch an vielen Stellen
Verbesserungsbedarf. Insbesondere die Detailinformationen sind manchmal
unvollständig oder nicht ganz korrekt. Das Problem besteht nur darin, diese
Fehler oder fehlenden Informationen zu bemerken oder zu finden.</p>
<p>Natürlich kann man sich einfach mal die Karte in der Umgebung des Wohnortes oder
anderer Orte, die man gut kennt, anschauen und nach Fehlern suchen. Dabei findet
sich oft schon eine ganze Menge an Kleinigkeiten, etwa fehlende Fuß- oder
Radwege, reine Wohnstraßen, fehlende Metadaten (z.B. Briefkästen, Geldautomaten,
Tankstellen, etc.).</p>
<p>Es gibt aber auch noch einige Websites, die einem das Fehlerfinden und -beheben
erleichtern:</p>
<ul>
<li><a href="http://openstreetbugs.schokokeks.org/">OpenStreetBugs</a>: Hier kann man einen Fehler eintragen, wenn man ihn nicht
selbst beheben will. Dazu einfach auf die Karte klicken, wo der Fehler liegt
und einen kleinen Kommentar eingeben. Man muss sich nicht einmal
anmelden. Wenn man einen Fehler behoben hat, dann kann man den Fehler auf
dieser Seite auch wieder einfach als "Fixed" markieren.</li>
<li><a href="http://matt.sandbox.cloudmade.com/">OSM No-names Minutely</a>: Auf dieser Karte werden alle Straßen rot markiert,
für die noch kein Name gespeichert wurde. Allerdings scheint es zur Zeit
Probleme mit dem Aktualisieren der Karte zu geben.</li>
<li><a href="http://osm.gt.owl.de/Strassenliste/">Strassenlistenauswertung</a>: Hier gibt es einen Abgleich zwischen den von
vielen Städten veröffentlichten Straßenlisten und den in Openstreetmap
angelegten. So kann man leicht herausfinden, welche Straßen noch angelegt
oder benannt werden müssen.</li>
<li><a href="http://www.openstreetmap.org">Maplint</a>: Maplint ist ein Layer, den man in der normalen
OpenStreetmap-Karte zusätzlich einblenden kann. Dazu auf der rechten Seite
der Karte auf das Plus klicken und ein Häckchen bei Maplint setzen. Es
werden dann alle möglichen Fehler in der Karte gekennzeichnet, die bei der
automatischen Auswertung der Kartendaten gefunden wurden.</li>
</ul>Reparatur der Cessna2009-06-07T17:07:00+08:002009-06-07T17:07:00+08:00andreastag:www.a-netz.de,2009-06-07:/blog/2009/06/reparatur-der-cessna.html<p>Nach meinem ersten <a href="https://www.a-netz.de/blog/2009/06/erstflug-der-cessna.html">Flugversuch</a> hier nun die Beschreibung der Reparatur und ein
paar Infos zum simulierten Fliegen.</p>
<h1 id="reparatur">Reparatur</h1>
<p>Die Reparatur ist relativ schnell und einfach erledigt. Die Luftschraube lässt
sich abschrauben, indem man die beiden kleinen Schräubchen am Spinner
losschraubt und dann die M3-Mutter auf der Motorachse direkt hinter dem …</p><p>Nach meinem ersten <a href="https://www.a-netz.de/blog/2009/06/erstflug-der-cessna.html">Flugversuch</a> hier nun die Beschreibung der Reparatur und ein
paar Infos zum simulierten Fliegen.</p>
<h1 id="reparatur">Reparatur</h1>
<p>Die Reparatur ist relativ schnell und einfach erledigt. Die Luftschraube lässt
sich abschrauben, indem man die beiden kleinen Schräubchen am Spinner
losschraubt und dann die M3-Mutter auf der Motorachse direkt hinter dem Spinner
löst. Dann kann man den Propeller nach vorne abschrauben. Gut, dass zumindest ein
Ersatzpropeller im Lieferumfang ist.</p>
<p>Erstaunt war ich über die Robustheit der Bugrad-Aufhängung. Das Rad selbst ist
an einem 2mm-Federstahldraht befestigt, der in einer Kunststoffführung
steckt. Nur der Draht war verbogen, die Kunststofführung hat es glücklicherweise
unbeschadet überstanden.</p>
<p>Beim Heraussuchen des Ersatzpropellers ist mir auch noch die CD mit dem
Flugsimulator wieder in die Hände gefallen. Die, denke ich mich, probier ich
lieber mal aus, bevor ich den nächsten Flugversuch unternehme.</p>
<h1 id="flugsimulator">Flugsimulator</h1>
<p>Wir treffen uns bei meinem Starthelfer, um den Simulator auszuprobieren, da er
nur unter Windows läuft, ich hier aber nur Linux habe. Der Simulator namens
<a href="http://n.ethz.ch/~mmoeller/fms/index_e.html">FMS</a> ist relativ einfach gehalten, was zum Fliegen lernen aber gar nicht
schlecht ist. Die Besonderheit ist, dass man die Fernsteuerung der Cessna über
USB anschließen kann und diese dann als Joystick im Simulator zur Steuerung
verwendet wird. Damit wird der Simulator ausgesprochen realitätsnah.</p>
<p>Nach einigem Üben (ca. 1,5h) und ungezählten virtuellen Crashs (die die Cessna
sicher nicht überlebt hätte), macht sich das Üben aber bezahlt und wir bekommen
es sogar hin, im Simulator ordentlich zu landen. Das hätten wir vielleicht
besser vor dem ersten real-life-Flugversuch machen sollen...</p>
<p>Nun warte ich erst einmal auf besseres Wetter und werde bis dahin noch einmal
wenig im Simulator üben, in der Hoffnung, dass sich die Übung dann auch in der
Realität bezahlt macht.</p>
<h1 id="simulator-unter-linux">Simulator unter Linux</h1>
<p>Hier noch ein paar Infos zu meinen Versuchen, einen Modellflugsimulator unter
Linux in Betrieb zu nehmen. Der erste Versuch war, den FMS unter Windows in qemu
(in einer virtuellen Maschine) laufen zu lassen. Von der Performance her (auf
meinem 2GHz Pentium M Notebook) müsste es gehen. Irgendwie klappt die
Übertragung der Joystick-Daten über USB an qemu aber nicht ganz richtig. Die
Controls im FMS zucken hin und wieder aber richtig steuern kann ich nicht.</p>
<p>Dann habe ich noch den <a href="http://crrcsim.berlios.de/wiki/">crrcsim</a> unter Linux entdeckt. Dieser scheint mit vom
Realitätsgrad der Steuerung wesentlich schlechter. Die Steuerung erscheint mir
viel zu direkt, so als würde die Trägheit des Modells gar nicht
berücksichtigt. Aber auch hier gibt es Probleme mit der Anbindung der
Fernsteuerung. Die wird zwar auch unter Linux als Joystick erkannt, aber die
Kalibrierung funktioniert nicht richtig. Die Controls schlagen immer in die eine
Richtung schnell bis zum Anschlag aus, in die andere Richtung aber nur ein ganz
kleines Stückchen. So kann man auch nicht steuern.</p>Erstflug der Cessna2009-06-07T17:04:00+08:002009-06-07T17:04:00+08:00andreastag:www.a-netz.de,2009-06-07:/blog/2009/06/erstflug-der-cessna.html<p>Letzten Freitag war es windstill und damit ideal für den Erstflug meiner
Cessna. Nun bin ich um ein paar Erfahrungen reicher... Aber um es vorweg zu
nehmen: Das Modell hat es überlebt :) Mit einem Bekannten bin ich zu einer Wiese
in der Nähe gefahren, die noch nicht gemäht war und …</p><p>Letzten Freitag war es windstill und damit ideal für den Erstflug meiner
Cessna. Nun bin ich um ein paar Erfahrungen reicher... Aber um es vorweg zu
nehmen: Das Modell hat es überlebt :) Mit einem Bekannten bin ich zu einer Wiese
in der Nähe gefahren, die noch nicht gemäht war und schön hochgewachsen, in der
Hoffnung, dass das hohe Gras einen eventuellen Absturz etwas bremsen würde.</p>
<p>Nach einiger Bastelei auf der Wiese - die Ruder waren noch nicht ganz passend
kalibriert und die Anlenkung des Querruders falsch herum - dann der erste Start
aus der Hand: Vollgas und das Modell mit einem leichten Schubs in die Luft
werfen. Erstes Ergebnis: Der Motor ist für das verhältnismäßig geringe Gewicht
mehr als ausreichend stark. Die Cessna zieht problemlos steil nach oben. Zweites
Ergebnis: Verdammt, das Flugzeug irgendwie in der Luft zu halten, funktioniert
noch, aber auch noch irgendwie dahin zu steuern, wo man es haben will, klappt
nicht so richtig. Nach einem unfreiwilligen Looping (Kunstflug scheint demnach
auch kein Problem zu sein...) war dann wohl die Reichweite der Steuerung
erreicht und die Cessna landet etwas unsanft im Gras. Hohes Gras macht aber auch
seine Probleme: Man findet das Modell nicht so einfach wieder...</p>
<p>Ok, war zwar ausgesprochen wackelig, dieser erste Flug, aber mit ein wenig Übung
klappt das bestimmt - also noch ein Start aus der Hand. Diesmal versuche ich,
die Cessna mehr in der Nähe zu halten. Klappt aber auch nicht so richtig, da sie
nun mehr über mir fliegt als vor mir und ich dann Probleme habe, die Fluglage
einzuschätzen. Der zweite Versuch endet kurz darauf wie der erste. Ich glaube,
ich komme mit den Querrudern noch nicht so ganz zurecht. Nachdem sich die Cessna
in eine große Kurve (die Kurve erschien mir zu groß) gelegt hatte, wollte ich
die Kurve enger machen und habe mehr Querruder gegeben. Ergebnis: Das Flugzeug
dreht sich so lange, bis die Flügel senkrecht nach oben und unten zeigen und
stürzt dann ab. Ich hätte wohl lieber das Hohenruder verwendet, um die Kurve
enger zu machen. Glücklicherweise geht auch der zweite Absturz glimpflich aus
und ich wage noch einen dritten Flug.</p>
<p>Dieses Mal klappt die Steuerung schon etwas besser. Aber irgendwie komme ich
ziemlich schnell mit Motorsteuerung und Höhenruder durcheinander. Da die Cessna
wohl etwas schwanzlastig ist, zieht sie beim Gasgeben sofort stark nach oben. So
lässt sich zum Teil das Höhenruder durch die Motorsteuerung ersetzen. Ich komme
aber durcheinander, ziehe an der Höhe, das geht mir zu schnell und ich nehme das
Gas zurück. Ergebnis: Strömungsabriss und die Cessna kommt ziemlich schnell dem
Boden näher. Erster Eindruck vom Absturz: Die ist bestimmt nicht mehr zu
retten. Beim Bergen dann aber die erstaunliche Erkenntnis, dass das Modell wohl
erheblich stabiler gebaut ist, als es zunächst den Eindruck macht. Beim Aufprall
ist der Propeller gebrochen und das Bugrad leicht verbogen. Ansonsten sind keine
Beschädigungen zu erkennen. Also erst einmal alles eingepackt und nach Hause
gefahren.</p>
<p>Todo: Add photos...Auf Flickr habe ich übrigens</p>Bilder mit Thumbnails in Wordpress einbinden2009-05-27T17:12:00+08:002009-05-27T17:12:00+08:00andreastag:www.a-netz.de,2009-05-27:/blog/2009/05/bilder-mit-thumbnails-in-wordpress-einbinden.html<p>Ich habe dieses Blog mit der Version 2.7.1 von <a href="http://www.wordpress.org">Wordpress</a> gestartet. Zunächst
funktionierte dann das Einbinden von Bildern nicht ganz richtig. Ich konnte zwar
Bilder einbinden, aber nur als "fullsize". Dadurch wird aber meist das Layout
durcheinander gebracht, da die meisten Bilder breiter sind also die Hauptspalte
mit …</p><p>Ich habe dieses Blog mit der Version 2.7.1 von <a href="http://www.wordpress.org">Wordpress</a> gestartet. Zunächst
funktionierte dann das Einbinden von Bildern nicht ganz richtig. Ich konnte zwar
Bilder einbinden, aber nur als "fullsize". Dadurch wird aber meist das Layout
durcheinander gebracht, da die meisten Bilder breiter sind also die Hauptspalte
mit dem Text. Eigentlich sollte es möglich sein, ein Bild als Thumbnail - mit
einem Link auf das Bild in Orginalgröße - einzubinden. Siehe zum
Beispiel <a href="https://www.a-netz.de/blog/2009/05/erfahrungen-mit-der-skyartec-cessna-182.html">hier</a>.</p>
<p>Schuld war eine fehlende PHP-Library auf dem Server. Nach Installation der
Library <code>php5-gd</code> war das Problem weg. Nun wird mit dem Upload eines Bildes ein
Thumbnail erzeugt. Dieses kann dann in ein Post eingefügt werden und verlinkt
auf das entsprechende Bild in Orginalgröße.</p>Review: Osram Nightbreaker H72009-05-26T16:00:00+08:002009-05-26T16:00:00+08:00andreastag:www.a-netz.de,2009-05-26:/blog/2009/05/review-osram-nightbreaker-h7.html<p>Vor kurzem ist einer der beiden Scheinwerfer (Abblendlicht) an meinem Auto,
einem VW Polo (Version 9N, Baujahr 2006, 1,4l Benziner) ausgefallen. Genauer
gesagt ist die Lampe für das Abblendlicht kaputt gegangen.</p>
<p>Nach einigen Erkundigungen - und wenig Durchblick (warum können die Hersteller
keine vernünftigen Datenblätter anbieten?) - hab ich mich für …</p><p>Vor kurzem ist einer der beiden Scheinwerfer (Abblendlicht) an meinem Auto,
einem VW Polo (Version 9N, Baujahr 2006, 1,4l Benziner) ausgefallen. Genauer
gesagt ist die Lampe für das Abblendlicht kaputt gegangen.</p>
<p>Nach einigen Erkundigungen - und wenig Durchblick (warum können die Hersteller
keine vernünftigen Datenblätter anbieten?) - hab ich mich für die <a href="http://www.osram.de/osram_de/Consumer/Automobilbeleuchtung/Produkte/Scheinwerferlicht/NIGHT_BREAKER/index.html">Nightbreaker</a>
Lampen von <a href="http://www.osram.de">Osram</a> entschieden. Die sind zwar ziemlich teuer im Vergleich zu
einigen anderen Lampen, haben aber auch ganz gute Kritiken bekommen.</p>
<h1 id="einbau">Einbau</h1>
<p>Ich war mir vorher nicht sicher, ob ich den Einbau selbst hinbekomme. Im
Nachhinein muss ich aber sagen, dass ich mir da keine Sorgen hätte machen
müssen. Zum Einen ist der Einbau in der Bedienungsanleitung des Autos ganz gut
beschrieben und zum Anderen hat der Polo (jedenfalls als 1.4l Benziner) den
großen Vorteil, dass die Scheinwerfer sehr gut zugänglich sind. Man braucht noch
nicht einmal Werkzeug, um die Lampen zu tauschen.</p>
<p>Der Einbau kurz zusammengefasst:</p>
<ul>
<li>Motorhaube auf</li>
<li>Die größere Gummiabdeckung am Scheinwerfer abziehen (da sind zwei drauf,
eine große für das Abblendlicht und eine kleine für das Standlicht)</li>
<li>Am Stecker anfassen, etwas wackeln und die Lampe daran herausziehen. Dabei
aufpassen, dass man mit der Lampe nicht im Reflektor des Scheinwerfers
anstößt. Bei meiner war nämlich so etwas silbriger Lack auf der Lampe, der
aber ganz spröde war. Nun habe ich so ein paar Krümel davon im
Scheinwerfer - keine Chance, die wieder herauszubekommen.</li>
<li>Stecker von der Lampe abziehen</li>
<li>Stecker an neue Lampe stecken. Dabei das Glas der Lampe niemals mit den
Fingern anfassen, sondern nur am Metall oder mit einem sauberen Tuch. Fett
auf dem Glas ist schädlich für die Lampe und für den Reflektor!</li>
<li>Lampe in die Halterung im Reflektor stecken</li>
<li>Gummiabdeckung wieder gut festdrücken</li>
<li>Motorhaube zumachen und neues Licht ausprobieren</li>
</ul>
<h1 id="fazit">Fazit</h1>
<p>Das was ich vorher auch schon in einigen Foren im Netz gefunden habe, kann ich
nur bestätigen: Das Licht der Nightbreaker-Lampen ist weißer als das der
VW-Standardlampen. Außerdem habe ich den Eindruck, dass ich Nachts wesentlich
besser sehen kann. Ich bin mir nur nicht sicher, ob das an den besseren neuen
Lampen liegt. Vielleicht sind auch einfach die alten Lampen mit der Zeit dunkler
geworden, sodass ich nur den Eindruck habe, dass es nun heller ist.</p>
<p>Die neuen Lampen sind zwar teuer, aber so schnell gehen sie hoffentlich auch
nicht wieder kaputt. Mal sehen, wie lange sie halten, dann entscheide ich, ob
ich die wieder kaufe oder nicht. Zur Zeit würde ich aber dazu tendieren, sie
wieder anzuschaffen. Ich habe meine übrigens bei <a href="http://www.reichelt.de/?;ACTION=3;LA=444;GROUP=L8;GROUPID=3506;ARTICLE=84330">Reichelt</a> für 17,95 pro Stück
gekauft.</p>Erfahrungen mit der Skyartec Cessna 1822009-05-24T15:14:00+08:002009-05-24T15:14:00+08:00andreastag:www.a-netz.de,2009-05-24:/blog/2009/05/erfahrungen-mit-der-skyartec-cessna-182.html<p>Nach einiger Zeit ohne Modellbauaktivitäten habe ich nun endlich mal wieder
etwas in dieser Richtung unternommen: Eine Cessna 182 von Skyartec, als "Ready
to Fly"-Modell (RTF) habe ich mir angeschafft. Hier eine kleine Zusammenfassung
meiner bisherigen Erfahrungen damit.</p>
<figure>
<a href="https://www.a-netz.de/blog/2009/05/images/cessna182-01.jpg">
<img src="https://www.a-netz.de/blog/2009/05/images/cessna182-01.jpg"
title="Vorderansicht der Cessna 182"
alt="Vorderansicht der Cessna 182">
</a>
<figcaption>Vorderansicht der Cessna 182</figcaption>
</figure>
<h1 id="ausstattung">Ausstattung</h1>
<p>Das Modell gibt es in verschiedenen …</p><p>Nach einiger Zeit ohne Modellbauaktivitäten habe ich nun endlich mal wieder
etwas in dieser Richtung unternommen: Eine Cessna 182 von Skyartec, als "Ready
to Fly"-Modell (RTF) habe ich mir angeschafft. Hier eine kleine Zusammenfassung
meiner bisherigen Erfahrungen damit.</p>
<figure>
<a href="https://www.a-netz.de/blog/2009/05/images/cessna182-01.jpg">
<img src="https://www.a-netz.de/blog/2009/05/images/cessna182-01.jpg"
title="Vorderansicht der Cessna 182"
alt="Vorderansicht der Cessna 182">
</a>
<figcaption>Vorderansicht der Cessna 182</figcaption>
</figure>
<h1 id="ausstattung">Ausstattung</h1>
<p>Das Modell gibt es in verschiedenen Varianten mit 3 oder 4 RC-Kanälen, einem
normalen DC- oder einem Brushless Motor und entweder einem NiMH- oder
LiIon-Akkupack. Ich habe mich für die "Maximalvariante" entschieden. In der
4-Kanal-Version werden Höhen-, Seiten- und Querruder und der Motor
gesteuert. Mit dem Seitenruder wird gleichzeitig das Bugfahrwerk gelenkt, so
dass auch Starts vom Boden möglich sind.</p>
<p>Das Flugzeug besteht fast vollständig aus einem festen styroporähnlichen
Material mit einer ziemlich glatten Oberfläche. Höhen- und Seitenleitwerk
bestehen aus Kunststoff.</p>
<figure>
<a href="https://www.a-netz.de/blog/2009/05/images/cessna182-02.jpg">
<img src="https://www.a-netz.de/blog/2009/05/images/cessna182-02.jpg"
title="Rückansicht der Cessna"
alt="Rückansicht der Cessna">
</a>
<figcaption>Rückansicht der Cessna</figcaption>
</figure>
<h1 id="aufbau">Aufbau</h1>
<p>Folgt man der Anleitung, dann müssen nur die beiden Leitwerke in den Rumpf
eingeklebt werden und das Fahrwerk drangesteckt werden und schon kann man
fliegen. Theoretisch. Allerdings gibt es ein paar Feinheiten, die ich direkt
beim Zusammenbau geändert / korrigiert habe.</p>
<p>Die Antenne am Empfänger ist aufgewickelt im Rumpf untergebracht, was für die
maximale Reichweite der Fernsteuerung sicher von Nachteil ist. Ich habe ein Loch
direkt vor dem Ansatz des Seitenruders in den Rumpf gebohrt, so dass die Antenne
komplett durch den Rumpf bis ans Rumpfende verlegt werden kann.</p>
<p>Die Anlenkung des Seitenruders und des Bugrads ist ungünstig ausgeführt. Die
Übersetzung für das Bugrad ist zu groß und die für das Seitenruder zu
klein. Durch Vertauschen der beiden Ansatzpunkte am Servo lässt sich dies aber
einfach korrigieren.</p>
<p>Die Aufkleber auf Rumpf, Tragflächen und Rudern sind ziemlich unsauber
aufgeklebt. Auch hier ist noch ein wenig Nacharbeit erforderlich, damit es
ordentlich aussieht.</p>
<p>Bei meinem Modell war eine Madenschraube in der Buchse zum Anschrauben des
Bugrades im Gewinde festgeklemmt und "ausgenudelt", so dass sie sich weder
festziehen noch herausschrauben ließ. Daher habe ich die Schraube herausgebohrt,
durch eine neue Schraube ersetzt und das ganze auch gleich noch etwas
gewichtsoptimiert, d.h. die Buchse etwas abgefeilt.</p>
<h1 id="bisheriges-fazit">Bisheriges Fazit</h1>
<p>Da ich das Modell bisher noch nicht geflogen habe, gibt es dazu in Kürze noch
ein Update.</p>
<p>Ich würde sagen, dass die Qualität - vor allem in Relation zu dem geringen Preis
und dem sehr vollständigen Lieferumfang - angemessen ist. Mit ein klein wenig
Nacharbeit erhält man ein nettes, einfaches Modell. Die Bauweise aus Styropor
macht einen erstaunlich soliden Eindruck, nur das Fahrwerk ist etwas
wackelig. Ob das Styropor die Belastungen beim Flug und vor allebei einer
unsanften Landung gut aushält, muss sich aber noch zeigen.</p>Erzeugen von X.509-Zertifikaten2009-02-01T01:00:00+08:002009-02-01T01:00:00+08:00andreastag:www.a-netz.de,2009-02-01:/blog/2009/02/erzeugen-von-x-509-zertifikaten.html<h1 id="grundlagen">Grundlagen</h1>
<p>Wenn man einen eigenen Web- oder Mailserver betreibt, möchte man ihn über kurz
oder lang auch über SSL ansprechen. Hier wird erklärt, wie man die dafür
benötigten Zertifikate selbst erzeugt.</p>
<p>In dieser Anleitung verwende ich OpenSSL zum Erzeugen der Zertifikate. Die
Pfadangaben sind die Standardpfade unter Debian.</p>
<p>Um die …</p><h1 id="grundlagen">Grundlagen</h1>
<p>Wenn man einen eigenen Web- oder Mailserver betreibt, möchte man ihn über kurz
oder lang auch über SSL ansprechen. Hier wird erklärt, wie man die dafür
benötigten Zertifikate selbst erzeugt.</p>
<p>In dieser Anleitung verwende ich OpenSSL zum Erzeugen der Zertifikate. Die
Pfadangaben sind die Standardpfade unter Debian.</p>
<p>Um die Zertifikate auszustellen, sind die folgenden vier Schritte notwendig:</p>
<ul>
<li>Ausstellen des Root-Zertifikats: Hier wird die Kombination aus öffentlichem
und privatem Schlüssel angelegt.</li>
<li>Signieren des Root-Zertifikats: Das root-Zertifikat wird durch sich sebst -
also mit dem enthaltenen privaten Schlüssel - unterschrieben.</li>
<li>Ausstellen der Anwendungs- bzw. Server-Zertifikate: Es werden die
Schlüsselpaare erzeugt, die später zur Authentifizierung, Signatur oder für
die SSL-Kommunikation verwendet werden.</li>
<li>Signieren der Anwendungszertifikate: Die Anwendungszertifikate werden mit
dem root-Zertifikat unterschrieben, um sie als valide zu kennzeichnen.</li>
</ul>
<h1 id="schlusselpaar-fur-das-root-zertifikat-erzeugen">Schlüsselpaar für das Root-Zertifikat erzeugen</h1>
<p>Zunächst benötigen wir ein Schlüsselpaar, also einen privaten und einen dazu
passenden öffentlichen Schlüssel.</p>
<div class="highlight"><pre><span></span><code>openssl genrsa -des3 -out /etc/ssl/private/myrootca.key <span class="m">2048</span>
</code></pre></div>
<p>Bei der Erzeugung sollte auf jeden fall ein starkes, d.h. schwer zu erratendes
Passwort gewählt werden. Denn sollte jemand das root-Zertifikat "knacken", dann
kann derjenige beliebige gültige Anwendungs-Zertifikate damit signieren und
evtl. erheblichen Schaden anrichten.</p>
<p>Mit dem Passwort wird der private Schlüssel geschützt, so dass ihn nicht jeder
verwenden kann. Das Passwort ist aber nicht selbst der private Schlüssel. Man
kann auch ein leeres Passwort angeben, so dass der private Schlüssel nicht mehr
geschützt ist. Das sollte man aber nur für Experimente machen, für den
produktiven Einsatz sollte der private Schlüssel aber auf jeden Fall durch ein
Passwort geschützt sein.</p>
<h1 id="signieren-des-root-zertifikats">Signieren des Root-Zertifikats</h1>
<p>Mit einem Schlüsselpaar allein kann man noch nichts angangen. Um aus einem
Schlüsselpaar ein Zertifikat zu machen, muss es von einer vertrauenswürdigen
Stelle signiert werden, die damit bestätigt, dass die an dem Zertifikat
hängenden Informationen, also im Allgemeinen der Name des Besitzers bzw. des
Servers tatsächlich demjenigen gehört, für den das Zerifikat ausgestellt wurde.</p>
<p>Bei einem root-Zertifikat gibt es natürlich keine noch weiter übergeordnete
Stelle, die diese Signatur erzeugen kann. Also wird das root-Zertifikat mit dem
eigenen privaten Schlüssel signiert.</p>
<p>Das Schlüsselpaar alleine zu signieren, genügt aber nicht, da niemand
nachvollziehen könnte, wem die Schlüssel gehören, bzw. wessen Identität sie
beweisen sollen. Dazu werden noch ein paar Informationen benötigt, die in einem
Certificate Request abgelegt werden. Bei dessen Ausstellung wird unter anderem
der Common Name abgefragt, der für den späteren Einsatzzweck besonders wichtig
ist, da er bei einem Server-Zertifikat den Namen des Servers enthalten muss oder
für ein E-Mail-Zertifikat die E-Mail-Adresse.</p>
<div class="highlight"><pre><span></span><code>openssl req -new -key /etc/ssl/private/myrootca.key -out myrootca.req
</code></pre></div>
<p>Nun enthält das Request die Schlüssel- und die Identitätsinformationen und kann
unterschrieben werden:</p>
<div class="highlight"><pre><span></span><code>openssl x509 -req -days <span class="m">7305</span> -sha1 -extensions v3_ca <span class="se">\</span>
-signkey myrootca.key <span class="se">\</span>
-in myrootca.req <span class="se">\</span>
-out /etc/ssl/certs/myrootca.crt
</code></pre></div>
<p>In der Datei <code>myrootca.crt</code> liegt nun das Root-Zertifikat mit dem öffentlichen
Schlüssel. Dieses Zertifikat kann und darf veröffentlicht werden. im Gegensatz
dazu muss das Schlüsselpaar in der Dateimyrootca.keyan einem sicheren Ort
bleiben und darf nicht veröffentlicht werden.</p>
<h1 id="erzeugen-des-schlusselpaars-fur-das-anwendungszertifikat">Erzeugen des Schlüsselpaars für das Anwendungszertifikat</h1>
<p>Nun kann nach dem gleichen Verfahren wie für das root-Zertifikat ein
Schlüsselpaar für das Anwendungszertifikat erstellt werden:</p>
<div class="highlight"><pre><span></span><code>openssl genrsa -out /etc/ssl/private/myhost.key <span class="m">2048</span>
</code></pre></div>
<h1 id="signieren-des-anwendungszertifikats">Signieren des Anwendungszertifikats</h1>
<p>Und auch der Ablauf zum Ausstellen des Zertifikats ist der selbe wie beim
root-Zertifikat, mit dem kleinen aber ganz wesentlichen Unterschied, dass das
Anwendungszertifikat natürlich nicht mit dem eigenen Schlüssel, sondern mit dem
des root-Zertifikats unterschrieben wird. Doch zunächst brauchen wir auch hier
ein Cerificate Request:</p>
<div class="highlight"><pre><span></span><code>openssl req -new -key myhost.key -out myhost.req
</code></pre></div>
<p>Nun kommt der wichtigste Schritt, die Signatur:</p>
<div class="highlight"><pre><span></span><code>openssl x509 -req -days <span class="m">3650</span> -sha1 -extensions v3_req <span class="se">\</span>
-CA /etc/ssl/certs/myrootca.crt <span class="se">\</span>
-CAkey /etc/ssl/private/myrootca.key <span class="se">\</span>
-CAserial /etc/ssl/myrootca.srl <span class="se">\</span>
-CAcreateserial <span class="se">\</span>
-in myhost.req <span class="se">\</span>
-out /etc/ssl/certs/myhost.crt
</code></pre></div>
<p>Damit ist das Anwendungszertifikat in der Datei <code>myhost.crt</code> fertig und kann
verwendet werden.</p>Bau eines Go-Spielfeldes2009-01-25T02:00:00+08:002009-01-25T02:00:00+08:00andreastag:www.a-netz.de,2009-01-25:/blog/2009/01/bau-eines-go-spielfeldes.html<h1 id="grundlagen">Grundlagen</h1>
<p>An dieser Stelle möchte ich von meinen Erfahrungen beim Bau eines Spielfelds für
das Spiel Go berichten.Bei Go handelt es sich um ein altes asiatisches
Brettspiel mit relativ leicht zu erlernenden Regeln, aber einer hohen
Komplexität - zu vergleichen mit Schach. Genauere Informationen zum Spiel,
Tutorials, etc. findet man …</p><h1 id="grundlagen">Grundlagen</h1>
<p>An dieser Stelle möchte ich von meinen Erfahrungen beim Bau eines Spielfelds für
das Spiel Go berichten.Bei Go handelt es sich um ein altes asiatisches
Brettspiel mit relativ leicht zu erlernenden Regeln, aber einer hohen
Komplexität - zu vergleichen mit Schach. Genauere Informationen zum Spiel,
Tutorials, etc. findet man zum Beispiel auf den Seiten
des <a href="http://www.dgob.de">Deutschen Go Bundes</a> oder bei <a href="http://www.wikipedia.de/wiki/Go_%28Brettspiel%29">Wikipedia Go</a>. Der Wikipedia-Artikel
zu Go ist sehr zu empfehlen.</p>
<figure>
<a href="https://www.a-netz.de/blog/2009/01/images/goboard_board.jpg">
<img src="https://www.a-netz.de/blog/2009/01/images/goboard_board.jpg"
title="Einfache Go-Spielbretter"
alt="Einfache Go-Spielbretter">
</a>
<figcaption>Einfache Go-Spielbretter</figcaption>
</figure>
<p>Ein einfaches Go-Brett besteht nur aus einer Holzplatte mit einem darauf
gezeichneten Linienraster. Ein großes Go-Spielfeld besitzt 19 × 19 Linien, für
Anfänger sind aber eher kleinere Bretter, zunächst mit 9 × 9, später dann mit 13
× 13 Linien besser geeignet.</p>
<p>Fortgeschrittene und der japanischen Tradition verpflichtete Spieler haben sehr
hohe Anforderungen an ein gutes Go-Brett. Es muss aus einem bestimmten Holz
bestehen, eine genau festgelegte Größe und Höhe haben und die Linien müssen
exakt die richtigen Abstände einhalten. Wer jedoch nur gelegentlich spielen
möchte bzw. noch Anfänger ist und zunächst ein kleines Brett zum Üben benötigt,
für den sollte auch die im Folgenden beschriebene einfachere Konstruktion
genügen.</p>
<h1 id="planung">Planung</h1>
<p>Als Material für das Brett habe ich eine Mitteldichte Faserplatte (MDF)
entsprechender Größe verwendet. MDF-Platten bekommt man in fast jedem Baumarkt,
wo man sie sich auch gleich auf die gewünschte Größe zurechtsägen lassen
kann. Ich habe eine Stärke von 16 mm gewählt, so dass das Brett solide wirkt und
beim Spielen nicht so leicht verrutscht.</p>
<p>Nun muss man die Größe des Feldes festlegen, die natürlich von der Anzahl der
Linien und deren Abstand abhängt. Bei der Suche im Internet habe ich auf
mehreren Seiten Angaben für den Abstand der Linien von ca. 22 mm in der einen
und 23,7 mm in der anderen Richtung gefunden, wie sie auch auf traditionellen
japanischen Brettern verwendet werden. Die Asymmetrie des Brettes soll dazu
dienen, die perspektivische Verzerrung auszugleichen, die auftritt, wenn sich
zwei Spieler gegenüber sitzen und schräg auf das Brett schauen. Deshalb wird das
Brett auch so angeordnet, dass die längere Seite von einem Spieler zum anderen
zeigt. Natürlich kann man auch andere, zu den Spielsteinen passende Abstände
wählen. Da die üblichen Spielsteine einen Durchmesser von etwas mehr als 20 mm
haben, passen die vorgeschlagenen Abstände ganz gut. Damit ergeben sich für die
Spielbretter folgende Größen:</p>
<div class="highlight"><pre><span></span><code>Anzahl Linien Länge Breite
--------------- ------- ---------
9 × 9 204mm 217,6mm
13 × 13 292mm 312,4mm
19 × 19 424mm 454,6mm
</code></pre></div>
<p>Zu den Linienabständen kommt an jeder Seite noch ein Rand; in der Tabelle oben
habe ich einen Rand von 14 mm verwendet.</p>
<h1 id="der-bau">Der Bau</h1>
<p>Die rohe Holzplatte habe ich nun zunächst mit Schleifpapier an den Kanten etwas
abgerundet und die Oberfläche glattgeschliffen. Nun kann die Platte das erste
Mal lackiert werden. Dazu habe ich einen wasserlöslichen Parkett-Lack verwendet,
der eine schön widerstandsfähige und etwas matte Oberfläche ergibt. Alle
Versuche, die Linien direkt auf das unbehandelte Holz zu zeichnen, führten bei
mir dazu, dass die Linien auseinanderliefen und unansehnlich wurden. Nach dem
Trocknen (am besten über Nacht trocknen lassen; wenn man nicht lange genug
wartet, bleibt der Lack klebrig und rubbelt sich beim schleifen ab) wird der
Lack glattgeschliffen, so dass die Linien aufgezeichnet werden können.</p>
<h1 id="aufzeichnen-der-linien">Aufzeichnen der Linien</h1>
<p>Nun können die Linien gezeichnet werden. Dazu misst man am besten zunächst die
genaue Position der Linien aus und markiert die Stellen mit Bleistift. Erst dann
zeichnet man die Linien durch. Dazu habe ich bei einem Brett einen dünnen
(ca. 0,6-0,8 mm breiten) Edding verwendet, bei einem anderen einen "Staedler
lumocolor permanent S", einen schwarzen Folienstift. Es ist darauf zu achten,
dass der Stift nicht wasserlöslich ist, da er sonst beim zweiten Lackieren
verschmiert. Am besten macht man zunächst einen Test auf einem kleinen
Abfallstück Holz.</p>
<figure>
<a href="https://www.a-netz.de/blog/2009/01/images/goboard_linien.jpg">
<img src="https://www.a-netz.de/blog/2009/01/images/goboard_linien.jpg"
title="Aufzeichnen der Linien"
alt="Aufzeichnen der Linien">
</a>
<figcaption>Aufzeichnen der Linien</figcaption>
</figure>
<p>Ich habe bisher nicht versucht, einen nicht-wasserlöslichen,
d.h. lösungsmittelhaltigen Lack zu verwenden, da ich annehme, dass das
Lösungsmittel im Lack auch die Linien anlösen und sie verschmieren wird. Deshalb
sollte das Brett auch erst dann ein weiteres Mal lackiert werden, wenn die
Linien ganz sicher getrocknet sind. Durch den zweiten Anstrich wird verhindert,
dass die Linien sich mit der Zeit abnutzen. Außerdem wird das Brett so
wasserfest, dass es sich bei Bedarf auch mal nass abwischen läßt.</p>
<p>Noch ein Hinweis zu den großen Brettern mit 19 × 19 Linien: Verwendet man eine
große Holzplatte, so ist das Brett später schlecht zu transportieren oder im
Schrank zu verstauen. Ich habe mein Brett deshalb aus zwei Hälften gebaut, die
man mit Holzdübeln zusammenstecken kann.</p>
<figure>
<a href="https://www.a-netz.de/blog/2009/01/images/goboard_duebel.jpg">
<img src="https://www.a-netz.de/blog/2009/01/images/goboard_duebel.jpg"
title="Dübelverbindung der beiden Spielbrett-Hälften"
alt="Dübelverbindung der beiden Spielbrett-Hälften">
</a>
<figcaption>Dübelverbindung der beiden Spielbrett-Hälften</figcaption>
</figure>
<p>Wie man sieht (liest), ist es nicht besonders kompliziert, ein ansehnliches
Go-Brett herzustellen. Eine Idee, wie man die Go-Steine herstellen könnte, habe
ich aber leider noch nicht. Sie lassen sich aber auch in gut-sortierten
Spielwarengeschäften erwerben oder bestellen, zum Beispiel beim
<a href="http://www.hebsacker-verlag.de">Hebsacker-Verlag</a>. (Nein, ich bekomme keine Provision für verkaufte Steine...)</p>
<p>Und nun viel Spaß beim Spielen!</p>Rezept Schoko-Koma-Plätzchen2008-11-08T01:00:00+08:002008-11-08T01:00:00+08:00andreastag:www.a-netz.de,2008-11-08:/blog/2008/11/rezept-schoko-koma-platzchen.html<h1 id="zutaten">Zutaten</h1>
<ul>
<li>200g Mandeln (Stifte)</li>
<li>100g Zartbitter-Schokolade</li>
<li>1 Tasse getrocknete Kirschen</li>
<li>100g Schokostreusel</li>
<li>2 Tassen Haferflocken</li>
<li>2 Tassen Mehl</li>
<li>1 Teelöffel Backpulver (gestr.)</li>
<li>1 Teelöffel Natriumkarbonat (Natron, gestr)</li>
<li>1/2 Teelöffel Salz</li>
<li>1/2 Pfund weiche Butter</li>
<li>1 Tasse brauner Zucker</li>
<li>2 Eier</li>
<li>1 Päckchen Vanillezucker</li>
</ul>
<h1 id="zubereitung">Zubereitung</h1>
<p>Den Backofen auf 180 …</p><h1 id="zutaten">Zutaten</h1>
<ul>
<li>200g Mandeln (Stifte)</li>
<li>100g Zartbitter-Schokolade</li>
<li>1 Tasse getrocknete Kirschen</li>
<li>100g Schokostreusel</li>
<li>2 Tassen Haferflocken</li>
<li>2 Tassen Mehl</li>
<li>1 Teelöffel Backpulver (gestr.)</li>
<li>1 Teelöffel Natriumkarbonat (Natron, gestr)</li>
<li>1/2 Teelöffel Salz</li>
<li>1/2 Pfund weiche Butter</li>
<li>1 Tasse brauner Zucker</li>
<li>2 Eier</li>
<li>1 Päckchen Vanillezucker</li>
</ul>
<h1 id="zubereitung">Zubereitung</h1>
<p>Den Backofen auf 180°C vorheizen. Zwei Kuchenbleche buttern. Die Mandeln in
einer beschichteten Pfanne bei mittlerer Hitze unter ständigem Rühren etwa 5 bis
10 Minuten anrösten, bis sie gerade anfangen, braun zu werden. Die Herdplatte
ausschalten.</p>
<p>Die Schokolade in kleine Stücke schneiden. Kirschen, Schokoladenstreusel und
Haferflocken in einer großen Schüssel vermischen.</p>
<p>Mehl, Backpulver, Natron und Salz durchsieben. In einer ausreichend großen
Schüssel die Butter schaumig schlagen, Zucker hinzufügen und alles noch etwa 4
Minuten rühren. Danach die Eier sowie die Vanille untermischen, bis eine schöne,
glatte Masse entstanden ist. Das durchgesiebte Mehl mit dem Backpulver, Salz und
Natron in den Teig einarbeiten. Zum Schluss die Mischung aus Kirschen,
Schokoladenstreuseln, Haferflocken und Mandeln sowie die Schokoladenstücke mit
einem Holzlöffel per Hand untermengen, bis alles gut im Teig verteilt ist.</p>
<p>Mit einem Esslöffel kleine Häufchen formen und auf das gebutterte Backbleck
setzen (im Abstand von ca. 5cm) 10 bis 12 Minuten backen, bis die Plätzchen
flacher und hellbraun geworden sind. 2 Minuten auf dem Bleck abkühlen lassen,
dann auf einem Gitter vollständig abkühlen lassen.</p>
<p>Es ergeben sich etwa 6 Dutzend Plätzchen.</p>Nokia 6230i Adressbuch-Abgleich2008-01-09T12:07:00+08:002008-01-09T12:07:00+08:00andreastag:www.a-netz.de,2008-01-09:/blog/2008/01/nokia-6230i-adressbuch-abgleich.html<h1 id="einrichten-von-gnokii">Einrichten von gnokii</h1>
<p>Wenn die Bluetooth-Verbindung funktioniert, kann man <code>gnokii</code> einrichten. Dazu
muss die Datei <code>/etc/gnokiirc</code> angepasst werden. Hier die wichtigen Punkte:</p>
<div class="highlight"><pre><span></span><code><span class="k">[global]</span>
<span class="na">port</span> <span class="o">=</span> <span class="s">{Die Bluetooth-Adresse des Handys}</span>
<span class="na">model</span> <span class="o">=</span> <span class="s">6510</span>
<span class="na">initlength</span> <span class="o">=</span> <span class="s">default</span>
<span class="na">connection</span> <span class="o">=</span> <span class="s">bluetooth</span>
</code></pre></div>
<p>Die weiteren Einstellungen können auf ihren default-Werten stehen bleiben.</p>
<p>Nun kann man mit <code>gnokii --identify …</code></p><h1 id="einrichten-von-gnokii">Einrichten von gnokii</h1>
<p>Wenn die Bluetooth-Verbindung funktioniert, kann man <code>gnokii</code> einrichten. Dazu
muss die Datei <code>/etc/gnokiirc</code> angepasst werden. Hier die wichtigen Punkte:</p>
<div class="highlight"><pre><span></span><code><span class="k">[global]</span>
<span class="na">port</span> <span class="o">=</span> <span class="s">{Die Bluetooth-Adresse des Handys}</span>
<span class="na">model</span> <span class="o">=</span> <span class="s">6510</span>
<span class="na">initlength</span> <span class="o">=</span> <span class="s">default</span>
<span class="na">connection</span> <span class="o">=</span> <span class="s">bluetooth</span>
</code></pre></div>
<p>Die weiteren Einstellungen können auf ihren default-Werten stehen bleiben.</p>
<p>Nun kann man mit <code>gnokii --identify</code> testen, ob gnokii sich mit dem Handy
versteht. Es sollte das Handy-Model und die IMEI des Handys angezeigt werden.</p>
<p>Zunächst habe ich versucht, für dieses Handy ein Plugin für multisync
bzw. multisynk zu finden, jedoch bisher ohne Erfolg. Daher habe ich bisher auch
noch keine Möglichkeit, die Kalender-Daten, Todo-Liste, etc. zu synchronisieren.</p>
<h1 id="problem-beim-koppeln">Problem beim Koppeln</h1>
<p>Manchmal gibt es Probleme beim Verbindungsaufbau. Das Handy fordert dazu auf,
ein Passwort einzugeben. Es kommt jedoch keine Verbindung zustande, egal was man
eingibt. Verantwortlich dafür ist oft die Konfiguration des hci-Dämons, der auf
dem PC nach der entsprechenden PIN fragen will, dies aber nicht richtig
kann. (Er will ein Fenster unter X aufmachen, hat dazu jedoch als Benutzer root
auf dem Desktop eines angemeldeten Benutzers keine Erlaubnis). Man kann dieses
Problem an Einträgen wie</p>
<div class="highlight"><pre><span></span><code>hcid[6618]: PIN helper exited abnormally with code 256
</code></pre></div>
<p>in der Datei <code>/var/log/syslog</code> erkennen.</p>
<p>Als Workaround kann man sich ein einfaches Skript schreiben, welches eine Pin
aus der Konfigurationsdatei <code>/etc/bluetooth/pin</code> ausliesst und dem hcid
übergibt. Das Skript sieht so aus:</p>
<div class="highlight"><pre><span></span><code><span class="ch">#!/bin/bash`</span>
<span class="nv">PIN</span><span class="o">=</span><span class="sb">`</span>cat /etc/bluetooth/pin<span class="sb">`</span>
<span class="nb">echo</span> PIN:<span class="nv">$PIN</span>
</code></pre></div>
<p>Es liegt bei mir in der Datei <code>/usr/local/bin/bluepin</code>. In der
Konfigurationsdatei des hcid muss man es dann nur noch in der entsprechenden
Zeile eintragen:</p>
<div class="highlight"><pre><span></span><code><span class="err">pin_helper /usr/local/bin/bluepin;</span>
</code></pre></div>
<p>Danach die bluez-utils mit <code>/etc/init.d/bluez-utils restart</code> neu starten und die
Kopplung sollte mit der in <code>/etc/bluetooth/pin</code> angegebenen Pin funktionieren.</p>
<h1 id="abgleich-mit-dem-kde-addressbook">Abgleich mit dem KDE Addressbook</h1>
<p>Es gibt eine einfache Möglichkeit, wenigstens die Adressen aus dem KDE
Addressbook in das Handy zu übernehmen. Im KDE Addressbook ist bereits eine
Schnittstelle zu gnokii implementiert. Im Menü File -> Export gibt es den Punkt
"Export to Mobile Phone". Dabei wird die Library <code>libgnokii</code> verwendet, um das
Adressbuch ins Handy zu laden.</p>
<p>Da ich nicht alle Einträge aus meinem Adressbuch aufs Handy übertragen möchte,
habe ich alle Adressen, die aufs Handy sollen, mit der Kategorie "Handy"
versehen. Beim Export der Adressen kann man dann auswählen, welche Kategorien
übertragen werden sollen.</p>
<p>Man sollte darauf achten, dass nicht aus Versehen Einträge im Handy, die dort
geändert wurden, mit veralteten Daten aus dem KDE Addressbook überschrieben
werden, da dieses die Einträge im Handy ohne Rückfrage überschreibt.</p>Nokia 6230i Internet-Verbindung2008-01-09T11:52:00+08:002008-01-09T11:52:00+08:00andreastag:www.a-netz.de,2008-01-09:/blog/2008/01/nokia-6230i-internet-verbindung.html<p>Im Notfall ist es durchaus praktisch, auch ohne einen DSL-Anschluss in
Reichweite mal eben ins Internet zu gehen. Hier eine Anleitung, wie man mit dem
Laptop über Bluetooth und das Handy eine Verbindung ins Internt aufbauen kann.</p>
<p>Im folgenden beschreibe ich die Konfiguration passend für O2 als Internet- und
Handy-Provider …</p><p>Im Notfall ist es durchaus praktisch, auch ohne einen DSL-Anschluss in
Reichweite mal eben ins Internet zu gehen. Hier eine Anleitung, wie man mit dem
Laptop über Bluetooth und das Handy eine Verbindung ins Internt aufbauen kann.</p>
<p>Im folgenden beschreibe ich die Konfiguration passend für O2 als Internet- und
Handy-Provider. Für andere Provider sollte die Konfiguration aber sehr ähnlich
sein.</p>
<h1 id="die-bluetooth-serielle-verbindung">Die Bluetooth- / serielle Verbindung</h1>
<p>Um mit dem Laptop übers Handy ins Internet zu kommen, benötigt man zwei
funktionierende Verbindungen. Die erste vom Laptop zum Handy - in diesem Fall
per Bluetooth - und die zweite vom Handy ins Internet.</p>
<p>Die erste Verbindung vom Laptop zum Handy geschieht über eine emulierte serielle
Verbindung. Damit lässt sich das Handy wie ein altes, analoges Modem über
AT-Befehle steuern. Wer noch nicht - oder besser: nicht mehr - mit Analogmodems
gearbeitet hat: AT-Befehle kann man über eine serielle Schittstelle an ein Modem
senden, um das Modem zu konfigurieren oder eine Verbindung zu wählen. Fast alle
Befehle fangen mit AT an, was angeblich für engl. Attention steht.</p>
<p>Voraussetzung für eine funktionierende Internet-Verbindung ist ein korrekt
konfigurierter Linux-Kernel. Er muss folgende Module enthalten:</p>
<ul>
<li>"ppp support" und "ppp support for async serial ports"</li>
<li>"Bluetooth Support" und darunter "rfcomm protocol support"</li>
</ul>
<p>Zum Aufbau der Bluetooth- / seriellen Verbindung verwendet man das Tool rfcomm:</p>
<div class="highlight"><pre><span></span><code>rfcomm <span class="nb">bind</span> <span class="m">0</span>
</code></pre></div>
<p>Damit wird eine Geräte-Datei namens <code>/dev/rfcomm0</code> angelegt, über die man mit
dem Handy kommunizieren kann. Die BD-Address bekommt man mit dem Aufruf von
<code>hcitool scan</code> heraus. Wer ein Terminal-Programm installiert hat, kann nun diese
Schnittstelle öffnen und ein <code>AT</code> an das Handy senden, welches daraufhin mit
<code>OK</code> antworten muss.</p>
<p>Über diese serielle Verbindung wird nun eine ppp-Verbindung ins Internet
aufgebaut. Diese konfiguriert man über zwei Dateien. Die Datei
<code>/etc/chatscripts/o2gprs</code> konfiguriert das Modem / Handy und baut die Verbindung
auf; die Datei <code>/etc/ppp/peers/o2gprs</code> konfiguriert den ppp-Dämon, der die
Netzwerkverbindung ins Internet aufbaut.</p>
<p><code>/etc/chatscripts/o2gprs</code>:</p>
<div class="highlight"><pre><span></span><code>TIMEOUT 5
ECHO ON
ABORT 'nBUSYr'
ABORT 'nERRORr'
ABORT 'nNO ANSWERr'
ABORT 'nNO CARRIERr'
ABORT 'nNO DIALTONEr'
ABORT 'nRINGINGrnrnRINGINGr'
'' rAT
TIMEOUT 12
OK ATE1
OK 'AT+CGDCONT=1,"IP","surfo2"'
OK ATD*99#
CONNECT ""
</code></pre></div>
<p>Um eine Internet-Verbindung per Handy aufzubauen, benötigt man keine richtige
Telefonnummer. Der ppp-Dämon "wählt" statt dessen <code>*99#</code>. Wichtig ist hingegen
der Ausdruck "surfo2", der den Access-Point kennzeichnet, zu dem sich das Handy
verbinden soll.</p>
<p><code>/etc/ppp/peers/o2gprs</code>:</p>
<div class="highlight"><pre><span></span><code>connect "/usr/sbin/chat -v -f /etc/chatscripts/o2gprs"
/dev/rfcomm0
115200
noipdefault
usepeerdns
defaultroute
persist
noauth
</code></pre></div>
<p>Nachdem die beiden Dateien angelegt sind, genügt ein Aufruf von</p>
<div class="highlight"><pre><span></span><code>pon o2grps
</code></pre></div>
<p>um eine Internet-Verbindung aufzubauen. Debug-Meldungen kann man sich anzeigen
lassen, indem man vorher auf einer anderen Konsole</p>
<div class="highlight"><pre><span></span><code>tail -f /var/log/syslog
</code></pre></div>
<p>aufruft. Zum Beenden der Verbindung genügt der Aufruf von</p>
<div class="highlight"><pre><span></span><code>poff o2grps
</code></pre></div>
<p>Das Nokia 6230i unterstützt leider nur GPRS. Damit lassen sich Geschwindigkeiten
erreichen, die etwa einem 56k-Modem entsprechen, also etwa 4-5kB pro
Sekunde. Das ist ganz deutlich langsamer als ein DSL-Anschluss. Surfen macht
damit also keinen Spaß, zum Abrufen von ein paar Emails genügt es jedoch. Neuere
Handys, die UMTS unterstützen, sollten hier deutlich schneller sein und mit der
selben Konfiguration arbeiten.</p>
<p>Außerdem ist der ganze Spaß leider auch noch immer recht teuer. Soweit ich
weiss, kostet eine Minute im Genion-Tarif 9ct. Im Voraus bezahlte Volumenpakete
sind eventuell günstiger.</p>Nokia 6230i Dateitransfer2008-01-09T11:43:00+08:002008-01-09T11:43:00+08:00andreastag:www.a-netz.de,2008-01-09:/blog/2008/01/nokia-6230i-dateitransfer.html<p>Um Dateien auf das Handy zu kopieren, kann man das Programm <code>obexftp</code>
verwenden. Um es über eine Bluetooth-Verbindung zu benutzen, ruft man es mit dem
Parameter <code>-b</code> auf:</p>
<div class="highlight"><pre><span></span><code>obexftp -b <span class="o">{</span>BD-Adresse des Handys<span class="o">}</span>
</code></pre></div>
<p>Hinter dieser Option können weitere angegeben werden: <code>-l</code> um den
Verzeichnisinhalt aufzulisten, <code>-c</code> um in ein Unterverzeichnis …</p><p>Um Dateien auf das Handy zu kopieren, kann man das Programm <code>obexftp</code>
verwenden. Um es über eine Bluetooth-Verbindung zu benutzen, ruft man es mit dem
Parameter <code>-b</code> auf:</p>
<div class="highlight"><pre><span></span><code>obexftp -b <span class="o">{</span>BD-Adresse des Handys<span class="o">}</span>
</code></pre></div>
<p>Hinter dieser Option können weitere angegeben werden: <code>-l</code> um den
Verzeichnisinhalt aufzulisten, <code>-c</code> um in ein Unterverzeichnis zu wechseln, <code>-p</code> um
eine Datei auf das Handy zu landen und <code>-g</code> um eine Datei vom Handy
herunterzuladen.</p>
<p>Um also zum Beispiel in das Verzeichnis <code>MMC</code> zu wechseln und dort die Datei
<code>test.mp3</code> abzulegen, würde man obexftp folgendermaßen aufrufen:</p>
<div class="highlight"><pre><span></span><code>obexftp -b <span class="o">{</span>BDADDR<span class="o">}</span> -c MMC -p test.mp3
</code></pre></div>
<p>Um die Datei wieder vom Handy herunterzukopieren, entsprechend</p>
<div class="highlight"><pre><span></span><code>obexftp -b <span class="o">{</span>BDADDR<span class="o">}</span> -c MMC -g test.mp3
</code></pre></div>
<p>und um sie zu löschen</p>
<div class="highlight"><pre><span></span><code>obexftp -b <span class="o">{</span>BDADDR<span class="o">}</span> -c MMC -d test.mp3
</code></pre></div>
<p>Für weitere Informationen zu <code>obexftp</code> einfach in die man-page schauen (<code>man
obexftp</code>).</p>
<p>Wem die Kommandozeile nicht ganz geheuer ist, der kann auch die entsprechenden
KDE-Utilities verwenden. Unter Debian gibt es dafür das Paket
<code>kdebluetooth</code>. Dieses installiert unter anderem den KDE Bluetooth OBEX Client
(<code>kbtobexclient</code>) mit einer Benutzeroberfläche zur Dateiübertragung auf das
Handy.</p>Nokia 6230i Bluetooth Connection2008-01-09T11:39:00+08:002008-01-09T11:39:00+08:00andreastag:www.a-netz.de,2008-01-09:/blog/2008/01/nokia-6230i-bluetooth-connection.html<h1 id="programs-needed">Programs needed</h1>
<p>To establish a connection between the mobile phone and my computer I have used
bluetooth. Therefore you need to have a kernel with the BlueZ bluetooth protocol
stack enabled and a few utilities installed:</p>
<ul>
<li><code>bluez-utils</code>: commandline programs to use bluetooth under linux.</li>
<li><code>bluez-pin</code>: This program asks for a …</li></ul><h1 id="programs-needed">Programs needed</h1>
<p>To establish a connection between the mobile phone and my computer I have used
bluetooth. Therefore you need to have a kernel with the BlueZ bluetooth protocol
stack enabled and a few utilities installed:</p>
<ul>
<li><code>bluez-utils</code>: commandline programs to use bluetooth under linux.</li>
<li><code>bluez-pin</code>: This program asks for a pin when connecting a bluetooth device.</li>
<li><code>obexftp</code> and <code>obexserver</code>: programs for copying files from and to the mobile
phone.</li>
<li><code>gnokii</code> and <code>libgnokii</code>: This program can access and change the addressbook
and other data on the mobile phone.</li>
</ul>
<h1 id="testing-the-connection">Testing the connection</h1>
<p>The first step is to check with hciconfig if the linux kernel can access the
bluetooth hardware. hciconfig should output something like this:</p>
<div class="highlight"><pre><span></span><code>hci0: Type: USB
BD Address: 00:AA:BB:CC:DE:AB ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:71711 acl:1680 sco:0 events:1473 errors:0
TX bytes:42883 acl:1299 sco:0 commands:96 errors:0
</code></pre></div>
<p>Now you can invoke <code>hcitool scan</code> to scan for bluetooth devices. This programm
lists the devices near the pc and their BD address. You should write down the
mobile phone BD address, because you will need it a few times.</p>
<p>If the phone is not listed, you should check if bluetooth in the phone is
enabled. Or perhaps there is a problem with your bluetooth hardware under linux.</p>Nokia 6230i Bluetooth-Verbindung2008-01-09T11:32:00+08:002008-01-09T11:32:00+08:00andreastag:www.a-netz.de,2008-01-09:/blog/2008/01/nokia-6230i-bluetooth-verbindung.html<h1 id="benotigte-programme">Benötigte Programme</h1>
<p>Um eine Verbindung zwischen Rechner und Handy aufzubauen, habe ich Bluetooth
verwendet. Auf dem PC benötigt man dazu einen Kernel, in dem der BlueZ Bluetooth
Stack aktiviert ist. Daneben werden noch einige Programm-Pakete benötigt:</p>
<ul>
<li><code>bluez-utils</code>: Kommandozeilen-Programme, um Bluetooth unter Linux zu
verwenden.</li>
<li><code>bluez-pin</code>: Programm, welches eine PIN abfragt …</li></ul><h1 id="benotigte-programme">Benötigte Programme</h1>
<p>Um eine Verbindung zwischen Rechner und Handy aufzubauen, habe ich Bluetooth
verwendet. Auf dem PC benötigt man dazu einen Kernel, in dem der BlueZ Bluetooth
Stack aktiviert ist. Daneben werden noch einige Programm-Pakete benötigt:</p>
<ul>
<li><code>bluez-utils</code>: Kommandozeilen-Programme, um Bluetooth unter Linux zu
verwenden.</li>
<li><code>bluez-pin</code>: Programm, welches eine PIN abfragt, wenn man ein
Bluetooth-Gerät koppelt.</li>
<li><code>obexftp</code> und <code>obexserver</code>: Programme, um Dateien auf das Handy bzw. zurück
auf den Rechner zu kopieren.</li>
<li><code>gnokii</code> und <code>libgnokii</code>: Dieses Programm kann auf das Adressbuch und die
weiteren Daten im Handy zugreifen und sie verändern.</li>
</ul>
<h1 id="test-der-verbindung">Test der Verbindung</h1>
<p>Als erstes kann mit <code>hciconfig</code> geprüft werden, ob die Bluetooth-Hardware des
Rechners korrekt erkannt wurde. Die Bluetooth-Adapter werden analog zu den
Netzwerkkarten unter Linux benannt (<code>hciX</code> anstelle <code>ethX</code>) und verwaltet
(<code>hciconfig</code> anstelle <code>ifconfig</code>). <code>hciconfig</code> sollte so etwas ähnliches wie</p>
<div class="highlight"><pre><span></span><code>hci0: Type: USB
BD Address: 00:AA:BB:CC:DE:AB ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:71711 acl:1680 sco:0 events:1473 errors:0
TX bytes:42883 acl:1299 sco:0 commands:96 errors:0
</code></pre></div>
<p>ausgeben.</p>
<p>Nun kann man mit dem Aufruf <code>hcitool scan</code> die in Reichweite des Rechners
befindlichen Bluetooth-Geräte jeweils mit ihrer BD-Adresse auflisten. Da man die
BD-Adresse des Handys noch öfters benötigt, sollte man sie sich aufschreiben.</p>
<p>Wird das Handy hier nicht mit aufgelistet, ist entweder Bluetooth im Handy
deaktiviert, oder die Bluetooth-Hardware des Rechners spielt nicht richtig mit
dem Kernel zusammen.</p>Nokia 6230i Java-Anwendungen installieren2008-01-09T09:23:00+08:002008-01-09T09:23:00+08:00andreastag:www.a-netz.de,2008-01-09:/blog/2008/01/nokia-6230i-java-anwendungen-installieren.html<p>Auch unter Linux ist es einfach möglich, eine Java-Anwendung auf das Handy zu
übertragen. Dazu genügt es aber nicht, die Dateien, aus denen die Anwendung
besteht (üblicherweise eine jad-Datei, die die Anwendung beschreibt und eine
jar-Datei mit dem eigentlichen Programmcode) einfach auf das Handy zu
kopieren. Statt dessen muss die …</p><p>Auch unter Linux ist es einfach möglich, eine Java-Anwendung auf das Handy zu
übertragen. Dazu genügt es aber nicht, die Dateien, aus denen die Anwendung
besteht (üblicherweise eine jad-Datei, die die Anwendung beschreibt und eine
jar-Datei mit dem eigentlichen Programmcode) einfach auf das Handy zu
kopieren. Statt dessen muss die Anwendung korrekt installiert werden.</p>
<p>Dies geht recht einfach mit dem Programm <code>gammu</code>. Zunächst richtet man eine
Konfigurationsdatei <code>~/.gammurc</code> ein. Diese sieht bei mir folgendermaßen aus:</p>
<div class="highlight"><pre><span></span><code><span class="k">[gammu]</span>
<span class="na">Model</span><span class="o">=</span><span class="s">6310i</span>
<span class="na">Device</span><span class="o">=</span>
<span class="na">Connection</span><span class="o">=</span><span class="s">bluephonet</span>
<span class="na">SyncTime</span><span class="o">=</span><span class="s">no</span>
<span class="na">LockDevice</span><span class="o">=</span><span class="s">yes</span>
<span class="na">StartInfo</span><span class="o">=</span><span class="s">no</span>
</code></pre></div>
<p>Nun kann man mit dem Aufruf <code>gammu --identify</code> testen, ob gammu eine Verbindung
zum Handy aufbauen kann. Ist dies erfolgreich, so kann man mit dem Aufruf</p>
<div class="highlight"><pre><span></span><code>gammu --nokiaaddfile Application
</code></pre></div>
<p>eine Anwendung übertragen. Der Name der Anwendung ist dabei der Name der jad-
und jar-Datei ohne die Datei-Endung. Ersetzt man in dem Aufruf "Application"
durch "Game", so wird die Anwendung nicht in den Anwendungs-, sondern in den
Spiele-Ordner installiert.</p>
<h1 id="update-04012008">Update (04.01.2008)</h1>
<p>Bernd Wurst beschreibt auf seiner Website unter <a href="http://www.bwurst.org/archives/151-Kurztipp-Schnellere-Bluetooth-Verbindung-mit-gammu.html">Kurztipp: Schnellere
Bluetooth-Verbindung mit gammu</a> geringfügig andere Einstellungen für die
gammu-Konfigurationsdatei, die den Zugriff auf das Handy beschleunigen.</p>Nokia 6230i Address book synchronization2008-01-09T00:00:00+08:002008-01-09T00:00:00+08:00andreastag:www.a-netz.de,2008-01-09:/blog/2008/01/nokia-6230i-address-book-synchronization.html<h1 id="configuration-of-gnokii">Configuration of gnokii</h1>
<p>If the bluetooth connection works, you can go on to configure <code>gnokii</code>. You need
to edit the file <code>/etc/gnokiirc</code>. These are the important lines:</p>
<div class="highlight"><pre><span></span><code><span class="k">[global]</span>
<span class="na">port</span> <span class="o">=</span> <span class="s">{BD address of the phone}</span>
<span class="na">model</span> <span class="o">=</span> <span class="s">6510</span>
<span class="na">initlength</span> <span class="o">=</span> <span class="s">default</span>
<span class="na">connection</span> <span class="o">=</span> <span class="s">bluetooth</span>
</code></pre></div>
<p>The other entries in this file can be left …</p><h1 id="configuration-of-gnokii">Configuration of gnokii</h1>
<p>If the bluetooth connection works, you can go on to configure <code>gnokii</code>. You need
to edit the file <code>/etc/gnokiirc</code>. These are the important lines:</p>
<div class="highlight"><pre><span></span><code><span class="k">[global]</span>
<span class="na">port</span> <span class="o">=</span> <span class="s">{BD address of the phone}</span>
<span class="na">model</span> <span class="o">=</span> <span class="s">6510</span>
<span class="na">initlength</span> <span class="o">=</span> <span class="s">default</span>
<span class="na">connection</span> <span class="o">=</span> <span class="s">bluetooth</span>
</code></pre></div>
<p>The other entries in this file can be left on their default values.</p>
<p>Now you can use <code>gnokii --identify</code> to check if gnokii can connect to the
phone. It should display the phone model and its IMEI.</p>
<p>I have searched for plugins for multisync or multisynk but have not found
anything, so until now I have found no way to synchronize the calender data,
todo list, etc.</p>
<h1 id="problems-when-connecting-to-the-phone">Problems when connecting to the phone</h1>
<p>Sometimes there is a problem connecting the phone and the PC. The phone asks for
a password, but you can enter what you want, the phone does not get the
connection. This is caused by the configuration of the hci daemon, that wants to
ask for the PIN on the pc, but is not permitted to do that (it tries to display
a window on the user desktop but has no right to do that as root). This problem
shows up with entries like</p>
<div class="highlight"><pre><span></span><code><span class="err">hcid[6618]: PIN helper exited abnormally with code 256</span>
</code></pre></div>
<p>in the file <code>/var/log/syslog</code>.</p>
<p>The workaround is to write a simple shell script that provides a pin to the hci
daemon. It reads the pin simply from the file <code>/etc/bluetooth/pin</code> and passes it
to hcid :</p>
<div class="highlight"><pre><span></span><code><span class="ch">#!/bin/bash</span>
<span class="nv">PIN</span><span class="o">=</span><span class="sb">`</span>cat /etc/bluetooth/pin<span class="se">\`</span>
<span class="nb">echo</span> PIN:<span class="nv">$PIN</span>
</code></pre></div>
<p>The script should be saved as <code>/usr/local/bin/bluepin</code>. Then you need to change
the configuration file <code>/etc/bluetooth/hcid.conf</code> to tell it to use this script:</p>
<div class="highlight"><pre><span></span><code>pin_helper /usr/local/bin/bluepin;
</code></pre></div>
<p>Then, after restarting the bluez utils with <code>/etc/init.d/bluez-utils restart</code> the
connection should work with the pin entered in <code>/etc/bluetooth/pin</code>.</p>
<h1 id="synchronizing-the-kde-addressbook">Synchronizing the KDE Addressbook</h1>
<p>There is an easy way to transfer the contents of the KDE Addressbook to the
mobile phone. In the KDE Addressbook there is implemented an interface to
gnokii. Click on the menu point File -> Export. There is the entry "Export to
Mobile Phone". It uses the library <code>libgnokii</code> to transfer the address data to the
phone.</p>
<p>If you do not want to transfer all entries to the phone, you can mark some
entries with a category and export only these entries to the phone.</p>
<p>Be sure not to overwrite important data in your phone. The addressbook
application does not check if an entry in your phone has changed and will
overwrite it with the data from the KDE Addressbook.</p>Nokia 6230i File Transfer2008-01-09T00:00:00+08:002008-01-09T00:00:00+08:00andreastag:www.a-netz.de,2008-01-09:/blog/2008/01/nokia-6230i-file-transfer.html<p>To copy files from and to your phone, you can use the program <code>obexftp</code>. To use
a bluetooth connection, invoke the program like this:</p>
<div class="highlight"><pre><span></span><code>obexftp -b <span class="o">{</span>BD address of the phone<span class="o">}</span>
</code></pre></div>
<p>Then you can append more options like <code>-l</code> to list the contents of a folder on
the phone, <code>-c …</code></p><p>To copy files from and to your phone, you can use the program <code>obexftp</code>. To use
a bluetooth connection, invoke the program like this:</p>
<div class="highlight"><pre><span></span><code>obexftp -b <span class="o">{</span>BD address of the phone<span class="o">}</span>
</code></pre></div>
<p>Then you can append more options like <code>-l</code> to list the contents of a folder on
the phone, <code>-c</code> to change to a folder, <code>-p</code> to put a file into a folder or <code>-g</code>
to fetch a file from a folder on the phone.</p>
<p>Here are a few examples: To change to the directory MMC and put the file
<code>test.mp3</code> there you would invoke obexftp with</p>
<div class="highlight"><pre><span></span><code>obexftp -b <span class="o">{</span>BDADDR<span class="o">}</span> -c MMC -p test.mp3
</code></pre></div>
<p>To copy the file back from the phone to the PC, accordingly</p>
<div class="highlight"><pre><span></span><code>obexftp -b <span class="o">{</span>BDADDR<span class="o">}</span> -c MMC -g test.mp3
</code></pre></div>
<p>and to delete it use</p>
<div class="highlight"><pre><span></span><code><span class="err">obexftp -b {BDADDR} -c MMC -d test.mp3</span>
</code></pre></div>
<p>For more information on obexftp use its manual page (<code>man obexftp</code>).</p>
<p>If you do not like the command line interface, you can use the KDE Bluetooth
Utilities. In debian there is the package <code>kdebluetooth</code>. This package installs
the KDE Bluetooth OBEX Client (<code>kbtobexclient</code>) with a graphical user interface
to manage files on your mobile phone.</p>Nokia 6230i Install Java Applications2008-01-09T00:00:00+08:002008-01-09T00:00:00+08:00andreastag:www.a-netz.de,2008-01-09:/blog/2008/01/nokia-6230i-install-java-applications.html<p>Installing java applications on your Nokia 6230i is not really difficult. But it
is not as easy as copying the application files (usually a jar- and a jad-file)
to the phone. You need to install them correctly to be able to use the
application .</p>
<p>A convenient way is to use …</p><p>Installing java applications on your Nokia 6230i is not really difficult. But it
is not as easy as copying the application files (usually a jar- and a jad-file)
to the phone. You need to install them correctly to be able to use the
application .</p>
<p>A convenient way is to use the programm <code>gammu</code>. First you need to set up a
configuration file to let gammu communicate with your phone over bluetooth. This
file should look similar to the following:</p>
<div class="highlight"><pre><span></span><code><span class="k">[gammu]</span>
<span class="na">Model</span><span class="o">=</span><span class="s">6310i</span>
<span class="na">Device</span><span class="o">=</span>
<span class="na">Connection</span><span class="o">=</span><span class="s">bluephonet</span>
<span class="na">SyncTime</span><span class="o">=</span><span class="s">no</span>
<span class="na">LockDevice</span><span class="o">=</span><span class="s">yes</span>
<span class="na">StartInfo</span><span class="o">=</span><span class="s">no</span>
</code></pre></div>
<p>Now you can try to connect to your phone by calling <code>gammu --identify</code>. If this
is successful, you can proceed by instructing gammu to install an application:</p>
<div class="highlight"><pre><span></span><code>gammu --nokiaaddfile Application
</code></pre></div>
<p>The name of the application is the name of the jar- or jad-file without its
extension. If you replace the term "Application" with "Game", you can install
the application to the games-folder instead of the default application folder.</p>
<h1 id="update-04012008">Update (04.01.2008)</h1>
<p>Bernd Wurst describes on his website under <a href="http://www.bwurst.org/archives/151-Kurztipp-Schnellere-Bluetooth-Verbindung-mit-gammu.html">Kurztipp: Schnellere
Bluetooth-Verbindung mit gammu</a> how to change the gammu configuration file to
speed up time gammu needs to connect to your phone.</p>Nokia 6230i Pin-Belegung des POP Port2008-01-09T00:00:00+08:002008-01-09T00:00:00+08:00andreastag:www.a-netz.de,2008-01-09:/blog/2008/01/nokia-6230i-pin-belegung-des-pop-port.html<p>Dies hier ist die Steckerbelegung des sog. POP-Ports an der Unterseite des
Handys. Pin 1 ist der mit etwas Abstand zu den anderen Pins angeordnete Kontakt.</p>
<div class="highlight"><pre><span></span><code>Pin Name Funktion
----- ------------ ----------------------------------------------------------------------------
1 Vin 5V-Eingang
2 Gnd Masse
3 ACI Auto-Connect-Ignition (Automatische-Erkennung für angeschlossene Geräte)
4 V Out +5V-Ausgang (Versorgungsspannung für externes Zubehör …</code></pre></div><p>Dies hier ist die Steckerbelegung des sog. POP-Ports an der Unterseite des
Handys. Pin 1 ist der mit etwas Abstand zu den anderen Pins angeordnete Kontakt.</p>
<div class="highlight"><pre><span></span><code>Pin Name Funktion
----- ------------ ----------------------------------------------------------------------------
1 Vin 5V-Eingang
2 Gnd Masse
3 ACI Auto-Connect-Ignition (Automatische-Erkennung für angeschlossene Geräte)
4 V Out +5V-Ausgang (Versorgungsspannung für externes Zubehör)
5 USB PwrDet USB Power Detection (nur bei USB Anschluß, sonst nicht belegt)
6 F-Bus Rx Serieller Datenbus (empfangen)
7 F-Bus Tx Serieller Datenbus (senden)
8 Gnd Masse
9 X Mic N Audio-Eingang (- negativ)
10 X Mic P Audio-Eingang (+ positiv)
11 HS Ear L N (Headset) Audio-Eingang links (- negativ)
12 HS Ear L P (Headset) Audio-Eingang links (+ positiv)
13 HS Ear R N (Headset) Audio-Eingang rechts (- negativ)
14 HS Ear R P (Headset) Audio-Eingang rechts (+ positiv)
</code></pre></div>Nokia 6230i POP port pin assignment2008-01-09T00:00:00+08:002008-01-09T00:00:00+08:00andreastag:www.a-netz.de,2008-01-09:/blog/2008/01/nokia-6230i-pop-port-pin-assignment.html<p>This is the pin assignment of the so called POP port of the Nokia 6230i
mobile. Pin 1 is the one with a small distance to the other pins.</p>
<div class="highlight"><pre><span></span><code>Pin Name Function
----- ------------ --------------------------------------------------------------------------
1 Vin 5V Input
2 Gnd Ground
3 ACI Auto-Connect-Ignition (automatic recognition of connected accessories)
4 V Out …</code></pre></div><p>This is the pin assignment of the so called POP port of the Nokia 6230i
mobile. Pin 1 is the one with a small distance to the other pins.</p>
<div class="highlight"><pre><span></span><code>Pin Name Function
----- ------------ --------------------------------------------------------------------------
1 Vin 5V Input
2 Gnd Ground
3 ACI Auto-Connect-Ignition (automatic recognition of connected accessories)
4 V Out +5V Output (accessories supply voltage)
5 USB PwrDet USB Power Detection (only used for USB connection)
6 F-Bus Rx Serial data bus (receive)
7 F-Bus Tx Serial data bus (transmit)
8 Gnd Ground
9 X Mic N audio input -
10 X Mic P audio input +
11 HS Ear L N (Headset) left audio output -
12 HS Ear L P (Headset) left audio output +
13 HS Ear R N (Headset) right audio output -
14 HS Ear R P (Headset) right audio output +
</code></pre></div>Hints on AVR Programming2008-01-05T01:00:00+08:002008-01-05T01:00:00+08:00andreastag:www.a-netz.de,2008-01-05:/blog/2008/01/hints-on-avr-programming.html<p>On this page I have collected some hints for programming of AVR
microcontrollers.</p>
<h1 id="io-pins">I/O-Pins</h1>
<p>To control the behaviour of each I/O-Pin there are three registers.</p>
<ul>
<li><code>PORTx</code>: State of the pin, low (0) or high (1) / without (0) or with (1)
pull-up resistor</li>
<li><code>DDRx</code> (Data Direction Register): This determines …</li></ul><p>On this page I have collected some hints for programming of AVR
microcontrollers.</p>
<h1 id="io-pins">I/O-Pins</h1>
<p>To control the behaviour of each I/O-Pin there are three registers.</p>
<ul>
<li><code>PORTx</code>: State of the pin, low (0) or high (1) / without (0) or with (1)
pull-up resistor</li>
<li><code>DDRx</code> (Data Direction Register): This determines if the pin is in
high-impedance, so that you can measure the applied voltage level, or
low-impedance (1), so that the pin is able to source or sink current.</li>
<li><code>PINx</code>: Reading this register returns the currently applied voltage level to
this port pin (high or low level).</li>
</ul>
<p>So you can assign one of four different modes to any i/o-pin by combination of
the PORTx and DDRx register:</p>
<ul>
<li>(<code>PORTx=1</code>, <code>DDRx=1</code>): High level: The controller tries to pull the pin to
high level.</li>
<li>(<code>PORTx=0</code>, <code>DDRx=1</code>): Low: The controller pulls the pin to ground.</li>
<li>(<code>PORTx=0</code>, <code>DDRx=0</code>): High Impedance, High-Z: The pin does not source or
sink current but you can read back the applied voltage level from the PINx
register.</li>
<li>(<code>PORTx=1</code>, <code>DDRx=0</code>): Pull-up: The controller connects the pin over a
resistor of appx. 60kOhm to VCC. So it is possible to pull down the pin by
connecting it to GND. This is an easy way to connect a switch or push button
to the controller.</li>
</ul>
<h1 id="generation-of-a-modulated-signal-eg-rc5">Generation of a modulated signal (e.g. RC5)</h1>
<p>To generate a modulated signal, e.g. to generate a infrared signal for a remote
control, it is convenient to use the waveform generation mode (WGM) available in
most of the recent AVR controllers. This is a part of the timer counter
peripheral that lets you generate a RC5 signal with nearly no cpu load.</p>
<ul>
<li>Set up the timer, so that it generates an output compare match with a
constant frequency.</li>
<li>Adjust the output compare mode, so that it toggles one of the output compare
pins (OCx) on every output compare match.</li>
<li>Now you only need to switch the WGM on or off at the right time to generate
a modulated signal on the OCx pin.</li>
</ul>
<p>Example code for a AT Tiny 2313:</p>
<div class="highlight"><pre><span></span><code><span class="c1">// setup waveform generation to 36kHz on timer 0</span>
<span class="n">TCCR0A</span> <span class="o">|=</span> <span class="n">_BV</span><span class="p">(</span><span class="n">WGM01</span><span class="p">);</span>
<span class="c1">// clear timer on compare match</span>
<span class="n">TCCR0B</span> <span class="o">|=</span> <span class="n">_BV</span><span class="p">(</span><span class="n">CS00</span><span class="p">);</span>
<span class="c1">// timer source is system clock OCR0A = 107;</span>
<span class="c1">// output compare value for 36kHz @ 8 MHz</span>
<span class="c1">// output compare pin to output mode, low level</span>
<span class="n">DDRB</span> <span class="o">|=</span> <span class="n">_BV</span><span class="p">(</span><span class="n">PB2</span><span class="p">);</span>
<span class="c1">// port PB2 as output</span>
<span class="n">PORTB</span> <span class="o">&=</span> <span class="o">~</span><span class="n">_BV</span><span class="p">(</span><span class="n">PB2</span><span class="p">);</span>
<span class="c1">// PB2 is low</span>
<span class="c1">// setup half-bit clock (555Hz) on timer 1</span>
<span class="n">TCCR1B</span> <span class="o">=</span> <span class="n">_BV</span><span class="p">(</span><span class="n">WGM12</span><span class="p">);</span>
<span class="c1">// Clear timer on compare match OCR1A = 7049;</span>
<span class="c1">// ~ 889us @ 8MHz</span>
<span class="n">TIMSK</span> <span class="o">|=</span> <span class="n">_BV</span><span class="p">(</span><span class="n">OCIE1A</span><span class="p">);</span>
<span class="c1">// output compare interrupt enable for timer 1a</span>
<span class="n">ISR</span><span class="p">(</span><span class="n">TIMER1_COMPA_vect</span><span class="p">)</span>
<span class="p">{</span>
<span class="k">if</span><span class="p">(...)</span>
<span class="p">{</span>
<span class="c1">// enable modulated signal</span>
<span class="n">TCCR0A</span> <span class="o">|=</span> <span class="n">_BV</span><span class="p">(</span><span class="n">COM0A0</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">else</span>
<span class="p">{</span>
<span class="c1">// disable modulated signal</span>
<span class="n">TCCR0A</span> <span class="o">&=</span> <span class="o">~</span><span class="n">_BV</span><span class="p">(</span><span class="n">COM0A0</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<h1 id="data-structures-in-flash-rom">Data structures in flash rom</h1>
<p>The GNU C compiler for AVR controllers does support the storage of data in the
flash rom of the controller. To store something in flash rom, you need to
include the <code>PROGMEM</code> keyword in the variable definition. This tells the
controller, to store the data in rom, but you cannot access the data as if it
has been stored like a normal variable in RAM. This is caused by the independent
data busses and address ranges for ram and rom accesses. It causes strange
behaviour of the code if you try to pass a variable stored in rom as a function
parameter. You will end up with random data from ram.</p>
<p>To be able to use the data from flash rom, you need to copy it to the ram before
using it. There is a function in the avrlibc that encasulates the LPM (load
program memory) assembler call. The following example is intended to copy a
whole data structure from the rom into a ram structure.</p>
<div class="highlight"><pre><span></span><code><span class="kt">uint8_t</span> <span class="nf">memdrv_read</span><span class="p">(</span><span class="kt">uint8_t</span> <span class="o">*</span><span class="n">buffer</span><span class="p">,</span> <span class="n">memaddr_t</span> <span class="n">address</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="n">numBytes</span><span class="p">)</span>
<span class="p">{</span>
<span class="kt">uint8_t</span> <span class="n">i</span><span class="p">;</span>
<span class="k">if</span><span class="p">((</span><span class="n">address</span> <span class="o">+</span> <span class="n">numBytes</span><span class="p">)</span> <span class="o">>=</span> <span class="n">FLASH_SIZE</span><span class="p">)</span>
<span class="p">{</span>
<span class="k">return</span> <span class="n">MEM_ERROR</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">for</span><span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o"><</span> <span class="n">numBytes</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">buffer</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">pgm_read_byte_near</span><span class="p">(</span><span class="n">address</span> <span class="o">+</span> <span class="n">i</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">return</span> <span class="n">MEM_SUCCESS</span><span class="p">;</span>
<span class="p">}</span>
</code></pre></div>
<p>With this function you can copy the rom located structure</p>
<div class="highlight"><pre><span></span><code><span class="k">struct</span> <span class="n">mystruct_t</span> <span class="n">flash_var</span> <span class="n">PROGMEM</span> <span class="o">=</span> <span class="p">{</span><span class="mi">7</span><span class="p">,</span> <span class="mh">0x13</span><span class="p">,</span> <span class="mh">0xffff</span><span class="p">};</span>
</code></pre></div>
<p>to ram by a call like</p>
<div class="highlight"><pre><span></span><code><span class="k">struct</span> <span class="n">mystruct_t</span> <span class="n">rambuf_var</span><span class="p">;</span>
<span class="n">memdrv_read</span><span class="p">(</span><span class="o">&</span><span class="n">rambuf_var</span><span class="p">,</span> <span class="p">(</span><span class="n">memaddr_t</span><span class="p">)(</span><span class="o">&</span><span class="n">flash_var</span><span class="p">),</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">flash_var</span><span class="p">));</span>
</code></pre></div>
<p>without thinking about the layout of the single bytes in ram or rom. You can
generalize this concept, so that it can be used for other memories attached to
the controller like an external eeprom or the ram from a real-time clock. It is
sufficient if the interface api for the memory provides a function for reading a
single byte by address (and perhaps write a single byte, so you can also store
back data from the controller ram).</p>E-Mail Certificates2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/213.html<h1 id="email-security">Email Security</h1>
<p>Do you send your business letters, love letters, etc. written on postcards? No?
Sure, you don't?</p>
<p>Emails are nothing more that electronic postcards. They are transmitted in
plaintext passing computers and networks that neither are known by the sender
nor the recipient.</p>
<p>That does not mean that every …</p><h1 id="email-security">Email Security</h1>
<p>Do you send your business letters, love letters, etc. written on postcards? No?
Sure, you don't?</p>
<p>Emails are nothing more that electronic postcards. They are transmitted in
plaintext passing computers and networks that neither are known by the sender
nor the recipient.</p>
<p>That does not mean that every email is caught and read and perhaps changed by
someone you don't want to do that. But it is possible and might happen. So
anyone that uses emails should think about the risks and the security of his
data. On the other hand it is possible to overcome these risks by use of
cryptographic methods. But what are these risks mentioned?</p>
<ul>
<li>Confidentiality: keep your data private → encrypt the email</li>
<li>Integrity: prevent changes to your email → electronically sign the email</li>
<li>Authenticity: Proof of the origin of an email → sign the email</li>
</ul>
<h1 id="encryption">Encryption</h1>
<p>Since a long time there exist so called symmetric encryption algorithms. When
using them the sender of an email chooses a password to encrypt the message. The
recipient of the mail has to use the same password to decrypt the message. The
problem is to transmit the password from the sender to the recipient without
using insecure communication (e.g. another email). If an attacker get to know
the password he can read the encrypted message and neither sender nor recipient
would notice that.</p>
<p>Since the invention of asymmetric cryptographic algorithms no one has to worry
about the key (password) exchange anymore. The asymmetric algorithms use one key
to encrypt a message and another one to decrypt it. One of the keys will be
declared as the public key while the other key becomes the private key. The
public key - as its name suggests - is published while the private key is kept
as a secret by its owner. So if someone wants to send a message to someone else
he must use the recipients public key to encrypt the message. The recipient then
uses his private key (that only he knows) to decrypt it.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/certificates-enc-en.png">
<img src="https://www.a-netz.de/blog/2007/08/images/certificates-enc-en.png"
title="E-Mail encryption"
alt="E-Mail encryption">
</a>
<figcaption>E-Mail encryption</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/certificates-dec-en.png">
<img src="https://www.a-netz.de/blog/2007/08/images/certificates-dec-en.png"
title="E-Mail decryption"
alt="E-Mail decryption">
</a>
<figcaption>E-Mail decryption</figcaption>
</figure>
<h1 id="signature">Signature</h1>
<p>If you get an email encrypted with your public key, you can be sure that no one
else could have read this message as long as your private key is secure. But how
do you know that the email is really from the one that is indicated as the
emails sender? Perhaps an attacker has caught the email, has written a new email
with other content and has encrypted it with your public key. You might not
notice this. But you can prevent this by using a mail signature.</p>
<p>For signing an email, the sender calculates a checksum of the emails contents. A
checksum is a large number that has a few important qualities. If you change the
emails contents only a little bit the checksum will be totally different. In
addition it is very difficult (nearly impossible) to find another email that has
the same checksum. And if you know the checksum of an email you cannot gather
any information about the content of the email. A well known algorithm to
calculate checksums e.g. is called MD5 (Message Digest 5).</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/certificates-md5hash-en.png">
<img src="https://www.a-netz.de/blog/2007/08/images/certificates-md5hash-en.png"
title="MD5 Checksum"
alt="MD5 Checksum">
</a>
<figcaption>MD5 Checksum</figcaption>
</figure>
<p>This checksum now is encrypted with the senders private key. When the recipient
gets the email he can decrypt the checksum with the senders public key. Then he
can compare this checksum with a checksum calculated by himself. If the
checksums differ, the email might have been altered. Or the email has not been
sent by the one that is indicated as the sender. Then you would have decrypted
the checksum with the wrong public key what results in something similar to a
random number.</p>
<p>Because the private key that was used to encrypt the checksum is only known to
its owner, you can be sure that the identity of the sender has not been faked.</p>
<h1 id="certificates">Certificates</h1>
<p>Now there is only one point to make email communication really secure. There is
no cryptographic method to ensure that someone generates a key pair in the name
of someone else. If an attacker would create a key pair for some bank and get
the banks customers to use this key, he would be able to decrypt messages that
go to the bank (in contrast to the bank that can not decrypt this emails). That
makes it important to get a secure and trustworthy mapping between a person and
its keys. And for this purpose email certificates are designed.</p>
<p>Certificates are nothing more than a key pair (public und private key), that is
signed by a trustworthy organization called Certificate Authority (CA). This
organization confirms that the owner declared inside the certificate is really
the one that owns the private key.</p>
<p>Unfortunately, most organizations take much money for creating a
certificate. But there are alternatives like e.g. <a href="http://www.cacert.org">CACert.org</a> that are free of
charge.</p>
<p>When applying for a certificate you should keep a few things in mind. You should
get information about how a CA ensures that the person mentioned in the
certificate and you yourself are the same person. Often this is done by a face
to face meeting and verification of an identity document like your passport.</p>
<p>Another point to mention is to check if the root certificate of the CA is
distributed with most standard software (like Internet Explorer, Firefox, etc. )
because for validating the signature that the CA has made to your certificate
the CAs public key must be known. The public keys of most commercial CAs are
installed with standard email applications or browsers. When you have got a
certificate free of charge this root certificate might be missing and recipients
of your signed emails cannot check the validity of your signature. They have to
download the root certificate from the CAs website before.</p>
<h1 id="links">Links</h1>
<ul>
<li><a href="http://www.thawte.com">Thawte</a>: Commercial CA that offers personal email certificates free of
charge</li>
<li><a href="http://www.cacert.org">CACert.org</a>: A free CA</li>
<li>Explanations of the <a href="http://www.barmala.de/thawte/index.de.php">Thawte Web of Trust</a></li>
<li>[Christian Barmala Free CA]: A free CA that can be used for the first
experiments with email certificates.</li>
<li>[The Open Source Public Key Infrastructure Book]</li>
</ul>Audio Amplifier with TDA72402007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/audio-amplifier-with-tda7240.html<h1 id="description">Description</h1>
<p>My television has only a single mono loudspeaker, so I have built the following
small audio amplifier to connect better loudspeakers. The amplification is done
with 2× <a href="http://www.st.com/stonline/products/literature/ds/1469/tda7240a.pdf">TDA7240</a> ICs from <a href="http://www.st.com">SGS Thomson</a>. This IC is designed for car radio
applications. But this simplifies the power supply design, because only …</p><h1 id="description">Description</h1>
<p>My television has only a single mono loudspeaker, so I have built the following
small audio amplifier to connect better loudspeakers. The amplification is done
with 2× <a href="http://www.st.com/stonline/products/literature/ds/1469/tda7240a.pdf">TDA7240</a> ICs from <a href="http://www.st.com">SGS Thomson</a>. This IC is designed for car radio
applications. But this simplifies the power supply design, because only one 12V
voltage is needed instead of an additional negative voltage.</p>
<p>The datasheet says that the amplifier ics can deliver 20 watts into
4Ω-Loudspeakers and 12 watt into 8Ω-Loudspeakers. I do not know if my
construction can reach this values but I think it is good enough for watching
TV.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/audioamp-schematics.png">
<img src="https://www.a-netz.de/blog/2007/08/images/audioamp-schematics.png"
title="Amplifier Schematics"
alt="Amplifier Schematics">
</a>
<figcaption>Amplifier Schematics</figcaption>
</figure>
<p>The circuit is quite simple and built according to the proposal in the
datasheet, merely for 2 channels and without the mute switch, because this can
be done with the TV. The power supply of this amplifier is a conventional one
with a 50VA 12V toroidal transformer, bridge rectifier and two 4700µF
electrolytic caps.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/audioamp-layout.png">
<img src="https://www.a-netz.de/blog/2007/08/images/audioamp-layout.png"
title="PCB Layout"
alt="PCB Layout">
</a>
<figcaption>PCB Layout</figcaption>
</figure>
<p>Only a few additional components are needed for the amplifier, so the whole
circuit fits on a 3,5cm × 5cm <abbr title="Printed Circuit Board">PCB</abbr>
. But the PCB is not the only component needing space inside the amplifiers
case - the ics need an adequately sized heatsink. They will not be destroyed
when the heatsink is too small because they are protected against overheating
and short-circuit.</p>
<p>The presented amplifier cannot compete with real hifi amplifiers but in my
opinion it is really good to watch TV and a great improvement in opposite to the
TVs' mono output.</p>
<p>The stereo potentiometer I used has some problems because the two resistors have
not exactly the same value. So I already think about a digital volume and sound
control (treble, bass, balance), perhaps with a remote control. If I have some
news about that I will publish it on this website.</p>
<h1 id="the-case">The case</h1>
<p>The case of this amplifier is made out of 8mm poplar plywood (hope this
translation is correct ...) I can only recommend this material for building such
cases. But you should paint it with lacquer to get a hard and shiny surface. And
remember to make enough holes into the bottom and cover of the case to avoid
overheating of the amplifier.</p>
<p><strong>Warning</strong>: The power supply of this amplifier is connected to the mains. Household
electrical current is extremely dangerous, and it may be illegal for you to
perform your own wiring, even for equipment that connects via a standard wall
outlet. If you are unsure of the procedures, terminology or anything else that
may cause a potentially fatal error due to oversight or lack of knowledge, you
must seek assistance from a qualified electrician. Remember that if someone is
killed or injured as a result of your work, you may be held liable and subject
to severe criminal and financial penalties.</p>
<h1 id="pictures">Pictures</h1>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/audioamp-ics.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/audioamp-ics.jpg"
title="The Amplifier Circuit"
alt="The Amplifier Circuit">
</a>
<figcaption>The Amplifier Circuit</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/audioamp-inside.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/audioamp-inside.jpg"
title="Inside the Amp"
alt="Inside the Amp">
</a>
<figcaption>Inside the Amp</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/audioamp.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/audioamp.jpg"
title="The completed Amplifier"
alt="The completed Amplifier">
</a>
<figcaption>The completed Amplifier</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/audioamp-back.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/audioamp-back.jpg"
title="and the back side"
alt="and the back side">
</a>
<figcaption>and the back side</figcaption>
</figure>
<h1 id="downloads">Downloads</h1>
<p>Eagle-Projekt: <a href="https://www.a-netz.de/blog/2007/08/files/audioamp_20040827.zip">audioamp-20040827.zip</a></p>
<h1 id="links">Links</h1>
<ul>
<li><a href="http://sound.westhost.com">Elliott Sound Products</a>: Basics, theory and circuits for do-it-yourself
audio, great site!</li>
<li><a href="http://www.st.com">SGS Thomson</a>: Manufacturer of the amplifier ics.</li>
<li><a href="http://www.st.com/stonline/products/literature/ds/1469/tda7240a.pdf">TDA7240</a>: Datasheet of the TDA7240.</li>
</ul>AVR Assembler-Code für HD44780-Displays2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/avr-assembler-fur-hd44780-display.html<h1 id="beschreibung">Beschreibung</h1>
<p>Der im Folgenden vorgestellte Code ist aus einem größeren Projekt entnommen. Die
Parameter an eine Prozedur werden in die Register <code>RP0</code>, <code>RP1</code> und <code>RP2</code>
geschrieben, der Rückgabewert steht nach dem Aufruf im Register <code>RRet</code>. Diese
Registernamen müssen also vor der Verwendung dieser Prozeduren definiert
werden. Zur Verwendung dieses Codes …</p><h1 id="beschreibung">Beschreibung</h1>
<p>Der im Folgenden vorgestellte Code ist aus einem größeren Projekt entnommen. Die
Parameter an eine Prozedur werden in die Register <code>RP0</code>, <code>RP1</code> und <code>RP2</code>
geschrieben, der Rückgabewert steht nach dem Aufruf im Register <code>RRet</code>. Diese
Registernamen müssen also vor der Verwendung dieser Prozeduren definiert
werden. Zur Verwendung dieses Codes ist neben der Datei <code>display.asm</code> die Datei
<code>inttimer16.asm</code> notwendig. In dieser sind zwei Delay-Prozeduren enthalten, die
den Prozessor während des delays in den Sleep-Modus versetzen, um Strom zu
sparen.</p>
<p>Der Code besteht aus den Prozeduren bzw. Makros:</p>
<p><code>disp_instruction</code> und <code>disp_data</code>: (Makro) Setzt das Display in den Daten-
bzw. Intruktions-Modus.</p>
<p><code>disp_put_byte</code>: Schreibt ein Byte auf das Display. Beispiel: </p>
<div class="highlight"><pre><span></span><code><span class="nf">disp_data</span>
<span class="nf">ldi</span> <span class="nv">RP0</span><span class="p">,</span> <span class="s">'A'</span>
<span class="nf">rcall</span> <span class="nb">disp</span><span class="nv">_put_byte</span>
<span class="nf">ldi</span> <span class="nv">RP0</span><span class="p">,</span> <span class="s">'B'</span>
<span class="nf">rcall</span> <span class="nb">disp</span><span class="nv">_put_byte</span>
</code></pre></div>
<p><code>disp_read_byte</code>: Liest ein Byte vom Display zurück.</p>
<p><code>disp_reset</code>: Setzt das Display in den Ausgangszustand zurück. Dabei wird der
Display-Inhalt gelöscht und der Cursor auf der Position des ersten Zeichens
gesetzt.</p>
<p><code>disp_write_string</code>: Schreibt einen null-terminierten String aus dem
Programmspeicher auf das Display. Beispiel: </p>
<div class="highlight"><pre><span></span><code><span class="nl">CSEG:</span>
<span class="nl">string_hello_world:</span>
<span class="nf">.db</span> <span class="s">'H'</span><span class="p">,</span> <span class="s">'e'</span><span class="p">,</span> <span class="s">'l'</span><span class="p">,</span> <span class="s">'l'</span><span class="p">,</span> <span class="s">'o'</span><span class="p">,</span> <span class="s">','</span><span class="p">,</span> <span class="s">' '</span><span class="p">,</span> <span class="s">'w'</span><span class="p">,</span> <span class="s">'o'</span><span class="p">,</span> <span class="s">'r'</span><span class="p">,</span> <span class="s">'l'</span><span class="p">,</span> <span class="s">'d'</span><span class="p">,</span> <span class="s">'!'</span><span class="p">,</span> <span class="mi">0</span>
<span class="nf">ldi</span> <span class="nv">RP0</span><span class="p">,</span> <span class="nv">LOW</span><span class="p">(</span> <span class="mi">2</span> <span class="o">*</span> <span class="nv">string_hello_world</span> <span class="p">)</span>
<span class="nf">ldi</span> <span class="nv">RP1</span><span class="p">,</span> <span class="nv">HIGH</span><span class="p">(</span> <span class="mi">2</span> <span class="o">*</span> <span class="nv">string_hello_world</span> <span class="p">)</span>
<span class="nf">rcall</span> <span class="nb">disp</span><span class="nv">_write_string</span>
</code></pre></div>
<h1 id="download">Download</h1>
<p><a href="https://www.a-netz.de/blog/2007/08/files/avr_hd44780.zip">avr_hd44780.zip</a></p>AVR Assembler-Code for HD44780 Displays2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/avr-assembler-fur-hd44780-display-en.html<h1 id="description">Description</h1>
<p>The following assembler code is from some another project. The parameters of the
procedures are passed through the registers <code>RP0</code>, <code>RP1</code> and <code>RP2</code>, the return
value is located in the register <code>RRet</code> after the call. These register names
have to be defined before the code can be used. To …</p><h1 id="description">Description</h1>
<p>The following assembler code is from some another project. The parameters of the
procedures are passed through the registers <code>RP0</code>, <code>RP1</code> and <code>RP2</code>, the return
value is located in the register <code>RRet</code> after the call. These register names
have to be defined before the code can be used. To use this code the file
inttimer16.asm is also required. It contains two delay-routines that are able
put the processor into sleep mode to save power.</p>
<p>The code consists of the following routines and macros:</p>
<p><code>disp_instruction</code> and <code>disp_data</code>: (macro) Puts the display into data or
instruction mode.</p>
<p><code>disp_put_byte</code>: Writes a byte to the display. Example:</p>
<div class="highlight"><pre><span></span><code><span class="nf">disp_data</span>
<span class="nf">ldi</span> <span class="nv">RP0</span><span class="p">,</span> <span class="s">'A'</span>
<span class="nf">rcall</span> <span class="nb">disp</span><span class="nv">_put_byte</span>
<span class="nf">ldi</span> <span class="nv">RP0</span><span class="p">,</span> <span class="s">'B'</span>
<span class="nf">rcall</span> <span class="nb">disp</span><span class="nv">_put_byte</span>
</code></pre></div>
<p><code>disp_read_byte</code>: Reads a byte from the display</p>
<p><code>disp_reset</code>: Resets the display to default values. The contents of the display
are erased and the cursor is moved to the position of the first character.</p>
<p><code>disp_write_string</code>: Writes a null-terminated string out of program memory to
the display. Example:</p>
<div class="highlight"><pre><span></span><code><span class="nl">CSEG:</span>
<span class="nl">string_hello_world:</span>
<span class="nf">.db</span> <span class="s">'H'</span><span class="p">,</span> <span class="s">'e'</span><span class="p">,</span> <span class="s">'l'</span><span class="p">,</span> <span class="s">'l'</span><span class="p">,</span> <span class="s">'o'</span><span class="p">,</span> <span class="s">','</span><span class="p">,</span> <span class="s">' '</span><span class="p">,</span> <span class="s">'w'</span><span class="p">,</span> <span class="s">'o'</span><span class="p">,</span> <span class="s">'r'</span><span class="p">,</span> <span class="s">'l'</span><span class="p">,</span> <span class="s">'d'</span><span class="p">,</span> <span class="s">'!'</span><span class="p">,</span> <span class="mi">0</span>
<span class="nf">ldi</span> <span class="nv">RP0</span><span class="p">,</span> <span class="nv">LOW</span><span class="p">(</span> <span class="mi">2</span> <span class="o">*</span> <span class="nv">string_hello_world</span> <span class="p">)</span>
<span class="nf">ldi</span> <span class="nv">RP1</span><span class="p">,</span> <span class="nv">HIGH</span><span class="p">(</span> <span class="mi">2</span> <span class="o">*</span> <span class="nv">string_hello_world</span> <span class="p">)</span>
<span class="nf">rcall</span> <span class="nb">disp</span><span class="nv">_write_string</span>
</code></pre></div>
<h1 id="download">Download</h1>
<p><a href="https://www.a-netz.de/blog/2007/08/files/avr_hd44780.zip">avr_hd44780.zip</a></p>AVR Programmer2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/avr-programmer.html<h1 id="beschreibung">Beschreibung</h1>
<p>Das im folgenden beschriebene Programmier-Gerät ist zum direkten Anschluss an
den Parallelport gedacht und eignet sich zum in-system-programming (ISP) von
AVR-Mikrocontrollern. Die benötigten Bauteile (die Widerstände zur Entkopplung
des Parallelport und die R-C-Kombination zur Entstörung von SCK) lassen sich in
einem 25-poligen Sub-D-Steckergehäuse unterbringen. Der Entwurf stammt
ursprünglich von …</p><h1 id="beschreibung">Beschreibung</h1>
<p>Das im folgenden beschriebene Programmier-Gerät ist zum direkten Anschluss an
den Parallelport gedacht und eignet sich zum in-system-programming (ISP) von
AVR-Mikrocontrollern. Die benötigten Bauteile (die Widerstände zur Entkopplung
des Parallelport und die R-C-Kombination zur Entstörung von SCK) lassen sich in
einem 25-poligen Sub-D-Steckergehäuse unterbringen. Der Entwurf stammt
ursprünglich von der Webseite der Programmiersoftware <a href="http://www.xs4all.nl/~sbolt/e-spider_prog.html">SP12</a>. Ich habe die
Schaltung aber auch schon mit dem Tool <a href="http://www.nongnu.org/avrdude/">avrdude</a> verwendet.</p>
<p>Das Kabel zur Verbindung von Rechner und MCU sollte nicht zu lang sein (je
kürzer, desto besser), da es sonst zu Störungen beim Programmieren kommen kann.</p>
<h1 id="schaltung">Schaltung</h1>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/avrprog-schematics.png">
<img src="https://www.a-netz.de/blog/2007/08/images/avrprog-schematics.png"
title="Schaltplan AVR-Parallelport-Programmer"
alt="Schaltplan AVR-Parallelport-Programmer">
</a>
<figcaption>Schaltplan AVR-Parallelport-Programmer</figcaption>
</figure>
<h1 id="links">Links</h1>
<ul>
<li><a href="http://www.xs4all.nl/~sbolt/e-spider_prog.html">SP12</a>: Einfach gehaltene Programmier-Software für Windows und Linux</li>
<li><a href="http://www.nongnu.org/avrdude/">avrdude</a>: Komplexere Programmier-Software mit Unterstützung für viele
verschiedene Programmier-Hardware-Typen.</li>
</ul>AVR Thermometer2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/avr-thermometer.html<h1 id="description">Description</h1>
<p>This circuit is one of my first applications of a microcontroller. It is a small
thermometer with a 2×16 characters display (see) that shows the current
temperature and extreme values, i.e. minimum and maximum temperature. The <abbr
title="Printed Circuit Board">PCB</abbr> is designed to fit behind the display
so that it …</p><h1 id="description">Description</h1>
<p>This circuit is one of my first applications of a microcontroller. It is a small
thermometer with a 2×16 characters display (see) that shows the current
temperature and extreme values, i.e. minimum and maximum temperature. The <abbr
title="Printed Circuit Board">PCB</abbr> is designed to fit behind the display
so that it is possible to build up a quite small device.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/avrtherm_complete.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/avrtherm_complete.jpg"
title="Complete Thermometer"
alt="Complete Thermometer">
</a>
<figcaption>Complete Thermometer</figcaption>
</figure>
<p>This circuit should not be understood as a ready and working device, but as a
platform to experiment, because there are some minor issues. Because of the
placement of the temperature sensor on the pcb its measurement values are off by
one or two degrees when the voltage regulator gets warm. Additionally the
circuit - particularly the display - needs too much current so that it cannot be
operated with small batteries over more than a few days.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/avrtherm_side.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/avrtherm_side.jpg"
title="front view with connectors"
alt="front view with connectors">
</a>
<figcaption>front view with connectors</figcaption>
</figure>
<h1 id="the-hardware">The Hardware</h1>
<p>I have used an AT90S2313 microcontroller from <a href="http://www.atmel.com">Atmel</a>. It is connected through a
2-wire-bus (compatible to the <a href="http://semiconductors.philips.com">Philips</a> I2C-Bus), a small eeprom to save the
minimum and maximum values and to the temperature sensor, a DS1621 from Dallas
Semiconductors (now <a href="http://www.maxim-ic.com">Maxim</a>).</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/avrtherm_sep.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/avrtherm_sep.jpg"
title="Display and Controller separated"
alt="Display and Controller separated">
</a>
<figcaption>Display and Controller separated</figcaption>
</figure>
<p>Additionally there are connectors for programming the controller, for connecting
more I2C-Devices, a push button, the supply voltage and to connect the circuit
to the serial interface of a PC. The circuit can operate at 6V - 18V from a
power supply or batteries, because a 5V voltage regulator is used. The display
has a built-in background light, but I disabled it because it needs too much
current that warms the temperature sensor. But it is possible to connect an
external sensor to the bus to overcome this problem.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/avrtherm_circuit.png">
<img src="https://www.a-netz.de/blog/2007/08/images/avrtherm_circuit.png"
title="The circuit ..."
alt="The circuit ...">
</a>
<figcaption>The circuit ...</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/avrtherm_layout.png">
<img src="https://www.a-netz.de/blog/2007/08/images/avrtherm_layout.png"
title="... and the layout"
alt="... and the layout">
</a>
<figcaption>... and the layout</figcaption>
</figure>
<p>There are two jumpers in the circuit. One is connected to reset of the
controller and should be open. It can be shortened to reset the controller if it
hangs (this should not happen...). The other jumper should be opened to program
the controller in-circuit. It disconnects the display, the temperature sensor
and the eeprom from VCC. After programming it must be shortened to let the
thermometer work.</p>
<h1 id="the-software">The Software</h1>
<p>There are two versions of the firmware of the microcontroller. One is written in
Assembler for <a href="http://avra.sourceforge.net">avra Assembler</a>. It consists of multiple independent units
(I2C-Bus, UART, Delays, Display, etc.) that can easily be adapted to be used in
other projects.</p>
<p>For comparsion I have written a version in C for avr-gcc with the same functions
(display of temperature, minimum und maximum). Although I tried to write compact
code in assembler the C version needs only slightly more program memory. (978
Bytes for assembler vs. 1024 Bytes for the C version).</p>
<p>Due to the structure of C this version is better modularized so that each
functional unit can easily be used in other projects. To simplify this, all
functions are documented in <a href="http://www.doxygen.org">Doxygen</a> style.</p>
<h1 id="download">Download</h1>
<ul>
<li>Eagle-project (PCB layout), C source code and documentation (Version
07/01/2007 with improved resolution of temperature values): <a href="https://www.a-netz.de/blog/2007/08/files/avrtherm-20070107.tar.gz">avrtherm-20070107.tar.gz</a></li>
<li>Eagle-project (PCB layout) with assembler and C source code (Version
11/27/2004): <a href="https://www.a-netz.de/blog/2007/08/files/avrtherm-20041127.zip">avrtherm-20041127.zip</a></li>
<li><abbr title="Application Programming Interface">API</abbr> -Documentation of
the C Sourcecode: <a href="https://www.a-netz.de/blog/2007/08/files/avrtherm-doc-20041127.tar.gz">avrtherm-doc-20041127.tar.gz</a></li>
</ul>AVR Thermometer2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/avr-thermometer-2.html<h1 id="beschreibung">Beschreibung</h1>
<p>Bei dieser Schaltung handelt es sich um eine meiner ersten halbwegs sinnvollen
Anwendungen für einen Microcontroller. Es ist ein Thermometer mit
2×16-Zeichen-LC-Display, welches die aktuelle Temperatur und die Extremwerte
(Minimal- und Maximaltemperatur) anzeigt. Die Schaltung ist so konstruiert, dass
sie genau unter die Platine des Displays passt. Somit …</p><h1 id="beschreibung">Beschreibung</h1>
<p>Bei dieser Schaltung handelt es sich um eine meiner ersten halbwegs sinnvollen
Anwendungen für einen Microcontroller. Es ist ein Thermometer mit
2×16-Zeichen-LC-Display, welches die aktuelle Temperatur und die Extremwerte
(Minimal- und Maximaltemperatur) anzeigt. Die Schaltung ist so konstruiert, dass
sie genau unter die Platine des Displays passt. Somit ergibt sich ein schön
kleines und kompaktes Gerät.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/avrtherm_complete.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/avrtherm_complete.jpg"
title="Zusammengebautes Thermometer"
alt="Zusammengebautes Thermometer">
</a>
<figcaption>Zusammengebautes Thermometer</figcaption>
</figure>
<p>Die Schaltung ist nicht als fertig einsatzbereites Gerät zu verstehen, sondern
als eine Plattform zum experimentieren - auch, weil es einige Schwierigkeiten im
Betrieb gibt. Durch die Platzierung des Temperatursensors und die Erwärmung der
Schaltung im Betrieb werden die Messwerte verfälscht. Das lässt sich durch die
Verwendung eines externen Temperatursensors jedoch vermeiden. Durch den relativ
hohen Stromverbrauch des verwendeten Controllers und des Displays ist außerdem
der Betrieb mit Batterien nur eingeschränkt möglich.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/avrtherm_side.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/avrtherm_side.jpg"
title="von der Seite"
alt="von der Seite">
</a>
<figcaption>von der Seite</figcaption>
</figure>
<h1 id="die-hardware">Die Hardware</h1>
<p>Als Microcontroller wird ein AT90S2313 von <a href="http://www.atmel.com">Atmel</a> verwendet. Daran sind über
einen 2-Wire-Bus (kompatibel zum <abbr title="Inter-IC-Bus">I2C</abbr>-Bus von
<a href="http://semiconductors.philips.com">Philips</a>) ein kleines EEProm zur Speicherung der Extremwerte und der
Temperatursensor, ein DS1621 von Dallas Semiconductors (inzwischen von <a href="http://www.maxim-ic.com">Maxim</a>
übernommen) angeschlossen.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/avrtherm_sep.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/avrtherm_sep.jpg"
title="Display und Controller getrennt"
alt="Display und Controller getrennt">
</a>
<figcaption>Display und Controller getrennt</figcaption>
</figure>
<p>Daneben gibt es noch einige Anschlüsse zur Programmierung des Controllers, zum
Anschluss weiterer Bausteine an den2-Wire-Bus, zum Anschluss eines Tasters und
der Versorgungsspannung und zur Kopplung mit dem PC über die serielle
Schnittstelle. Versorgt werden kann das Thermometer über ein kleines Netzteil
oder mit Batterien ab 6 Volt, da ein 5V-Spannungsregler eingebaut ist. Das
Display besitzt eine Hintergrundbeleuchtung, die ich zur Zeit aber nicht
verwende, da sich die gesamte Schaltung sonst etwas erwärmt und somit die
Messwerte etwas abweichen. Es lässt sich aber ein externer Sensor anschliessen,
womit dieses Problem behoben wäre.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/avrtherm_circuit.png">
<img src="https://www.a-netz.de/blog/2007/08/images/avrtherm_circuit.png"
title="Die Schaltung ..."
alt="Die Schaltung ...">
</a>
<figcaption>Die Schaltung ...</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/avrtherm_layout.png">
<img src="https://www.a-netz.de/blog/2007/08/images/avrtherm_layout.png"
title="... und das Layout"
alt="... und das Layout">
</a>
<figcaption>... und das Layout</figcaption>
</figure>
<p>Es gibt zwei Jumper in der Schaltung. Der eine is mit dem Reset-Anschluss des
Controllers verbunden. Er sollte normalerweise offen sein und nur geschlossen
werden, wenn sich der Controller aufhängt. Der andere dient dazu, den
Temperatursensor, das EEProm und das Display von der Versorgungsspannung zu
trennen, während der Controller in der Schaltung programmiert wird. Danach
sollte er wieder geschlossen werden, da das Thermometer sonst nicht
funktionieren kann.</p>
<h1 id="die-software">Die Software</h1>
<p>Es gibt zwei Versionen der Software, genauer der Firmware des
Microcontrollers. Die eine ist in Assembler für den <a href="http://avra.sourceforge.net">avra Assembler</a>
geschrieben. Sie besteht aus mehreren Dateien, die jeweils eigenständige
Funktionseinheiten (I2C-Bus, UART, Delays, Display, etc.) darstellen und sich
somit auch leicht in anderen Projekten verwenden lassen sollten.</p>
<p>Zum Vergleich gibt es nun eine in C geschriebene Version für den avr-gcc
(genauer <a href="http://winavr.sourceforge.net">WinAVR</a>) mit gleicher Funktionalität (Anzeige der Temperatur, Minimum
und Maximum). Obwohl ich mir bei der Programmierung der Assembler-Version Mühe
gegeben habe, möglichst kompakten Code zu schreiben, ist die C-Version im
Speicherverbrauch (Programmspeicher) nicht wesentlich schlechter (978 Bytes für
die Assembler-Version gegenüber 1024 Bytes für die C-Version).</p>
<p>Die C-Version ist entsprechend den Fähigkeiten von C noch stärker modularisiert,
so dass sich einzelne Funktionseinheiten leicht in anderen Projekten verwenden
lassen sollten. Alle Funktionen sind mittels <a href="http://www.doxygen.org">Doxygen</a> dokumentiert, so dass der
EInsatz in anderen Projekten keine Probleme bereiten sollte.</p>
<h1 id="download">Download</h1>
<ul>
<li>Eagle-Projekt und Sourcecode (nur C) (Version vom 07.01.2007 mit höherer
Auflösung der Temeraturmesswerte und Dokumentation):
<a href="https://www.a-netz.de/blog/2007/08/files/avrtherm-20070107.tar.gz">avrtherm-20070107.tar.gz</a></li>
<li>Eagle-Projekt und Sourcecode (Assembler und C, Version vom 27.11.2004):
<a href="https://www.a-netz.de/blog/2007/08/files/avrtherm-20041127.zip">avrtherm-20041127.zip</a></li>
<li><abbr title="Application Programming Interface">API</abbr> -Dokumentation
des C-Sourcecodes: <a href="https://www.a-netz.de/blog/2007/08/files/avrtherm-doc-20041127.tar.gz">avrtherm-doc-20041127.tar.gz</a></li>
</ul>AVR Tipps, Tricks und Hinweise2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/avr-tipps-tricks-und-hinweise.html<p>Auf dieser Seite gibt es einige Hinweise und Tipps für die Programmierung von
AVR-Microcontrollern.</p>
<h1 id="io-pins">I/O-Pins</h1>
<p>Zur Ansteuerung jedes I/O-Ports gibt es drei Register:</p>
<ul>
<li><code>PORTx:</code> Zustand des Pins, low (0) oder high (1) bzw. ohne (0) oder mit (1)
Pull-Up-Widerstand</li>
<li><code>DDRx</code> (Data Direction Register): Legt fest, ob der Pin …</li></ul><p>Auf dieser Seite gibt es einige Hinweise und Tipps für die Programmierung von
AVR-Microcontrollern.</p>
<h1 id="io-pins">I/O-Pins</h1>
<p>Zur Ansteuerung jedes I/O-Ports gibt es drei Register:</p>
<ul>
<li><code>PORTx:</code> Zustand des Pins, low (0) oder high (1) bzw. ohne (0) oder mit (1)
Pull-Up-Widerstand</li>
<li><code>DDRx</code> (Data Direction Register): Legt fest, ob der Pin hochohmig (0) ist,
so dass man eine anliegende Spannung messen kann oder niederohmig (1), so
dass man Strom "sourcen" oder "sinken" kann.</li>
<li><code>PINx</code>: Gibt den tatsächlichen Zustand (high oder low), also die am Pin
anliegende Spannung zurück.</li>
</ul>
<p>Damit kann jeder I/O-Pin vier Zustände (Kombination von (PORTx, DDRx)) annehmen:</p>
<ul>
<li>(<code>PORTx=1</code>, <code>DDRx=1</code>): High: Der MC versucht, den Pin auf High zu ziehen,
also VCC auszugeben</li>
<li>(<code>PORTx=0</code>, <code>DDRx=1</code>): Low: Der MC zieht den Pin auf Masse</li>
<li>(<code>PORTx=0</code>, <code>DDRx=0</code>): Hochohmig (High Impedance, High-Z): Der MC macht gar
nichts mit dem Pin, man kann in PINx das anliegende Level (high / low)
ablesen</li>
<li>(<code>PORTx=1</code>, <code>DDRx=0</code>): Pull-up: Der MC verbindet den Pin über einen
Widerstand (ca. 60kOhm) mit VCC. Der Pin lässt sich aber noch extern, zum
Beispiel durch einen Taster oder Schalter auf Masse ziehen.</li>
</ul>
<h1 id="moduliertes-signal-ausgeben-zb-rc5">Moduliertes Signal ausgeben (z.B. RC5)</h1>
<p>Um ein moduliertes Rechteck-Signal auszugeben, etwa für eine, kann man gut den
in vielen AVRs verfügbaren Waveform Generator Mode (WGM), einen Bestandteil der
Timer/Counter ausnutzen. Damit benötigt die Erzeugung des Signals fast keine
Rechenleistung. Vorgehensweise:</p>
<ul>
<li>Timer einstellen, so dass er mit einer konstanten Frequenz einen Output
Compare Match erreicht</li>
<li>Den Output Compare Mode so einstellen, dass ein Output Compare Pin (OCx) bei
jedem Compare Match toggelt.</li>
<li>Nun nur noch den WGM zu geeigneten Zeitpunkten an- oder ausschalten, so dass
das korrekte Signal am OCx-Pin anliegt.</li>
</ul>
<p>Beispiel für ATTiny2313:</p>
<div class="highlight"><pre><span></span><code><span class="c1">// setup waveform generation to 36kHz on timer 0</span>
<span class="n">TCCR0A</span> <span class="o">|=</span> <span class="n">_BV</span><span class="p">(</span><span class="n">WGM01</span><span class="p">);</span>
<span class="c1">// clear timer on compare match</span>
<span class="n">TCCR0B</span> <span class="o">|=</span> <span class="n">_BV</span><span class="p">(</span><span class="n">CS00</span><span class="p">);</span>
<span class="c1">// timer source is system clock</span>
<span class="n">OCR0A</span> <span class="o">=</span> <span class="mi">107</span><span class="p">;</span>
<span class="c1">// output compare value for 36kHz @ 8 MHz</span>
<span class="c1">// output compare pin to output mode, low level</span>
<span class="n">DDRB</span> <span class="o">|=</span> <span class="n">_BV</span><span class="p">(</span><span class="n">PB2</span><span class="p">);</span>
<span class="c1">// port PB2 as output</span>
<span class="n">PORTB</span> <span class="o">&=</span> <span class="o">~</span><span class="n">_BV</span><span class="p">(</span><span class="n">PB2</span><span class="p">);</span>
<span class="c1">// PB2 is low</span>
<span class="c1">// setup half-bit clock (555Hz) on timer 1</span>
<span class="n">TCCR1B</span> <span class="o">=</span> <span class="n">_BV</span><span class="p">(</span><span class="n">WGM12</span><span class="p">);</span>
<span class="c1">// Clear timer on compare match</span>
<span class="n">OCR1A</span> <span class="o">=</span> <span class="mi">7049</span><span class="p">;</span>
<span class="c1">// ~ 889us @ 8MHz</span>
<span class="n">TIMSK</span> <span class="o">|=</span> <span class="n">_BV</span><span class="p">(</span><span class="n">OCIE1A</span><span class="p">);</span>
<span class="c1">// output compare interrupt enable for timer 1a</span>
<span class="n">ISR</span><span class="p">(</span><span class="n">TIMER1_COMPA_vect</span><span class="p">)</span>
<span class="p">{</span>
<span class="k">if</span><span class="p">(...)</span>
<span class="p">{</span>
<span class="c1">// enable modulated signal</span>
<span class="n">TCCR0A</span> <span class="o">|=</span> <span class="n">_BV</span><span class="p">(</span><span class="n">COM0A0</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">else</span>
<span class="p">{</span>
<span class="c1">// disable modulated signal</span>
<span class="n">TCCR0A</span> <span class="o">&=</span> <span class="o">~</span><span class="n">_BV</span><span class="p">(</span><span class="n">COM0A0</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<h1 id="datenstrukturen-im-flash-rom">Datenstrukturen im Flash-ROM</h1>
<p>Der GNU C Compiler für AVR unterstützt die Ablage von Daten im
Flash-Speicher. Dazu wird bei der Definition einer Variablen das
KeywordPROGMEMverwendet. Leider kann der Compiler auf diese Variablen danach
aber nicht mehr wie auf Daten im RAM zugreifen. Dies hängt damit zusammen, dass
die AVR-Architektur getrennte Datenbusse für den Zugriff auf den Flashspeicher
und den RAM vorsieht. Eine Übergabe einer solchen Variable etwa als
Funktionsparameter funktioniert schlicht nicht und führt teilweise zu recht
seltsamem Verhaltes des Codes.</p>
<p>Um dennoch an die im Flash-Speicher abgelegten Daten zu gelangen, gibt es in der
avrlibc entsprechende Funktionen, um einzelne Bytes aus dem Flash-Speicher zu
lesen. Um mit den im Flash abgelegten Daten zu arbeiten, ist man also immer
gezwungen, diese zunächst in den RAM zu kopieren. Dazu ist zum Beispiel die
folgende Funktion sehr nützlich, da man damit einfach auch größere Strukturen
aus dem Flash laden kann:</p>
<div class="highlight"><pre><span></span><code><span class="kt">uint8_t</span> <span class="nf">memdrv_read</span><span class="p">(</span><span class="kt">uint8_t</span> <span class="o">*</span><span class="n">buffer</span><span class="p">,</span> <span class="n">memaddr_t</span> <span class="n">address</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="n">numBytes</span><span class="p">)</span>
<span class="p">{</span>
<span class="kt">uint8_t</span> <span class="n">i</span><span class="p">;</span>
<span class="k">if</span><span class="p">((</span><span class="n">address</span> <span class="o">+</span> <span class="n">numBytes</span><span class="p">)</span> <span class="o">>=</span> <span class="n">FLASH_SIZE</span><span class="p">)</span>
<span class="p">{</span>
<span class="k">return</span> <span class="n">MEM_ERROR</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">for</span><span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o"><</span> <span class="n">numBytes</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">buffer</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">pgm_read_byte_near</span><span class="p">(</span><span class="n">address</span> <span class="o">+</span> <span class="n">i</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">return</span> <span class="n">MEM_SUCCESS</span><span class="p">;</span>
<span class="p">}</span>
</code></pre></div>
<p>Damit kann man dann eine im Flash ablegte Struktur</p>
<div class="highlight"><pre><span></span><code><span class="k">struct</span> <span class="n">mystruct</span><span class="err">\</span><span class="n">_t</span> <span class="n">flash</span><span class="err">\</span><span class="n">_var</span> <span class="n">PROGMEM</span> <span class="o">=</span> <span class="p">{</span><span class="mi">7</span><span class="p">,</span> <span class="mh">0x13</span><span class="p">,</span> <span class="mh">0xffff</span><span class="p">};</span>
</code></pre></div>
<p>mit dem Aufruf</p>
<div class="highlight"><pre><span></span><code><span class="k">struct</span> <span class="n">mystruct_t</span> <span class="n">rambuf_var</span><span class="p">;</span>
<span class="n">memdrv_read</span><span class="p">(</span><span class="o">&</span><span class="n">rambuf_var</span><span class="p">,</span> <span class="p">(</span><span class="n">memaddr_t</span><span class="p">)(</span><span class="o">&</span><span class="n">flash_var</span><span class="p">),</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">flash_var</span><span class="p">));</span>
</code></pre></div>
<p>wieder in den RAM lesen, ohne sich um das exakte Layout der einzelnen Bytes im
Flash oder im RAM kümmern zu müssen. Dieses Konzept lässt sich auch ganz gut für
andere Speicher, wie etwa ein externes EEPROM oder den RAM einer RTC (dann
naürlich nicht nur zum Lesen, sondern auch zum Schreiben) einsetzen. Es genügt,
wenn der Speicher eine Funktion zum Lesen (oder Schreiben) einzelner Bytes
unterstützt.</p>Bluetooth Basics2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/bluetooth-basics.html<h1 id="basics">Basics</h1>
<p><a href="http://www.bluetooth.com">Bluetooth</a> is a standard for the wireless Transmission of small amounts of data
over short distances. It is designed particularly for mobile devices (mobile
phones, headsets, etc.) because the transmission does not consume much
energy. It can reach speeds between 1 <abbr title="Megabits per
second">mbps</abbr> (version 1.2) and 3 mbps (version …</p><h1 id="basics">Basics</h1>
<p><a href="http://www.bluetooth.com">Bluetooth</a> is a standard for the wireless Transmission of small amounts of data
over short distances. It is designed particularly for mobile devices (mobile
phones, headsets, etc.) because the transmission does not consume much
energy. It can reach speeds between 1 <abbr title="Megabits per
second">mbps</abbr> (version 1.2) and 3 mbps (version 2.0 + <abbr
title="Enhanced Datarate">EDR</abbr> ).</p>
<h1 id="range">Range</h1>
<p>Transmit power and so the range is devided into classes: Class 1 is capable to
cover 100m under ideal circumstances, class 2 is about 10m und class 3
ca. 1m. Most of the mobile phones are class 2 devices and cover a 10m
range. Dongles for the USB port are mostly class 1 devices. The covered range is
limited by the "smaller" comminutaction partner. So it does not make sense to
buy a class 1 dongle to exchange data with a class 2 mobile phone. The range
will be limited to 10m.</p>
<h1 id="profiles">Profiles</h1>
<p>The bluetooth standard contains diverse profiles, that are based on the simple
data exchange and define (ideally manufacturer independent) protocols for
various applications. Examples are</p>
<ul>
<li><abbr title="Dialup Networking">DUN</abbr>: connect a PC over the phone to the
internet</li>
<li><abbr title="File Transfer Protocol">FTP</abbr>: File exchange</li>
<li><abbr title="Advanced Audio Distribution Profile">A2DP</abbr>: Music
transmission to headphones</li>
</ul>
<p>To secure the data transmission, the to devices participating in the
communication have to be coupled the first time they are connected. To do that
it is required to enter the same pin on both devices. Some devices like Headsets
have a hardcoded pin. When coupling two devices, they create an encryption key
that is used in the following data transfers, so that it is not easily possible
to eavesdrop the transmitted data.</p>E-Mail-Zertifikate2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/e-mail-zertifikate.html<h1 id="sicherheit-von-emails">Sicherheit von EMails</h1>
<p>Versenden Sie Ihre Geschäftsbriefe, Liebesbriefe, etc. etwa auf Postkarten?
Nein? Ganz sicher nicht?</p>
<p>EMails sind nichts anderes als elektronische Postkarten. Sie werden
üblicherweise im Klartext übertragen und zwar nicht vom Rechner des Absenders
direkt auf den Rechner des Empfängers, sondern über einige dazwischenliegende
Mailserver. Aber auch während …</p><h1 id="sicherheit-von-emails">Sicherheit von EMails</h1>
<p>Versenden Sie Ihre Geschäftsbriefe, Liebesbriefe, etc. etwa auf Postkarten?
Nein? Ganz sicher nicht?</p>
<p>EMails sind nichts anderes als elektronische Postkarten. Sie werden
üblicherweise im Klartext übertragen und zwar nicht vom Rechner des Absenders
direkt auf den Rechner des Empfängers, sondern über einige dazwischenliegende
Mailserver. Aber auch während der Übertragung durchläuft eine Mail viele
Netzwerke, von denen Daten abgehört werden könnten.</p>
<p>Natürlich bedeutet das nicht, dass jede versendete Email von irgend jemandem
abgefangen und vielleicht sogar in veränderter Form weitergeleitet wird. Aber es
besteht immerhin die Möglichkeit und deshalb sollte sie jeder, der Emails
verschickt, über die Sicherheit seiner Daten Gedanken machen. Bei der
Kommunikation per EMail gibt es also eine Reihe von Schwachstellen, die mit
Hilfe der Kryptographie gelöst werden können. Dabei handelt es sich um</p>
<ul>
<li>Vertraulichkeit: Geheimhaltung von Daten → Verschlüsselung der EMail</li>
<li>Integrität: Verhinderung der Fälschung von Daten (Versiegelung) → Signatur
der EMail</li>
<li>Authentizität: Beweis der Herkunft einer EMail → Signatur der EMail</li>
</ul>
<h1 id="verschlusselung">Verschlüsselung</h1>
<p>Schon seit langem gibt es so genannte symmetrische
Verschlüsselungsverfahren. Dabei wird eine Nachricht vom Absender mit Hilfe
eines Schlüssels (Password) verschlüsselt. Der Empfänger entschlüsselt die
Nachricht nun einfach mit dem selben Schlüssel. Problematisch ist hierbei der
Austausch des Schlüssels. Wird dieser einem Angreifer bekannt, kann er die
Nachricht unbemerkt mitlesen.</p>
<p>Seit der Erfindung der asymetrischen Verschlüsselungsverfahren muss man sich um
dem Schlüsselaustausch keine Gedanken mehr machen. Es handelt sich um ein
Verfahren welches zwei Schlüssel einsetzt. Wird eine Nachricht mit einem der
beiden Schlüssel verschlüsselt, kann sie nur mit dem anderen der beiden
Schlüssel wieder entschlüsselt werden. Eines der bekanntesten asymetrischen
Verschlüsselungsverfahren ist RSA, erfunden von Rivest, Shamir und Adleman.</p>
<p>Üblicherweise wird einer der beiden Schlüssel als Public Key veröffentlicht. Der
andere - der Private Key - ist nur dem Besitzer bekannt und wird
geheimgehalten. Möchte man nun jemandem eine Nachricht senden, so verwendet man
dessen Public Key zur Verschlüsselung der Nachricht. Nur der Empfänger kann nun
mit seinem Private Key (der ja ausschliesslich ihm bekannt ist) die Nachricht
entschlüsseln. Demensprechend wichtig ist es, den eigenen Private Key besonders
gut zu schützen.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/certificates-enc-de.png">
<img src="https://www.a-netz.de/blog/2007/08/images/certificates-enc-de.png"
title="E-Mail verschlüsseln"
alt="E-Mail verschlüsseln">
</a>
<figcaption>E-Mail verschlüsseln</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/certificates-dec-de.png">
<img src="https://www.a-netz.de/blog/2007/08/images/certificates-dec-de.png"
title="E-Mail entschlüsseln"
alt="E-Mail entschlüsseln">
</a>
<figcaption>E-Mail entschlüsseln</figcaption>
</figure>
<h1 id="signatur">Signatur</h1>
<p>Erhält man eine per Public Key verschlüsselte Nachricht, so ist zwar
sichergestellt, dass kein Angreifer die Nachricht lesen konnte. Es ist aber
nicht klar, ob die Nachricht nicht unterwegs abgefangen, verfälscht und von
neuem verschlüsselt wurde. Um sicherzustellen, dass der in einer EMail
angegebene Absender tatsächlich derjenige ist, der die EMail angeschickt hat,
kann eine Nachricht signiert werden.</p>
<p>Um eine Nachricht zu signieren, berechnet der Absender aus den Daten der
Nachricht eine Prüfsumme. Dies ist eine große Zahl, die einige wichtige
Eigenschaften hat. Sobald man die Nachricht nur geringfügig ändert, ergibt sich
eine ganz andere Zahl. Außerdem ist es sehr schwierig (fast unmöglich) eine
andere Nachricht zu finden, aus der sich die gleiche Prüfsumme ergibt. Und
zusätzlich läßt sich, wenn man die Zahl kennt, nicht auf den Inhalt der
Nachricht schliessen. Ein bekanntes Verfahren zur Berechnung von Prüfsummen
nennt sich MD5 (Message Digest 5).</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/certificates-md5hash-de.png">
<img src="https://www.a-netz.de/blog/2007/08/images/certificates-md5hash-de.png"
title="E-Mail signieren"
alt="E-Mail signieren">
</a>
<figcaption>E-Mail signieren</figcaption>
</figure>
<p>Die Prüfsumme wird nun mit dem Private Key des Absenders verschlüsselt. Kommt
die Nachricht beim Empfänger an, so kann dieser die Prüfsumme mit Hilfe des
Public Key des Absenders entschlüsseln und mit der selbst berechneten Prüfsumme
der Nachricht vergleichen. Unterscheiden sich die beiden Prüfsummen, so ist die
Nachricht wahrscheinlich unterwegs verfälscht worden. Es kann aber auch sein,
dass die Nachricht garnicht von demjenigen signiert wurde, der als Absender
angegeben ist. Dann wäre die Signatur aber mit einem Public Key entschlüsselt
worden, der nicht zum Private Key des Absenders passt und es hätte sich eine
sinnlose Zahl anstelle der Prüfsumme ergeben.</p>
<p>Da der Private Key, mit dem die Signatur verschlüsselt wurde, nur demjenigen
bekannt ist, der die Signatur erstellt hat, ist sichergestellt, dass die
Identität des Absenders nicht verfälscht worden ist.</p>
<h1 id="zertifikate">Zertifikate</h1>
<p>Nun fehlt nur noch ein wichtiger Punkt, um die EMail-Kommunikation wirklich
sicher zu machen. Mit Hilfe der vorgestellten Verfahren kann nicht verhindert
werden, dass sich irgendjemand ein Schlüsselpaar erzeugt, welches auf einen
fremden Namen ausgestellt ist. Würde ein Angreifer zum Beispiel ein
Schlüsselpaar mit dem Namen einer Bank erzeugen und einen Kunden der Bank dazu
bringen, diesen Schlüssel zu verwenden, so könnte der Angreifer die
Kommunikation des Kunden mit der Bank entschlüsseln (im Gegensatz zur
Bank). Deshalb ist es wichtig, eine sichere und vertraunswürdige Zuordnung
zwischen einer Person und deren Schlüsseln herzustellen. Und genau zu diesem
Zweck dienen EMail-Zertifikate.</p>
<p>Zertifikate sind nichts anderes als Schlüsselpaare (Public und Private Key), die
von einer vertrauenswürdigen Organisation (CA, Certificate Authority) signiert
wurden. Die CA bestätigt dabei, dass der in dem Zertifikat genannte Besitzer mit
der Person übereinstimmt, die im Besitz des Private Keys ist.</p>
<p>Leider verlangen die meisten Organisationen viel Geld für die Ausstellung eines
Zertifikates. Eine Alternative sind kostenlose Zertifizierungs-Organisationen
wie zum Beispiel <a href="http://www.cacert.org">CACert.org</a>.</p>
<p>Bei der Beantragung eines EMail-Zertifikats sind aber einige wichtige Dinge zu
beachten. Man sollte sich genau darüber informieren, wie die CA sicherstellt,
dass die im Zertifikat genannte Person und man selbst übereinstimmen. Das wird
oft durch persönliches Erscheinen und Vorlage eines Ausweises erreicht.</p>
<p>Ein weiterer zu beachtender Punkt ist die Verbreitung des Zertifikats der CA. Um
die Signatur des eigenen Zertifikats zu überprüfen, muss der Public Key der CA
bekannt sein. Die Public Keys der meistens kommerziellen CAs sind in den
verbreiteten EMail-Programmen und Browsern schon gespeichert. Bei kostenlosen
CAs fehlt dieses so genannte Root-Zertifikat aber, sodass die Korrektheit des
eigenen Zertifikats nicht direkt überprüft werden kann. Das Root-Zertifikat muss
dann zunächst meist von der Webseite der CA geladen werden. Und zwar von jedem,
der Ihnen eine verschlüsselte EMail senden möchte bzw. der die Signatur einer
von Ihnen stammenden Nachricht überprüfen möchte.</p>
<h1 id="links">Links</h1>
<ul>
<li><a href="http://www.thawte.com">Thawte</a>: Kommerzielle CA, die aber auch kostenlose EMail-Zertifikate
anbietet.</li>
<li><a href="http://www.cacert.org">CACert.org</a>: Eine freie CA</li>
<li>Erläuterungen zum <a href="http://www.barmala.de/thawte/index.de.php">Thawte Web of Trust</a></li>
<li><a href="http://ca.barmala.com/index.de.php">Christian Barmala Freie CA</a>: Eine freie CA - praktisch, wenn man ein wenig
mit Zertifikaten experimentieren möchte</li>
<li><a href="http://ospkibook.sourceforge.net">The Open Source Public Key Infrastructure-Book</a>: Ausführliche Bearbeitung
des Themas</li>
</ul>HD44780 LC-Display2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/hd44780-lc-display.html<h1 id="hardware">Hardware</h1>
<p>Viele heute verwendete alphanumerischen <abbr title="Liquid Crystal">LC</abbr>-Displays (siehe<a href="https://www.a-netz.de/blog/2007/08/avr-thermometer-2">AVR Thermometer</a>) für ein Beispiel) basieren auf einem
HD44780- oder einem kompatiblen Controller. Sie eigenen sich gut für die
Verwendung mit einem Mikrocontroller, da sie über ein einfach anzusteuerndes
paralleles Interface verfügen. Sie zeigen Buchstaben, Zahlen und einige
Sonderzeichen in 5 × 7 …</p><h1 id="hardware">Hardware</h1>
<p>Viele heute verwendete alphanumerischen <abbr title="Liquid Crystal">LC</abbr>-Displays (siehe<a href="https://www.a-netz.de/blog/2007/08/avr-thermometer-2">AVR Thermometer</a>) für ein Beispiel) basieren auf einem
HD44780- oder einem kompatiblen Controller. Sie eigenen sich gut für die
Verwendung mit einem Mikrocontroller, da sie über ein einfach anzusteuerndes
paralleles Interface verfügen. Sie zeigen Buchstaben, Zahlen und einige
Sonderzeichen in 5 × 7 Pixeln an, d.h. der Zeichensatz ist fest
definiert. Zusätzlich kann das Aussehen von bis zu 8 Zeichen vom Benutzer
festgelegt werden.</p>
<h1 id="io-pins">I/O-Pins</h1>
<p>Im folgenden eine Übersicht der I/O-Pins mit den Bezeichnungen, wie sie
üblicherweise in den Datenblättern verwendet werden.</p>
<div class="highlight"><pre><span></span><code>D0 - D7 Bidirektionale Datenleitungen
RS Auswahl des Daten- bzw. Befehlsregisters
low: Ist das Display im Schreibmodus, so werden die Befehle an das
Display in das Instruction Register geschrieben. Ist es im Lesemodus,
so kann der Busy-Flag und der Addresss-Counter ausgelesen werden.
high: Das Daten-Register zum Lesen bzw. Schreiben des Displayinhalts
wird angesprochen.
R/W Mit dieser Leitung wird festgelegt, ob Daten aus einem der Register
gelesen bzw. in eines der Register geschrieben werden soll.
high: Lesen des ausgewählten Registers
low: Schreiben in das ausgewählte Register
E Dieser Pin dient dazu, einen Takt für die Datenübertragung vorzugeben.
low → high: Es wird der Zustand der RS- und R/W-Leitungen eingelesen
und falls geschrieben wird, der Zustand der Datenleitungen übernommen.
high → low: Wird gelesen, so liegen die Daten bis zu diesem Übergang
korrekt an den Datenleitungen an.
VCC Versorgungsspannung, meistens 5 Volt
GND Masse-Anschluss
VEE Kontrast-Spannung. Der Kontrast wird üblicherweise durch ein Poti
zwischen VCC und GND eingestellt, dessen Schleifer an VEE hängt.
Achtung: Es gibt auch Displays, die eine negative Kontrastspannung
benötigen, also genau im Datenblatt nachschauen.
</code></pre></div>
<h1 id="ansteuerung">Ansteuerung</h1>
<p>Die Displays lassen sich über ein 4- oder 8-Bit-Datenbus (Pins <code>D4</code> - <code>D7</code>
bzw. <code>D0</code> - <code>D7</code>) und 3 weitere Leitungen (<code>RS</code>, <code>E</code>, <code>R/W</code>) steuern. Die
Datenbusbreite läßt sich während der Initialisierung durch die <abbr title="Microcontroller Unit">MCU</abbr> festlegen. Damit kann man einige I/O-Pins sparen und
das Display komplett über einen 7 Bit breiten Port des Mikrocontrollers
ansteuern. Da im 4-Bit-Modus jeder Buchstabe und jeder Befehl mit zwei Takten
übertragen wird, ist die Ansteuerung etwas langsamer, was aber normalerweise
nicht weiter stört.</p>
<p>Zur Übertragung von Daten im 8-Bit-Modus werden die entsprechenden Signale auf
die Datenleitungen <code>D0</code> - <code>D7</code>, <code>R/W</code> und <code>RS</code> gelegt. Nun wird der Pegel von
<code>E</code> von low auf high und wieder auf low geändert. Dabei übernimmt das Display
die Daten mit der fallenden Taktflanke. Sollen Daten gelesen werden, wird der
Pegel von <code>E</code> von low auf high geändert, nun die Daten ausgelesen und der Pegel
von <code>E</code> wieder zurück auf low gesetzt. Im 4-Bit-Modus wird ebenso verfahren,
wobei hier zunächst das höherwertige Nibble (Bits 4-7) und dann im zweiten
Schritt das niederwertige Nibble (Bits 0 - 3) übertragen wird.</p>
<h1 id="befehlssatz">Befehlssatz</h1>
<p>Neben den Codes zur Darstellung des Displayinhalts gibt es einige Kommandos, mit
denen das Display gesteuert werden kann. Hierbei handelt es sich um Befehle zum
Ein- und Ausschalten, Positionieren des Cursors, etc.</p>
<p>In den Angaben zu den einzelnen Pins bedeutet 1 ein high-Pegel, also ein
5-Volt-Signal und 0 entsprechend einen low-Pegel. Wo ein <code>*</code> steht, ist es egal,
welches Signal anliegt. Dort, wo ein Buchstabe steht, ist die Funktion dieses
Signals in der Beschreibung erläutert.</p>
<h2 id="display-loschen-bzw-zurucksetzen">Display löschen bzw. zurücksetzen</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 0 0 0 0 0 0 1
</code></pre></div>
<p>Der Displayinhalt wird gelöscht und der Cursor auf die erste Position in der
ersten Zeile gesetzt.</p>
<h2 id="cursor-auf-startposition-setzen">Cursor auf Startposition setzen</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 0 0 0 0 0 1 *
</code></pre></div>
<p>Der Cursor wird auf die Startposition gesetzt. Falls der Displayinhalt geshiftet
wurde, wird auch der Shift zurückgesetzt.</p>
<h2 id="cursor-richtung-und-display-shift">Cursor-Richtung und Display-Shift</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 0 0 0 0 1 CD S
</code></pre></div>
<p>Dieser Befehl legt die Bewegungsrichtung des Cursors (<code>CD=0</code>: Bewegung nach
links, <code>CD=1</code>: Bewegung nach rechts) und den Display-Shift (<code>S=0</code>: kein Shift,
<code>S=1</code>: Display-Inhalt wird geshiftet) fest. Shift bedeutet, dass der gesamte
Inhalt des Displays um eine Position verschoben wird.</p>
<h2 id="display-zustand">Display-Zustand</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 0 0 0 1 P C B`
</code></pre></div>
<p>Mit diesem Befehl kann das Display ein- oder ausgeschaltet werden (<code>P=0</code>:
Display aus, <code>P=1</code>: Display an), es kann der Cursor angezeigt werden (<code>C=0</code>:
Cursor aus, <code>C=1</code>: Cursor an) und es kann der Cursor blinkend dargestellt werden
(<code>B=0</code>: ständig sichtbarer Cursor, <code>B=1</code>: blinkender Cursor).</p>
<h2 id="cursor-funktion">Cursor-Funktion</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 0 0 1 M SD * *
</code></pre></div>
<p>Mit diesem Befehl wird festgelegt, ob beim Schreiben eines Zeichens der Cursor
bewegt werden soll, oder ob der Display-Inhalt geshiftet werden soll (<code>M=0</code>:
Cursor bewegen, <code>M=1</code>: Display shiften) und, in welche Richtung geshiftet werden
soll (<code>SD=0</code>: nach links shiften, <code>SD=1</code>: nach rechts shiften)</p>
<h2 id="display-einstellungen">Display-Einstellungen</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 0 1 BW N F * *
</code></pre></div>
<p>Es kann festgelegt werden, ob die Daten in 2 mal 4-Bit-Häppchen oder auf einmal
als 8-Bit-Happen übertragen werden, (<code>BW=0</code>: 4-Bit-Bus, <code>BW=1</code>: 8-Bit-Bus),
wieviele Zeilen das Display anzeigt (<code>N=0</code>: 1 Zeile, <code>N=1</code>: 2 Zeilen) und
welcher Font verwendet wird (<code>F=0</code>: 5 × 7 Punkte, <code>F=1</code>: 5 × 10 Punkte)</p>
<h2 id="adresse-im-zeichenerzeugungsspeicher-setzen">Adresse im Zeichenerzeugungsspeicher setzen</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 1 A5 A4 A3 A2 A1 A0
</code></pre></div>
<p>Es wird festgelegt, dass beim Schreiben in das Datenregister mit dem nächsten
Befehl an der angegebenen Adresse in den Speicher der Zeichenerzeugung
geschrieben wird (um eigene Zeichen zu definieren).</p>
<h2 id="adresse-im-datenspeicher-setzen">Adresse im Datenspeicher setzen</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 0 1 A6 A5 A4 A3 A2 A1 A0
</code></pre></div>
<p>Es wird festgelegt, dass beim Schreiben in das Datenregister mit dem nächsten
Befehl an der angegebenen Adresse in den Speicher geschrieben wird, in dem der
Display-Inhalt abgelegt ist.</p>
<h2 id="busy-flag-und-adress-zahler-auslesen">Busy-Flag und Adress-Zähler auslesen</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 1 BF A6 A5 A4 A3 A2 A1 A0
</code></pre></div>
<p>Es werden der Busy-Flag (<code>BF=0</code>: Display kann Befehl entgegennehmen, <code>BF=1</code>:
Display ist beschäftigt) und der Addresscounter des zuletzt angesprochenen
Speichers ausgegeben.</p>
<h2 id="speicher-beschreiben">Speicher beschreiben</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
1 0 D7 D6 D5 D4 D3 D2 D1 D0
</code></pre></div>
<p>Die anliegenden Daten werden in den zuletzt ausgewählten Speicher geschrieben.</p>
<h2 id="speicher-auslesen">Speicher auslesen</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
1 1 D7 D6 D5 D4 D3 D2 D1 D0`
</code></pre></div>
<p>Es werden die Daten aus dem ausgewählten Speicher an der zuletzt festgelegten
Adresse ausgegeben.</p>
<h1 id="timing">Timing</h1>
<p>Fast alle an das Display übermittelten Befehle benötigen 40us zur
Ausführung. Ausnahmen sind die Befehle "Löschen bzw. zurücksetzen des Displays"
und "Cursor auf Startposition setzen". Diese benötigen 1,64ms zur
Ausführung. Diese Zeiten gelten für alle Displays, sofern diese intern mit einer
Frequenz von 250kHz arbeiten. Mir sind bisher aber keine Ausnahmen dazu
bekannt. Es kann aber immer anhand des Busy-Flag festgestellt werden, ob bereits
ein weiterer Befehl übermittelt werden kann.</p>
<h1 id="benutzerdefinierte-zeichen">Benutzerdefinierte Zeichen</h1>
<p>Es können 8 benutzerdenifierte Zeichen mit den Zeichencodes 0 bis 7 festgelegt
werden. Die Pixeldaten der Zeichen werden dazu in den Speicher des
Zeichengenerators geschrieben. Jedes Zeichen benötigt 8 Bytes, wobei jeweils nur
die Bits 0 bis 4 entsprechend den 5 Pixeln in einer Zeile relevant sind. Das
erste Byte beschreibt die oberste Zeile, das letzte die unterste.</p>
<h1 id="initialisierung-des-displays">Initialisierung des Displays</h1>
<p>Nach dem anlegen der Betriebsspannung bzw. nach einem Reset der MCU muss das
Display in einen definierten Zustand gebracht werden. Dazu wird folgende
Prozedur durchgeführt:</p>
<ul>
<li>Nach dem anlegen der Betriebsspannung ca. 15 ms warten, bis das Displays
bereit ist, Befehle entgegenzunehmen</li>
<li>Den Befehl 0x30 ("Display-Einstellungen") dreimal hintereinander schreiben
und jeweils 1,64ms warten (die Abfrage des Busy-Flag ist hier noch nicht
möglich). Das Display ist hier noch nicht im 4-Bit-Modus, daher wird nur das
höherwertige Nibble (Bits 4-7) übertragen, falls nicht alls 8 Datenleitungen
angeschlossen worden sind.</li>
<li>Falls auf 4-Bit umgestellt werden soll, nun den Befehl dazu geben</li>
<li>Display löschen</li>
</ul>
<h1 id="zeichensatz">Zeichensatz</h1>
<p>Der Zeichensatz dieser Displays entspricht im Wesentlichen dem
ASCII-Zeichensatz. Damit liegen die Ziffern '0' - '9' zwischen 0x30 und 0x39,
die Großbuchstaben 'A' - 'Z' zwischen 0x41 bis 0x5A und die Kleinbuchstaben
'a' - 'z' zwischen 0x61 bis 0x7A. Die anderen Zeichen können sich je nach
Hersteller unterscheiden und sind deshalb am besten im Datenblatt des Chips
bzw. des Displays nachzuschlagen.</p>HD44780 LC Display2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/hd44780-lc-display-2.html<h1 id="hardware">Hardware</h1>
<p>Many <abbr title="Liquid Crystal">LC</abbr> displays used today are based on a
HD44780 (or compatible) controller. See <a href="https://www.a-netz.de/blog/2007/08/avr-thermometer-2">AVR Thermometer</a> for example. They can
easily be interfaced to a microcontroller because of their simple parallel
interface. They can display letters, numbers and a few special characters in 5 ×
7 pixels. Additionally you can …</p><h1 id="hardware">Hardware</h1>
<p>Many <abbr title="Liquid Crystal">LC</abbr> displays used today are based on a
HD44780 (or compatible) controller. See <a href="https://www.a-netz.de/blog/2007/08/avr-thermometer-2">AVR Thermometer</a> for example. They can
easily be interfaced to a microcontroller because of their simple parallel
interface. They can display letters, numbers and a few special characters in 5 ×
7 pixels. Additionally you can program 8 characters by yourself.</p>
<h1 id="io-pins">I/O Pins</h1>
<p>The following is an overview of the i/o-pins of the display. The pin names are
the ones often used in the displays datasheets.</p>
<div class="highlight"><pre><span></span><code>D0 - D7 bidirectional data
RS select data or instruction register
low: instruction register if writing, busy flag and address counter
when reading
high: data register to read and write display contents
R/W select data direction, i.e. read or write
high: read out the selected register
low: Write to the selected register
E This pin is used to clock the data transfer
low → high: if reading the state of the RS and R/W-Line are taken over,
if writing the state of the data lines is taken over
high → low: if reading the data on the data lines is correct until this
transition occurs
VCC Supply, often 5V
GND Ground
VEE Contrast. It is often controlled by a potentiometer between VCC and GND
with its middle pin connected to VEE. Attention: There are also
displays which need a negative contrast voltage on this pin
</code></pre></div>
<h1 id="display-control">Display Control</h1>
<p>The display can be controlled over a 4- or 8-bit data bus (pin <code>D4</code> - <code>D7</code>) and
3 status lines (<code>RS</code>, <code>E</code>, <code>R/W</code>). The width of the data bus can be selected
during the initialization of the display by the <abbr title="microcontroller
unit">mcu</abbr> . So it is possible to save a few i/o-pins and control the
display with only 7 i/o pins. In 4 bit mode every character needs 2 clock cycles
so the display is a little bit slower than in 8 bit mode. But in most
circumstances that does not matter.</p>
<p>To transmit data in 8 bit mode the data lines are set according to the bit
pattern of the character or command, <code>R/W</code> is set to low and <code>RS</code> according to
the right register. Now the level of <code>E</code> is brought from low to high and back to
low. The data is taken over to the display with the falling edge of the <code>E</code>
signal. For reading data it is the same procedure with the E signal but the
<code>R/W</code> signal must be set high. In 4 bit mode it is quite the same as in 8 bit
mode but at first the high nibble (bit 4-7) is transmitted and then the lower
nibble (bit 0-3) in a second clock cycle.</p>
<h1 id="command-set">Command Set</h1>
<p>Apart from the codes to control the display contents there are a few commands to
control the display mode. These are commands to switch the display on or off, to
position the cursor, etc.</p>
<p>A 1 at a pin means a high level, i.e. a 5 volts signal, a 0 stands for low. The
level of a pin marked with * stands for "don't care". A function of a pin
marked with a character is described in the text of this command.</p>
<h2 id="clear-display-and-reset">Clear Display and Reset</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 0 0 0 0 0 0 1
</code></pre></div>
<p>The content of the display is erased and the cursor is set back to the first
character in the first row.</p>
<h2 id="set-cursor-to-start-position">Set Cursor to Start Position</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 0 0 0 0 0 1 *
</code></pre></div>
<p>The Cursor is set to the first character position in the first row. If the
display contents are shifted, the shifting function is switched off.</p>
<h2 id="cursor-direction-and-display-shift">Cursor Direction and Display Shift</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 0 0 0 0 1 CD S
</code></pre></div>
<p>This command sets the moving direction of the cursor (<code>CD=0</code>: move to the left,
<code>CD=1</code>: move to the right) and the display shift (<code>S=0</code>: no shift, <code>S=1</code>:
display contents are shifted). Display shift means that the whole display
content is moved by one character.</p>
<h2 id="display-mode">Display Mode</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 0 0 0 1 P C B
</code></pre></div>
<p>With this command the display can be switched on or off (<code>P=0</code>: display off,
<code>P=1</code>: display on), the cursor can be displayed (<code>C=0</code>: cursor off, <code>C=1</code>:
cursor on) and the cursor can be set to blinking (<code>B=0</code>: cursor always visible,
<code>B=1</code>: blinking cursor).</p>
<h2 id="cursor-function">Cursor Function</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 0 0 1 M SD * *
</code></pre></div>
<p>This command can be used to select whether the cursor should be moved after ever
character written to the display or whether the display contents are shifted
(<code>M=0</code>: move cursor, <code>M=1</code>: shift display) and which direction to shift the
display (<code>SD=0</code>: shift to the left, <code>SD=1</code>: shift to the right).</p>
<h2 id="display-settings">Display Settings</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 0 1 BW N F * *
</code></pre></div>
<p>It is possible to select if the data bus width is 4 bit or 8 bit (<code>BW=0</code>: 4 bit
bus, <code>BW=1</code>: 8 bit bus), how much rows the display can show (<code>N=0</code>: 1 row,
<code>N=2</code>: 2 rows) und what font should be used (<code>F=0</code>: 5 × 7 pixel, <code>F=1</code>: 5 × 10
pixel)</p>
<h2 id="address-for-character-generator-memory">Address for Character Generator Memory</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 1 A5 A4 A3 A2 A1 A0
</code></pre></div>
<p>The address for the byte written next to character generator memory is selected
(for creating user defined character).</p>
<h2 id="address-in-data-memory">Address in Data Memory</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 0 1 A6 A5 A4 A3 A2 A1 A0
</code></pre></div>
<p>The address for the byte written next to data generator memory is selected (for
writing characters to the display).</p>
<h2 id="read-busy-flag-and-address-counter">Read Busy-Flag and Address Counter</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
0 1 BF A6 A5 A4 A3 A2 A1 A0
</code></pre></div>
<p>The busy flag (<code>BF=0</code>: display can process the next command) <code>BF=1</code>: display is
busy) and the address counter of the recently used memory locationis returned.</p>
<h2 id="write-memory">Write Memory</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
1 0 D7 D6 D5 D4 D3 D2 D1 D0
</code></pre></div>
<p>The attached data is written to the at last selected memory.</p>
<h2 id="read-memory">Read Memory</h2>
<div class="highlight"><pre><span></span><code>RS R/W D7 D6 D5 D4 D3 D2 D1 D0
1 1 D7 D6 D5 D4 D3 D2 D1 D0
</code></pre></div>
<p>The data of the memory selected before is returned.</p>
<h1 id="timing">Timing</h1>
<p>Nearly all commands transmitted to the display need 40us for
execution. Exceptions are the commands "Clear Display and Reset" and "Set Cursor
to Start Position" These commands need 1,64ms for execution. These timings are
valid for all displays working with an internal clock of 250kHz. But I do not
know any displays that use other frequencies. Any time you can use the busy flag
to test if the display is ready to accept the next command.</p>
<h1 id="user-defined-characters">User Defined Characters</h1>
<p>It is possible to define 8 characters by yourself. The pixel data of these
characters is written to the character generator memory. Each character needs 8
byte but only the bits 0 to 4 of each byte are used to define the 5 pixels in
every row. The first byte stands for the topmost row, the last one for the
bottom row.</p>
<h1 id="initialization-of-the-display">Initialization of the Display</h1>
<p>After attaching the supply voltage or after a reset you should bring the display
to a defined state. This can be done with the following procedure:</p>
<ul>
<li>After attaching supply voltage wait approximately 15 ms until the display is
ready to execute commands</li>
<li>Execute the command 0x30 ("Display Settings") three times (wait 1,64ms after
each command, the busy flag cannot be queried now). The display is in 8 bit
mode, so if you have only connected 4 data pins you should only transmit the
higher nibble of each command.</li>
<li>If you want to use the 4 bit mode, now you can execute the command to switch
over to this mode now.</li>
<li>Execute the "clear display" command</li>
</ul>
<h1 id="character-set">Character Set</h1>
<p>The character set of these displays corresponds for letters and numbers to the
ASCII character set. So the digits '0' - '9' are between 0x30 and 0x39, the
upper case letters 'A' - 'Z' between 0x41 and 0x5A and lower case letters 'a' -
'z' between 0x61 and 0x7A. The other character codes can differ between
producers and should be looked up in the datasheet of the controller chip or
display used.</p>Intel Centrino IPW2200 Monitor Mode unter Linux2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/intel-centrino-ipw2200-monitor-mode-unter-linux.html<p>Nach meinen bisherigen Versuchen unterstützt der im Linux Kernel enthaltene
Treiber für den Intel IWP2200 Centrino WLAN-Chipsatz (zumindest bis Version
2.6.15.1) nicht den Monitor Mode. Man kann diesen Modus aber durch
Selbstkompilieren der nötigen Treiber aktivieren und dann Tools wie Kistmet
verwenden, um WLANs auf Schwachstellen hin …</p><p>Nach meinen bisherigen Versuchen unterstützt der im Linux Kernel enthaltene
Treiber für den Intel IWP2200 Centrino WLAN-Chipsatz (zumindest bis Version
2.6.15.1) nicht den Monitor Mode. Man kann diesen Modus aber durch
Selbstkompilieren der nötigen Treiber aktivieren und dann Tools wie Kistmet
verwenden, um WLANs auf Schwachstellen hin zu untersuchen.</p>
<h1 id="benotigte-treiber-software">Benötigte Treiber & Software</h1>
<p>Man benötigt die folgenden Softwarepakete, um den WLAN-Treiber selbst zu
übersetzen:</p>
<ul>
<li>Die Quellen des Linux-Kernel: <a href="http://www.kernel.org">http://www.kernel.org</a></li>
<li>Den Sourcecode des WLAN-Treibers: <a href="http://ipw2200.sourceforge.net">http://ipw2200.sourceforge.net</a></li>
<li>Den Sourcecode des IEEE802.11
WLAN-Subsystems: <a href="http://ieee80211.sourceforge.net">http://ieee80211.sourceforge.net</a></li>
<li>Die aktuelle Firmware für den IPW2200
Chipsatz: <a href="http://ipw2200.sourceforge.net">http://ipw2200.sourceforge.net</a></li>
</ul>
<h1 id="vorgehensweise">Vorgehensweise</h1>
<h2 id="kernel-konfigurieren">Kernel konfigurieren</h2>
<p>Zunächst wird der Kernel konfiguriert (zum Beispiel mit <code>make menuconfig</code>), so
als wolle man die im Kernel integrierten WLAN-Treiber als Modul verwenden.</p>
<h2 id="ieee-80211-subsystem">IEEE 802.11 Subsystem</h2>
<p>Nun wird das IEEE 802.11 WLAN-Subsystem übersetzt. Zunächst müssen aber die
entsprechenden Bestandteile aus den Kernel-Quellen durch den Aufruf des Skripts
<code>remove-old</code> entfernt werden. Dann kann der Sourcecode mit <code>make install</code> als
root übersetzt und installiert werden.</p>
<h2 id="wlan-treiber">WLAN-Treiber</h2>
<p>Nachdem das WLAN-Subsystem installiert wurde, kann man den eigentlichen Treiber
übersetzen. Auch hier muss zunächst wieder das Skript <code>remove-old</code> ausgeführt
werden, um Bestandteile des Treibers im Kernel durch andere Versionen zu
ersetzen. Eventuell ist das Skript nicht als ausführbar markiert, dies kann man
dann einfach mit <code>chmod +x remove-old</code> ändern. Dann wird der Sourcecode
ebenfalls mit <code>make install</code> als root übersetzt und installiert.</p>
<h2 id="chipsatz-firmware">Chipsatz-Firmware</h2>
<p>Nun muss nur noch die Firmware der Karte / des Chipsatzes in das Verzeichnis
<code>/usr/lib/hotplug/firmware/</code> entpackt werden. Die einzelnen <code>*.fw</code>-Dateien
müssen direkt in diesem Verzeichnis, nicht in einem Unterverzeichnis liegen,
damit der hotplug-Prozess sie dort bei Bedarf finden kann.</p>
<h2 id="laden-der-module">Laden der Module</h2>
<p>Nun sollten zunächst die bisherigen Treiber (das <code>ipw2200</code>-Modul und alles, was
mit <code>ieee80211</code> beginnt), sofern geladen (kann man mit <code>lsmod</code> nachschauen) mit
<code>rmmod MODUL</code> entladen werden. Dann muss nur noch (einmalig) die
Abhängigkeitsdatenbank der Kernelmodule mit <code>depmod -a</code> aktualisiert werden und
die neuen Module können mit einem <code>modprobe ipw2200</code> (die <code>ieee80211</code>-Module
werden dabei automatisch mitgeladen) geladen werden und der Monitor-Mode sollte
funktionieren. :) Die Software <code>kismet</code> aktiviert den Modus selbstständig,
ansonsten kann man ihn auch mit <code>iwconfig DEVICE mode monitor</code> aktivieren, wobei
DEVICE die von <code>iwconfig</code> ausgegebene WLAN-Schnittstelle - meist <code>eth1</code> oder
<code>wlan0</code> - ist.</p>
<h1 id="links">Links</h1>
<ul>
<li><a href="http://docs.lucidinteractive.ca/index.php/Cracking_WEP_and_WPA_Wireless_Networks">Entschlüsseln von WEP-Verbindungen</a></li>
</ul>Nokia Headset-Umbau2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/nokia-headset-umbau.html<p>Mein Ziel war es, eine 3,5mm Klinkenbuchse einzubauen, so dass man jeden
gängigen Kopfhörer anschliessen kann und trotzdem noch das Mikrofon und die
Rufannahmetaste funktionsfähig bleiben.</p>
<h1 id="offnen-des-gehauses">Öffnen des Gehäuses</h1>
<p>Zunächst habe ich das Gehäuse geöffnet, in dem auch das Mikrofon eingebaut
ist. Bei meinem Headset war das Gehäuse verklebt …</p><p>Mein Ziel war es, eine 3,5mm Klinkenbuchse einzubauen, so dass man jeden
gängigen Kopfhörer anschliessen kann und trotzdem noch das Mikrofon und die
Rufannahmetaste funktionsfähig bleiben.</p>
<h1 id="offnen-des-gehauses">Öffnen des Gehäuses</h1>
<p>Zunächst habe ich das Gehäuse geöffnet, in dem auch das Mikrofon eingebaut
ist. Bei meinem Headset war das Gehäuse verklebt, es lies sich aber mit einem
scharfen Messer aufhebeln. Dabei brechen leider die Rastnasen ab, die das
Gehäuse auch ohne Kleber zusammenhalten würden. Man muss es also später auf
jeden Fall wieder verkleben. Ich habe aber auch schon andere Versionen des
Headsets gesehen, die mit 4 kleinen Schrauben zusammengehalten wurde.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/nokia-headset-01.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/nokia-headset-01.jpg"
title="Das Innere des Headsets"
alt="Das Innere des Headsets">
</a>
<figcaption>Das Innere des Headsets</figcaption>
</figure>
<p>Im inneren befindet sich eine kleine Platine mit einem Controller drauf. Diese
Platine ist ebenfalls mit Kleber fixiert und muss gelöst werden, um an die
Anschlüsse auf der Unterseite heranzukommen.</p>
<h1 id="anschluss-der-klinkenbuchse">Anschluss der Klinkenbuchse</h1>
<p>Auf der Platine befinden sich 4 Lötpunkte, die mit R+, R-, L+ und L-
gekennzeichnet sind und an denen die Ohrstöpsel angeschlossen sind. Diese lötet
man nun ab. Dabei sollte man darauf achten, dass die Anschlusskabel, die zum
Handy führen, nicht beschädigt oder abgelötet werden.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/nokia-headset-02.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/nokia-headset-02.jpg"
title="Die Lötpunkte auf der Rückseite der
Platine"
alt="Die Lötpunkte auf der Rückseite der
Platine">
</a>
<figcaption>Die Lötpunkte auf der Rückseite der
Platine</figcaption>
</figure>
<p>Nun habe ich die Rückseite des Gehäuses entsprechend den Pin-Abständen einer
Klinkenbuchse durchbohrt, die Beinchen der Buchse durchgesteckt, auf der
Innenseite des Gehäuses umgebogen und drei kurze Kabel (ca. 3 bis 4cm)
angelötet. Die Kabel dürfen nicht zu lang sein, da sonst nicht genug Platz im
Gehäuse bleibt, um sie unterzubringen. Wenn sie zu kurz sind, wird es hingegen
immer schwieriger, sie anzulöten.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/nokia-headset-03.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/nokia-headset-03.jpg"
title="Passende Löcher für die Klinkenbuchse
bohren"
alt="Passende Löcher für die Klinkenbuchse
bohren">
</a>
<figcaption>Passende Löcher für die Klinkenbuchse
bohren</figcaption>
</figure>
<p>Dann kann man die Kabel auf der Platine angelöten. Da eine Klinkenbuchse nur
3-polig ist, muss man durch ein zusätzliches Kabel die Punkte R- und L-
miteinander verbinden. Dann wird der Anschluss L+ mit dem Kontakt verbunden, der
an der Klinkenbuchse ganz vorne ist, der Anschluss R+ mit dem mittleren der
Klinkenbuchse und R- und L- zusammen mit dem hinteren Anschluss verbunden.</p>
<h1 id="zusammenbau">Zusammenbau</h1>
<p>Nun kann man die Kabel vorsichtig zusammenrollen und unter der Platine
unterbringen. Bevor man das Gehäuse wieder verschliesst, sollte man das
Anschlusskabel, welches zum Handy führt, wieder festkleben, damit es bei
Zugbelastung nicht von der Platine reisst. Das Gehäuse lässt sich dann ganz gut
mit Kleber verschliessen, der auch für den Plastik-Modellbau verwendet wird.</p>
<p>Von nun an kann man in bester Qualität und mit seinem Lieblingskopfhörer Musik
vom Handy hören und auch darüber telefonieren.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/nokia-headset-04.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/nokia-headset-04.jpg"
title="Nach dem Umbau"
alt="Nach dem Umbau">
</a>
<figcaption>Nach dem Umbau</figcaption>
</figure>Platinen herstellen2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/platinen-herstellen.html<p>Hier eine Zusammenfassung der Schritte, die nötig sind, um eigene Platinen
herzustellen.</p>
<h1 id="erstellung-des-layouts">Erstellung des Layouts</h1>
<p>Für Hobby-Zwecke ist die Software Eagle (kostenlos
bei <a href="http://www.cadsoft.de">Cadsoft</a> für Windows und Linux zu erhalten) gut zu
gebrauchen. Einzige Einschränkung der für nicht-kommerzielle Verwendung
kostenlosen Version ist die nutzbare Platinenfläche von 8 x 10 cm …</p><p>Hier eine Zusammenfassung der Schritte, die nötig sind, um eigene Platinen
herzustellen.</p>
<h1 id="erstellung-des-layouts">Erstellung des Layouts</h1>
<p>Für Hobby-Zwecke ist die Software Eagle (kostenlos
bei <a href="http://www.cadsoft.de">Cadsoft</a> für Windows und Linux zu erhalten) gut zu
gebrauchen. Einzige Einschränkung der für nicht-kommerzielle Verwendung
kostenlosen Version ist die nutzbare Platinenfläche von 8 x 10 cm.</p>
<p>Bei der Erstellung des Layouts sollte man zwei Dinge beachten. Um die Ätzlösung
nicht zu schnell zu verbrauchen und die Umwelt zu schonen (Kupfer ist ein
Schwermetall und in gelöster Form ziemlich giftig, also nur beim Schadstoffmobil
abgeben, niemals in den Ausguss schütten!), sollte man die Zwischenräume
zwischen den Leiterbahnen auch mit Kupfer auffüllen und nur dünne
Isolationsstege freilassen. Dazu kann man in Eagle einfach ein Polygon über die
gesamte Platine legen. Beim nächsten Klick auf "Ratsnest" werden automatisch
Kupferflächen und Isolationsstege berechnet.</p>
<p>Bei der Layouterstellung sollte man auch schon daran denken, dass man die
Platine später auch noch bohren und bestücken muss. Daher nur Bauteile
verwenden, die Kupferringe und Bohrlöcher vorsehen, die groß genug sind. Die
Widerstände in der Package 0204V etwa sehen zwar schön klein aus und passen auch
genau zu den üblichen 1/4W-Typen, nach dem Bohren ist der Restring aber so
knapp, das der leicht kaputtgeht und sich schlecht löten lässt. Ähnlich verhält
es sich mit einigen Kondensatoren. Leider lässt sich die Größe der Pads nicht
einzeln anpassen, sie ist in der Definition der Bauteile festgelegt. Wenn also
garnichts anderes hilft, muss man eben eine eigene Library mit passenden
Bauteilen anlegen. Wie so etwas geht, ist
im <a href="ftp://ftp.cadsoft.de/eagle/program/4.16r1/manual-ger.pdf">Eagle Manual</a> gut
erklärt und demonstriert.</p>
<h1 id="erstellung-der-belichtungsvorlage">Erstellung der Belichtungsvorlage</h1>
<p>Dies ist meiner Meinung nach der für den Hobbyisten schwierigste Teil der
Herstellung. Taugt die Belichtungsvorlage nichts, so wird auch die Platine
nichts. Es gibt einige immer wieder erwähnte Verfahren, die in vielen Fällen
wohl auch funktionieren (Ausdruck mit Laser- oder Tintendrucker, auf
Transparentfolie, auf Backpapier oder Seiten aus dem "Spiegel", etc.). Ich habe
mich aber immer wieder darüber geärgert, dass die Verfahren nicht zuverlässig
funktionieren, was man meist erst nach dem Ätzen der Platine feststellt, so dass
eine Menge Arbeit umsonst war.</p>
<p>Seit einiger Zeit lasse ich mir daher die Layouts meiner Platinen auf
Belichtungsfilm ausgeben, wie er von Druckereien zur Herstellung von
Druckvorlagen verwendet wird. Dabei handelt es sich um Transparentfolie mit
schwarzem Aufdruck in ziemlich hoher Auflösung, der tatsächlich völlig
Lichtdicht ist. Anscheinend kann man solche Filme bei den meisten Druckereien
anfertigen lassen, meist auch zu recht geringen Preisen. Ich bestelle meine
bisher bei <a href="http://www.cadgrafik-bauriedl.de">CAD Bauriedl</a> (unter CAD/LTP).</p>
<h1 id="belichten-der-platine">Belichten der Platine</h1>
<p>Zur Belichtung benötigt man - jedenfalls bei kleinformatigen Platinen keinen
Belichtungsrahmen. Mir genügt bisher eine einfach Halogenlampe mit 100W. Dieser
habe ich den Glasschirm entfernt, damit möglichst viel UV-Licht die Platine
erreicht. Zur Belichtung wird die Vorlage auf die fotopositiv beschichtete
Platine gelegt und mit einer möglichst dünnen Glasplatte darüber fixiert. (Die
in rahmenlosen Fotohaltern verwendeten Gläser sind gut geeignet und scheinen um
so UV-durchlässiger und dünner zu sein, je billiger die Halter sind). Die
Belichtung dauert bei mir aufgrund des insgesamt doch recht geringen UV-Anteile
ca. eine halbe Stunden bei einem Abstand von 25cm zwischen Lampe und
Platine. Die optimalen Belichtungszeiten muss aber jeder selbst durch
experimentieren herausfinden, da sie von Lampe, Glas und Platinenbeschichtung
abhängen.</p>
<p>Ich vermute, dass die Platinenbeschichtung auch durch Wärme verändert wird. Wird
die Platine beim Belichten also zu warm, so kann man einen kleinen Lüfter (etwa
aus einem defekten PC-Netzteil) danebenstellen. Ebenso scheint zu lange Lagerung
die Platinenbeschichtung zu verändern. Daher möglichst immer "frische" Platinen
verwenden. Die meisten Conrad-Läden haben wohl einen so großen Umsatz an
Platinenmaterial, so dass die Platinen dort meist brauchbar sind, ebenso das bei
Reichelt bestellte Material.</p>
<h1 id="entwickeln">Entwickeln</h1>
<p>Zur Entwicklung wird die Platine in eine Natriumhydroxid-Lösung (Natronlauge)
gelegt. Nach kurzer Zeit sollten sich dann die belichteten Stellen umfärben und
dann ablösen. Sobald das Kupfer überall dort sichtbar ist, wo es zu sehen sein
soll, die Platine unter Wasser abspülen und ins Ätzbad damit.</p>
<p>Die Entwicklerlösung setze ich für jede Entwicklung neu an, da die Lösung
angeblich nicht lange gelagert werden kann. Das Natriumhydroxid (NaOH) gibt es
bei Reichelt oder Conrad zu kaufen. Die zum Entwickeln benötigten Mengen sind
jedoch sehr gering, so dass es schwierig ist, sie genau zu dosieren. Laut
Anleitung soll man einen Messlöffel (10g) auf ein Liter Wasser (am besten
destilliertes) geben. Da man für eine Platine aber meist mit 100ml auskommt,
wird es schon schwierig, 1g genau zu dosieren. Ist die Lösung zu konzentriert,
so lösen sich ziemlich schnell auch die unbelichteten Stellen der Platine
ab. Daher lieber zunächst zu gering dosieren. Wenn sich dann beim Entwickeln
garnichts tut, nimmt man die Platine wieder heraus, löst noch etwas NaOH auf und
entwickelt weiter. Dabei muss nur darauf geachtet werden, dass keine NaOH-Krümel
mehr in der Lösung schwimmen. Diese setzen sich sonst nämlich gerne auf eine
besonders wichtige Stelle der Platine und entfernen dort die Beschichtung
restlos.</p>
<h1 id="atzen">Ätzen</h1>
<p>Zum Ätzen verwende ich Eisen-III-Chlorid. Das gibt es recht günstig zu kaufen,
hat aber den Nachteil, dass es, in Wasser gelöst, eine schlammfarbene "Brühe"
ergibt, so dass man die Platine beim Ätzen nicht sehen kann. Außerdem färbt es
sehr stark und wenn es auf die Kleidung tropft, entstehen dort nach einiger Zeit
Löcher, also zum Ätzen keine guten Sachen anziehen...</p>
<p>Damit der Ätzvorgang nicht zu lange dauert, ist es hilfreich, die Ätzlösung zu
erwärmen. Außerdem sollte die Lösung beim Ätzen umgewälzt werden. Ich verwende
dazu ein altes Einmachglas, welches ich in einen Kochtopf mit Wasser stelle und
so erwärme. In die Mikrowelle stellen wäre auch möglich, hab ich aber nicht
ausprobiert. Dann die Platine hinein, Deckel drauf und schütteln. Aber
aufpassen: Es bildet sich anscheinend ein leichter Überdruck, so dass immer
etwas Lösung unter dem Deckel heraustropft. Nach dem Ätzen dann die Platine
gründlich unter Wasser abspülen.</p>
<h1 id="bohren">Bohren</h1>
<p>Das Bohren der Platine ist eine aufwenige Angelegenheit und wohl nur mit
vernünftigem Werkzeug zu machen. Zu diesem Zweck hab ich glücklicherweise
Zugriff auf eine Bohr- und Fräsmaschine mit vernünftigem Bohrständer. Ohne
diesen ist es ziemlich schwierig, exakte Löcher zu bohren. Soviel ich weiss,
gibt es aber für die Kleinbohrmaschinen von Proxon oder Dremel entsprechende
Bohrständer, mit denen Platinen ganz gut gelingen sollten.</p>
<p>Um den Verschleiss an Bohrern gering zu halten, sollte man unbedingt
Hartpapier-Material verwenden, kein Epoxy! Epoxy-Platinen enthalten Glasfasern
und schaffen es innerhalb kürzester Zeit, jeden Bohrer und jedes Sägeblatt zur
Aufgabe zu bewegen.</p>
<p>Um das Bohren zu vereinfachen, gibt es in Eagle ein Userscript
namensdrillaid. Dieses sollte man, nachdem das Platinenlayout fertig ist, einmal
aufrufen. Es sorgt dafür, dass die Bauteil-Pads bis auf ein ganz kleines Loch
(ca. 0,3mm) ausgefüllt sind. Dieses kleine Loch hilft beim Bohren dann, den
Bohrer zu zentrieren.</p>
<h1 id="verzinnen">Verzinnen</h1>
<p>Damit habe ich noch keine Erfahrung. Soviel ich weiss, gibt es die Möglichkeit,
die Platine in einer Lösung auf chemischem Wege zu verzinnen. Damit ist die
Platine vor Umwelteinflüssen besser geschützt und lässt sich leichter
löten. Lässt man die Platine ungeschützt, so oxidiert sie schnell und dann wird
das löten schwieriger. Eine Alternative ist es, die Platine mit in Spiritus
aufgelöstem Kolophonium, einem Flussmittel, einzustreichen. Dadurch wird die
Platine etwas klebrig, wird aber auch ganz gut geschützt. Ich weiss allerdings
nicht, wie lange das Kolophonium die Platine gdavor schützt, zu oxidieren.</p>
<h1 id="bestucken">Bestücken</h1>
<p>Dazu muss ich wohl nicht mehr viel sagen: Bauteile rein, Platine umdrehen und
festlöten... Umdrehen? Nach einigen Versuchen mit SMD-Bauteilen habe ich die
inzwischen recht gern. Einerseits werden die Platinen kleiner und außerdem spart
man sich da lästige Bohren. Allerdings verwende ich bisher nur SMD-ICs, das
restliche Hühnerfutter (Kondensatoren, Widerstände, etc) ist noch bedrahtet. Um
die SMD-ICs zu verarbeiten, verzinne ich zuerst die Pads auf der Platine, setze
dann die ICs darauf und tippe jeden Pin mit dem Lötkolben kurz an. So lassen
sich die ICs sehr einfach und schnell verarbeiten. Zum Üben eignen sich zunächst
auch gut alte Platinen aus Computern, etc. von denen man die SMD-ICs erst
entlötet und dann versucht, wieder anzulöten.</p>
<h1 id="fazit">Fazit</h1>
<p>Wie man sieht, ist es zwar mit einigem Arbeitsaufwand verbunden, ordentliche
Platinen herzustellen, der finanzielle Aufwand hält sich aber doch in Grenzen
und es sieht halt einfach professioneller aus, eine geätzte Platine zu
verwenden, als alles freifliegend oder auf Lochraster aufzubauen.</p>Rezept Apfelstrudel2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/rezept-apfelstrudel.html<h1 id="zutaten">Zutaten</h1>
<p>Für den Teig:</p>
<ul>
<li>2 Eigelb</li>
<li>80ml Wasser</li>
<li>4-5 EL Öl</li>
<li>200g Mehl</li>
</ul>
<p>Für die Füllung:</p>
<ul>
<li>1,5kg Äpfel</li>
<li>2 TL Zimt</li>
<li>100g Zucker</li>
<li>40g kleingeraspelte Mandeln</li>
<li>40g Rosinen</li>
</ul>
<h1 id="zubereitung">Zubereitung</h1>
<p>Die Zutaten für den Teig vermengen, gut durchkneten, in zwei gleichgroße
Portionen aufteilen und jeweils auf einem Küchentuch sehr dünn …</p><h1 id="zutaten">Zutaten</h1>
<p>Für den Teig:</p>
<ul>
<li>2 Eigelb</li>
<li>80ml Wasser</li>
<li>4-5 EL Öl</li>
<li>200g Mehl</li>
</ul>
<p>Für die Füllung:</p>
<ul>
<li>1,5kg Äpfel</li>
<li>2 TL Zimt</li>
<li>100g Zucker</li>
<li>40g kleingeraspelte Mandeln</li>
<li>40g Rosinen</li>
</ul>
<h1 id="zubereitung">Zubereitung</h1>
<p>Die Zutaten für den Teig vermengen, gut durchkneten, in zwei gleichgroße
Portionen aufteilen und jeweils auf einem Küchentuch sehr dünn (ca. 3mm dick)
ausrollen.</p>
<p>Die Äpfel schälen, in kleine Würfel schneiden und mit Mandeln und Rosinen
vermengen.</p>
<p>Den Teig mit Zimt und Zucker bestreuen und mit der Apfelfüllung belegen. Nun den
Teig zu einer Rolle zusammenrollen und die Ränder zusammendrücken. Nun den
Strudel mit ein bisschen Öl bestreichen und ca. eine Stunde bei 200° (Umluft
180°) backen.</p>
<p>Schmeckt gut mit warmer Vanillesauce.</p>Rezept Einfache Weihnachtsplätzchen2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/rezept-einfache-weihnachtsplatzchen.html<p>Rezept für 3 Bleche.</p>
<h1 id="zutaten">Zutaten</h1>
<p>Für die Plätzchen</p>
<ul>
<li>500 Mehl</li>
<li>250g Butter</li>
<li>200g Zucker</li>
<li>3 Eier Klasse M</li>
<li>1/2 Päckchen Vanillezucker</li>
<li>1 TL Kakaopulver</li>
</ul>
<p>Zum Verzieren (je nach Geschmack, siehe Rezept)</p>
<ul>
<li>Puderzucker</li>
<li>gehackte Mandeln</li>
<li>groben Zucker</li>
<li>Kouvertüre</li>
</ul>
<h1 id="zeitbedarf">Zeitbedarf</h1>
<p>Etwa 45 - 60 Minuten.</p>
<h1 id="zubereitung">Zubereitung</h1>
<p>Mehl, Butter, Eiern und Vanillezucker zu …</p><p>Rezept für 3 Bleche.</p>
<h1 id="zutaten">Zutaten</h1>
<p>Für die Plätzchen</p>
<ul>
<li>500 Mehl</li>
<li>250g Butter</li>
<li>200g Zucker</li>
<li>3 Eier Klasse M</li>
<li>1/2 Päckchen Vanillezucker</li>
<li>1 TL Kakaopulver</li>
</ul>
<p>Zum Verzieren (je nach Geschmack, siehe Rezept)</p>
<ul>
<li>Puderzucker</li>
<li>gehackte Mandeln</li>
<li>groben Zucker</li>
<li>Kouvertüre</li>
</ul>
<h1 id="zeitbedarf">Zeitbedarf</h1>
<p>Etwa 45 - 60 Minuten.</p>
<h1 id="zubereitung">Zubereitung</h1>
<p>Mehl, Butter, Eiern und Vanillezucker zu einem Teig verkneten. Teig in Protionen
teilen und unter die eine Hälfte das Kakaopulver kneten. Die Portionen einige
Zeit kühl stellen.</p>
<p>Teig portionsweise etwa 0,5cm dick ausrollen und Plätzchen ausstechen.Nun kann
die Oberseite mit Eiweiß bestrichen und mit grobem Zucker, gehackten Mandeln,
o.ä. verziert werden. Nun die Plätzchen auf der mittleren Schiene 12 bis 15
Minuten bei 200°C (Umluft 180°C) backen.</p>
<p>Nachdem die Plätzchen abgekühlt sind, können sie mit Zuckerguss oder Kouvertüre
verziert werden.</p>Rezept Fischragout2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/rezept-fischragout.html<h1 id="zutaten">Zutaten</h1>
<ul>
<li>300-400g Fischfilet</li>
<li>etwas Zitronensaft</li>
<li>1 Zwiebel</li>
<li>30g Butter</li>
<li>1/8 l Weißwein</li>
<li>1 Becher Crème Frâiche</li>
<li>1-2 EL Gehackte Kräuter (Petersilie, Dill)</li>
</ul>
<h1 id="zubereitung">Zubereitung</h1>
<p>Das Fischfilet waschen, trocknen, mit Zitronensaft beträufeln und etwas ziehen
lassen. Dann abtrocknen, salzen und in mundgerechte Stücke
zerschneiden. (tiefgefrorenen Fisch schon vor dem Auftauen zerschneiden …</p><h1 id="zutaten">Zutaten</h1>
<ul>
<li>300-400g Fischfilet</li>
<li>etwas Zitronensaft</li>
<li>1 Zwiebel</li>
<li>30g Butter</li>
<li>1/8 l Weißwein</li>
<li>1 Becher Crème Frâiche</li>
<li>1-2 EL Gehackte Kräuter (Petersilie, Dill)</li>
</ul>
<h1 id="zubereitung">Zubereitung</h1>
<p>Das Fischfilet waschen, trocknen, mit Zitronensaft beträufeln und etwas ziehen
lassen. Dann abtrocknen, salzen und in mundgerechte Stücke
zerschneiden. (tiefgefrorenen Fisch schon vor dem Auftauen zerschneiden, das
geht einfacher)</p>
<p>Die Zwiebel würfeln und in der Butter andünsten. Den Fisch hinzugeben, mit dem
Weisswein ablöschen und 10 bis 12 Minuten gar dünsten.</p>
<p>Den Fisch vorsichtig aus dem Sud herausnehmen und warm stellen. Die Crème
Frâiche und die Kräuter unterrühren und mit Pfeffer, Salz und Speisewürze
(Maggi-Würze) abschmecken. Kurz aufkochen lassen und den Fisch wieder dazugeben.</p>
<p>Als Beilage passen dazu Reis oder Salzkartoffeln und ein grüner Salat.</p>Rezept Hefezopf2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/rezept-hefezopf.html<h1 id="zutaten">Zutaten</h1>
<ul>
<li>500g Mehl</li>
<li>20g frische Hefe bzw. 1 Päckchen Trockenhefe</li>
<li>60 - 80g Zucker</li>
<li>1 - 2 Eier</li>
<li>80 - 100g Butter oder Margarine</li>
<li>250 ml Milch</li>
<li>1 Prise Salz</li>
<li>etwas Eiweis</li>
<li>etwas grober Zucker (Hagelschlag)</li>
</ul>
<h1 id="zeitbedarf">Zeitbedarf</h1>
<p>Ca. 15 Minuten zum Bereiten des Teiges, 1 Stunde zum Gehen und 45 Minuten zum
Backen …</p><h1 id="zutaten">Zutaten</h1>
<ul>
<li>500g Mehl</li>
<li>20g frische Hefe bzw. 1 Päckchen Trockenhefe</li>
<li>60 - 80g Zucker</li>
<li>1 - 2 Eier</li>
<li>80 - 100g Butter oder Margarine</li>
<li>250 ml Milch</li>
<li>1 Prise Salz</li>
<li>etwas Eiweis</li>
<li>etwas grober Zucker (Hagelschlag)</li>
</ul>
<h1 id="zeitbedarf">Zeitbedarf</h1>
<p>Ca. 15 Minuten zum Bereiten des Teiges, 1 Stunde zum Gehen und 45 Minuten zum
Backen.</p>
<h1 id="zubereitung">Zubereitung</h1>
<p>Zur Information: Damit der Kuchen schön locker wird, muss sich die Hefe vor dem
Backen richtig entickeln können. Dazu sind 3 Voraussetzungenzu erfüllen. Die
Hefe benötigt Zucker als Nahrung, Feuchtigkeit und die richtige Temperatur,
nämlich idealerweise 32° Celsius. Sie entwickelt sich auch schon bei
Zimmertemperatur, ab ca. 50°C sterben die Hefepilze ab. Durch die Entwicklung
der Hefepilze entstehen Kohlensäure und Alkohol. Die Kohlensäure bildet kleine
Bläschen, die den Teig locker machen, der Alkohol entweicht beim Backen. Durch
das Backen wird die Entiwicklung der Hefepilze gestoppt.</p>
<p>Die Zutaten ggf. aus dem Kühlschrank nehmen und an einem warmen Ort
(Zimmertemperatur) anwärmen lassen. Falls nötig können die Eier in eine Schale
mit lauwarmem Wasser gelegt werden und die Milch vorsichtig auf dem Herd erwärmt
werden.</p>
<p>Falls die Zeit zur Zubereitung knapp ist, kann ein Vorteig zubereitet
werden. Dazu wird das Mehl in eine Schüssel gegeben, in der Mitte eine
Vertiefung gemacht und die anderen Zutaten dort mit ein wenig Mehl zu einem
dünnflüssigen Teig vermengt. Diesen Teig nun gehen lassen und später mit dem
restlichen Mehl vermengen. Besser und einfacher ist aber folgende
Vorgehensweise:</p>
<p>Die Zutaten für den Teig gut vermengen und den Teig etwa 1 Stunde an einem
warmen Ort gehen lassen.</p>
<p>Den Teig nun noch einmal gut durchkneten und zu drei gleichmäßig dicken Strängen
formen. Diese werden zu einem Zopf geflochten. Nun mit Eiweis bestreichen, damit
sich eine glänzende Kruste ergibt und mit grobem Zucker betreuen. Im Ofen ca. 45
Minuten bei 200° (bei Umluft 180°) backen.</p>
<p>Nach dem Backen auf dem Blech abkühlen lassen und nicht zu früh in Folie
einwickeln, da sonst die Kruste weich wird.</p>Rezept Ingwerwürfel2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/rezept-ingwerwurfel.html<p>Rezept für ca. 80 Stück.</p>
<h1 id="zutaten">Zutaten</h1>
<ul>
<li>400g Butter, zimmerwarm</li>
<li>200g Zucker</li>
<li>2 TL Ingwer, gemahlen</li>
<li>1 Zitrone, abgeriebene Schale davon</li>
<li>1 Prise Salz</li>
<li>500g Mehl</li>
<li>200g Zitronengelee</li>
<li>50g Ingwer, kandiert</li>
<li>80g Mandelblättchen</li>
</ul>
<h1 id="zeitbedarf">Zeitbedarf</h1>
<p>Etwa 40 Minuten.</p>
<h1 id="zubereitung">Zubereitung</h1>
<p>Zimmerwarme Butter, Zucker, Ingwerpulver, Zitronenschale, und Salz mit Knethaken
zu einer glatten Masse …</p><p>Rezept für ca. 80 Stück.</p>
<h1 id="zutaten">Zutaten</h1>
<ul>
<li>400g Butter, zimmerwarm</li>
<li>200g Zucker</li>
<li>2 TL Ingwer, gemahlen</li>
<li>1 Zitrone, abgeriebene Schale davon</li>
<li>1 Prise Salz</li>
<li>500g Mehl</li>
<li>200g Zitronengelee</li>
<li>50g Ingwer, kandiert</li>
<li>80g Mandelblättchen</li>
</ul>
<h1 id="zeitbedarf">Zeitbedarf</h1>
<p>Etwa 40 Minuten.</p>
<h1 id="zubereitung">Zubereitung</h1>
<p>Zimmerwarme Butter, Zucker, Ingwerpulver, Zitronenschale, und Salz mit Knethaken
zu einer glatten Masse verarbeiten. Mehl zugeben und unterkneten. Die Hälfte des
Teiges etwa 35cm mal 25cm groß auf ein mit Backpapier belegtes Blech gleichmäßig
glatt ausrollen. Gelee aufstreichen.</p>
<p>Ingwer fein hacken, mit den Mandeln in den übrigen Teig mischen. Teig mit den
Händen zu Streuseln reiben. Auf das Gelee streuen und andrücken. Im vorgeheizten
Ofen auf der zweiten Schiene von unten etwa 18 bis 20 Minuten bei 200°C (Umluft
180°C) backen. Abkühlen lassen und in 3 mal 3cm große Würfel schneiden.</p>Rezept Käsespätzle2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/rezept-kasespatzle.html<h1 id="zutaten">Zutaten</h1>
<p>für die Spätzle:</p>
<ul>
<li>400g Mehl</li>
<li>Salz</li>
<li>Pfeffer</li>
<li>4 Eier</li>
<li>Muskat</li>
<li>1 EL Öl</li>
<li>ca. 125ml Milch</li>
<li>4 EL Butter</li>
<li>200g geriebenenen Emmentaler Käse</li>
</ul>
<p>für die Röstzwiebeln:</p>
<ul>
<li>4 Zwiebeln</li>
<li>ca. 5 EL Mehl</li>
<li>Öl zum Ausbacken</li>
</ul>
<h1 id="zubereitung">Zubereitung</h1>
<p>Mehl, Eier, Muskat, Milch, das Öl und etwas Salz in einer Schüssel schnell …</p><h1 id="zutaten">Zutaten</h1>
<p>für die Spätzle:</p>
<ul>
<li>400g Mehl</li>
<li>Salz</li>
<li>Pfeffer</li>
<li>4 Eier</li>
<li>Muskat</li>
<li>1 EL Öl</li>
<li>ca. 125ml Milch</li>
<li>4 EL Butter</li>
<li>200g geriebenenen Emmentaler Käse</li>
</ul>
<p>für die Röstzwiebeln:</p>
<ul>
<li>4 Zwiebeln</li>
<li>ca. 5 EL Mehl</li>
<li>Öl zum Ausbacken</li>
</ul>
<h1 id="zubereitung">Zubereitung</h1>
<p>Mehl, Eier, Muskat, Milch, das Öl und etwas Salz in einer Schüssel schnell zu
einem zähen Teig verarbeiten. Anschließend in einem großen Topf reichlich
Salzwasser zum Kochen bringen.</p>
<p>Teig portionsweise auf ein feuchtes Brett geben, etwas flach drücken, mit einem
langen Messer einzelne Spätzle abtrennen und ins kochende Wasser
schaben. Einfacher: Teig in Portionen durch das Sieb eines Spätzledrückers ins
Wasser geben. Die Nudeln sind gar, wenn sie an der Ober߬che schwimmen.</p>
<p>Spätzle mit einem Schaumlöffel aus dem Wasser heben und gut abtropfen
lassen. Ist der gesamte Teig verarbeitet, in einer großen beschichteten Pfanne
die Butter schmelzen und die Spätzle darin schwenken. Käse unterrühren, mit Salz
und Pfeffer abschmecken.</p>
<p>Zwischendurch Zwiebeln schälen, in dünne Ringe schneiden, mit Mehl bestäuben. Öl
in einer großen Pfanne erhitzen, Zwiebeln darin rösten und zum Schluss uber die
Käsespätzle geben.</p>Rezept Mandelhörnchen2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/rezept-mandelhornchen.html<p>Rezept für ca. 30 Hörnchen.</p>
<h1 id="zutaten">Zutaten</h1>
<ul>
<li>200g Rohmarzipan</li>
<li>100g Puderzucker</li>
<li>1 TL Lebkuchengewürz</li>
<li>2 TL Mandelsirup</li>
<li>1 Ei Klasse M</li>
<li>1 EL Orangensaft</li>
<li>60g Mandelblättchen</li>
<li>100g Halbbitter-Kuvertüre</li>
<li>50g dunkle Kuchenglasur</li>
</ul>
<h1 id="zeitbedarf">Zeitbedarf</h1>
<p>Etwa eine Stunde plus Kühlzeit.</p>
<h1 id="zubereitung">Zubereitung</h1>
<p>Marzipan grob raspeln. Mit Puderzucker, Lebuchengewürz, Mandelsirup und Eiweiß
mit den Quirlen des …</p><p>Rezept für ca. 30 Hörnchen.</p>
<h1 id="zutaten">Zutaten</h1>
<ul>
<li>200g Rohmarzipan</li>
<li>100g Puderzucker</li>
<li>1 TL Lebkuchengewürz</li>
<li>2 TL Mandelsirup</li>
<li>1 Ei Klasse M</li>
<li>1 EL Orangensaft</li>
<li>60g Mandelblättchen</li>
<li>100g Halbbitter-Kuvertüre</li>
<li>50g dunkle Kuchenglasur</li>
</ul>
<h1 id="zeitbedarf">Zeitbedarf</h1>
<p>Etwa eine Stunde plus Kühlzeit.</p>
<h1 id="zubereitung">Zubereitung</h1>
<p>Marzipan grob raspeln. Mit Puderzucker, Lebuchengewürz, Mandelsirup und Eiweiß
mit den Quirlen des Handrührers zu einer glatten, cremigen Masse verrühren. Mit
einem Spritzbeutel mit mittlerer Lochtülle zu ca. 4cm langen Hörnchen auf
Bleche - ausgelegt mit Backpapier - spritzen. Dabei sollte zwischen den Hörnchen
etwas Abstand eingehalten werden, damit sie sich beim Aufgehen während des
Backens nicht berühren.</p>
<p>Eigelb und Orangensaft verquirlen. Hörnchen damit dünn bestreichen, dann die
Mandelblättchen auflegen. Nun im vorgeheizten Ofen auf der zweiten Schiene von
unten etwa 15 Minuten bei 175°C (Umluft 150°C) backen. Herausnehmen und abkühlen
lassen.</p>
<p>Kuvertüre und Glasur hacken. Zusammen über einem heissen Wasserbad auflösen. Die
Hörnchen mit den Spitzen hineintauchen, abtropfen und festwerden lassen.</p>Rezept Marmorkuchen2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/rezept-marmorkuchen.html<h1 id="zutaten">Zutaten</h1>
<ul>
<li>100g Butter</li>
<li>100g Zucker</li>
<li>2 Eigelb</li>
<li>2 Eiweiß</li>
<li>1/2 Päckchen Vannilinzucker</li>
<li>1/2 Päckchen Backpulver</li>
<li>250g Mehl</li>
<li>1/8 l Milch</li>
<li>1 - 2 EL Kakaopulver</li>
</ul>
<h1 id="zeitbedarf">Zeitbedarf</h1>
<p>Ca. 20 Minuten für den Teig und eine Stunde zum Backen.</p>
<h1 id="zubereitung">Zubereitung</h1>
<p>Die Butter schaumig rühren, dann Zucker und Eigelb zugeben und …</p><h1 id="zutaten">Zutaten</h1>
<ul>
<li>100g Butter</li>
<li>100g Zucker</li>
<li>2 Eigelb</li>
<li>2 Eiweiß</li>
<li>1/2 Päckchen Vannilinzucker</li>
<li>1/2 Päckchen Backpulver</li>
<li>250g Mehl</li>
<li>1/8 l Milch</li>
<li>1 - 2 EL Kakaopulver</li>
</ul>
<h1 id="zeitbedarf">Zeitbedarf</h1>
<p>Ca. 20 Minuten für den Teig und eine Stunde zum Backen.</p>
<h1 id="zubereitung">Zubereitung</h1>
<p>Die Butter schaumig rühren, dann Zucker und Eigelb zugeben und verrühren. Nun
das Mehl mit dem Backpulver mischen, durchsieben und dazugeben. Gleichzeitig die
Milch dazugeben und das ganze zu einem glatten Teig verrühren.</p>
<p>Das Eiweiß zu Eischnee schlagen und unter den Teig heben.</p>
<p>Die Form (kleine Gugelhupf-Form) gut einfetten, mit Mehl bestäuben und zwei
Drittel des Teiges einfüllen.</p>
<p>Den Rest des Teiges mit dem Kakaopulver verrühren, je nach Geschmack noch etwas
Zucker (reiner Kakao ist bitter) und ggf. noch etwas Milch zugeben.</p>
<p>Den Kakaoteig über den anderen Teig schichten und mit der Gabel einmal
spiralförmig verrühren, sodass sich ein Marmormuster ergibt.</p>
<p>Den Kuchen bei 180°C (Umluft ca. 160°C) eine Stunde lang backen.</p>
<p>Nach dem Backen den Kuchen 10 Minuten in der Form abkühlen lassen und dann auf
ein Kuchengitter stürzen. Mit Puderzucker bestäuben.</p>Rezept Mozartthaler2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/rezept-mozartthaler.html<p>Für ca. 40 Stück</p>
<h1 id="zutaten">Zutaten</h1>
<ul>
<li>100g Butter</li>
<li>60g Puderzucker</li>
<li>1 Prise Salz</li>
<li>1 Vanilleschote, Mark davon</li>
<li>1 Eigelb Kl. M</li>
<li>100g gemahlene Haselnüsse</li>
<li>100g Mehl</li>
<li>40 Haselnüsse</li>
<li>50g Halbbitter-Kuvertüre</li>
<li>75g Nougat-Masse</li>
<li>50g Marzipan-Rohmasse</li>
<li>1 EL Orangensaft</li>
</ul>
<h1 id="zeitbedarf">Zeitbedarf</h1>
<p>Die Zubereitung benötigt etwa eine Stunde plus drei Stunden Kühlzeit.</p>
<h1 id="zubereitung">Zubereitung</h1>
<p>Butter, Zucker …</p><p>Für ca. 40 Stück</p>
<h1 id="zutaten">Zutaten</h1>
<ul>
<li>100g Butter</li>
<li>60g Puderzucker</li>
<li>1 Prise Salz</li>
<li>1 Vanilleschote, Mark davon</li>
<li>1 Eigelb Kl. M</li>
<li>100g gemahlene Haselnüsse</li>
<li>100g Mehl</li>
<li>40 Haselnüsse</li>
<li>50g Halbbitter-Kuvertüre</li>
<li>75g Nougat-Masse</li>
<li>50g Marzipan-Rohmasse</li>
<li>1 EL Orangensaft</li>
</ul>
<h1 id="zeitbedarf">Zeitbedarf</h1>
<p>Die Zubereitung benötigt etwa eine Stunde plus drei Stunden Kühlzeit.</p>
<h1 id="zubereitung">Zubereitung</h1>
<p>Butter, Zucker, Salz und Vanillemark mit Knethaken zu einer glatten Masse
verrühren. Eigelb kurz einarbeiten. Nüsse und Mehl kurz unterkneten. Teig in
Folie gewickelt mindestens drei Stunden kalt stellen.</p>
<p>Teig in Portionen auf einer bemehlten Fläche 3mm dünn ausrollen. Zu Kreisen von
4cm Durchmesser ausstechen, auf Bleche mit Backpapier legen. Im vorgeheizten
Ofen etwa 8 bis 10 Minuten bei 170°C (Umluft 150°C) backen. Herausnehmen,
abkühlen lassen.</p>
<p>Die ganzen Nüsse auf einem Blech rösten (10 bis 12 Minuten bei 170°C, Umluft
150°C). In einem Tuch die Schale abreiben. Kuchenglasur und Kuvertüre hacken,
gemischt über einem heißen Wasserbad schmelzen. Die Hälfte des Gebäcks
hineintauchen, gut abtropfen lassen. Je eine Nuss aufsetzen und trocknen lassen.</p>
<p>Nougat leicht erwärmen und glattrühren. Mit einem Spritzbeutel mit kleiner
Sterntülle als Rand auf die übrigen Kreise spritzen, kurz kalt stellen. Marzipan
und Orangensaft pürieren. In die Mitte der Nougatringe
spritzen. Schokoladen-Hälften aufsetzen.</p>Rezept Quarkhörnchen2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/rezept-quarkhornchen.html<h1 id="zutaten">Zutaten</h1>
<ul>
<li>100g Quark</li>
<li>4 EL Milch</li>
<li>4 EL Öl</li>
<li>50g Zucker</li>
<li>1 Päckchen Vanillinzucker</li>
<li>1 Prise Salz</li>
<li>200g Mehl</li>
<li>1/2 Päckchen Backpulver</li>
</ul>
<h1 id="zeitbedarf">Zeitbedarf</h1>
<p>Ca. 15 Minuten zzgl. Backzeit</p>
<h1 id="zubereitung">Zubereitung</h1>
<p>Den Quark, die Milch, das Öl, den Zucker, den Vanillinzucker und das Salz
miteinander verkneten. Nun das Mehl und das …</p><h1 id="zutaten">Zutaten</h1>
<ul>
<li>100g Quark</li>
<li>4 EL Milch</li>
<li>4 EL Öl</li>
<li>50g Zucker</li>
<li>1 Päckchen Vanillinzucker</li>
<li>1 Prise Salz</li>
<li>200g Mehl</li>
<li>1/2 Päckchen Backpulver</li>
</ul>
<h1 id="zeitbedarf">Zeitbedarf</h1>
<p>Ca. 15 Minuten zzgl. Backzeit</p>
<h1 id="zubereitung">Zubereitung</h1>
<p>Den Quark, die Milch, das Öl, den Zucker, den Vanillinzucker und das Salz
miteinander verkneten. Nun das Mehl und das Backpulver unterkneten.</p>
<p>Den Teig rund und flach ausrollen und in 8 Stücke teilen. Diese Stücke nun von
aussen zusammenrollen und ein wenig biegen, so dass sich die typische
Hörnchenform ergibt. Nun ca. 15 bis 20 Minuten bei 180°C (Umluft 160°C) backen.</p>
<p>Die Hörnchen schmecken am besten warm mit Butter und Marmelade.</p>Rezept Schokokipferl2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/rezept-schokokipferl.html<p>Rezept für ca. 50 Stück.</p>
<h1 id="zutaten">Zutaten</h1>
<ul>
<li>125g Halbbitter-Kuvertüre</li>
<li>250g Mehl</li>
<li>10g Kakao</li>
<li>40g Speisestärke</li>
<li>100g gemahlene Mandeln</li>
<li>125g zimmerwarme Butter</li>
<li>1 Prise Salz</li>
<li>100g Puderzucker</li>
<li>2 Eier Klasse M</li>
<li>100g Vollmilch-Kuvertüre</li>
<li>100g dunkle Kuchenglasur</li>
</ul>
<h1 id="zeitbedarf">Zeitbedarf</h1>
<p>Etwa 1,5 Stunden plus Kühlzeiten.</p>
<h1 id="zubereitung">Zubereitung</h1>
<p>Die Halbbitter-Kuvertüre auf der Küchenreibe raspeln, mit Mehl …</p><p>Rezept für ca. 50 Stück.</p>
<h1 id="zutaten">Zutaten</h1>
<ul>
<li>125g Halbbitter-Kuvertüre</li>
<li>250g Mehl</li>
<li>10g Kakao</li>
<li>40g Speisestärke</li>
<li>100g gemahlene Mandeln</li>
<li>125g zimmerwarme Butter</li>
<li>1 Prise Salz</li>
<li>100g Puderzucker</li>
<li>2 Eier Klasse M</li>
<li>100g Vollmilch-Kuvertüre</li>
<li>100g dunkle Kuchenglasur</li>
</ul>
<h1 id="zeitbedarf">Zeitbedarf</h1>
<p>Etwa 1,5 Stunden plus Kühlzeiten.</p>
<h1 id="zubereitung">Zubereitung</h1>
<p>Die Halbbitter-Kuvertüre auf der Küchenreibe raspeln, mit Mehl, Kakao, Stärke
und Mandeln mischen.</p>
<p>Butter, Salz und Puderzucker mit Knethaken zu einer glatten Masse
verkneten. Eier kurz unterarbeiten. Mehlmischung zugeben und schnell zu einem
glatten Teig verkneten. 2 Stunden in Folie eingewickelt kalt stellen.</p>
<p>Portionsweise aus dem Kühlschrank nehmen (die Masse soll möglichst kühl
bleiben). Zu Kipferln formen, auf Bleche mit Backpapier setzen. Im vorgeheizten
Ofen ca. 12 Minuten bei 160°C (Umluft 150°C) backen, dann abkühlen lassen.</p>
<p>Vollmilch-Kuvertüre und Kuchenglasur hacken, gemischt über einem heissen
Wasserbad auflösen. Die Spitzen der Kipferl hineintauchen, abtropfen und
trocknen lassen.</p>Rezept Tomaten-Zwiebel-Schnitzel2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/rezept-tomaten-zwiebel-schnitzel.html<h1 id="zutaten">Zutaten</h1>
<ul>
<li>1-2 Zwiebeln</li>
<li>3-4 große Tomaten</li>
<li>4 Minutenschnitzel</li>
<li>3 EL Olivenöl</li>
<li>etwas Rosmarin</li>
<li>etwas Paprikapulver</li>
<li>1 Knoblauchzehe</li>
</ul>
<p>Zeitaufwand: ca. 20 Minuten</p>
<h1 id="zubereitung">Zubereitung</h1>
<p>Die Zwiebel würfeln und mit einem Esslöffel des Olivenöls in einem Topf
andünsten. Die Tomaten in ca. 1cm große Würfel schneiden, den Knoblauch abziehen
und fein würfeln oder …</p><h1 id="zutaten">Zutaten</h1>
<ul>
<li>1-2 Zwiebeln</li>
<li>3-4 große Tomaten</li>
<li>4 Minutenschnitzel</li>
<li>3 EL Olivenöl</li>
<li>etwas Rosmarin</li>
<li>etwas Paprikapulver</li>
<li>1 Knoblauchzehe</li>
</ul>
<p>Zeitaufwand: ca. 20 Minuten</p>
<h1 id="zubereitung">Zubereitung</h1>
<p>Die Zwiebel würfeln und mit einem Esslöffel des Olivenöls in einem Topf
andünsten. Die Tomaten in ca. 1cm große Würfel schneiden, den Knoblauch abziehen
und fein würfeln oder pressen und beides zu den Zwiebeln geben. Ca. 10-15
Minuten kochen lassen.</p>
<p>Die Schnitzel waschen und trocknen und mit einer Mischung aus Paprikapulver,
Rosmarin, Pfeffer, Salz und dem Olivenöl einstreichen.</p>
<p>Die Schnitzel ein paar Minuten ziehen lassen und dann in einer heißen Pfanne
anbraten. Nun die Schnitzel aus der Pfanne nehmen, das Tomaten-Zwiebel-Gemüse in
die Pfanne geben und mit Pfeffer und Salz abschmecken. Die Schitzel auf dem
Gemüse anrichten.</p>
<p>Als Beilage passen Pommes Frites.</p>Rezept Überbackenes Schweinefilet2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/rezept-uberbackenes-schweinefilet.html<h1 id="zutaten">Zutaten</h1>
<ul>
<li>350 - 400g Schweinefilet</li>
<li>Schinkenspeck</li>
<li>1 Becher Crème Fraiche</li>
<li>1 Becher Schlagsahne</li>
<li>Curry</li>
<li>Tomatenketchup</li>
<li>Petersilie</li>
<li>Pfeffer und Salz</li>
</ul>
<h1 id="zubereitung">Zubereitung</h1>
<p>Die Crème Fraiche und die Sahne mit Curry und Petersilie verrühren. Soviel
Ketchup dazugeben, dass eine hellrosa Sauce entsteht. Mit Salz und Pfeffer
würzen.</p>
<p>Das Schweinefilet in Stücke von ca. 3 …</p><h1 id="zutaten">Zutaten</h1>
<ul>
<li>350 - 400g Schweinefilet</li>
<li>Schinkenspeck</li>
<li>1 Becher Crème Fraiche</li>
<li>1 Becher Schlagsahne</li>
<li>Curry</li>
<li>Tomatenketchup</li>
<li>Petersilie</li>
<li>Pfeffer und Salz</li>
</ul>
<h1 id="zubereitung">Zubereitung</h1>
<p>Die Crème Fraiche und die Sahne mit Curry und Petersilie verrühren. Soviel
Ketchup dazugeben, dass eine hellrosa Sauce entsteht. Mit Salz und Pfeffer
würzen.</p>
<p>Das Schweinefilet in Stücke von ca. 3 - 4cm Länge schneiden und jeweils mit
einem Streifen Schinkenspeck umwickeln. Falls nötig, mit einem Zahnstocher
feststecken.</p>
<p>Die Fleischstücke in eine Auflaufform setzen und mit der Sauce übergießen. Die
Auflaufform sollte so groß sein, dass das Fleisch etwa zur Hälfte in der Sauce
liegt. So wird der Speck an der Oberseite schön knusprig. Und ab in den
vorgeheizten Ofen damit.</p>
<p>Als Beilage passen Kroketten, aber auch Reis.</p>Schaltregler mit LM25762007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/schaltregler-mit-lm2576.html<p>Viele elektronische Schaltungen benötigen eine geregelte, konstante
Spannungsversorgung. So lange der Stromverbrauch nicht zu groß ist und genug
Energie zur Verfügung steht (etwa durch ein Steckernetzteil im Gegensatz zur
Versorgung mit Batterien) greift man dann oft zu Linearreglern wie dem <a href="http://www.onsemi.com/pub/Collateral/MC7800-D.PDF">7805</a>
(für 5V), <a href="http://www.onsemi.com/pub/Collateral/MC7800-D.PDF">7812</a> (für 12V) oder dem <a href="http://www.on-semi.com/pub/Collateral/LM317-D.PDF">LM317</a> (einstellbare …</p><p>Viele elektronische Schaltungen benötigen eine geregelte, konstante
Spannungsversorgung. So lange der Stromverbrauch nicht zu groß ist und genug
Energie zur Verfügung steht (etwa durch ein Steckernetzteil im Gegensatz zur
Versorgung mit Batterien) greift man dann oft zu Linearreglern wie dem <a href="http://www.onsemi.com/pub/Collateral/MC7800-D.PDF">7805</a>
(für 5V), <a href="http://www.onsemi.com/pub/Collateral/MC7800-D.PDF">7812</a> (für 12V) oder dem <a href="http://www.on-semi.com/pub/Collateral/LM317-D.PDF">LM317</a> (einstellbare Spannung).</p>
<p>Diese Regler haben aber einen wesentlichen Nachteil: Die "überschüssige"
Spannung wird in Form von Wärme vernichtet. Dies ist dann ein Problem, wenn die
Energie knapp ist. Sobald diese in Wärme umgesetzt ist, ist sie für die
Versorgung der Schaltung verloren. Andererseits wird es ein Problem, wenn die
Schaltung sehr viel Strom benötigt oder die Spannungsdifferenz zwischen Ein- und
Ausgang des Reglers sehr hoch ist. Dann wird nämlich so viel Energie in Wärme
umgesetzt, dass die Abfuhr der Wärme ein Problem wird.</p>
<p>Ein Beispiel: Eine Schaltung wird über einen Trafo mit 24 Volt versorgt. Es wird
aber ein kleiner Mikrocontroller mit Display und Hintergrund-Beleuchtung
eingesetzt, der 5 Volt und etwa 500mA benötigt. Mit einem Linearregler werden
dann (24V - 5V) * 0,5A = 9,5W in Wärme umgesetzt. Dies kann bei einem kleinen
Gehäuse schon ein Problem werden und einen großen Kühlkörper erfordern.</p>
<p>Aber es gibt einen Ausweg: Den Schaltregler. Dieser kann eine Eingangs- in eine
Ausgangsspannung konvertieren, ohne viel Energie in Form von Wärme zu
"verlieren".</p>
<h1 id="funktionsweise">Funktionsweise</h1>
<p>Die Funktion eines Schaltreglers kann man sich etwa so vorstellen: Der Regler
legt die Eingangsspannung an eine Spule. Dabei fließt ein Strom, so dass sich in
der Spule ein Magnetfeld aufbaut. Dann wird die Eingangsspannung
abgeschaltet. Die Spule hat nun die Eigenschaft, das Magnetfeld abzubauen, indem
sie den Strom weiter fließen lässt. Die Spule bzw. deren Magnetfeld wird also
als kurzzeitiger Energiespeicher eingesetzt. Je nach Form der Reglerschaltung
und der Ansteuerung der Spule kann man nun am Ausgang eine niedrigere
(Step-Down- oder Buck-Converter) oder sogar eine höhere Spannung (Step-Up- oder
Boost-Converter) erzeugen, als sie am Eingang anliegt. Außerdem kann man die
Spannung invertieren, d.h. aus einer positiven Eingangsspannung wird eine
negative Ausgangsspannung.</p>
<h1 id="beispielschaltung">Beispielschaltung</h1>
<p>An dieser Stelle möchte ich zunächst einmal nur die Art von Reglern beschreiben,
die eine hohe in eine niedrigere Spannung wandeln. Im Folgenden wird ein
<a href="http://www.national.com/pf/LM/LM2576.html">LM2576-ADJ</a> aus der Simple-Switcher-Serie von <a href="http://www.national.com">National Semiconductor</a>
verwendet. Dieser benötigt als externe Beschaltung nur ein paar Elkos, eine
Speicherspule und eine Diode und ist damit ziemlich einfach aufzubauen. Die
Schaltung entspricht der im Datenblatt des Reglers beschriebenen. Dort ist auch
die Auslegung der Spule und der Diode in Form eines Design Guide sehr
ausführlich beschrieben, so dass es nicht schwer ist, den Regler in Betrieb zu
nehmen.</p>
<p>Für alle, die sich damit nicht so genau beschäftigen wollen, hier die von mir
verwendeten Bauteile und der Schaltplan, um 12 Volt am Eingang in 3,3 Volt am
Ausgang zu konvertieren, wobei bis zu 3 Ampere fließen dürfen. Der Regler
erwärmt sich dabei auch ohne Kühlkörper nicht wesentlich. Der gemessene
Wirkungsgrad liegt bei ca. 75 Prozent. Nach Datenblatt sollten sich bis zu 77
Prozent erreichen lassen. Die geringe Differenz kann an der Tolleranz meines
Messgerätes, aber auch an der Verwendung "normaler" anstelle von Low-<abbr
title="Equivalent Series Resistance">ESR</abbr>-Elkos liegen.</p>
<p>Die Verwendung von Elkos mit Low-ESR ist bei Schaltreglern wichtig, da sie mit
der Schaltfrequenz des Reglers ständig auf- und entladen werden. Ein höherer
Innenwiderstand der Elkos führt damit zu einer höheren Verlustleistung. Das
senkt einerseits den Wirkungsgrad der Regler-Schaltung, vermindert durch die
Erwärmung der Elkos aber auch deren Lebensdauer.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/lm2576-schematics.png">
<img src="https://www.a-netz.de/blog/2007/08/images/lm2576-schematics.png"
title="Schaltplan für LM2576"
alt="Schaltplan für LM2576">
</a>
<figcaption>Schaltplan für LM2576</figcaption>
</figure>
<ul>
<li>IC1: LM2576T-ADJ</li>
<li>C1, C2: 47 Microfarad, 25V</li>
<li>C3, C4: 470 Microfarad, 16V</li>
<li>D1: 1N5822</li>
<li>L1: 0,8mm Kupferlackdraht, 45 Windungen auf Eisenpulver-Ringkern T80-26</li>
<li>R1: 1kOhm</li>
<li>R2: 1,5kOhm</li>
</ul>
<p>Die Ausgangsspannung wird durch das Verhältnis der beiden Widerstände R1 und R2
festgelegt. Die Elkos am Eingang und Ausgang der Schaltung sind jeweils parallel
geschaltet. Im Datenblatt sind hier Low-ESR-Typen vorgesehen, die jedoch
schlecht erhältlich sind. Bei die Parallelschaltung von Standard-Elkos wird der
ESR ebenfalls verringert. Im Datenblatt wird darauf hingewiesen, dass die
Verbindungen zwischen Regler und GND, Diode und den Ein- und Ausgangs-Elkos
möglichst kurz sein müssen, um den angegebenen Wirkungsgrad zu
erreichen. Außerdem sollte die Feedback-Leitung (FB) nicht in der Nähe der Spule
verlaufen, damit dort keine Störungen eingekoppelt werden.</p>
<h1 id="anwendungs-moglichkeiten">Anwendungs-Möglichkeiten</h1>
<p>Schaltregler eignen sich für all die Anwendungen, wo es nicht darauf ankommt,
dass die Ausgangsspannung besonders "glatt" ist, also nicht mit einer kleinen
Störspannung überlagert ist. Durch das ständige Ein- und Ausschalten des
Spulenstroms entstehen am Ausgang geringe Störungen mit der Schaltfrequenz des
Reglers. Außerdem entstehen an der Spule recht starke Magnetfelder, so dass in
direkter Nähe der Spule keine Leitungen oder Bauteile liegen sollten, in denen
ein induzierter Strom stören würde. Für digitale und Mikrocontroller-Schaltungen
stellen diese Störungen im Allgemeinen kein Problem dar. Anders sieht es aber
etwa bei Schaltungen aus, die analoge Signale verarbeiten (Operationsverstärker,
Digital-Analog-Wandler oder Audio-Schaltungen). Diese können durch Schaltregler
beeinflusst werden. Es müssen dann entweder weitere Entstörmaßnahmen getroffen
werden oder auf den Einsatz von Schaltreglern verzichtet werden.</p>Umstieg auf Linux2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/umstieg-auf-linux.html<p>Die folgenden Notizen sind wärend meinem Unstieg auf Debian Linux enstanden. Ich
habe sie ins Internet gestellt in der Hoffnung, dass andere Leute mit ähnlichen
Problemen beim Umstieg auf Linux haben und hoffe, dass sie die mit Hilfe dieser
Notizen lösen können.</p>
<h1 id="welche-betriebssysteme-bisher-liefen">Welche Betriebssysteme bisher liefen</h1>
<p>Neben meinem bisgerien Hauptbetriebssystem …</p><p>Die folgenden Notizen sind wärend meinem Unstieg auf Debian Linux enstanden. Ich
habe sie ins Internet gestellt in der Hoffnung, dass andere Leute mit ähnlichen
Problemen beim Umstieg auf Linux haben und hoffe, dass sie die mit Hilfe dieser
Notizen lösen können.</p>
<h1 id="welche-betriebssysteme-bisher-liefen">Welche Betriebssysteme bisher liefen</h1>
<p>Neben meinem bisgerien Hauptbetriebssystem Windows lief meist ein Linux
(angefangen mit SuSE Linux 5.1, Kernel 2.0.32), so dass ich damit ein paar
Erfahrungen sammeln konnte. Mit Linux beschäftigte ich mich mehr aus Neugierde,
die meiste Arbeit habe ich unter Windows erledigt. Mit "Arbeit" meine ich dabei
Software-Entwicklung (Java, C++, C#, PHP), Office- und Internet-Sachen (EMail,
News, WWW), Spiele eher weniger.</p>
<h1 id="abkehr-von-windows">Abkehr von Windows</h1>
<p>Nach einigem Ärger über Microsoft ziehe ich in Erwägung, Linux zu benutzen. Ich
besorge mir dazu an der Uni aktuelle CD-Rom-Images und installiere davon Debian.</p>
<p>Den Anstoss, mir Gedanken über einen vollständigen Umstieg zu machen, gibt dann
das folgende Ereignis: Microsoft bietet ein Anti-Spyware-Programm (Beta-Version)
zum download an. Der Download scheitert bei mir aber daran, dass Microsoft
meinen Rechner daraufhin überprüfen möchte, ob ich auch nur legale Software
einsetze. Dies soll durch die Ausführung eines kleinen Programms geschehen,
welches die Daten automatisch an Microsoft übermittelt. Meiner Ansicht nach
hätte Microsoft gerne die Seriennummer meiner Windows-Installation haben
können - was sonst noch auf meinem Rechner ist, geht Microsoft aber nichts
an. Also gibt es auch kein Anti-Spyware-Programm, und da ähnliche Aktionen von
Microsoft in Zukunft wohl noch öfter zu erwarten sind, rückt der Umstieg auf
Linux wieder ein Stückchen näher...</p>
<p>Meine weitere Planung sieht nun folgendermaßen aus: Zunächst möchte ich meine
Hardware unter Linux zum Laufen bringen und dann eine Anwendung nach der anderen
durch ein geeignetes Programm unter Linux ersetzen.</p>
<h1 id="einrichtung-der-hardware">Einrichtung der Hardware</h1>
<p>Der folgende Text bezieht sich auf die folgende Hardware (sicherlich nicht mehr
ganz frisch, genügt mir aber (Update im Oktober 2005: genügt mir nicht mehr,
siehe):</p>
<ul>
<li>Notebook Asus MP8300C mit Intel Celeron 550MHz Prozessor</li>
<li>Chipsatz Intel 440MX</li>
<li>192 MB RAM</li>
<li>SiliconMotion Graphik-Chipsatz mit 8 MB Speicher</li>
<li>Intel EtherExpress Pro 100 Netzwerkkarte</li>
<li>Lucent WinModem</li>
<li>AC97-Kompatible Soundkarte</li>
<li>USB-Maus</li>
<li>D-Link DWL-G650 Wireless LAN PCMCIA Karte (Revision B2 mit Atheros Chipsatz)</li>
</ul>
<h1 id="usb-maus">USB-Maus</h1>
<p>Nach dem Booten von Linux habe ich nur einen Shell-Prompt. Daran habe ich mich
schon gewöhnt, zum täglichen Arbeiten ist eine graphische Oberfläche aber doch
irgendwie praktischer. Die Installation mittels <code>apt-get install kde</code> gelingt
erfreulich problemlos. Nur leider mag sich der Maus-Zeiger kein bischen
bewegen. Gutes Zureden hilft leider auch nicht weiter. Das Laden von ein paar
Modulen verhilft dann schließlich zur gewünschte Bewegung.</p>
<p>Um die USB-Maus sowohl auf der Konsole als auch unter X verwenden zu können habe
ich folgendes gemacht:</p>
<h2 id="eintragen-der-kernel-module">Eintragen der Kernel-Module</h2>
<p>Ich habe die Kernel-Module</p>
<ul>
<li><code>usbcore</code></li>
<li><code>uhci-hcd</code></li>
<li><code>mousedev</code></li>
<li><code>usbhid</code></li>
</ul>
<p>in die Datei <code>/etc/modules</code> eingetragen, so dass diese beim Booten automatisch
geladen werden. Man kann die Module zum Testen auch mittels <code>modprobe Modulname</code>
laden und schauen, ob man nach einem <code>cat /dev/input/mice</code> wirre Zeichen
sieht. Das sind dann die Daten, die die Maus liefert. Die Ausgabe kann man mit
<code>Ctrl-C</code> wieder abbrechen. Statt dessen ist es aber auch möglich, das Paket
<code>hotplug</code> zu verwenden. Es sucht während des bootens nach bekannter Hardware und
lädt die benötigten Kernel-Module austomatisch. Möchte man USB auch für andere
Peripherie (USB-Festplatten, Kartenleser, etc.) verwenden, empfiehlt sich die
Verwendung von hotplug.</p>
<h2 id="console-support">Console-Support</h2>
<p>Das Programm <code>gpmconfig</code> aufgerufen, als Protokoll <code>imps/2</code> und als Device
<code>/dev/input/mice</code> angegeben. Nach einem Neustart von gpm sollte dann ein
Mauscorsur auf der Console erscheinen.</p>
<h2 id="xfree">XFree</h2>
<p>Um die Maus auch unter XFree nutzen zu können, habe ich in der Datei
<code>/etc/X11/XF86Config-4</code> folgenden Eintrag gemacht:</p>
<div class="highlight"><pre><span></span><code>Section "InputDevice"
Identifier "Generic Mouse"
Driver "mouse"
Option "SendCoreEvents" "true"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "Emulate3Buttons" "true"
Option "ZAxisMapping" "4 5"
Option "CorePointer"
EndSection
</code></pre></div>
<p>Der Name der Maus (hier "Generic Mouse") muss auch im Abschnitt <code>ServerLayout</code>
mittels <code>InputDevice "Generic Mouse"</code> bekannt gemacht werden. Und schon bewegt
sich der Mauszeiger auch unter X. :-)</p>
<h1 id="lucent-winmodem">Lucent WinModem</h1>
<p>Mit dem verwendeten Modem habe ich etwas mehr Aufwand gehabt, da es kein
normales serielles Modem ist, sondern ein sogenanntes WinModem, für welches es
keine Treiber im Kernel gibt. Auf der Seite http://www.linmodems.org gibt es
Informationen und Treiber zu WinModems unter Linux. Zur Installation des
Treibers für mein Modem ist aber der konfigurierte Kernel-Quellcode
notwendig. Also habe ich mich zunächst - mehr aus Neugierde, ob es denn auch
funktioniert - darangemacht, einen eigenen Kernel zu kompilieren.</p>
<p>Zunächst habe ich mit</p>
<div class="highlight"><pre><span></span><code>apt-get install kernel-source-2.6.10
</code></pre></div>
<p>den Quellcode des zur Zeit aktuellen Kernels installiert und im Verzeichnis
<code>/usr/src/linux</code> mittels <code>make menuconfig</code> eine meiner Meinung nach günstige
Konfiguration ausgewählt. Dazu sollte man sich viel Zeit nehmen und die
jeweiligen Hilfetexte durchlesen, um zu verstehen, was man da gerade
konfiguriert. Ist die Konfiguration fertig, speichert man sie am besten in einer
Datei ab, um sie später weiter bearbeiten zu können.</p>
<p>Nach dem Verlassen des Konigurationstools kann man dann mit dem Packet
<code>kernel-package</code> ein eigenes Debian-Paket mit dem selbst konfigurierten Kernel
erstellen lassen. Dazu ruft man im Quellcode-Verzeichnis des Kernels
(meist <code>/usr/src/linux</code>) den Befehl</p>
<div class="highlight"><pre><span></span><code>make-kpkg --append-to-version YYYYMMDD kernel_image
</code></pre></div>
<p>auf. Damit wird der Kernel und die nötigen Module kompiliert und in eine
.deb-Datei unter <code>/usr/src</code> gepackt. Die Zeichen <code>YYYYMMDD</code> sollte man natürlich
durch das aktuelle Datum ersetzen, denn dann bekommt der Kernel das Datum an die
Version drangehängt. Dieses kann man nach der Installation mit <code>uname -a</code>
überprüfen. So kommt man nicht mit mehreren Kernels der selben Version
durcheinander, denn es ist sehr wahrscheinlich, dass man mehrere Anläufe
braucht, bis die Konfiguration "perfekt" konfiguriert ist. Das erstellte
Debian-Paket kann nun mittels</p>
<div class="highlight"><pre><span></span><code>dpkg -i kernel-image-2.6.10-YYYYMMDD.deb
</code></pre></div>
<p>installiert werden.</p>
<p>Nun endlich kann man mit der Installation der Modem-Treiber beginnen. Dazu entpackt man das Archivltmodem.VVVV.tar.gzmittar -xvzf ltmodem.VVVV.tar.gz, zum Beispiel im Verzeichnis/usr/src. Nun wechselt man in das dabei erstellte Verzeichnis und ruft dort den Befehlbuild_moduleauf. Es gibt auch ein Skriptbuild_deb, welches ein Debian-Paket erstellen soll. Das hat bei mir jedoch nicht funktioniert.</p>
<p>Wenn das Kompilieren funktioniert hat, findet man im Unterverzeichnis <code>drivers</code>
die Kernel-Module. Diese kann man nun mit</p>
<div class="highlight"><pre><span></span><code>mkdir /lib/modules/<span class="sb">`</span>uname -r<span class="sb">`</span>/extra
cp lt*.ko /lib/modules/<span class="sb">`</span>uname -r<span class="sb">`</span>/extra
</code></pre></div>
<p>zu den anderen Kernel-Modulen kopieren. Nach einem Aufruf von <code>depmod -a</code> werden
die Abhängigkeiten zu anderen Modulen berechnet und man kann das Modul
<code>lt_serial.ko</code> mittels <code>modprobe lt_serial</code> laden und/oder in die Datei
<code>/etc/modules</code> eintragen, damit es bereits beim booten geladen wird.</p>
<h1 id="die-wlan-karte">Die WLAN-Karte</h1>
<p>Da meine WLAN-Karte einen Chipsatz von Atheros enthält, gibt es im Kernel -
ebenso wie beim Modem - keinen Treiber. Das
Projekt <a href="http://madwifi.sourceforge.net">MadWifi</a> stellt aber einen Treiber zur
Verfügung. Dieser Treiber enthält jedoch Binärcode von Atheros; es handelt sich
also nicht um einen reinen OpenSource-Treiber.</p>
<p>Auch dieser Treiber benötigt die konfigurierten Kernel-Sourcen. Man verfährt
also ähnlich wie bei der Installation der Modem-Treiber, entpackt das
Treiber-Archiv und ruftmakeauf. Der Treiber wird nun compiliert und man kann das
fertige Modul ebenfalls nach <code>/lib/modules/\</code>uname -r`/extra` kopieren.</p>
<p>Zum Betrieb der WLAN-Karte, einer PCMCIA-Karte, benötigt man dann noch:</p>
<ul>
<li>das Paket <code>wireless-tools</code></li>
<li>Die Software und einen passenden Kernel zum Betrieb des PCMCIA-Busses</li>
</ul>
<p>Dann kann man die Karte einfach einstecken, mittels modprobe <code>ath_pci</code> das
entsprechende Modul laden, dann mit <code>ifconfig eth0 up</code> die Karte anschalten und
mit <code>iwlist scanning</code> nach Accesspoints in Reichweite suchen. Wenn man in einem
Netz mit DHCP-Server aktiv ist, kann man mit <code>dhclient ath0</code> eine IP-Adresse
beziehen. Ansonsten kann man die IP-Adresse auch statisch mit dem
Programm <code>ifconfig</code> festlegen.</p>
<h1 id="einrichtung-der-anwendungen">Einrichtung der Anwendungen</h1>
<p>Die meisten Anwendungen lassen sich problemlos mittels <code>apt-cache search
NameDerAnwendung</code> suchen und dann mittels <code>apt-get install Anwendung</code>
installieren. Es gibt jedoch ein paar Ausnahmen, bei denen die aktuellste
Version der Anwendung noch nicht als Debian-Paket vorliegt oder die es gar nicht
als Debian-Paket gibt.</p>
<h1 id="software-entwicklung-java-und-eclipse-31">Software-Entwicklung: Java und Eclipse 3.1</h1>
<p>Da ich zur Zeit an der Uni mit Java und Eclipse entwickle, brauche ich diese
Anwendungen auch unter Linux. Das JDK (Java Development Kit) von Sun ist leider
kein Open Source und daher auch nicht als Debian-Packet (jedenfalls nicht auf
den Debian-Servern) erhältlich. Man kan es sich aber als selbstentpackendes
Archiv unter http://java.sun.com herunterladen und einfach in einem beliebigen
Verzeichnis entpacken. Ich habe dazu <code>/opt/jdk1.5.0</code> gewählt.</p>
<p>Mit Eclipse kann man ganz ähnlich verfahren. Die aktuelle Version habe ich von
einem Mirror von http://www.eclipse.org heruntergeladen. Genau genommen handelt
es sich um mehrere Archive: Die Eclipse Platform (das Eclipse SDK benötigt man
normalerweise nicht), die Java Development Tools (JDT) (damit man überhaupt
Java-Unterstützung in Eclipse hat) und bei Bedarf das JUnit Testing
Framework. Diese Archive habe ich ebenso wie das JDK im Verzeichnis <code>/opt</code>
entpackt, so dass Eclipse nun im Verzeichnis <code>/opt/eclipse</code> installiert
ist. Unter Umständen müssen noch die GTK-Bibliotheken installiert werden, damit
Eclipse läuft. Bei mir waren sie aber schon installiert, so dass ich dazu nichts
genaueres sagen kann.</p>
<h1 id="ein-office-paket-openoffice">Ein Office-Paket: OpenOffice</h1>
<p>Natürlich benötige ich auch ein Office-Paket um hin und wieder mal einen Brief
zu schreiben, eine Tabelle zu erstellen, etc. Dazu habe ich mir zum einen das
Paket OpenOffice, aber auch das zum KDE-Projekt gehörende KOffice installiert
und beide ausprobiert. Mein Eindruck ist, dass KOffice an einigen Stellen noch
nicht so weit entwickelt ist wie OpenOffice, daher habe ich es wieder gelöscht.</p>
<h1 id="personal-information-management-kontact">Personal Information Management: Kontact</h1>
<p>Das Debian-Pseudo-Paket <code>kdepim</code> installiert alles, was man braucht. :) Es
handelt sich um mehrere Anwendungen (EMail, News, Adressverwaltung, Kalender,
Todo-Liste, etc.), die in einer "Rahmenanwendung" namens Kontact dargestellt
werden. Kontact startet die anderen Anwendungen in einer MS Outlook ähnlichen
Oberfläche.</p>
<p>Gut gefällt mir besonders die inzwischen weit fortgeschrittene Integration von
GnuPG (Programm zum Verschlüsseln) in KMail. Mit einem Klick wird eine EMail
signiert, mit einem weiteren auch verschlüsselt. Das Entschlüsseln und
Überprüfen der Signatur funktioniert sogar automatisch, sofern man das Passwort
weiss.</p>
<h1 id="fazit">Fazit</h1>
<p>Ich bin erstaunt, wie gut sich Linux inzwischen für den Einsatz auf dem Desktop
eignet. Meine Hardware funtioniert problemlos und ich vermisse bisher keine
Software. Ich kann also nur jedem, der es probieren möchte, nur Mut
machen. Probiert es aus - im Notfall kann man es ja auch wieder von der Platte
putzen, ich hoffe aber, das wird nicht nötig sein.</p>VC820 Software2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/vc820-software-de.html<p>Ich habe vor einiger Zeit das Multimeter VC820 von Voltcraft gekauft (zum
Beispiel bei <a href="http://www.conrad.de">Conrad</a> zu bekommen). Mit dem Gerät bin ich sehr zufrieden, nur
die beliegende Software gefällt mit nicht. Da ich keine andere frei verfügbare
bzw. Open-Source-Software finden konnte, habe ich diese Software geschrieben.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/vc820.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/vc820.jpg"
title="Das VC820 Multimeter"
alt="Das VC820 Multimeter">
</a>
<figcaption>Das VC820 Multimeter</figcaption>
</figure>
<p>Die …</p><p>Ich habe vor einiger Zeit das Multimeter VC820 von Voltcraft gekauft (zum
Beispiel bei <a href="http://www.conrad.de">Conrad</a> zu bekommen). Mit dem Gerät bin ich sehr zufrieden, nur
die beliegende Software gefällt mit nicht. Da ich keine andere frei verfügbare
bzw. Open-Source-Software finden konnte, habe ich diese Software geschrieben.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/vc820.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/vc820.jpg"
title="Das VC820 Multimeter"
alt="Das VC820 Multimeter">
</a>
<figcaption>Das VC820 Multimeter</figcaption>
</figure>
<p>Die Software befindet sich zur Zeit noch in einer frühen Entwicklungsphase und
könnte daher noch einige Fehler enthalten. Für jeden gefundenen und mir
mitgeteilten Fehler bin ich daher sehr dankbar!</p>
<h1 id="screenshot">Screenshot</h1>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/vc820_screenshot.png">
<img src="https://www.a-netz.de/blog/2007/08/images/vc820_screenshot.png"
title="Screenshot der VC820-Software"
alt="Screenshot der VC820-Software">
</a>
<figcaption>Screenshot der VC820-Software</figcaption>
</figure>
<h1 id="features">Features</h1>
<ul>
<li>Verarbeitung der Messwerte parallel in mehreren Modulen (Anzeige, Graph,
Statistik)</li>
<li>Auswählbare Daten-Quelle</li>
<li>Einfache Erweiterbarkeit der Software durch eigene Module zur Messwert-
Verarbeitung</li>
<li>Übertragung der Messwerte über UDP (User Datagram Protocol), um sie auf
einem anderen Rechner mit der gleichen Software weiter zu verarbeiten</li>
</ul>
<h1 id="lizenz">Lizenz</h1>
<p>Diese Software steht unter der GNU General Public License in ihrer aktuellen
Version, einzusehen auf der <a href="http://www.gnu.org">GNU</a> website. Es steht damit jedem frei, die
Software nicht nur zu verwenden, sondern auch zu verändern und
weiterzuentwickeln.</p>
<h1 id="benotigte-komponenten">Benötigte Komponenten</h1>
<p>Da die Software mit dem Microsoft.Net Framework geschrieben ist, braucht man die
entsprechende .Net-Laufzeitumgebung. Diese ist kostenlos bei <a href="http://www.microsoft.com">Microsoft</a> zu
bekommen. Alles weitere liegt dem Programm-Archiv bei.</p>
<h1 id="installation">Installation</h1>
<p>Zunächst muss das DotNet-Framework installiert sein. Dann einfach das Archiv in
ein beliebiges Verzeichnis entpacken und die exe-Datei aufrufen. Beim ersten
Starten wird automatisch eine Konfigurations-Datei im Arbeitsverzeichnis
erstellt. Bei Bedarf nun noch ein Programm-Icon anlegen und schon ist die
Software einsatzbereit.</p>
<h1 id="download">Download</h1>
<ul>
<li>Sourcecode (Visual Studio Projekt): <a href="https://www.a-netz.de/blog/2007/08/files/vc820tool_0_22_src.zip">vc820tool_0_22_src.zip</a></li>
<li>Ausführbares Programm: <a href="https://www.a-netz.de/blog/2007/08/files/vc820tool_0_22_bin.zip">vc820tool_0_22_bin.zip</a></li>
</ul>
<h1 id="code-fur-java">Code für Java</h1>
<p>Ein freundlicher Entwickler hat mich gebeten, seinen Code zur Abfrage des VC820
unter Java hier zur Verfügung zu stellen: <a href="https://www.a-netz.de/blog/2007/08/files/vc820-java.zip">vc820-java.zip</a></p>
<h1 id="erweiterung-der-software">Erweiterung der Software</h1>
<p>Die Software ist dafür ausgelegt, dass sie einfach um neue Module erweitert
werden kann. Es gibt folgende Typen von Modulen:</p>
<ul>
<li>Datagram Source (DS): Quelle für Messwerte. Bisher gibt es eine Quelle zum
Auslesen von Messwerten eines VC820-Messgerätes, eine Dummy-Quelle zum
Testen und eine Quelle, die über UDP/IP empfangene Messwerte ausgibt. Jede
DS muss das Interface <code>IDatagramSource</code> implementieren.</li>
<li>Datagram Processor (DP): Ein Datagram Processor ist eine Klasse, die einen
aufgenommenen Messwert in irgendeiner Art verarbeitet. Eingebaut sind bisher
eine Anzeige, die den Messwert als Zahl darstellt, ein Plotter zum Zeichnen
des Verlaufs einer Messwertfolge, ein Statistikmodul (Durchschnittsbildung,
etc.) und ein Sender, der die Messwerte per UDP/IP verschickt. Jeder DP muss
das Interface <code>IDatagramProcessor</code> implementieren.</li>
<li>ValueDispatcherTrigger (VDT): Hierbei handelt es sich um eine Komponente,
die dafür sorgt, dass nicht jeder von einer Datagram Source empfangene
Messwert sofort an alle Prozessoren weitergegeben wird. Bisher gibt es einen
Timer-VDT, der zeitgesteuert einen Messwert an die Datagram Processors
weitergibt (zum Beispiel alle 15 Minuten ein Messwert), einen
SingleShot-VDT, der nur bei einem Mausclick einen Messwert weitergibt und
einen Instrument-VDT, der jeden empfangenenen Messwert weitergibt. Jeder VDT
muss das Interface <code>IDispatcherTrigger</code> implementieren. Besser ist es aber,
von der abstrakten Basisklasse <code>AbstractDispatcherTrigger</code> zu erben.</li>
</ul>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/vc820_modules.png">
<img src="https://www.a-netz.de/blog/2007/08/images/vc820_modules.png"
title="Klassenstruktur"
alt="Klassenstruktur">
</a>
<figcaption>Klassenstruktur</figcaption>
</figure>
<p>Die Software kann einfach um jede Art von Modul leicht erweitert werden, indem
eine Klasse erstellt wird, die das ensprechende Interface implementiert bzw. von
der passenden Basisklasse erbt. Diese Klasse muss dann in der Klasse <code>MainForm</code>
mit einer der Methoden <code>RegisterDatagramProcessor()</code>,
<code>RegisterDispatcherTrigger()</code> oder <code>RegisterSource()</code> registriert werden. Den
dafür benötigten Code schreibt man am besten in eine der
<code>Initialize...()</code>-Methoden. Damit sollte das Modul in der GUI erscheinen und
benutzt werden können.</p>
<h1 id="das-protokoll">Das Protokoll</h1>
<p>Die Übertragung der Werte vom Messgerät zum Computer läuft über eine serielle
Schnittstelle. Die Verbindung ist galvanisch getrennt und funktioniert mithilfe
von Optokopplern. Diese werden über die Statusleitungen <code>DTR</code> und <code>RTS</code> mit
Strom versorgt. Es muss <code>DTR</code> auf high und <code>RTS</code> auf low gesetzt werden, damit
Daten empfangen werden können. Die Übertragung läuft dann mit 2400 Baud.</p>
<p>Das Protokoll ist sehr simpel aufgebaut. Es überträgt einfach 1-zu-1 den Zustand
jedes LCD-Segments des Messgeräts in einem Bit. Dazu wird ungefähr einmal pro
Sekunde ein Datenpaket mit 14 Bytes gesendet. Die Bedeutung der Bits ist in der
folgenden Tabelle angegeben. Die Zahl vor dem Komma ist das entsprechende Byte,
die hinter dem Komma das Bit innerhalb des Byte. Die Angabe 4,3 bedeutet also
"Bit Nummer 3 im Byte Nummer 4".</p>
<h2 id="symbole">Symbole</h2>
<div class="highlight"><pre><span></span><code>RS232 0, 0
Auto 0, 1
TrueRMS 0, 2
AC 0, 3
Diode 9, 0
Beep 10, 0
Hold 11, 0
Delta 11, 1
</code></pre></div>
<h2 id="einheiten">Einheiten</h2>
<div class="highlight"><pre><span></span><code>Volt 10, 2
Prozent 11, 1
Ohm 11, 2
Farad 11, 3
Ampere 12, 1
Hertz 12, 2
</code></pre></div>
<h2 id="prafixe">Präfixe</h2>
<div class="highlight"><pre><span></span><code>Nano 11, 1
Micro 9, 3
Milli 10, 3
Kilo 9, 1
Mega 10, 1
</code></pre></div>
<h2 id="ziffern">Ziffern</h2>
<div class="highlight"><pre><span></span><code>1. Ziffer (10**0) 7,4 - 8,3
2. Ziffer (10**1) 5,4 - 6,3
3. Ziffer (10**2) 3,4 - 4,3
4. Ziffer (10**3) 1,4 - 2,3
</code></pre></div>
<p>Die Bits für die Ziffern sind hierbei als 7-Segment-Codes zu verstehen. Jedes
Bit entspricht also auch hier einem Segment. Zu beachten ist, dass die
erste 4. Ziffer - also die höchstwertigste bzw. am weitesten links stehende -
auch das Minus anzeigt. Die Segmente können wie folgt interpretiert werden:</p>
<div class="highlight"><pre><span></span><code><span class="n">number</span> <span class="p">&=</span> <span class="m">0</span><span class="n">x7f</span><span class="p">;</span>
<span class="k">switch</span><span class="p">(</span><span class="n">number</span><span class="p">)</span>
<span class="p">{</span>
<span class="k">case</span> <span class="m">0</span><span class="n">x7d</span><span class="p">:</span>
<span class="k">return</span> <span class="m">0</span><span class="p">;</span>
<span class="k">case</span> <span class="m">0</span><span class="n">x05</span><span class="p">:</span>
<span class="k">return</span> <span class="m">1</span><span class="p">;</span>
<span class="k">case</span> <span class="m">0</span><span class="n">x5b</span><span class="p">:</span>
<span class="k">return</span> <span class="m">2</span><span class="p">;</span>
<span class="k">case</span> <span class="m">0</span><span class="n">x1f</span><span class="p">:</span>
<span class="k">return</span> <span class="m">3</span><span class="p">;</span>
<span class="k">case</span> <span class="m">0</span><span class="n">x27</span><span class="p">:</span>
<span class="k">return</span> <span class="m">4</span><span class="p">;</span>
<span class="k">case</span> <span class="m">0</span><span class="n">x3e</span><span class="p">:</span>
<span class="k">return</span> <span class="m">5</span><span class="p">;</span>
<span class="k">case</span> <span class="m">0</span><span class="n">x7e</span><span class="p">:</span>
<span class="k">return</span> <span class="m">6</span><span class="p">;</span>
<span class="k">case</span> <span class="m">0</span><span class="n">x15</span><span class="p">:</span>
<span class="k">return</span> <span class="m">7</span><span class="p">;</span>
<span class="k">case</span> <span class="m">0</span><span class="n">x7f</span><span class="p">:</span>
<span class="k">return</span> <span class="m">8</span><span class="p">;</span>
<span class="k">case</span> <span class="m">0</span><span class="n">x3f</span><span class="p">:</span>
<span class="k">return</span> <span class="m">9</span><span class="p">;</span>
<span class="p">}</span>
</code></pre></div>
<p>Die Variable <code>number</code> enthält die Bits wie in der Tabelle angegeben. Das
höchstwertige, hier mit 0x7f maskierte Bit entspricht dem Dezimalpunkt neben
jeder Ziffer. Bei Unklarheiten zur Dekodierung der Daten ist ein Blick in die
Datei <code>Datagram.cs</code> im Quelltextarchiv empfohlen!</p>
<h1 id="was-kommt-als-nachstes">Was kommt als nächstes</h1>
<p>Zunächst einmal sollte der Quellcode weiter kommentiert werden. Als echte
Erweiterung der Software plane ich einen Datagram Processor, der die Messwerte
in eine Datenbank schreibt. Für weitere Ideen bzw. auch für Hinweise auf bereits
fertige Erweiterungen der Software bin ich jederzeit dankbar!</p>VC820 Software2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/vc820-software-en.html<p>Since I have bought a multimeter VC820 made by Voltcraft, I am quite happy with
this device, but I think the software delivered with it is not as good as the
multimeter. I could not find any free or open source software, so i have written
something by myself.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/vc820.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/vc820.jpg"
title="The VC820 Multimeter"
alt="The VC820 Multimeter">
</a>
<figcaption>The …</figcaption></figure><p>Since I have bought a multimeter VC820 made by Voltcraft, I am quite happy with
this device, but I think the software delivered with it is not as good as the
multimeter. I could not find any free or open source software, so i have written
something by myself.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/vc820.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/vc820.jpg"
title="The VC820 Multimeter"
alt="The VC820 Multimeter">
</a>
<figcaption>The VC820 Multimeter</figcaption>
</figure>
<p>The software is in an early development stage and can contain a few errors. I am
glad about any error that you report to me so that I can fix it.</p>
<h1 id="screenshot">Screenshot</h1>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/vc820_screenshot.png">
<img src="https://www.a-netz.de/blog/2007/08/images/vc820_screenshot.png"
title="Screenshot of the VC820 software"
alt="Screenshot of the VC820 software">
</a>
<figcaption>Screenshot of the VC820 software</figcaption>
</figure>
<h1 id="features">Features</h1>
<ul>
<li>Parallel processing of the measurement values in multiple modules (text
display, graph, statistics)</li>
<li>Selection of a data source</li>
<li>Simple extensibility of the software with your own modules for processing
measurement values.</li>
<li>Sending and receiving of measurements by UDP to / from other computers</li>
</ul>
<h1 id="license">License</h1>
<p>This software is distributed under the terms of the GNU General Public License
in its current version, see the <a href="http://www.gnu.org">GNU</a> website for details.</p>
<h1 id="needed-components">Needed Components</h1>
<p>The software is written with Microsoft.Net, so you need the DotNet-Framework
installed. You can get it at <a href="http://www.microsoft.com">Microsoft</a>. Anything else needed is included in
the program archive.</p>
<h1 id="installation">Installation</h1>
<p>At first you need to install the DotNet-Framework. Then, uncompress the program
archive in a directory and invoke the exe-file. The program creates a
configuration file automatically. If you want, you can create a shortcut to the
program on your desktop or in the start menu. That's all.</p>
<h1 id="download">Download</h1>
<ul>
<li>Source code: <a href="https://www.a-netz.de/blog/2007/08/files/vc820tool_0_22_src.zip">vc820tool_0_22_src.zip</a></li>
<li>Executable program: <a href="https://www.a-netz.de/blog/2007/08/files/vc820tool_0_22_bin.zip">vc820tool_0_22_bin.zip</a></li>
</ul>
<h1 id="code-for-java">Code for Java</h1>
<p>A developer who does not want to be named has sent me his basic implementation
of the data access to the VC820 for java. This is his
implementation: <a href="https://www.a-netz.de/blog/2007/08/files/vc820-java.zip">vc820-java.zip</a></p>X.509-Zertifikate mit KDE und KMail verwenden2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/x-509-zertifikate-mit-kde-und-kmail-verwenden.html<p>Bei X.509-Zertifikaten handelt es sich um Schlüssel für die Verschlüsselung und
Signatur von Emails mit Hilfe des Public-Key-Verfahrens, die von vielen
Mail-Programmen und Browsern unterstützt werden. Im Folgenden einige Hinweise
zur Verwendung der Zertifikate mit KMail.</p>
<h1 id="voraussetzungen">Voraussetzungen</h1>
<p>Die Anleitung bezieht sich auf ein Debian 3.1 (unstable) Linux. Sie …</p><p>Bei X.509-Zertifikaten handelt es sich um Schlüssel für die Verschlüsselung und
Signatur von Emails mit Hilfe des Public-Key-Verfahrens, die von vielen
Mail-Programmen und Browsern unterstützt werden. Im Folgenden einige Hinweise
zur Verwendung der Zertifikate mit KMail.</p>
<h1 id="voraussetzungen">Voraussetzungen</h1>
<p>Die Anleitung bezieht sich auf ein Debian 3.1 (unstable) Linux. Sie sollte sich
aber auch mit anderen Linux-Systemen nachvollziehen lassen. Im folgenden wird
vorausgesetzt, dass KMail bereits eingerichtet ist und außerdem die folgenden
Pakete installiert sind:</p>
<ul>
<li>gnupg: Verwaltet die Schlüssel und sichert den Privaten Schlüssel</li>
<li>gpgsm: Versteht das Secure Mime (S/MIME) Format</li>
<li>openssl: Extrahiert die öffentlichen und privaten Schlüssel</li>
<li>kleopatra: Graphische Oberfläche für KDE zur Verwaltung der Zertifikate</li>
</ul>
<p>Sollten sie fehlen, können sie auf Debian-Systemen einfach mit</p>
<div class="highlight"><pre><span></span><code>apt-get install <span class="o">{</span>Paketname<span class="o">}</span>
</code></pre></div>
<p>installiert werden. Ich nehme an, dass es für RPM-basierte Systeme (z.B. SuSE
oder Redhat) Pakete mit ähnlichem Namen gibt, die sich dann mit <code>rpm -i
{Paketname}</code> installieren lassen.</p>
<h1 id="export-der-zertifikate-aus-der-anwendung">Export der Zertifikate aus der Anwendung</h1>
<p>Üblicherweise werden X.509-Zertifikate im Format ">PKCS12 (Public Key
Cryptographic Standard #12) ausgetauscht, auch an der Endung der exportierten
Datei .p12 zu erkennen. An einen solchen Container mit dem Zertifikat
(öffentlicher Schlüssel) und dem privaten Schlüssel kommt man, in dem man es zum
Beispiel im Browser in der Zertifikatsverwaltung (Firefox und Internet Explorer
können das auf jeden Fall) oder in der Zertifikatsverwaltung von Windows sein
Zertifikat exportiert. Dabei ist darauf zu achten, dass auch der private
Schlüssel exportiert wird!</p>
<h1 id="konvertierung-fur-gnupg">Konvertierung für GnuPG</h1>
<p>Leider kann die Zertifikatsverwaltung unter Linux bisher nicht richtig mit dem
PKCS12-Format umgehen. Daher muss der PKCS12-Container zunächst in seine
Einzelteile zerlegt werden.</p>
<p>Zunächst wird er ins PEM-Format (Privacy Enhanced Mail) konvertiert, wobei nach
dem beim Export festgelegten Passwort gefragt wird:</p>
<div class="highlight"><pre><span></span><code>openssl pkcs12 -in <span class="o">{</span>*.p12-Datei<span class="o">}</span> -out certbundle.pem -nodes
</code></pre></div>
<p>Dann kann man den privaten Schlüssel extrahieren:</p>
<div class="highlight"><pre><span></span><code>openssl pkcs12 -in certbundle.pem -export -out certkey.p12 -nocerts -nodes
</code></pre></div>
<p>Bei der PEM-Datei handelt es sich um ein ASCII-Format, aus dem man auch "von
Hand", d.h. mit einem Texteditor die einzelnen Schlüssel herauskopieren
kann. Ein Schlüssel beginnt mit der Zeile <code>Bag attributes</code> und endet mit
<code>-----END CERTIFICATE-----</code>. Am besten speichert man die Schlüssel einzeln in
*.pem-Dateien.</p>
<h1 id="import-unter-kde">Import unter KDE</h1>
<p>Nun kann man entweder kleopatra starten (Bei mir habe ich in KDE keinen
Menüpunkt dafür, also auf der Konsole starten) und dort File, Import
Certificates verwenden, um den privaten Schlüssel (certkey.p12 und die
öffentlichen Schlüssel in den *.pem-Dateien importieren. Kommt es zu Problemen,
ist unter Umständen die Ausgabe des gpg-log-agent hilfreich, den man über das
Menü Tools starten kann.</p>
<p>Alternativ kann man den Import auch auf der Kommandozeile durchführen. Dazu
verwendet man den Befehl gpgsm:</p>
<div class="highlight"><pre><span></span><code>gpgsm --import certkey.p12
</code></pre></div>
<p>(manchmal wird auch</p>
<div class="highlight"><pre><span></span><code>gpgsm --call-protect-tool --p12-import --store certkey.p12
</code></pre></div>
<p>vorgeschlagen, mir ist nicht klar, wo die Unterschiede liegen)</p>
<p>Hat das funktioniert, so sollte man in Kleopatra auf die Baumansicht umschalten
(View, Hierarchical Key List), mit F5 aktualisieren und seine
Zertifikat-Hierarchie dort sehen - genaugenommen die Public Keys.</p>
<p>Die importierten privaten Schlüssel kann man sich auf der Kommandozeile mit</p>
<div class="highlight"><pre><span></span><code>gpgsm --list-secret-keys
</code></pre></div>
<p>anzeigen lassen.</p>
<h1 id="vertrauenseinstellungen-fur-root-zertifikate">Vertrauenseinstellungen für Root-Zertifikate</h1>
<p>Das Root-Zertifikat des Thawte-Freemail-Projekts
(siehe <a href="http://www.thawte.com">www.thawte.com</a> ) ist standardmäßig nicht als
Vertrauenswürdig markiert, daher kann man zunächst keine damit signierten
Zertifikate zum Verschlüsseln oder Signieren verwenden.</p>
<p>Um das zu ändern, trägt man den SHA1-Hash-Wert (Secure Hashing Algorithm</p>
<h1 id="1-des-thawte-zertifikats-in-der-datei-trustlisttxt-im-verzeichnis">1) des Thawte-Zertifikats in der Datei <code>trustlist.txt</code> im Verzeichnis</h1>
<p><code>~/.gnupg</code> ein. Den Hashwert bekommt man in Kleopatra heraus, indem
man das Root-Zertifikat rechts anklickt, dann Certificate Details, Dump wählt,
und den Ausdruck hinter <code>sha1_fpr</code> kopiert und in die Datei <code>trustlist.txt</code>
einfügt.</p>
<p>Danach muss man dem Programm gnupg-agent bekannt machen, dass sich die Datei
<code>trustlist.txt</code> geändert hat. Dazu schickt man ihm mit</p>
<div class="highlight"><pre><span></span><code><span class="nb">kill</span> -SIGHUP <span class="o">{</span>PID von gnupg-agent<span class="o">}</span>
</code></pre></div>
<p>ein Signal oder startet einfach KDE bzw. den Rechner neu.</p>
<h1 id="verschlusseln-einer-nachricht">Verschlüsseln einer Nachricht</h1>
<p>Nun kann man in KMail eine neue Nachricht erstellen, in der Symbolleiste als
Verschlüsselungsmethode "S/MIME" wählen und daneben die Symbole für Signieren
und / oder Verschlüsseln anklicken.</p>
<p>Zum Testen kann man einfach eine Mail an sich selbst schreiben. (von sich selbst
hat man ja auf jeden Fall Public und Private Key gerade importiert). Beim Senden
wird man dann zunächst gebeten, den Public Key für den Empfänger auszuwählen und
dann auch noch den Private Key für den Absender (ich weiss nicht, ob die Frage
danach immer kommt, oder nur, wenn mehrere Private Keys zur angegebenen
Email-Adresse passen).</p>
<h1 id="fehlersuche">Fehlersuche</h1>
<p>Wenn irgendein Schritt nicht funktioniert, kann man zum einen auf der
Kommandozeile mit</p>
<div class="highlight"><pre><span></span><code>gpgsm --list-keys
</code></pre></div>
<p>und</p>
<div class="highlight"><pre><span></span><code>gpgsm --list-secret-keys
</code></pre></div>
<p>schauen, welche Schlüssel erfolgreich importiert wurden. Andererseits kann man
mit dem GnuPG Log Viewer (in Kleopatra im Tools-Menü aktivieren) auch gut
verfolgen, was das System gerade macht bzw. woran es scheitert. Den Detailgrad
der Meldungen kann man in Kleopatra im Menü Settings, Configure GpgME Backend,
GPG for S/MIME unter Debugstufe auf Name setzen erhöhen, indem man dort guru
einträgt.</p>
<h1 id="anmerkungen">Anmerkungen</h1>
<p>Ich habe mein EMail-Zertifikat aus dem Thawte-Freemail-Programm. Bei dem vor
ca. einem Jahr erstellten Zertifikat (also im Juni 2004) gab es keine Probleme
beim Importieren des privaten Schlüssels. Das nun (Juni 2005) verlängerte
Zertifikat kann ich bisher nicht importieren. Anscheinend hat gpgsm (Version
1.9.15) einen Bug beim Lesen der PKCS12-Datei,
wie <a href="http://lists.gnupg.org/pipermail/gnupg-users/2005-April/025491.html">hier</a>
zu lesen ist.</p>
<p>Ich habe bisher Probleme, Mails die von Outlook Express gesendet wurden, zu
entschlüsseln. Der verwendete Algorithmus RC2 wird (noch?) nicht
unterstützt. Vermutlich gibt es das Problem auch bei Mails von MS Outlook, dort
kann aber anscheinend der verwendete Verschlüsselungsalgorithmus eingestellt
werden (<abbr title="Advanced Encryption Standard">AES</abbr> oder <abbr
title="Tripple Data Encryption Standard">3DES</abbr> sollten funktionieren).</p>Bluetooth Grundlagen2007-08-17T01:00:00+08:002007-08-17T01:00:00+08:00andreastag:www.a-netz.de,2007-08-17:/blog/2007/08/bluetooth-basics.html<h1 id="grundlagen">Grundlagen</h1>
<p><a href="http://www.bluetooth.com">Bluetooth</a> ist ein Standard zur drahtlosen Übertragung geringer Datenmengen
über geringe Entfernungen. Ausgelegt ist er vor allem für mobile Geräte (Handys,
Headsets, etc.), da die Übertragung im Gegensatz zu WLAN besonders wenig Energie
benötigt. Die erreichbaren Geschwindigkeiten bewegen sich zwischen 1 <abbr title="Megabit pro Sekunde">Mbps</abbr> (Version 1.2) und 3 Mbps (Version …</p><h1 id="grundlagen">Grundlagen</h1>
<p><a href="http://www.bluetooth.com">Bluetooth</a> ist ein Standard zur drahtlosen Übertragung geringer Datenmengen
über geringe Entfernungen. Ausgelegt ist er vor allem für mobile Geräte (Handys,
Headsets, etc.), da die Übertragung im Gegensatz zu WLAN besonders wenig Energie
benötigt. Die erreichbaren Geschwindigkeiten bewegen sich zwischen 1 <abbr title="Megabit pro Sekunde">Mbps</abbr> (Version 1.2) und 3 Mbps (Version 2.0 +
<abbr title="Enhanced Datarate">EDR</abbr>).</p>
<h1 id="reichweite">Reichweite</h1>
<p>Die Sendeleistung und damit die Reichweite der Geräte wird in Klassen
eingeteilt: Klasse 1 schafft ca. 100m bei idealen Voraussetzungen, Klasse 2
ca. 10m und Klasse 3 ca. 1m. Die meisten Handys sind Klasse-2-Geräte und haben
somit ca. 10m Reichweite. Dongles für den USB-Port sind meist eher
Klasse-1-Geräte. </p>
<p>Die Reichweite wird aber immer durch den "schwächeren" Kommunikationspartner
beschränkt. Ein Dongle mit 100m Reichweite nützt also nichts, wenn das Handy nur
10m schafft.</p>
<h1 id="profile">Profile</h1>
<p>Im Bluetooth-Standard sind diverse Profile enthalten, die auf der reinen
Datenübertragung aufsetzen und ein (im Idealfall herstellerunabhängiges)
Protokoll definieren, mit Hilfe dessen zwei Geräte interagieren
können. Beispiele dafür sind </p>
<ul>
<li><abbr title="Dialup Networking">DUN</abbr>: ermöglicht die Einwahl eines PC
über das Handy ins Internet )</li>
<li><abbr title="File Transfer Protocol">FTP</abbr>: Dateiaustausch</li>
<li><abbr title="Advanced Audio Distribution Profile">A2DP</abbr>: Übertragung von
Musik</li>
</ul>
<p>Zur Sicherung der Datenübertragung müssen zwei Geräte, zwischen denen Daten
ausgetauscht werden sollen, beim ersten Kontakt gekoppelt werden. Dazu muss
üblicherweise auf beiden Geräten (z.B. PC und Handy) die selbe PIN eingegeben
werden, bei manchen Geräten (z.B. Headsets) ist die PIN auch schon fest
eingestellt. Während der Kopplung handeln die beiden Geräte einen Schlüssel aus,
mit der die weitere Kommunikation dann verschlüsselt wird, so dass sie nicht
einfach abgehört werden kann.</p>Audio-Verstärker mit TDA72402007-08-16T01:00:00+08:002007-08-16T01:00:00+08:00andreastag:www.a-netz.de,2007-08-16:/blog/2007/08/audio-verstarker-mit-tda7240.html<h1 id="beschreibung">Beschreibung</h1>
<p>Da mein Fernseher nur einen einzelnen Mono-Lautsprecher besitzt und die
Stereoanlage nicht in Reichweite ist, habe ich den im Folgenden beschriebenen
kleinen Audio-Verstärker gebaut. Die Verstärkung erfolgt mit 2 ICs des Typs
<a href="http://www.st.com/stonline/products/literature/ds/1469/tda7240a.pdf">TDA7240</a> von <a href="http://www.st.com">SGS-Thomsom</a>. Dabei handelt es sich eigentlich um Verstärker für
Autoradios. Andererseits wird genau deshalb der …</p><h1 id="beschreibung">Beschreibung</h1>
<p>Da mein Fernseher nur einen einzelnen Mono-Lautsprecher besitzt und die
Stereoanlage nicht in Reichweite ist, habe ich den im Folgenden beschriebenen
kleinen Audio-Verstärker gebaut. Die Verstärkung erfolgt mit 2 ICs des Typs
<a href="http://www.st.com/stonline/products/literature/ds/1469/tda7240a.pdf">TDA7240</a> von <a href="http://www.st.com">SGS-Thomsom</a>. Dabei handelt es sich eigentlich um Verstärker für
Autoradios. Andererseits wird genau deshalb der Aufbau des Netzteils einfacher,
da die ICs nur eine 12V-Versorgungsspannung benötigen statt der bei den meisten
Verstärkern zusätzlich nötigen negativen Spannung.</p>
<p>Laut dem Datenblatt leistet der Verstärker an 4Ω-Lautsprechern 20 Watt, an
8Ω-Lautsprechern ca. 12 Watt. Ob mein Aufbau diese Werte genau so erreicht, kann
ich nicht sagen. Jedenfalls reicht es zum Fernsehen vollkommen aus. :-)</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/audioamp-schematics.png">
<img src="https://www.a-netz.de/blog/2007/08/images/audioamp-schematics.png"
title="Schaltung des Verstärkers"
alt="Schaltung des Verstärkers">
</a>
<figcaption>Schaltung des Verstärkers</figcaption>
</figure>
<p>Die Schaltung ist recht einfach und weitgehend entsprechend dem Vorschlag im
Datenblatt aufgebaut, nur eben für 2 Kanäle und ohne einen Schalter für die
Mute-Funktion, denn den gibt es schon am Fernseher. Das Netzteil des Verstärkers
ist konventionell mit einem 50VA 12V-Ringkerntrafo, Brückengleichrichter und
zwei 4700µF-Elkos aufgebaut.</p>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/audioamp-layout.png">
<img src="https://www.a-netz.de/blog/2007/08/images/audioamp-layout.png"
title="Platinenlayout"
alt="Platinenlayout">
</a>
<figcaption>Platinenlayout</figcaption>
</figure>
<p>Die Schaltung findet Platz auf einer ca. 3,5cm × 5cm großen Platine, da neben
den Verstärker-ICs nur wenige Bauteile benötigt werden. Daneben ist der
(ausreichend groß dimensionierte) Kühlkörper das großte Bauteil. Zerstören kann
man die ICs durch einen zu kleinen Kühlkörper aber kaum - sie sind gegen
Übertemperatur sowie Kurzschluss am Ausgang abgesichert.</p>
<p>Der hier vorgestellte Verstärker kann sicherlich nicht mit Highend-Verstärkern
mithalten. Meiner Meinung nach ist der Klang aber durchaus gut und stellt auf
jeden Fall eine große Verbesserung gegenüber dem bisherigen Sound des Fernsehers
dar.</p>
<p>Da das verwendete Stereo-Poti zur Lautstärke-Einstellung Probleme mit dem
Gleichlauf hat, ist bereits eine digitale Lautstärke- und Sound-Kontrolle
(Höhen, Bässe, Balance) in Planung, evtl. sogar mit Fernbedienung. Sobald es
dazu etwas Neues gibt, wird es ebenfalls auf dieser Site veröffentlicht.</p>
<h1 id="das-gehause">Das Gehäuse</h1>
<p>Das Gehäuse des Verstärkers ist aus 8mm dickem Pappelsperrholz gefertigt. Ich
kann dieses Material zum Bau von Gehäusen nur empfehlen. Es lässt sich leicht
mit der Laubsäge sägen und bearbeiten. Da die Oberfläche sehr weich ist, ist es
sinnvoll, das Gehäuse mit Parkett-Lack zu behandeln, wodurch die Oberfläche
schön matt glänzend und recht hart und widerstandsfähig wird. Wer lieber ein
dunkles Gehäuse mag, kann es vor dem Lackieren mit einer dunklen Lasur
streichen. Aber immer an ausreichend Luftlöcher denken, da das Holz recht gut
wärmeisolierend ist und der Verstärker sonst sicher schnell überhitzen würde.</p>
<p>Hier noch eine Warnung: Das Netzteil dieses Verstärkers ist an Netzspannung
angeschlossen. Wer sich nicht damit auskennt, sollte die Finger davon lassen
oder es von einem Fachmann anschliessen lassen! Es besteht Lebensgefahr! Da es
sich hier um ein privates Bastelprojekt handelt, kann ich für nichts
garantieren. Weder für die Funktionsfähigkeit eines Nachbaus noch für die
Fehlerfreiheit dieser Beschreibung. Also: Alles auf eigene Gefahr.</p>
<h1 id="bilder">Bilder</h1>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/audioamp-ics.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/audioamp-ics.jpg"
title="Die Verstärker-ICs"
alt="Die Verstärker-ICs">
</a>
<figcaption>Die Verstärker-ICs</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/audioamp-inside.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/audioamp-inside.jpg"
title="Innenleben des Verstärkers"
alt="Innenleben des Verstärkers">
</a>
<figcaption>Innenleben des Verstärkers</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/audioamp.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/audioamp.jpg"
title="Der fertige Verstärker"
alt="Der fertige Verstärker">
</a>
<figcaption>Der fertige Verstärker</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2007/08/images/audioamp-back.jpg">
<img src="https://www.a-netz.de/blog/2007/08/images/audioamp-back.jpg"
title="Die Rückseite"
alt="Die Rückseite">
</a>
<figcaption>Die Rückseite</figcaption>
</figure>
<h1 id="download">Download</h1>
<p>Eagle-Projekt: <a href="https://www.a-netz.de/blog/2007/08/files/audioamp_20040827.zip">audioamp-20040827.zip</a></p>
<h1 id="links">Links</h1>
<ul>
<li><a href="http://sound.westhost.com">Elliott Sound Products</a>: Grundlagen, Theorie und Schaltungen zum Thema
Audio-Verstärker, hervorragende Seite!</li>
</ul>Kopete mit Google Talk verwenden2007-08-16T01:00:00+08:002007-08-16T01:00:00+08:00andreastag:www.a-netz.de,2007-08-16:/blog/2007/08/kopete-mit-google-talk-verwenden.html<p>Google betreibt seit August 2005 einen Messenger-Dienst names <a href="http://talk.google.com">Google Talk</a>,
ähnlich wie zum Beispiel <a href="http://www.icq.com">ICQ</a>. Für Windows gibt es dazu von Google eine eigene
Client-Software. Für Linux ist dies auch geplant, bisher gibt es sie aber noch
nicht.</p>
<p>Da Google ein offenes Protokoll für den Messenger-Dienst namens <abbr
title="Extensible Messaging and Presence Protocol">XMPP</abbr>
(siehe <a href="http://www.xmpp.org">http …</a></p><p>Google betreibt seit August 2005 einen Messenger-Dienst names <a href="http://talk.google.com">Google Talk</a>,
ähnlich wie zum Beispiel <a href="http://www.icq.com">ICQ</a>. Für Windows gibt es dazu von Google eine eigene
Client-Software. Für Linux ist dies auch geplant, bisher gibt es sie aber noch
nicht.</p>
<p>Da Google ein offenes Protokoll für den Messenger-Dienst namens <abbr
title="Extensible Messaging and Presence Protocol">XMPP</abbr>
(siehe <a href="http://www.xmpp.org">http://www.xmpp.org</a> ) verwendet, welches zum Beispiel auch von <a href="http://www.jabber.org">Jabber</a>
genutzt wird, ist es möglich, jeden Instant-Messenger-Client zu verwenden, der
dieses Protokoll unterstützt.</p>
<p>Auf den Webseiten von Google gibt es sogar schon Anleitungen zur Konfiguration
für einige verbreitete Clients. Mein Favorit, <a href="http://kopete.kde.org">Kopete</a> ist aber leider nicht
dabei. Deshalb hier eine kurze Anleitung.</p>
<ul>
<li>Zunächst legt man über <em>Settings</em> → <em>Configure Kopete</em> →
<em>Accounts</em> einen neuen Account für das Jabber-Protokoll an.</li>
<li>Im darauf folgenden Dialog gibt man als Jabber ID den Namen des
Google-Mail-Accounts ein. Auf den Webseiten von Google sieht man als
Beispiel immer einen in der Form <code>...@gmail.com</code>. Das muss aber nicht
zwangsläufig so sein - meiner endet zum Beispiel auf <code>...@googlemail.com</code>.</li>
<li>Unter <em>Connection</em> wählt man <em>Use Protokoll Encryption</em>, <em>Allow plain-text
password authentication</em> und <em>Override default server information</em> aus. Als
Server gibt man dort <code>talk.google.com</code> und den Port <code>5223</code> an.</li>
</ul>
<p>Nun sollte es problemlos funktionieren, mit Kopete über Google Talk Nachrichten
auszutauschen.</p>T6963-basiertes LC-Display2007-08-16T01:00:00+08:002007-08-16T01:00:00+08:00andreastag:www.a-netz.de,2007-08-16:/blog/2007/08/t6963-basiertes-lc-display.html<p>Hin und wieder werden recht günstig graphische LC-Displays von
Restpostenanbietern verkauft. Ich habe eines von <a href="http://www.pollin.de">Pollin</a> namens 'DataVision
DG12864-12', Best.-Nr. 120 291 mit 128 × 64 Pixeln gekauft. Es eignet sich
bestens, um es mit einem kleinen Microcontroller zu verbinden, denn es besitzt
einen eingebauten Zeichengenerator, der die ersten 128 …</p><p>Hin und wieder werden recht günstig graphische LC-Displays von
Restpostenanbietern verkauft. Ich habe eines von <a href="http://www.pollin.de">Pollin</a> namens 'DataVision
DG12864-12', Best.-Nr. 120 291 mit 128 × 64 Pixeln gekauft. Es eignet sich
bestens, um es mit einem kleinen Microcontroller zu verbinden, denn es besitzt
einen eingebauten Zeichengenerator, der die ersten 128 ASCII-Zeichen darstellen
kann. Man kann entscheiden, ob man das Aussehen der Zeichen mit den Codes 0x7f
bis 0xff oder sogar aller Zeichen selbst definieren möchte. Natürlich kann man
aber auch Grafik anzeigen, also jeden Pixel einzeln setzen. Das Display-Modul
verwendet den Chip T6963 von Toshiba.</p>
<h1 id="elektrisches-interface">Elektrisches Interface</h1>
<p>Das elektrische Interface ist sehr einfach aufgebaut. Auf 8 Datenleitungen (D0 -
D7) werden die Daten übertragen, daneben gibt es Steuerleitungen für Lesen (RD),
Schreiben (WR), Chip-Enable (CE, dient als Clock-Leitung zur Steuerung der
Datenübertragung), Daten- oder Kommando-Modus (C/D) und Reset (RST).</p>
<p>Die Steuerleitungen sind low-active, d.h. im Normalzustand liegt an ihnen ein
high-Pegel, zur Aktivierung wird ein low-Pegel angelegt. Die RD- und WR-Leitung
dürfen natürlich nicht gleichzeitig aktiviert werden.</p>
<h1 id="datenubertragung">Datenübertragung</h1>
<p>Bei der Datenübertragung kann man mit Hilfe der C/D-Leitung festlegen, ob das
Display die Übertragung als Daten oder als Kommando interpretieren soll. Soll
ein Kommando geschickt werden, so werden, sofern vorhanden, zunächst die
Parameter zu dem Befehl übertragen, die das Display auf einem internen Stack
ablegt und danach der Befehl selbst.</p>
<h1 id="display-speicher">Display-Speicher</h1>
<p>Das Display besitzt 8kB internen Speicher, den man mit entsprechenden Befehlen
an das Display selbst in Bereiche für Text-, Grafik- und
Zeichengenerator-Speicher aufteilen kann. Dies sollte bei der Initialisierung
erledigt werden. Bei der Initialisierung wird ebenfalls festgelegt, ob das
Display den Text-, den Grafik-Speicher oder beide darstellt.</p>
<p>Nun kann man den Address-Pointer des Displays auf den zu beschreibenden
Speicherbereich setzen und dort Daten ablegen. Die übertragenen Daten werden
dann sofort dargestellt.</p>
<h1 id="font-auswahl">Font-Auswahl</h1>
<p>Über den Font-Select-Pin am Display kann festgelegt werden, ob der Text in einem
6×8-Pixel-Zeichensatz (effektiv 5×7 Pixel plus 1 Pixel Abstand zum nächsten
Zeichen) oder 8×8-Pixel-Zeichensatz dargestellt wird.</p>
<p>Bei der Auswahl das 6×8-Pixel-Fonts ist darauf zu achten, dass damit auch die
Darstellung der Graphik-Daten beeinflusst wird. Es werden dann nämlich nur noch
die unteren 6 Bit jedes Byte als Pixel-Daten genutzt, die oberen (<abbr
title="most significant bit">MSB</abbr>) 2 Bit werden dann nicht beachtet. Im
8×8-Pixel-Font-Modus werden dementsprechend alle 8 Bit eines Bytes als
Pixel-Daten genutzt.</p>RC5-Infrarot-Fernbedienung2006-11-01T00:00:00+08:002006-11-01T00:00:00+08:00andreastag:www.a-netz.de,2006-11-01:/blog/2006/11/rc5-infrarot-fernbedienung.html<p>Jede Stereoanlage lässt sich heutzutage mit einer Fernbedienung bedienen,
weshalb natürlich auch mein Selbstbau-Verstärker eine bekommen muss.</p>
<figure>
<a href="https://www.a-netz.de/blog/2006/11/images/rc5-prototype.jpg">
<img src="https://www.a-netz.de/blog/2006/11/images/rc5-prototype.jpg"
title="Prototyp der Fernbedienung"
alt="Prototyp der Fernbedienung">
</a>
<figcaption>Prototyp der Fernbedienung</figcaption>
</figure>
<h1 id="grundlagen">Grundlagen</h1>
<p>Fast alle Fernbedienungen für Fernseher und Stereoanlagen funktionieren heute
per Infrarot. Das heißt aber noch nicht, dass auch jede Fernbedienung mit jedem
Gerät funktioniert. Es kommt auf das Protokoll …</p><p>Jede Stereoanlage lässt sich heutzutage mit einer Fernbedienung bedienen,
weshalb natürlich auch mein Selbstbau-Verstärker eine bekommen muss.</p>
<figure>
<a href="https://www.a-netz.de/blog/2006/11/images/rc5-prototype.jpg">
<img src="https://www.a-netz.de/blog/2006/11/images/rc5-prototype.jpg"
title="Prototyp der Fernbedienung"
alt="Prototyp der Fernbedienung">
</a>
<figcaption>Prototyp der Fernbedienung</figcaption>
</figure>
<h1 id="grundlagen">Grundlagen</h1>
<p>Fast alle Fernbedienungen für Fernseher und Stereoanlagen funktionieren heute
per Infrarot. Das heißt aber noch nicht, dass auch jede Fernbedienung mit jedem
Gerät funktioniert. Es kommt auf das Protokoll an, das die Fernbedienung
verwendet, um dem Gerät Befehle zu übermitteln. Fast jeder Hersteller verwendet
da eine Eigenentwicklung. Eines der wenigen standardisierten und bekannten
Protokolle ist das von Philips entwickelte <a href="http://de.wikipedia.org/wiki/RC-5">RC5</a>.</p>
<p>RC5 überträgt mit einem Tastendruck ein 14 Bit langes Datenpaket. Dabei sind die
ersten zwei Bits Startbits, die immer 1 sind, dann folgt das Toggle-Bit (damit
lässt sich eine dauerhaft gedrückte Taste vom mehrfachen Betätigen der selben
Taste unterscheiden), dann 5 Bits für eine Geräteadresse (damit sich mit der
Fernbedienung für den Fernseher nicht auch gleichzeitig der Receiver
angesprochen fühlt) und 6 Bit für einen Befehl an das Gerät.</p>
<p>Bei der Übertragung von Daten wird das Infrarotlicht mit einer Frequenz von
meistens 36kHz (manchmal auch 38kHz) getaktet, damit der Empfänger es von
Umgebungslicht unterscheiden kann. Die Bits werden dann biphasenkodiert
übertragen. Das heisst, jedes Bit besteht aus zwei Teilen, einer
Übertragungsphase in der IR-Licht (mit 36 - 38 kHz moduliert) gesendet wird und
einer genau so langen Pause, in der kein Licht ausgesendet wird. Für ein 1-Bit
wird zunächst die Pause abgewartet und dann gesendet, für ein 0-Bit genau
umgekehrt erst gesendet und dann die Pause abgewartet.</p>
<figure>
<a href="https://www.a-netz.de/blog/2006/11/images/rc5-timing.png">
<img src="https://www.a-netz.de/blog/2006/11/images/rc5-timing.png"
title="Timing des RC5-Protokolls"
alt="Timing des RC5-Protokolls">
</a>
<figcaption>Timing des RC5-Protokolls</figcaption>
</figure>
<p>Ein Bit ist immer genau 1,8ms lang, das heisst, die Sendephase und die Pause
dauern jeweils 900µs. Damit ist die Übertragung der 14 Bit nach ca. 25ms
abgeschlossen. Das Protokoll sieht aber vor, dass höchstens alle 114ms ein
Datenpaket übertragen wird.</p>
<h1 id="aufbau">Aufbau</h1>
<p>Da der Verstärker nicht viele Funktionen hat, die gesteuert werden sollen, hat
der Prototyp der Fernbedienung erst einmal nur 5 Taster. Ein Tastendruck weckt
den für die Fernbedienung verwendeten Microcontroller (Atmel ATTiny 2313) aus
dem Power-Down-Modus auf, so dass der entsprechende Befehl gesendet werden
kann. Danach geht der Controller direkt wieder in den Sleep-Modus, um möglichst
wenig Strom zu verbrauchen (ca. 0,5uA).</p>
<figure>
<a href="https://www.a-netz.de/blog/2006/11/images/rc5-schematic.png">
<img src="https://www.a-netz.de/blog/2006/11/images/rc5-schematic.png"
title="Schaltplan des RC5-Senders"
alt="Schaltplan des RC5-Senders">
</a>
<figcaption>Schaltplan des RC5-Senders</figcaption>
</figure>
<p>Die Infrarot-LED (LD274) wird über einen Transistor (BC337) angesteuert, da sie
im Impuls-Modus wesentlich mehr als die von einem Portpin des Controllers
gelieferten 20mA verkraften und so "heller" leuchten kann.</p>
<p>Die Tasten sind jeweils mit einem Portpin verbunden, dessen interner
Pull-up-Widerstand aktiviert ist. Zusätzlich zieht der Taster über eine Diode
den Eingang für den externen Interrupt auf low, um so den Controller aus dem
Schlafmodus zu wecken. Die jeweils zwischen Taster und Portpin geschalteten
Widerstände dienen dem Schutz des Controllers und haben einen Wert von 1kOhm. In
meinem Prototyp-Aufbau habe ich sie zunächst weggelassen.</p>
<p>Der Transistor zur Ansteuerung der Infrarot-LED hängt über einen 1KOhm-
Widerstand an einem Output-Pin des Controllers. Die Led wird durch den
Transistor angesteuert. Ihr Maximalstrom wird durch einen 6,1-Ohm-Widerstand
begrenzt. In dieser Konfiguration und mit einem TSOP1736 als Empfänger schafft
man so eine Reichweite von etwa 10m.</p>
<h1 id="code">Code</h1>
<p>Der Code besteht im wesentlichen aus einem Initialisierungsteil, in dem die
Hardware-Timer konfiguriert werden, einem Interrupt-Handler für die Taster und
einem Interrupt-Handler für den Bit-Timer, der dafür sorgt, dass ein Bit nach
dem anderen übertragen wird. Die 36kHz-Modulationsfrequenz wird ebenfalls von
einem Timer erzeugt, so dass der Controller - auch während ein Datenpaket
gesendet wird - kaum etwas zu tun hat (siehe auch).</p>
<p>Im Power-Down-Modus wird der Oszillator des Controllers abgeschaltet. Wird der
Controller durch einen Tastendruck aufgeweckt, so läuft er mit 8MHz, denn mit
geringerer Taktfrequenz könnte man die Modultationsfrequenz und Bit-Zeiten nicht
so exakt einhalten.</p>
<h1 id="links">Links</h1>
<p>Download des Source-Code: <a href="https://www.a-netz.de/blog/2006/11/files/remote-control-20061019.tar.gz">remote-control-20061019.tar.gz</a></p>Elektrische Anlage für Modell-LKW2006-03-17T00:00:00+08:002006-03-17T00:00:00+08:00andreastag:www.a-netz.de,2006-03-17:/blog/2006/03/elektrische-anlage-fur-modell-lkw.html<p>Auf dieser Seite dokumentiere ich die Planungen und den Bau einer elektrischen
Anlage zur Beleuchtungs- und Sonderfunktionssteuerung für meine. Es sollen dazu
mittels eines Mikrocontrollers die Signale von einigen Kanälen der Fernsteuerung
ausgewertet werden und die Beleuchtung und Sonderfunktionen möglichst
originalgetreu gesteuert werden.</p>
<h1 id="anforderungen">Anforderungen</h1>
<p>Die Schaltung soll sowohl die Beleuchtung …</p><p>Auf dieser Seite dokumentiere ich die Planungen und den Bau einer elektrischen
Anlage zur Beleuchtungs- und Sonderfunktionssteuerung für meine. Es sollen dazu
mittels eines Mikrocontrollers die Signale von einigen Kanälen der Fernsteuerung
ausgewertet werden und die Beleuchtung und Sonderfunktionen möglichst
originalgetreu gesteuert werden.</p>
<h1 id="anforderungen">Anforderungen</h1>
<p>Die Schaltung soll sowohl die Beleuchtung als auch Sonderfunktionen steuern. Bei
der elektrischen Anlage des Herstellers (<a href="http://www.wedico.de">Wedico</a>) hat mich gestört, dass es
kein direktes Interface zum Empfänger gibt, so dass für jede Funktion ein extra
RC-Schalter (ich habe bisher welche von Conrad verwendet) benötigt
wird. Außerdem war das Verhalten nicht realistisch: Die Richtungsblinker blinken
nur, solange man lenkt, es gibt keine Möglichkeit, den Blinker vor dem
Abbiegevorgang zu setzen. Es blinkt genau so lange, wie die Räder eingeschlagen
sind. Ähnliches gilt für die Bremslichter. Sie leuchten, solange man weder
vorwärts noch rückwärts fährt. Jeder vernünftige Fahrer nimmt aber nach einier
Zeit im Stillstand den Fuß vom Bremspedal und nutzt die Hand- oder
Feststellbremse. Außerdem sollten die Bremslichter eingeschaltet werden, sobald
die Geschwindigkeit verringert wird.</p>
<p>Die Anlage soll die Beleuchtungsfunktionen</p>
<ul>
<li>Hauptlicht</li>
<li>Bremslicht</li>
<li>Richtungsblinker</li>
<li>Warnblinker</li>
<li>Rückfahrscheinwerfer</li>
</ul>
<p>sowie die Sonderfunktionen</p>
<ul>
<li>Hupe</li>
<li>Dach-Beleuchtung</li>
<li>Auffahrrampen des Tiefladers</li>
</ul>
<p>steuern.</p>
<p>Eine weitere Anforderung bestand darin, die vielen Kabel, die von der
Steuereinheit zur vorderen und hinteren Stoßstange sowie evtl. zum Anhänger oder
Auflieger laufen, zu beseitigen und durch ein Bussystem mit weniger Adern zu
ersetzten.</p>
<p>Diese Anforderungen lassen sich relativ einfach mit Hilfe eines passenden
Mikrocontroller umsetzen. Meine Wahl fiel auf dem ATMega8 von <a href="http://www.atmel.com">Atmel</a>, da ich
mich mit der AVR-Baureihe bereits auskenne.</p>
<h1 id="aufbau">Aufbau</h1>
<p>Die Anlage besteht aus der Steuereinheit und mehreren Schalteinheiten. Die
Steuereinheit ist in der Fahrerkabine untergebracht und ist für die Auswertung
der vom Empfänger kommenden Signale zuständig. Die Schalteinheiten sitzen in der
Nähe der vorderen und hinteren Stoßstange und steuern die Lampen an.</p>
<h1 id="steuereinheit">Steuereinheit</h1>
<p>Die Steuereinheit enthält den Mikrocontroller <a href="http://www.atmel.com/dyn/products/product_card.asp?part_id=2004">ATMega8</a>, der dafür zuständig
ist, die Fernsteuersignale des Empfängers auszuwerten und daraufhin die
Schaltvorgänge für die Beleuchtung und die Sonderfunktionen auszulösen. Außerdem
befinden sich hier auch zwei Spannungsregler, ein 5V-Linearregler für die
Elektronik und ein einstellbarer Schaltregler <a href="http://www.national.com/pf/LM/LM2576.html">LM2576-ADJ</a> für die
Lampenspannung, welcher ca. 3V erzeugt.</p>
<p>Auf der Steuer-Platine sitzen außerdem 4 Transistoren zum Schalten von
12V-Verbrauchern. Bisher ist hier nur der Anschluss der Hupe und des Dachlichts
geplant, die restlichen zwei sind noch nicht verplant.</p>
<figure>
<a href="https://www.a-netz.de/blog/2006/03/images/rc-switch-01.jpg">
<img src="https://www.a-netz.de/blog/2006/03/images/rc-switch-01.jpg"
title="Die Steuerplatine von oben (noch ohne
Schaltregler)"
alt="Die Steuerplatine von oben (noch ohne
Schaltregler)">
</a>
<figcaption>Die Steuerplatine von oben (noch ohne
Schaltregler)</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/03/images/rc-switch-02.jpg">
<img src="https://www.a-netz.de/blog/2006/03/images/rc-switch-02.jpg"
title="... und von unten (mit dem Mikrocontroller in
SMD-Technik)"
alt="... und von unten (mit dem Mikrocontroller in
SMD-Technik)">
</a>
<figcaption>... und von unten (mit dem Mikrocontroller in
SMD-Technik)</figcaption>
</figure>
<h1 id="auswertung-der-rc-kanale">Auswertung der RC-Kanäle</h1>
<p>Die Steuereinheit ist so ausgelegt, dass gleichzeitig vier RC-Kanäle ausgewertet
werden. Die zwei für Lenken und Fahren zuständigen Kanäle werden zum Anschluss
von Fahrtregler und Lenkservo durchgeschleift. Diese Kanäle werden ausgewertet,
um Bremslicht, Rückfahrlicht und die Richtungsblinker anzusteuern. Die beiden
anderen RC-Kanäle dienen zur Steuerung der Sonderfunktionen. Über jeden der
Sonderfunktionskanäle können 4 Schaltfunktionen gesteuert werden. Dazu wird der
Sender mit einem Schaltmodul ausgerüstet, welches die Schalterstellungen für die
Sonderfunktionen in einen Proportionalwert umsetzt, der vom Mikrokontroller
wieder dekodiert und zur Ansteuerung der Sonderfunktionen verwendet wird.</p>
<p>Damit die Dekodierung der Sonderfunktionskanäle funktioniert, muss die
Steuereinheit einmalig kalibriert werden. Dabei werden die Mittelstellungen
sowie die Minimal- und Maximalwerte der vier RC-Kanäle bestimmt und im Eeprom
des Mikrocontrollers gespeichert.</p>
<h1 id="erzeugung-der-lampenspannung">Erzeugung der Lampenspannung</h1>
<p>Mit dem Spannungsregler für die Lampen (jeweils 3V, 100mA) habe ich mich in der
ersten Version völlig verschätzt und einen LM317 im TO220-Gehäuse verwendet. Die
Abwärme dieses Linearreglers ist aber selbst bei relativ wenigen eingeschalteten
Lampen so groß, dass die Kühlung zu aufwendig wird. Außerdem ist es schade um
die unnütz verschwendete Energie aus den Akkus. Daher wurde der Linearregler
durch einen Schaltregler ersetzt, der einen wesentlich besseren Wirkungsgrad von
ca. 75 Prozent hat. Der Aufbau der Schaltregler-Einheit ist auf der Seite
... genauer erläutert.</p>
<h1 id="schalteinheiten">Schalteinheiten</h1>
<p>Die Schalteinheiten empfangen von der Steuereinheit die Befehle zum Schalten der
Lampen (und evtl. anderer Verbraucher). Dazu sind sie mit der Steuereinheit über
ein 4-adriges Kabel verbunden. Darüber wird die Schaltelektronik mit 5V und die
Lampen mit ca. 3V versorgt. Die Schaltbefehle werden über ein serielles
Protokoll übertragen. Die Platinen der Schalteinheiten sind so ausgelegt, dass
sie in die existierenden Plantinenhalterungen für die elektrische Anlage von
Wedico passen.</p>
<figure>
<a href="https://www.a-netz.de/blog/2006/03/images/rc-switch-03.jpg">
<img src="https://www.a-netz.de/blog/2006/03/images/rc-switch-03.jpg"
title="Eines der Schaltmodule mit MCU und Treiber-IC"
alt="Eines der Schaltmodule mit MCU und Treiber-IC">
</a>
<figcaption>Eines der Schaltmodule mit MCU und Treiber-IC</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/03/images/rc-switch-04.jpg">
<img src="https://www.a-netz.de/blog/2006/03/images/rc-switch-04.jpg"
title="Schaltmodule von oben"
alt="Schaltmodule von oben">
</a>
<figcaption>Schaltmodule von oben</figcaption>
</figure>
<p>Meine ersten Überlegungen gingen in die Richtung, einen I2C-Bus zur
Datenübertragung zu verwenden. Dies wurde aber verworfen, da zwei Adern (I2C
benötigt eine Clock- und eine Datenleitung) zur Datenübertragung benötigt
werden. Dadurch wird es aufwändiger, eine (für die Zukunft geplante) drahtlose
Übertragung der Daten an einen Anhänger zu realisieren. Außerdem wird die
Bidirektionalität von I2C nicht benötigt. Bei der I2C-Lösung wäre geplant
gewesen, einen 8-Bit-IO-Expander Philips <a href="http://www.semiconductors.philips.com/acrobat/datasheets/PCF8574_4.pdf">PCF8574</a> einzusetzten. Außerdem bin
ich nicht sicher, ob diese Lösung dazu geeignet gewesen wäre, im
Multicast-Verfahren Daten an mehrere der IO-Expander gleichzeitig zu übertragen.</p>
<p>Daher habe ich mich für eine andere Lösung dieses Problems entschieden. Die
Daten werden von der Steuereinheit per RS232 übertragen, wobei nur die
Sendeleitung verbunden ist, es gibt also keinen Rückkanal. Auf den
Schalteinheiten sitzt jeweils ein Mikrocontroller AT90S2313 (inzwischen <a href="http://www.atmel.com/dyn/products/product_card.asp?part_id=3229">AT Tiny
2313</a>) sowie ein Treiberbaustein <a href="http://www.st.com/stonline/books/pdf/docs/5279.pdf#search=%22uln2003%22">ULN2003</a> in SMD-Version. Der Mikrokontroller
ist derzeit sicher ziemlich unterfordert. Meiner Ansicht nach ist dies aber die
zur Zeit flexibleste Lösung. Außerdem ist er sogar günstiger als ein
entsprechende I2C-IO-Expander. Durch die Verwendung von RS232 sollte auch die
drahtlose Übertragung der Steuersignale an einen Anhänger, z.B. per
Infrarot-Transmitter und -Receiver, einfach zu realisieren sein.</p>Rekorderrennen 20062006-01-26T00:00:00+08:002006-01-26T00:00:00+08:00andreastag:www.a-netz.de,2006-01-26:/blog/2006/01/rekorderrennen-2006.html<p>These are a few photos of the <a href="http://www.rekorderrennen.de">Casette Recorder Race</a> <a href="http://www.rekorderrennen.de/Rekorderrennen2006.html">2006</a> in the
Phönixhalle in Dortmund. The photos are taken by the team <em>Die
Geschwindigkeitsraketen</em> with their vehicle <em>Pött-Pött</em>.</p>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_01.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_01.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_02.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_02.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_03.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_03.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_04.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_04.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_05.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_05.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_06.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_06.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_07.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_07.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_08.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_08.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_09.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_09.jpg"
title=""
alt="">
</a>
</figure>Rekorderrennen 20062006-01-26T00:00:00+08:002006-01-26T00:00:00+08:00andreastag:www.a-netz.de,2006-01-26:/blog/2006/01/rekorderrennen-2006.html<p>Dies sind die Photos vom <a href="http://www.rekorderrennen.de">Rekorderrennen</a> <a href="http://www.rekorderrennen.de/Rekorderrennen2006.html">2006</a> in der Phönixhalle in
Dortmund. Dies sind die Photos des Teams <em>Die Geschwindigkeitsraketen</em> mit ihrem
Fahrzeug <em>Pött-Pött</em>.</p>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_01.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_01.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_02.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_02.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_03.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_03.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_04.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_04.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_05.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_05.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_06.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_06.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_07.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_07.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_08.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_08.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_09.jpg">
<img src="https://www.a-netz.de/blog/2006/01/images/rekorderrennen_09.jpg"
title=""
alt="">
</a>
</figure>Linux auf dem Lifebook S-70202005-08-10T00:00:00+08:002005-08-10T00:00:00+08:00andreastag:www.a-netz.de,2005-08-10:/blog/2005/08/linux-auf-dem-lifebook-s-7020.html<p>Auf dieser Seite werde ich kurz meine Erfahrungen bei der Einrichtung von Linux
auf meinem Notebook, dem <a href="http://www.fujitsu-siemens.de">Fujitsu-Siemens</a> <a href="http://www.fujitsu-siemens.de/products/mobile/notebooks/lifebook_s.html">Lifebook S-7020</a>
zusammenfassen. Diese Seite ist übrigens auch über <a href="http://tuxmobil.org">TuxMobil</a> zu erreichen.</p>
<figure>
<a href="https://www.a-netz.de/blog/2005/08/images/lifebook-s7020.jpg">
<img src="https://www.a-netz.de/blog/2005/08/images/lifebook-s7020.jpg"
title="Lifebook S-7020"
alt="Lifebook S-7020">
</a>
<figcaption>Lifebook S-7020</figcaption>
</figure>
<h1 id="hardwareausstattung">Hardwareausstattung</h1>
<ul>
<li>Pentium M 760 (2,0GHz)</li>
<li>1024MB Ram</li>
<li>80GB SATA-Festplatte</li>
<li>Grafik: Intel GMA900</li>
<li>Display: 1400x1050 Punkte SXGA+</li>
<li>IEEE1394-Anschluss …</li></ul><p>Auf dieser Seite werde ich kurz meine Erfahrungen bei der Einrichtung von Linux
auf meinem Notebook, dem <a href="http://www.fujitsu-siemens.de">Fujitsu-Siemens</a> <a href="http://www.fujitsu-siemens.de/products/mobile/notebooks/lifebook_s.html">Lifebook S-7020</a>
zusammenfassen. Diese Seite ist übrigens auch über <a href="http://tuxmobil.org">TuxMobil</a> zu erreichen.</p>
<figure>
<a href="https://www.a-netz.de/blog/2005/08/images/lifebook-s7020.jpg">
<img src="https://www.a-netz.de/blog/2005/08/images/lifebook-s7020.jpg"
title="Lifebook S-7020"
alt="Lifebook S-7020">
</a>
<figcaption>Lifebook S-7020</figcaption>
</figure>
<h1 id="hardwareausstattung">Hardwareausstattung</h1>
<ul>
<li>Pentium M 760 (2,0GHz)</li>
<li>1024MB Ram</li>
<li>80GB SATA-Festplatte</li>
<li>Grafik: Intel GMA900</li>
<li>Display: 1400x1050 Punkte SXGA+</li>
<li>IEEE1394-Anschluss (Funktion nicht getestet, s.u.)</li>
<li>USB 2.0</li>
<li>Netzwerk: Broadcom BCM5751</li>
<li>WLAN: Intel PRO/Wireless 2200BG</li>
<li>Bluetooth</li>
<li>Modem: Agere HDA Modem 56k</li>
<li>Sound: Intel HD Audio mit Realtek ALC260</li>
<li>PCMCIA-Slot</li>
<li>ExpressCard-Slot (noch nicht getestet)</li>
<li>CD-/DVD-Brenner NEC ND-6500A</li>
</ul>
<p>Ausgabe von <code>lspci</code>:</p>
<div class="highlight"><pre><span></span><code>0000:00:00.0 Host bridge: Intel Corp. Mobile Memory Controller Hub (rev 03)
0000:00:02.0 VGA compatible controller: Intel Corp. Mobile Graphics Controller (rev 03)
0000:00:02.1 Display controller: Intel Corp. Mobile Graphics Controller (rev 03)
0000:00:1b.0 0403: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller (rev 04)
0000:00:1c.0 PCI bridge: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 (rev 04)
0000:00:1c.1 PCI bridge: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 2 (rev 04)
0000:00:1d.0 USB Controller: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 04)
0000:00:1d.1 USB Controller: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 04)
0000:00:1d.2 USB Controller: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 04)
0000:00:1d.3 USB Controller: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4 (rev 04)
0000:00:1d.7 USB Controller: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 04)
0000:00:1e.0 PCI bridge: Intel Corp. 82801 PCI Bridge (rev d4)
0000:00:1f.0 ISA bridge: Intel Corp. 82801FBM (ICH6M) LPC Interface Bridge (rev 04)
0000:00:1f.1 IDE interface: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) IDE Controller (rev 04)
0000:00:1f.2 0106: Intel Corp. 82801FBM (ICH6M) SATA Controller (rev 04)
0000:00:1f.3 SMBus: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Controller (rev 04)
0000:02:00.0 Ethernet controller: Broadcom Corporation: Unknown device 167d (rev 11)
0000:06:03.0 CardBus bridge: O2 Micro, Inc.: Unknown device 7134 (rev 20)
0000:06:05.0 Network controller: Intel Corp. PRO/Wireless 2200BG (rev 05)
0000:06:06.0 FireWire (IEEE 1394): Texas Instruments TSB43AB21 IEEE-1394a-2000 Controller (PHY/Link)`
</code></pre></div>
<h1 id="installation-von-debiangnu-linux">Installation von Debian/GNU Linux</h1>
<p>Bei der Installation von <a href="http://www.debian.org">Debian</a> Linux Unstable konnte ich leider nicht den
aktuellen Debian-Installer der stable-Version verwenden, da dessen Kernel
(2.4.XX und 2.6.8) entweder die SATA-Festplatte oder den Netzwerk-Chip nicht
verwenden konnten. Dass es auch eine testing-Version des Installers gibt, habe
ich leider zu spät gemerkt...</p>
<p>Ich habe mir geholfen, indem ich auf meinemeinen passenden Kernel (aktuelle
Version 2.6.12.5) für den neuen Rechner übersetzt habe, dann ein Image der
Festplatte auf das neue Notebook übertragen habe und dort mit Hilfe von
<a href="http://www.knoppix.org">Knoppix</a> den Bootmanager lilo wieder installiert habe und somit recht einfach
und schnell wieder ein lauffähiges System hatte.</p>
<h2 id="ubertragung-des-hd-images">Übertragung des HD-Images</h2>
<p>Um das Image der Festplatte des alten Notebooks auf das Neue zu übertragen, habe
ich die Systempartition auf dem alten Notebook mit dem Befehl <code>dd</code> ausgelesen
und mittels <code>netcat</code> zum neuen Notebook geschickt.</p>
<div class="highlight"><pre><span></span><code>dd <span class="k">if</span><span class="o">=</span>/dev/hda2 <span class="p">|</span> netcat <span class="m">192</span>.168.0.5 <span class="m">3124</span>
</code></pre></div>
<p>Damit das neue Notebook die Daten entgegennehmen kann, muss dort zuvor ebenfalls
<code>netcat</code> im Servermodus gestartet werden:</p>
<div class="highlight"><pre><span></span><code>netcat -p <span class="m">3124</span> -l <span class="p">|</span> dd <span class="nv">of</span><span class="o">=</span>/dev/sda2
</code></pre></div>
<p>Da ich die Systempartition gleichzeitig vergrößern wollte, habe ich auf dem
neuen Notebook zuvor eine entsprechend große Partition erstellt und nach dem
übertragen des Images dieses mit <code>resize2fs</code> (unterstützt auch das ext3
Dateisyystem) vergrößert, was problemlos und ohne Datenverlust funktioniert hat.</p>
<h1 id="sata-controller-und-festplatte">SATA-Controller und -Festplatte</h1>
<p>Serial-ATA-Festplatten werden unter Linux wie SCSI-Geräte behandelt. Daher muss
man in der Kernel-Konfiguration auch unter Device Drivers → SCSI Device
Support → SCSI low-level drivers → Serial ATA Support und für den
verwendeten Intel 915 Chipsatz die AHCI-Unterstützung aktivieren. Die Festplatte
sollte sich dann als<code>/dev/sdX</code> und nicht wie die normalen ATA-Platten als
<code>/dev/hdX</code> ansprechen lassen.</p>
<h1 id="netzwerk-chip">Netzwerk-Chip</h1>
<p>Aus Lizenzgründen wurde in den aktuellen Debian-Kernel-Sourcen der Treiber für
den Broadcom-Chip entfernt. Im offiziellen Kernel ist er aber noch enthalten. Er
befindet sich bei den 1000MBit-Netzwerkchips und heisst <code>tg3</code>. Nach dem Laden
des tg3-Moduls lässt sich die Karte dann problemlos mit ifconfig
etc. ansprechen.</p>
<h1 id="wireless-lan">Wireless LAN</h1>
<p>Für den WLAN-Chip Intel Pro/Wireless 2200 LAN von Intel gibt es unter
http://ipw2200.sourceforge.net die entsprechenden Kernel-Module. Man benötigt
neben dem Treiber für den WLAN-Chip auch noch die passende Firmware, die es
ebenfalls dort gibt.</p>
<p>Die Verschlüsselungsvariante WPA läuft bei mir problemlos mit Kernel 2.6.12 und
der Software <code>wpa_supplicant</code>. Mogu (Vielen Dank für den Hinweis!) schrieb mir
jedoch:</p>
<p>"WPA läuft nicht mit Kernel 2.6.13 und ipw2200-1.0.6 zusammen, bei mir
funktioniert wpa mit <code>wpasupplicant</code> nur mit dem <code>wext</code> Treiber von
<code>wpasupplicant</code>."</p>
<h2 id="update-13082006">Update - 13.08.2006</h2>
<p>Im aktuellen Kernel (2.6.17) ist bereits ein Treiber für die Centrino-WLAN-Chips
enthalten. Man benötigt also nicht mehr unbedingt den Code von
sourceforge.net. Möchte man jedoch den Monitormode verwenden, so gibt es auf der
Seite genauere Informationen dazu.</p>
<h1 id="bluetooth">Bluetooth</h1>
<p>Das Bloototh-Modul hängt intern am USB-Bus. Damit man es ansprechen kann, muss
im Kernel der Bluetooth-Support unter "Device Drivers → Networking →
Bluetooth Subsystem" und darin unter "Bluetooth device drivers" das Modul <code>HCI
USB Driver</code> ausgewählt werden. Zusätzlich habe ich die <code>bluez-utils</code>
installiert. Mit dem darin enthaltenen Programm <code>hciconfig</code> kann man dann sehen,
ob Bluetooth verfügbar ist. Mangels eines Bluetooth-Gerätes habe ich aber bisher
keine Kommunikation ausprobiert.</p>
<h1 id="pcmcia-bzw-pc-card-slot">PCMCIA- bzw PC-Card-Slot</h1>
<p>Der PCMCIA-Chip wird vom Yenta-Treiber erkannt. Ob eine entsprechende Karte
damit funktioniert, habe ich noch nicht getestet.</p>
<h1 id="ieee1394-anschluss">IEEE1394-Anschluss</h1>
<p>Der Chipsatz wird von dem Kernel-Module <code>nohci1394</code> und <code>ieee1394</code>
erkannt. Mangels einem passenden Gerät habe ich den Anschluss aber noch nicht
testen können.</p>
<h1 id="usb-anschlusse">USB-Anschlüsse</h1>
<p>Die Anschlüsse werden von den Kernel-Modulen <code>uhci-hcd</code>und <code>ehci-hcd</code> erkannt
und funktionieren einwandfrei. Mangels eines USB 2.0-Gerätes habe ich diese
Funktion noch nicht getestet.</p>
<h1 id="stromsparfunktion-speedstep">Stromsparfunktion / Speedstep</h1>
<p>Nach dem Laden des Modules <code>centrino-speedstep</code> kann der Dämon <code>cpufreqd</code> die
Prozessorfrequenz in einigen Schritten zwischen 800 MHz und 2 GHz variieren, um
Strom zu sparen.</p>
<p>Die Standard-Konfiguration von <code>cpufreqd</code> habe ich angepasst, so dass das
Notebook, wenn es am Stromnetz hängt und die CPU-Last kleiner als 10% ist, mit
nur 800 MHz läuft. So springt der Lüfter fast nie an, solange man nicht daran
arbeitet.</p>
<p>Man kann die Frequenz, mit der die CPU läuft, mit dem Kommando</p>
<div class="highlight"><pre><span></span><code>cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
</code></pre></div>
<p>überprüfen. Die weiteren Dateien in diesem Verzeichnis geben unter anderem die
minimale und maximale Frequenz an, mit der die CPU laufen kann.</p>
<h2 id="update-13112006-hibernate-modus">Update 13.11.2006: Hibernate-Modus</h2>
<p>Bisher gab es ein Problem mit dem Hibernate-Modus (unter Windows "Ruhezustand"),
bei dem der Inhalt des Arbeitsspeichers auf der Festplatte gesichert und beim
nächsten Booten wieder geladen wird, was die Zeit zum Booten erheblich
verkürzt. Nach dem Booten konnte die Festplatte nicht mehr angesprochen werden,
was mit dem Stillstand von Linux endete. Seit der Kernel-Version 2.6.18.1
(vielleicht auch schon frühere) gibt es aber einen alternativen Treiber für den
SATA-Controller.</p>
<p>Der <abbr title="Advanced Host Controller Interface">AHCI</abbr> Treiber
funktioniert nicht, der für Intel <abbr title="I/O Controller Hub">ICH</abbr>
aber schon. Nach dessen Aktivierung (nicht als Modul, denn er wird beim Booten
benötigt) funktioniert der Hibernate-Modus dann einwandfrei. Zur Aktivierung
benötigt man noch das Paket <code>hibernate</code>, in dem einige Skripte enthalten sind,
die unter anderem dafür sorgen, dass nach dem Booten die Grafik wieder so
eingestellt wird, dass die volle Auflösung dargestellt werden kann (Einstellung
<code>"Runi915resolution yes"</code> in der Datei <code>/etc/hibernate/common.conf</code>).</p>
<h1 id="einrichtung-des-x-servers">Einrichtung des X-Servers</h1>
<p>Der GMA900 wird vom X-Server von X.org (Debian-Package xserver-xorg)
unterstützt. Als Treiber muss in der Konfiguration <code>i810</code> eingetragen werden. Da
es aber ein Problem bei der Abfrage der möglichen Auflösungen durch den X-Server
gibt und so zunächst nur 1280x1024 Punkte möglich sind, gibt es ein kleines
Utility <code>855resolution</code>, welches die Tabelle der unterstützten Auflösungen des
Graphikchips so ändert, dass der X-Server auch 1400x1050 Punkte verwenden
kann. Das Tool muss vor dem Start des X-Server zum Beispiel mit folgenden
Parametern aufgerufen werden: <code>855resolution 3c 1400 1050</code> Das wird bei mir in
einem init-Skript direkt nach dem booten gemacht. Bei der Installation des
Debian-Paketes <code>855resolution</code> reicht es, in der Datei
<code>/etc/default/855resolution</code> die entsprechenden Daten einzutragen.</p>
<p>Die Datei <code>xorg.conf</code> sollte dann etwa so wie bei mir aussehen:</p>
<h2 id="update-13092005">Update - 13.09.2005</h2>
<p>Es gibt inzwischen unter <a href="http://www.fairlite.demon.co.uk/intel.html">http://www.fairlite.demon.co.uk/intel.html</a> einen
X-Server, der den GMA900 ohne das Programm <code>855resolution</code> unterstützt. Dazu
wird die Datei <code>i810_drv.o</code> im Verzeichnis <code>/usr/X11R6/lib/modules/drivers/</code>
ersetzt durch die heruntergeladene.</p>
<p>Dann muss nur noch die Konfigurationsdatei xorg.conf angepasst werden, so dass
der Device-Abschnitt in etwa so aussieht (die ForceBios Option ist wichtig):</p>
<div class="highlight"><pre><span></span><code>Section "Device"
Identifier "Intel MGA900"
Driver "i810"
Option "ForceBIOS" "1024x768=1400x1050"
EndSection
</code></pre></div>
<h2 id="update-12112005-xinerama">Update - 12.11.2005: Xinerama</h2>
<p>Andreas Bichler berichtet, dass auch Xinerama, eine Erweiterung für den
X-Server, um den Desktop auf mehrere Monitore auszudehen, läuft. Beim Lifebook
umfasst der Desktop dann das LCD-Display und einen extern angeschlossenen
Monitor. Ein Beispiel für eine passende Konfigurationsdatei für den x.org
X-Server gibt es hier:</p>
<h2 id="update-13082006-855resolution">Update - 13.08.2006: 855resolution</h2>
<p><a href="http://www.control.auc.dk/~jdn">Jens Frederik Dalsgaard Nielsen</a> berichtet,
dass das <code>855resolution</code> Tool ersetzt wurde durch <code>915resolution</code>. Versucht man
in Debian, das Paket <code>855resolution</code> zu installieren, so wird automatisch das
Paket <code>915resolution</code> installiert.</p>
<h1 id="sound">Sound</h1>
<p>Um die Soundkarte zu nutzen, benötigt man das Kernel-Modul <code>snd-hda-intel</code> und
eine funktionierende <a href="http://www.alsa-project.org">ALSA</a> -Installation. Die
Soundausgabe funktioniert dann mit Einschränkungen problemlos. Die internen
Lautsprecher des Notebooks hängen am Kopfhörer-Ausgang des Soundchips und lassen
sich daher auch nur mit dem entsprechenden Lautstärkeregler
beeinflussen. Außerdem funktioniert die Soundausgabe über die
Line-Out-/Kopfhörer-Buchse bisher nicht. Ich vermute, dass das mit der "Plug
re-tasking"-Fähigkeit des Soundchips zusammenhängt
(siehe
<a href="http://www.realtek.com.tw/products/products1-2.aspx?modelid=2004052">Realtek-Webseite</a> -
Die dort angebotenen Linux-Treiber enthalten anscheinend nur den aktuellen
Sourcecode des ALSA-Projects und können den Kopfhörerausgang auch nicht
aktivieren).</p>
<h2 id="update-13022006">Update - 13.02.2006</h2>
<p>Im aktuellen Kernel (2.6.15) ist der Patch für HD-Audio integriert, so dass der
Sound mit diesem Kernel funktioniert. Das entsprechende Kernel-Modul
(<code>snd-hda-audio</code>) kennt den Parameter <code>fix_position</code>, der auf 1 gesetzt werden muss,
damit keine Knackser bei der Soundausgabe auftreten:</p>
<div class="highlight"><pre><span></span><code>option snd-hda-audio fix_position=1
</code></pre></div>
<h1 id="modem">Modem</h1>
<p>Inzwischen habe ich auch das interne Modem in Betrieb nehmen können. In den
Treibern für den HD-Audio-Chipsatz ist auch ein Treiber für das Modem
enthalten. Der alleine genügt aber nicht. Zusätzlich muss das
Paket <code>sl-modem-daemon</code> installiert werden. Dieser Dämon wird beim Booten gestartet
und erzeugt für das Modem ein device-File <code>/dev/ttySL0</code>, so dass man das Modem wie
ein normales externes Modem ansprechen kann.</p>
<p>Damit der Dämon weiss, welche Hardware er ansprechen soll, muss sie in der
Konfigurationsdatei <code>/etc/defaults/sl-modem-daemon</code> angegeben werden:</p>
<div class="highlight"><pre><span></span><code>SLMODEMD_DEVICE="hw:Intel,6"
</code></pre></div>
<h1 id="problematische-hardware">Problematische Hardware</h1>
<p>Die folgende Hardware hat sich bisher meinen Versuchen zur Inbetriebnahme
widersetzt:</p>
<ul>
<li>Die Tasten oberhalb der Tastatur können bisher nicht verwendet werden. Sie
erzeugen leider keine ACPI-Events (ausgenommen der Power-Knopf, der
funktioniert im Zusammenspiel mit demacpidproblemlos).</li>
</ul>Linux on the Lifebook S-70202005-08-10T00:00:00+08:002005-08-10T00:00:00+08:00andreastag:www.a-netz.de,2005-08-10:/blog/2005/08/linux-on-the-lifebook-s-7020-en.html<p>On this page you can find a short summary of my experiences with the
installation of [Debian/GNU Linux] on the <a href="http://www.fujitsu-siemens.de">Fujitsu-Siemens</a> <a href="http://www.fujitsu-siemens.de/products/mobile/notebooks/lifebook_s.html">Lifebook
S-7020</a>. This page can also be reached from <a href="http://tuxmobil.org">TuxMobil</a>.</p>
<figure>
<a href="https://www.a-netz.de/blog/2005/08/images/lifebook-s7020.jpg">
<img src="https://www.a-netz.de/blog/2005/08/images/lifebook-s7020.jpg"
title="Lifebook S-7020"
alt="Lifebook S-7020">
</a>
<figcaption>Lifebook S-7020</figcaption>
</figure>
<h1 id="hardware">Hardware</h1>
<ul>
<li>Pentium M 760 (2,0GHz)</li>
<li>1024MB Ram</li>
<li>80GB SATA-Festplatte</li>
<li>Grafik: Intel GMA900</li>
<li>Display: 1400x1050 Pixel …</li></ul><p>On this page you can find a short summary of my experiences with the
installation of [Debian/GNU Linux] on the <a href="http://www.fujitsu-siemens.de">Fujitsu-Siemens</a> <a href="http://www.fujitsu-siemens.de/products/mobile/notebooks/lifebook_s.html">Lifebook
S-7020</a>. This page can also be reached from <a href="http://tuxmobil.org">TuxMobil</a>.</p>
<figure>
<a href="https://www.a-netz.de/blog/2005/08/images/lifebook-s7020.jpg">
<img src="https://www.a-netz.de/blog/2005/08/images/lifebook-s7020.jpg"
title="Lifebook S-7020"
alt="Lifebook S-7020">
</a>
<figcaption>Lifebook S-7020</figcaption>
</figure>
<h1 id="hardware">Hardware</h1>
<ul>
<li>Pentium M 760 (2,0GHz)</li>
<li>1024MB Ram</li>
<li>80GB SATA-Festplatte</li>
<li>Grafik: Intel GMA900</li>
<li>Display: 1400x1050 Pixel SXGA+</li>
<li>IEEE1394- (Firewire) Connector (not tested yet)</li>
<li>USB 2.0</li>
<li>Network: Broadcom BCM5751 (Gigabit Ethernet)</li>
<li>WLAN: Intel PRO/Wireless 2200BG</li>
<li>Bluetooth</li>
<li>Modem: Agere HDA Modem 56k</li>
<li>Sound: Intel HD Audio with Realtek ALC260 Chipset</li>
<li>PCMCIA-Slot</li>
<li>ExpressCard-Slot (not tested yet)</li>
<li>CD-/DVD-Writer NEC ND-6500A</li>
</ul>
<p>Output from <code>lspci</code>:</p>
<div class="highlight"><pre><span></span><code>0000:00:00.0 Host bridge: Intel Corp. Mobile Memory Controller Hub (rev 03)
0000:00:02.0 VGA compatible controller: Intel Corp. Mobile Graphics Controller (rev 03)
0000:00:02.1 Display controller: Intel Corp. Mobile Graphics Controller (rev 03)
0000:00:1b.0 0403: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller (rev 04)
0000:00:1c.0 PCI bridge: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 (rev 04)
0000:00:1c.1 PCI bridge: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 2 (rev 04)
0000:00:1d.0 USB Controller: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 04)
0000:00:1d.1 USB Controller: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 04)
0000:00:1d.2 USB Controller: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 04)
0000:00:1d.3 USB Controller: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4 (rev 04)
0000:00:1d.7 USB Controller: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 04)
0000:00:1e.0 PCI bridge: Intel Corp. 82801 PCI Bridge (rev d4)
0000:00:1f.0 ISA bridge: Intel Corp. 82801FBM (ICH6M) LPC Interface Bridge (rev 04)
0000:00:1f.1 IDE interface: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) IDE Controller (rev 04)
0000:00:1f.2 0106: Intel Corp. 82801FBM (ICH6M) SATA Controller (rev 04)
0000:00:1f.3 SMBus: Intel Corp. 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Controller (rev 04)
0000:02:00.0 Ethernet controller: Broadcom Corporation: Unknown device 167d (rev 11)
0000:06:03.0 CardBus bridge: O2 Micro, Inc.: Unknown device 7134 (rev 20)
0000:06:05.0 Network controller: Intel Corp. PRO/Wireless 2200BG (rev 05)
0000:06:06.0 FireWire (IEEE 1394): Texas Instruments TSB43AB21 IEEE-1394a-2000 Controller (PHY/Link)`
</code></pre></div>
<h1 id="debiangnu-linux-installation">Debian/GNU Linux Installation</h1>
<p>When installing Debian/GNU Linux Unstable I could not use the current Debian
stable installer because the kernel it uses (2.4.XX and 2.6.8) could not detect
the SATA-Harddisk or the network chipset. After having mouch trouble with the
installation I now know that there is also a testing-version of the installer
that probably would have worked.</p>
<p>I have helped me with copying an harddisk image from the old to my new
notebook. Before that I had built a recent kernel on the old notebook that has
all things needed to run on the new one. After copying the image I booted with
<a href="http://www.knoppix.org">Knoppix</a> and only had to invoke lilo to install the new kernel.</p>
<h2 id="transfer-of-the-hd-image">Transfer of the HD Image</h2>
<p>To transfer the harddisk image from to the new notebook, I read out the old
hasddisk with the <code>dd</code> command and sent its output with <code>netcat</code> to the new one:</p>
<div class="highlight"><pre><span></span><code>dd <span class="k">if</span><span class="o">=</span>/dev/hda2 <span class="p">|</span> netcat <span class="m">192</span>.168.0.5 <span class="m">3124</span>
</code></pre></div>
<p>One the lifebook I previously invoked <code>netcat</code> in server mode to receive the
data:</p>
<div class="highlight"><pre><span></span><code>netcat -p <span class="m">3124</span> -l <span class="p">|</span> dd <span class="nv">of</span><span class="o">=</span>/dev/sda2<span class="sb">`</span>
</code></pre></div>
<p>To be able to increase the size of the system partition, I created a primary
system partition on the lifebook about twice as big as on the old notebook. Then
after transfering the image, I booted Knopix and invoked <code>resize2fs</code> (the ext3
filesystem is also supported) to increase the filesystem size to fit exactly
into the partition size. It worked without any problems and I have not lost any
data :)</p>
<h1 id="sata-controller-and-harddisk">SATA-Controller and -Harddisk</h1>
<p>Serial-ATA-Harddisks are handled as SCSI-Devices inside the Kernel. So you need
to activate Device Drivers → SCSI Device Support → SCSI low-level drivers
→ Serial ATA Support. To be able to use the Intel 915 Controller AHCI-Support
is needed, too. After booting this kernel, the harddisks can be accessed as
<code>/dev/sdX</code> but not as normal ATA harddisks under <code>/dev/hdX</code>.</p>
<h1 id="network-chipset">Network-Chipset</h1>
<p>The driver for the Broadcom network chipset is called <code>tg3</code> but it is removed
from the kernel sources that come with debian because of licence problems. The
official kernel from http://www.kernel.org contains it. You can find it under
Device Drivers → Networking → 1000MBit. After loading the module <code>tg3</code> it is
no problem to configure the networking card with ifconfig or ifup / ifdown.</p>
<h1 id="wireless-lan">Wireless LAN</h1>
<p>To be able to use the wireless lan card (Intel Pro/Wireless 2200 LAN) you need
to get and compile the driver from http://ipw2200.sourceforge.net/. It provides
a kernel module <code>ipw2200</code>. You also need to get a firmware for this card that
can also be downloaded at that website.</p>
<p>The encryption method <abbr title="Wi-Fi Protected Access">WPA</abbr> is working
here without problems with kernel 2.6.12.5 and the software <code>wpa_supplicant</code>.</p>
<p>But Mogu (many thanks for your note!) reports, that WPA does not work with
kernel 2.6.13 and the <code>ipw2200-1.0.6</code> drivers. He has to use WPA with
<code>wpasupplicant</code> and the <code>wext</code> drivers.</p>
<h2 id="update-13082006">Update - 13.08.2006</h2>
<p>The current kernel (2.6.17) already contains a driver for the centrino wlan
chips. The driver from sourceforge.net is only needed, if you want to be able to
use the monitor mode. See the german version of this post for more information.</p>
<h1 id="bluetooth">Bluetooth</h1>
<p>The bluetooth-hardware is internally attached to the USB bus. To access it, you
need to enabled the bluetooth support under Device Drivers → Networking
→ Bluetooth Subsystem and the HCI USB Driver under Bluetoth Device
Drivers. To connect to a bluetooth device you also need to install the
<code>bluez-utils</code>. This package contains the program <code>hciconfig</code> to check, if the
bluetooth subsystem is usable.</p>
<h1 id="pcmcia-pc-card-slot">PCMCIA- / PC-Card-Slot</h1>
<p>The PCMCIA-chip is supported by the yenta-driver. When booting the kernel it
reports that it has found a PCMCIA-Cardbus bridge. I have not yet tested if a pc
card or expresscard really works.</p>
<h1 id="ieee1394-connector">IEEE1394-Connector</h1>
<p>The ieee1394 (firewire) chipset is recognized by the kernel modules <code>ohci1394</code>
and <code>ieee1394</code>. I have no firewire device, so I have not yet tested it.</p>
<h1 id="usb">USB</h1>
<p>You need to load the kernel modules <code>uhci-hcd</code> and <code>ehci-hcd</code> to use the usb. I
tested both usb 1.1 and usb 2.0 devices and they work without any problems.</p>
<h1 id="power-saving-speedstep">Power Saving / Speedstep</h1>
<p>After loading the kernel module <code>centrino-speedstep</code> the daemon <code>cpufreqd</code> can
be used to control the processor clock frequency between 800 MHz and 2 GHZ in a
few steps.</p>
<p>I adapted the standard configuration of <code>cpufreqd</code> so that the processor runs
with 800 MHz as long as the load is below 10%. If the notebook runs on battery
the processor stays at 800 MHz, if not it is switched to 2 GHz if the load is
above 10%. With this configuration the processor cooling fan does not run as
long as you do not work with the notebook.</p>
<p>You can check the frequency the cpu is running at with the command</p>
<div class="highlight"><pre><span></span><code>cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
</code></pre></div>
<p>The other files in this directory tell you, what minimum and maximum frequency
your cpu can reach.</p>
<h2 id="update-13112006-hibernate-modus">Update 13.11.2006: Hibernate-Modus</h2>
<p>To be able to use the hibernate mode, you have to activate the Serial ATA Driver
for Intel <abbr title="I/O Controller Hub">ICH</abbr> chipsets. If you use the
generic <abbr title="Advanced Host Controller Interface">AHCI</abbr> -driver,
the harddisk hangs after a resume.</p>
<p>Additionally you have to install the <code>hibernate</code> package, that controls the
deactivation and activation of the device drivers. It is necessary to enable the
option <code>Runi915resolution yes</code> in the file <code>/etc/hibernate/common.conf</code> so that
the full monitor resolution is restored after a resume.</p>
<h1 id="configuration-of-the-x-server">Configuration of the X-Server</h1>
<p>The GMA900 chipset is supported by the x-server from x.org. (Debian-package
<code>xserver-xorg</code>). You need to enter <code>i810</code> for the driver in the configuration
file <code>xorg.conf</code>.</p>
<p>The x-server has a problem with querying the supported resolutions of the
chipset and works only up to 1280x1024 dots. So the tool <code>855resolution</code> is needed
to tune the supported resolution table of the chipset. This tool has to be run
as an init script. You can also call it by hand as</p>
<div class="highlight"><pre><span></span><code>855resolution 3c <span class="m">1400</span> <span class="m">1050</span>
</code></pre></div>
<p>to test the function.</p>
<p>When you have installed the tool as a debian package, you only have to enter the
right values in the file <code>/etc/default/855resolution</code>.</p>
<p>The xorg.conf file should then look similar to mine:</p>
<h2 id="update-13092005">Update - 13.09.2005</h2>
<p>There is a x-server that supports the GMA900 without use of the <code>855resolution</code>
tool. You can get it at http://www.fairlite.demon.co.uk/intel.html. Replace
the driver <code>i810_drv.o</code> in <code>/usr/X11R6/lib/modules/drivers/</code> shipped with the X.org
x-server with the downloaded file.</p>
<p>Then you need to modify the device section in your <code>xorg.conf</code> file, so that it
looks like this one (the <code>ForceBios</code> option is the important one):</p>
<div class="highlight"><pre><span></span><code>Section "Device"
Identifier "Intel MGA900"
Driver "i810"
Option "ForceBIOS" "1024x768=1400x1050"
EndSection
</code></pre></div>
<h2 id="update-12112005-xinerama">Update - 12.11.2005: Xinerama</h2>
<p>Andreas Bichler reports that Xinerama, an extension for the X-server to expand
the desktop over multiple displays can be used. On the Lifebook the desktop then
is expanded over the internal LC-Display and an externally connected
display. Here is an example for a suitable configuration file for the x.org
x-server:.</p>
<h2 id="update-13082006-855resolution">Update - 13.08.2006: 855resolution</h2>
<p><a href="http://www.control.auc.dk/~jdn">Jens Frederik Dalsgaard Nielsen</a> reports, that
the <code>855resolution</code> tool has been replaced by the 915resolution tool. If you try
to install the <code>855resoltion</code> package in Debian, you will get the
<code>915resolution</code> package installed automatically.</p>
<h1 id="sound">Sound</h1>
<p>To use the sound card, you need the kernel modulesnd-hda-inteland a functional
installation of <a href="http://www.alsa-project.org">ALSA</a> . Sound output only works
with the internal loudspeakers. Their volume is controlled by the headphone
mixer. The external plug for a headphone does not work at the moment. I think
that might be related to the "plug re-tasking" feature of the sound chip
(see
<a href="http://www.realtek.com.tw/products/products1-2.aspx?modelid=2004052">Realtek-Website</a> -
The linux drivers you can get there seem to be an older version of the ALSA
sources and also do not enable the headphone output).</p>
<h2 id="update-13092005_1">Update - 13.09.2005</h2>
<p>There has been submitted a patch to the alsa project that fixes the sound driver
so that the headphone output and line in will work. It should appear in one of
the next alsa releases.</p>
<h1 id="modem">Modem</h1>
<p>Now I have managed to get the internal modem chip to work. The drivers for the
hd-audio chipset contain a driver for the modem hardware. To be able to use the
driver, you need to install the package <code>sl-modem-daemon</code>. It is started, when
the system is booted and creates a device file <code>/dev/ttySL0</code> for the modem, so
that it can be accessed like a normal external modem.</p>
<p>To let the daemon know which hardware to access, its configuration
file <code>/etc/defaults/sl-modem-daemon</code> has to be changed:</p>
<p>```text
SLMODEMD_DEVICE="hw:Intel,6"
````</p>
<h1 id="problematic-hardware">Problematic Hardware</h1>
<p>The following hardware components do not seem to be supported at the moment:</p>
<ul>
<li>The buttons above the keyboard (labeled 1 to 4 and enter) do not work. They
do not raise acpi events, except the power button which works perfectly
with <code>acpid</code>.</li>
</ul>Gallerie LKW-Modelle2005-06-26T00:00:00+08:002005-06-26T00:00:00+08:00andreastag:www.a-netz.de,2005-06-26:/blog/2005/06/gallerie-lkw-modelle.html<p>Auf dieser Seite gibt es ein paar Bilder und Infos zu meinem
Modellbau-Aktivitäten. Die Modelle sind in Zusammenarbeit mit meinem Vater
entstanden. Die beiden gezeigten LKW-Zugmaschinen sind Bausätze der Firma
<a href="(http://www.wedico.de/">Wedico</a>. Die Dampfwalze ist von <a href="http://www.wilesco.de">Wilesco</a> (schrottreif vom Trödelmarkt
gerettet), jedoch nachträglich von uns stark modifiziert. Die beiden Auflieger
sowie …</p><p>Auf dieser Seite gibt es ein paar Bilder und Infos zu meinem
Modellbau-Aktivitäten. Die Modelle sind in Zusammenarbeit mit meinem Vater
entstanden. Die beiden gezeigten LKW-Zugmaschinen sind Bausätze der Firma
<a href="(http://www.wedico.de/">Wedico</a>. Die Dampfwalze ist von <a href="http://www.wilesco.de">Wilesco</a> (schrottreif vom Trödelmarkt
gerettet), jedoch nachträglich von uns stark modifiziert. Die beiden Auflieger
sowie das Rennboot sind vollständige Eigenkonstruktionen.</p>
<p>Eine Spezialität der beiden Auflieger sind die zwangsgelenkten Hinterachsen. Da
beide Auflieger relativ lang sind, soll so erreicht werden, dass enge Kurven
besser durchfahren werden können. Die Stellung der Hinterachsen wird dabei nur
vom Winkel zwischen Zugmaschine und Anhänger beeinflusst und erfolgt rein
mechanisch. Versuche mit einer elektronischen Steuerung waren zu empfindlich und
wurden daher verworfen.</p>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0001.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0001.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0002.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0002.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0003.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0003.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0004.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0004.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0005.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0005.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0006.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0006.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0007.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0007.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0008.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0008.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0009.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0009.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0010.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0010.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0011.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0011.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0012.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0012.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0013.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0013.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0014.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0014.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0015.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0015.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0016.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0016.jpg"
title=""
alt="">
</a>
</figure>Scale Model Pictures2005-06-26T00:00:00+08:002005-06-26T00:00:00+08:00andreastag:www.a-netz.de,2005-06-26:/blog/2005/06/scale-model-pictures.html<p>Here you can find a few pictures and info regarding my model building
activities. Most of the models are created in cooperation with my father. The
two trucks are built from construction kits from <a href="(http://www.wedico.de/">Wedico</a>. The steam engine is
manufactured by <a href="http://www.wilesco.de">Wilesco</a>. We have found it on a flea market …</p><p>Here you can find a few pictures and info regarding my model building
activities. Most of the models are created in cooperation with my father. The
two trucks are built from construction kits from <a href="(http://www.wedico.de/">Wedico</a>. The steam engine is
manufactured by <a href="http://www.wilesco.de">Wilesco</a>. We have found it on a flea market and had to modify
and partly rebuild it. The two truck trailers and the speedboat are build from
scratch without a construction kit.</p>
<p>The two truck trailers have one special thing in common: We have implemented a
mechanical forced stearing system for the rear axes, so that the trailers can go
around very sharp curves. The steering angle of the rear axes is only controlled
by the angle between truck and trailer and only controlled mechanically. We have
also tried to implement an electronic steering system, but that has shown to be
not as robust as needed.</p>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0001.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0001.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0002.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0002.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0003.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0003.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0004.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0004.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0005.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0005.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0006.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0006.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0007.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0007.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0008.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0008.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0009.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0009.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0010.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0010.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0011.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0011.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0012.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0012.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0013.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0013.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0014.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0014.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0015.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0015.jpg"
title=""
alt="">
</a>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/06/images/rc_model_0016.jpg">
<img src="https://www.a-netz.de/blog/2005/06/images/rc_model_0016.jpg"
title=""
alt="">
</a>
</figure>Urlaub in Dresden2005-01-13T00:00:00+08:002005-01-13T00:00:00+08:00andreastag:www.a-netz.de,2005-01-13:/blog/2005/01/urlaub-in-dresden.html<p>Zu Sylvester 2004 habe ich zusammen mit einem Bekannten einen Kurzurlaub in
Dresden gemacht. Darauf basierend gibt es auf dieser Seite ein paar
Urlaubs-Tipps.</p>
<h1 id="unterbringung">Unterbringung</h1>
<p>Wir haben im Gästehaus <a href="http://www.mezcalero.de">Mezcalero</a> gewohnt, zentral in der Neustadt
gelegen. Obwohl in der Nähe des Kneipenviertels gelegen, befindet sich das
Mezcalero in einem ruhigen …</p><p>Zu Sylvester 2004 habe ich zusammen mit einem Bekannten einen Kurzurlaub in
Dresden gemacht. Darauf basierend gibt es auf dieser Seite ein paar
Urlaubs-Tipps.</p>
<h1 id="unterbringung">Unterbringung</h1>
<p>Wir haben im Gästehaus <a href="http://www.mezcalero.de">Mezcalero</a> gewohnt, zentral in der Neustadt
gelegen. Obwohl in der Nähe des Kneipenviertels gelegen, befindet sich das
Mezcalero in einem ruhigen Innenhof. Wir empfanden es als eine einfache, aber
saubere und günstige Unterkunft mit ausgesprochen gutem Frühstücksbuffet.</p>
<figure>
<a href="https://www.a-netz.de/blog/2005/01/images/dresden-01.jpg">
<img src="https://www.a-netz.de/blog/2005/01/images/dresden-01.jpg"
title="Das Zimmer"
alt="Das Zimmer">
</a>
<figcaption>Das Zimmer</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/01/images/dresden-02.jpg">
<img src="https://www.a-netz.de/blog/2005/01/images/dresden-02.jpg"
title="Gemütlich..."
alt="Gemütlich...">
</a>
<figcaption>Gemütlich...</figcaption>
</figure>
<h1 id="erster-tag-besuch-in-der-altstadt">Erster Tag - Besuch in der Altstadt</h1>
<p>Um sich einen Überblick über die wichtigsten Sehenswürdigkeiten in der Altstadt
zu verschaffen, sollte man diese zumindest einen halben Tag zu Fuß
erkunden. Ausgehend von der Neustadt kommt man über die Augustusbrücke über die
Elbe. Sehenswert sind in der Altstadt die Semperoper, den Zwinger, die
Hofkirche, das Schloss, die Kunstakademie mit den davorliegenden Brühl'schen
Terrassen, die Frauenkirche und die Kreuzkirche. Das Albertinum wurde zum
Zeitpunkt unseres Besuchs leider renoviert und war nicht zu sehen.</p>
<figure>
<a href="https://www.a-netz.de/blog/2005/01/images/dresden-03.jpg">
<img src="https://www.a-netz.de/blog/2005/01/images/dresden-03.jpg"
title="Die Gebäude am Elbufer - Kunstakademie und
Frauenkirche"
alt="Die Gebäude am Elbufer - Kunstakademie und
Frauenkirche">
</a>
<figcaption>Die Gebäude am Elbufer - Kunstakademie und
Frauenkirche</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/01/images/dresden-04.jpg">
<img src="https://www.a-netz.de/blog/2005/01/images/dresden-04.jpg"
title="Dresdens Altstadt bei Nacht - Kunstakademie,
Hofkirche und Semperoper"
alt="Dresdens Altstadt bei Nacht - Kunstakademie,
Hofkirche und Semperoper">
</a>
<figcaption>Dresdens Altstadt bei Nacht - Kunstakademie,
Hofkirche und Semperoper</figcaption>
</figure>
<p>Hat man mehr Zeit, lohnen sich vor allem eine Führung durch die Semperoper und
ein Besuch im grünen Gewölbe (dort befinden sich die gesammelten Schätze der in
Dresden ansässigen Regenten). Ebenfalls sehr interessant sind die <a href="http://www.schloesser-dresden.de/festung">Kasematten</a>,
die sich unter den Brühl'schen Terrassen befinden. Hat man nach dem Sightseeing
Hunger bekommen, so findet man in der Münzgasse - in der Nähe der Frauenkirche -
für jeden Geschmack etwas.</p>
<h1 id="zweiter-tag-im-groen-garten">Zweiter Tag - Im Großen Garten</h1>
<p>Zur Abwechslung geht es heute ins Grüne - genau genommen zur Bürgerwiese und zum
Großen Garten, einem großen Park in direkter Nähe zur Dresdener Innenstadt. Ist
man vom vielen Laufen Müde, kann man in den Sommermonaten den Park auch von der
parkeigenen Schmalspurbahn aus erkunden.</p>
<figure>
<a href="https://www.a-netz.de/blog/2005/01/images/dresden-05.jpg">
<img src="https://www.a-netz.de/blog/2005/01/images/dresden-05.jpg"
title="Brunnen an der Bürgerwiese"
alt="Brunnen an der Bürgerwiese">
</a>
<figcaption>Brunnen an der Bürgerwiese</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/01/images/dresden-06.jpg">
<img src="https://www.a-netz.de/blog/2005/01/images/dresden-06.jpg"
title="Palais im Park"
alt="Palais im Park">
</a>
<figcaption>Palais im Park</figcaption>
</figure>
<p>Auf dem Rückweg kommt man an der <a href="http://www.glaesernemanufaktur.de">Gläsernen Manufaktur</a> von VW vorbei. Neben
einer interessanten Architektur bietet sich auch die Möglichkeit, die Produktion
des VW Phaeton anzuschauen. Dazu ist jedoch eine vorherige Anmeldung zu
empfehlen, da die Besichtigungstermine oft ausgebucht sind.</p>
<p>Ebenfalls auf dem Rückweg liegt das Hygienemuseum, dessen Besuch sich jedoch
nicht unbedingt lohnt.</p>
<h1 id="stadt-rathen-und-die-bastei">Stadt Rathen und die Bastei</h1>
<p>Einen lohnenden Tagesausflug stellt eine Tour nach <a href="http://www.kurort-rathen.de">Rathen</a> und zur
nahegelegenen Bastei dar. Es ist gut möglich, von Dresden aus mit der Bahn nach
Rathen zu fahren, dort mit der Fähre über die Elbe und zu Fuß zur Bastei zu
wandern (sofern man körperlich fit ist, es geht steil bergauf). Im Sommer kann
man aber auch mit einem der in Dresden anlegenden Ausflugsschiffe Richtung
Rathen fahren.</p>
<figure>
<a href="https://www.a-netz.de/blog/2005/01/images/dresden-07.jpg">
<img src="https://www.a-netz.de/blog/2005/01/images/dresden-07.jpg"
title="Fähre in Rathen"
alt="Fähre in Rathen">
</a>
<figcaption>Fähre in Rathen</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/01/images/dresden-08.jpg">
<img src="https://www.a-netz.de/blog/2005/01/images/dresden-08.jpg"
title="Das Elbtal, von der Bastei aus gesehen"
alt="Das Elbtal, von der Bastei aus gesehen">
</a>
<figcaption>Das Elbtal, von der Bastei aus gesehen</figcaption>
</figure>
<figure>
<a href="https://www.a-netz.de/blog/2005/01/images/dresden-09.jpg">
<img src="https://www.a-netz.de/blog/2005/01/images/dresden-09.jpg"
title="Die Basteibrücke"
alt="Die Basteibrücke">
</a>
<figcaption>Die Basteibrücke</figcaption>
</figure>
<p>Von der Bastei aus hat man einen schönen Ausblick über das ca. 100m tiefer
gelegene Elbtal und das Elbsandsteingebirge. Nun kann man entweder hier zu
Mittag essen oder zunächst entlang eines Wanderweges durch den Höllengrund bis
nach Wehlen wandern.</p>
<h1 id="besuch-in-meien">Besuch in Meißen</h1>
<p>Als weiteres Ausflugsziel lohnt sich die nahegelegene Stadt <a href="http://www.stadt-meissen.de">Meißen</a>, die von
Dresden aus gut mit der Regionalbahn zu erreichen ist. Neben der weltbekannten
<a href="http://www.meissen.de">Porzellan-Manufaktur</a> ist vor allem die schöne Altstadt mit dem auf einem Hügel
gelegenen Schloss sehenswert.</p>
<h1 id="schlosser-entlang-der-elbe">Schlösser entlang der Elbe</h1>
<p>Ist noch ein weiterer Tag Zeit, so lohnt sich ein Besuch der Schlösser
elb-aufwärts von Dresden. Von dort aus ist es nicht mehr weit bis zum
Villlenviertel <a href="http://www.dresden-weisser-hirsch.de">Weisser Hirsch</a> und zu der Elbbrücke <a href="http://de.wikipedia.org/wiki/Blaues_Wunder">Blaues Wunder</a> (nicht so
spektakulär...).</p>
<figure>
<a href="https://www.a-netz.de/blog/2005/01/images/dresden-10.jpg">
<img src="https://www.a-netz.de/blog/2005/01/images/dresden-10.jpg"
title="Schloss Albrechtsberg"
alt="Schloss Albrechtsberg">
</a>
<figcaption>Schloss Albrechtsberg</figcaption>
</figure>
<h1 id="beruhmte-dresdener">Berühmte Dresdener</h1>
<p>Und hier noch ein paar Verwirrung stiftende Anmerkungen zu Dresdens Herrschern:
Zunächst war da August der Starke - oder auch Friedrich August der
Erste. Nachdem er zum katholischen Glauben konvertierte, wurde er August der
Zweite von Polen. Sein Sohn und Nachfolger, Friedrich August der Zweite (nicht
identisch mit August dem Zweiten von Polen) wurde August der Dritte von Polen,
konvertierte deshalb ebenfalls zum katholischen Glauben und legte heimlich den
Grundstein zur Dresdner Hofkirche (Augustusdom bzw. seit 1980
Sankt-Trinitatis-Kathedrale). Hundert Jahre später war Friedrich August der
Dritte bis 1918 letzter König in Deutschland.</p>
<p>Im Übrigen hat Zar Peter I. der Große August dem Starken die goldene Trinkschale
von Zar Iwan dem Schrecklichen geschenkt, welche im <a href="http://www.skd-dresden.de/de/museen/gruenes_gewoelbe.html">Grünen Gewölbe</a> in Dresden
ausgestellt ist.</p>
<p>Die Villa Stockhausen wurde Ende des 19. Jahrhunderts von Fabrikant Karl August
Lingner, dem berühmten Erfinder des <a href="http://www.odol.de">Odol</a>-Mundwassers, übernommen. Er war es
auch, der das Dresdner Hygienemuseum gründete.</p>
<p>Und das allerletzte: Nicht über das Kabel stolpern!</p>
<figure>
<a href="https://www.a-netz.de/blog/2005/01/images/dresden-11.jpg">
<img src="https://www.a-netz.de/blog/2005/01/images/dresden-11.jpg"
title="Kabel!"
alt="Kabel!">
</a>
<figcaption>Kabel!</figcaption>
</figure>
<p>PS: Otto Vorbacher-Lemurran isst seinen Döner immer bei Bä kere. Don't mind. ;-)</p>Neural Nets Framework2004-07-15T00:00:00+08:002004-07-15T00:00:00+08:00andreastag:www.a-netz.de,2004-07-15:/blog/2004/07/neural-nets-framework.html<h1 id="description">Description</h1>
<p>This software is a collection of classes for management, training and
visualization of neural nets written in C#. It is developed for the exercises of
the lecture <a href="http://lrb.cs.uni-dortmund.de/~hildebra/GACI1-gr.html">GACI</a> <em>Theory and Applications of Artificial Intelligence I:
Artificial Neural Nets</em> at the University of Dortmund.</p>
<p>This software is no ready to …</p><h1 id="description">Description</h1>
<p>This software is a collection of classes for management, training and
visualization of neural nets written in C#. It is developed for the exercises of
the lecture <a href="http://lrb.cs.uni-dortmund.de/~hildebra/GACI1-gr.html">GACI</a> <em>Theory and Applications of Artificial Intelligence I:
Artificial Neural Nets</em> at the University of Dortmund.</p>
<p>This software is no ready to use product but an example of the concepts of
algorithms and data structures of neural nets, e.g. back propagation with
momentum, batch- and online-training, etc. Without knowledge of the basics of
neural nets this software might not be very useful.</p>
<h1 id="download">Download</h1>
<p>This is the current version from 2004-07-08 (source code, C#): <a href="https://www.a-netz.de/blog/2004/07/files/neuralnets.zip">neuralnets.zip</a></p>Neuronale Netze Framework2004-07-15T00:00:00+08:002004-07-15T00:00:00+08:00andreastag:www.a-netz.de,2004-07-15:/blog/2004/07/neuronale-netze-framework.html<h1 id="beschreibung">Beschreibung</h1>
<p>Bei dieser Software handelt es sich um eine Sammlung von Klassen zur Verwaltung,
zum Training und zur Visualisierung von neuronalen Netzen, geschrieben in
C#. Entstanden ist sie für die Übungen zur Vorlesung <a href="http://lrb.cs.uni-dortmund.de/~hildebra/GACI1-gr.html">GACI</a> <em>Grundlagen und
Anwendungen der Computational Intelligence I: Künstliche neuronale Netze</em> an der
Uni Dortmund im Jahr …</p><h1 id="beschreibung">Beschreibung</h1>
<p>Bei dieser Software handelt es sich um eine Sammlung von Klassen zur Verwaltung,
zum Training und zur Visualisierung von neuronalen Netzen, geschrieben in
C#. Entstanden ist sie für die Übungen zur Vorlesung <a href="http://lrb.cs.uni-dortmund.de/~hildebra/GACI1-gr.html">GACI</a> <em>Grundlagen und
Anwendungen der Computational Intelligence I: Künstliche neuronale Netze</em> an der
Uni Dortmund im Jahr 2004.</p>
<p>Es handelt sich bei dieser Software nicht um ein fertiges Produkt, viel mehr
soll sie (bisher) Anschauungsmaterial für die Umsetzung der in Bezug auf
neuronale Netze wichtigen Algorithmen und Datenstrukturen, zum Beispiel
Backpropagation mit Momentum, Batch- und Online-Training, etc. sein. Ohne sich
mit den Grundlagen neuronaler Netze auszukennen wird diese Software vermutlich
wenig hilfreich sein.</p>
<h1 id="download">Download</h1>
<p>Und hier gibt es die aktuelle Version vom 08.07.2004 (Quellcode, C#):
<a href="https://www.a-netz.de/blog/2004/07/files/neuralnets.zip">neuralnets.zip</a></p>