<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>nAnL - hacken, kracken, kacken &#187; English articles</title>
	<atom:link href="http://nanl.de/blog/category/english-articles/feed/" rel="self" type="application/rss+xml" />
	<link>http://nanl.de/blog</link>
	<description></description>
	<lastBuildDate>Fri, 16 Dec 2011 16:59:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>PostgreSQL &#8211; altering table name does not update references to its primary key and sequence automatically</title>
		<link>http://nanl.de/blog/2011/10/postgresql-altering-table-name-screws-up-references-to-its-primary-key-and-sequence/</link>
		<comments>http://nanl.de/blog/2011/10/postgresql-altering-table-name-screws-up-references-to-its-primary-key-and-sequence/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 10:27:42 +0000</pubDate>
		<dc:creator>mirko</dc:creator>
				<category><![CDATA[English articles]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://nanl.de/blog/?p=609</guid>
		<description><![CDATA[During a setup of multiple PostgreSQL instances, replicating content via the replication framework Slony-I, I had to manually create the very same SQL schema to every Postgres node &#8211; as Slony just replicates the payload data and not the actual SQL schemas. I was creating tables like this on every node: CREATE TABLE x ( [...]]]></description>
			<content:encoded><![CDATA[<p>During a setup of multiple PostgreSQL instances, replicating content via the replication framework <a title="Slony-I" href="http://slony.info/" target="_blank">Slony-I</a>, I had to manually create the very same SQL schema to every Postgres node &#8211; as Slony just replicates the payload data and not the actual SQL schemas.</p>
<p>I was creating tables like this on every node:</p>
<blockquote><p>CREATE TABLE <strong>x</strong> (<br />
id             SERIAL PRIMARY KEY,<br />
content   VARCHAR(255) DEFAULT NULL<br />
);</p></blockquote>
<p>but decided after half of having those nodes I already configured to rename the table from &#8216;<strong>x</strong>&#8216; to &#8216;<strong>y</strong>&#8216; using the &#8216;<strong>ALTER TABLE</strong>&#8216; command</p>
<blockquote><p>ALTER TABLE <strong>x</strong> RENAME TO <strong>y</strong>;</p></blockquote>
<p>and continued creating the schemas on the remaining nodes with the following command:</p>
<blockquote><p>CREATE TABLE <strong>y</strong> (<br />
id             SERIAL PRIMARY KEY,<br />
content   VARCHAR(255) DEFAULT NULL<br />
);</p></blockquote>
<p>After finally having provided the schema to all nodes I started the replication daemons and got thrown errors from half of the nodes that replication doesn&#8217;t work properly since the schema doesn&#8217;t match the one on the master replication server:</p>
<blockquote><p>CESTERROR  remoteWorkerThread_1: &#8220;select &#8220;_db&#8221;.setAddTable_int(1, 3, &#8216;&#8221;public&#8221;.&#8221;y&#8221;&#8216;, &#8216;x_pkey&#8217;, &#8216;Table public.y with primary key&#8217;); &#8221; PGRES_FATAL_ERROR ERROR:  Slony-I: setAddTable_int(): table &#8220;public&#8221;.&#8221;y&#8221; has no index x_pkey</p></blockquote>
<p>All of the non-working nodes were those, I first created the table <strong>x</strong> on and later renamed it<strong> </strong>to <strong>y</strong>, instead of just directly creating table <strong>y</strong> like I did on the others.</p>
<p>Looking at the global table definitions &#8211; including the automatically co-created sequence &#8211; you can see that the table did get renamed, but the sequence didn&#8217;t:</p>
<p>Table <strong>y</strong> directly created:</p>
<blockquote><p>postgres=# \d<br />
List of relations<br />
Schema |      Name      |   Type   |  Owner<br />
&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-<br />
public | <strong>y</strong>              | table    | postgres<br />
public | <strong>y_id_seq</strong>       | sequence | postgres<br />
(4 rows)</p></blockquote>
<p>Table <strong>x</strong> created and altered to be named <strong>y</strong>:</p>
<blockquote><p>postgres=# \d<br />
List of relations<br />
Schema |      Name      |   Type   |  Owner<br />
&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-<br />
public | <strong>y</strong>              | table    | postgres<br />
public | <strong>x_id_seq</strong>       | sequence | postgres<br />
(4 rows)</p></blockquote>
<p>That <em>normally</em> doesn&#8217;t cause any trouble, since the reference of table <strong>y</strong> (formerly <strong>x</strong>) to the sequence <strong>x_id_seq</strong> is still valid. However since replication requires the very exact same schema on every node this actually <strong>is</strong> causing trouble. However that&#8217;s not the error mentioned in the error message above, which is referring to the <strong>primary key</strong>.</p>
<p>Diff&#8217;ing the actual schemas shows up more differences:</p>
<blockquote><p>                                  Table &#8220;public.y&#8221;<br />
Column  |          Type          |                   Modifiers<br />
&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
- id      | integer                | not null default nextval(&#8216;<strong>x_id_seq</strong>&#8216;::regclass)<br />
+ id      | integer                | not null default nextval(&#8216;<strong>y_id_seq</strong>&#8216;::regclass)<br />
content | character varying(255) | default NULL::character varying<br />
Indexes:<br />
-    &#8220;<strong>x_pkey</strong>&#8221; PRIMARY KEY, btree (id)<br />
+    &#8220;<strong>y_pkey</strong>&#8221; PRIMARY KEY, btree (id)</p></blockquote>
<p>The reference to the sequence and and name of the reference to the value of the primary key were <strong>NOT</strong> updated by altering the table name to match again. This separation of table-name and references might be a feature, however I find it hard to imagine a use-case where it makes sense using the sequence and/or primary key of another table. <em><strong>UPDATE:</strong> I just got told that it indeed might make sense sharing one sequence among several tables</em>.</p>
<p>Also sequence and primary key were created inside / co-created by the &#8216;<strong>CREATE TABLE</strong>&#8216; statement, so at least I&#8217;d find it more consistent if both would be <strong>always</strong> reference by <strong>this</strong> table, by means of the table they got originally created with.</p>
<p>Looking for information, hints or documentation about this behaviour wasn&#8217;t fruitful as well.</p>
<p>So personally I&#8217;d really like to really see those reference updated &#8211; by changing the tables name - automatically.  I&#8217;d like to see at least a <strong>NOTICE</strong> that primary key and sequence are still haveing the name of / are referring to it&#8217;s old values and need to be updated / re-created to match again.</p>
<p><strong><em>Conclusion:</em> Make sure &#8211; when altering table names in Postgres &#8211; references to primary key and sequence are getting updated as well &#8211; manually! Primary key and sequence are NOT tied together with the table they got created with!<br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://nanl.de/blog/2011/10/postgresql-altering-table-name-screws-up-references-to-its-primary-key-and-sequence/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LinuxInput devices (in Qt embedded) &#8211; take care!</title>
		<link>http://nanl.de/blog/2011/06/linuxinput-devices-in-qt-embedded-take-care/</link>
		<comments>http://nanl.de/blog/2011/06/linuxinput-devices-in-qt-embedded-take-care/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 01:06:01 +0000</pubDate>
		<dc:creator>mirko</dc:creator>
				<category><![CDATA[embedded systems]]></category>
		<category><![CDATA[English articles]]></category>
		<category><![CDATA[OpenWrt]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://nanl.de/blog/?p=586</guid>
		<description><![CDATA[I&#8217;m currently working on an embedded project based on Linux which involves a graphical user interface based on Qt. In our case Qt accesses framebuffer as well as the LinuxInput devices directly &#8211; there is no further layer (DirectFB, Xorg, Wayland, etc.) in between. In this quite common scenario I noticed that Qt is treating [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently working on an embedded project based on Linux which involves a graphical user interface based on Qt.</p>
<p>In our case Qt accesses framebuffer as well as the LinuxInput devices directly &#8211; there is no further layer (DirectFB, Xorg, Wayland, etc.) in between.</p>
<p>In this quite common scenario I noticed that Qt is treating the LinuxInput devices in a quite counterintuitive way which may lead into severe security problems.<br />
The embedded device we are using in this particular project has a keyboard which to the userland is exposed as LinuxInput device.</p>
<p>Everything worked quite well, however our Qt application crashed once due to a programming error (our fault) and I was shown the underlying UNIX console which<strong> reflected every single keystroke I did inside the Qt application &#8211; all typing input within the Qt application also got passed to other applications / underlying shells!</strong></p>
<p><strong>An exposed root shell to the active TTY &#8211; possibly hidden by the GUI &#8211; is therewith also capturing all input.</strong> Since almost all linux (embedded) distributions are exposing login prompts / shells to all TTYs by default, this scenario is far from being unlikely.</p>
<p>My expected behavior would have been: the Qt application is opening the LinuxInput devices exclusively, so that <strong>only</strong> the Qt application receives data from the input devices.</p>
<p>After some research and asking around I got pointed to the EVIOCGRAB IOCTL implemented in the LinuxInput subsystem.</p>
<p>As stated in $(LINUX_KERNEL)/include/input/linux.h:</p>
<blockquote><p>@grab: input handle that currently has the device grabbed (via<br />
EVIOCGRAB ioctl). When a handle grabs a device it becomes sole<br />
recipient for all input events coming from the device</p></blockquote>
<p>This means: When opening LinuxInput devices they&#8217;re not grabbed, they&#8217;re<strong> not opened exclusively by default</strong>.</p>
<p>Okay, I got it <img src='http://nanl.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So let&#8217;s just find the magic option / command which tells Qt to set up an EVIOCGRAB with an appropriate argument on the going-to-be-used LinuxInput device. Since I didn&#8217;t find any documentation I grep&#8217;ed through the Qt source:</p>
<blockquote><p>&gt; ~/src/qt.git$ git grep EVIOCGRAB<br />
&gt; ~/src/qt.git$</p></blockquote>
<p>nothing&#8230; so I took a closer look into how Qt implemented support for LinuxInput devices (src/gui/embedded/qkbdlinuxinput_qws.cpp) &#8211; still nothing&#8230;</p>
<p>So I implemented support for telling Qt to open LinuxInput devices exclusively by optionally passing an &#8216;grab&#8217;-argument to the LinuxInput drivers inside Qt.</p>
<p>And here it is &#8211; a patch which adds support for passing another parameter named &#8216;grab&#8217; to the LinuxInput device driver of Qt &#8211; to specify whether the device should be opened exclusively (grabbed) or not.</p>
<blockquote><p><a href="https://dev.openwrt.org/browser/packages/Xorg/lib/qt4/patches/500-allow-device-grabbing.patch?rev=26780">https://dev.openwrt.org/browser/packages/Xorg/lib/qt4/patches/500-allow-device-grabbing.patch?rev=26780</a></p></blockquote>
<p><strong>Conclusion: Take care when using Qt and its LinuxInput drivers &#8211; all input might be received and used by other applications as well &#8211; including shells running on TTYs.</strong></p>
<p>&nbsp;</p>
<p><strong>UPDATE:</strong> The patch finally git committed and went upstream. Grabbing can now be configured since Qt version 4.8 (http://www.qt.gitorious.org/qt/qt/commit/947aaa79b05adec527c7500e36766c7ff19f118d/diffs)</p>
]]></content:encoded>
			<wfw:commentRss>http://nanl.de/blog/2011/06/linuxinput-devices-in-qt-embedded-take-care/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RFM12 &#8211; kernel patches</title>
		<link>http://nanl.de/blog/2011/04/rfm12-kernel-patches/</link>
		<comments>http://nanl.de/blog/2011/04/rfm12-kernel-patches/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 05:32:26 +0000</pubDate>
		<dc:creator>mirko</dc:creator>
				<category><![CDATA[embedded systems]]></category>
		<category><![CDATA[English articles]]></category>
		<category><![CDATA[OpenWrt]]></category>
		<category><![CDATA[qi-hardware]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://nanl.de/blog/?p=569</guid>
		<description><![CDATA[Since I got asked several times about the pin mappings and wirings between the rfm12 modules and GPIOs of the devices providing them (in my case the Netgear WGT634U router / the Qi NanoNote) I&#8217;d like to try making some things clearer: In Linux the use of buses is tried to get as abstracted as [...]]]></description>
			<content:encoded><![CDATA[<p>Since I got asked several times about the pin mappings and wirings between the rfm12 modules and GPIOs of the devices providing them (in my case the <a href="http://nanl.de/blog/2011/01/rfm12-under-linux-and-remote-controlled-power-sockets/">Netgear WGT634U router</a> / the <a href="http://nanl.de/blog/2011/02/ben-nanonote-able-to-control-radio-power-sockets/">Qi NanoNote</a>) I&#8217;d like to try making some things clearer:</p>
<p>In Linux the use of buses is tried to get as abstracted as possible &#8211; the idea is that the actual boards (or call it whatever you like as devices, platforms etc) define and expose the capability of buses and its properties.</p>
<p>In our case the rfm12 kernel module requires the availability of an SPI bus &#8211; it doesn&#8217;t matter how it is implemented (native SPI bus, SPI over GPIOs or any other way of implementation). The client module &#8211; the kernel module implementing an driver for the actual rfm12 hardware &#8211; simply doesn&#8217;t care and doesn&#8217;t need to know about that.</p>
<p>That&#8217;s the reason why the actual <a href="https://github.com/mirko/rfm12-ASK-for-linux">rfm12 code</a> doesn&#8217;t contain any GPIO &lt;-&gt; rfm12 hardware mappings &#8211; the rfm12 code is just using an existing and otherwise exposed SPI bus.</p>
<p>The actual wiring / mapping and setup of the SPI bus is done within the platform / board / device code, which is located below <em>arch/${ARCH}/${BOARD}</em> &#8211; a common place for code like that is <em>arch/${ARCH}/${BOARD}/setup.c</em>.</p>
<p>This project however seemed to have raised some interest and I got asked quite a few times about the board specific changes I made &#8211; so here they are now:<br />the <a href="https://github.com/mirko/rfm12-ASK-for-linux/tree/master/patches/openwrt/target/linux">kernel patches</a> which provide SPI buses on both boards, including GPIO mappings.</p>
<p>Since both targets I used the rfm12 module and driver on are running OpenWrt, I created both patches against the Linux vanilla tree having OpenWrt specific kernel patches already applied.</p>
<p>Changes however are small and clear, so they should be easy to understand and adapt.</p>
<p>The wiring I used to get the rfm12 module working on the NanoNote working by the way is the following:<br />
<code><br />
GPIO | PIN on SD port | PIN on module | purpose / description<br />
=====|================|===============|=================================<br />
108  | D12 (1)        | MISO / SDO    | SPI: master input slave output<br />
109  | D13 (2)        | nIRQ          | interrupt<br />
104  | D08 (3)        | (unused)      | (unused)<br />
X    | VDD (4)        | VDD           | power<br />
105  | D09 (5)        | MOSI / SDI    | SPI: master output slave input<br />
X    | VSS (6)        | GND (1+2)     | ground<br />
106  | D10 (7)        | SCK           | SPI: clock<br />
107  | D11 (8)        | nSEL          | SPI: chip select<br />
</code></p>
<p>There needs to be a resistor (10-100kOhm) between pin FSK (if used) of<br />
the rfm12 module and VDD as pullup &#8211; however when just using ASK it isn&#8217;t needed anyway.</p>
]]></content:encoded>
			<wfw:commentRss>http://nanl.de/blog/2011/04/rfm12-kernel-patches/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GDB behaves strange while debugging threads</title>
		<link>http://nanl.de/blog/2011/02/gdb-behaves-strange-when-debugging-threads/</link>
		<comments>http://nanl.de/blog/2011/02/gdb-behaves-strange-when-debugging-threads/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 18:08:50 +0000</pubDate>
		<dc:creator>mirko</dc:creator>
				<category><![CDATA[embedded systems]]></category>
		<category><![CDATA[English articles]]></category>
		<category><![CDATA[misc]]></category>
		<category><![CDATA[OpenWrt]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://nanl.de/blog/?p=556</guid>
		<description><![CDATA[While debugging issues involving binaries on a system running Linux, having a debugger such as GDB available is quite helpful. However while working on a certain project we recently experienced quite some issues debugging applications involving threads. Debugging the application on my local workstation worked quite fine, however on OpenWrt-targets &#8211; ARM as well as [...]]]></description>
			<content:encoded><![CDATA[<p>While debugging issues involving binaries on a system running Linux, having a debugger such as GDB available is quite helpful.</p>
<p>However while working on a certain project we recently experienced quite some issues debugging applications involving <strong>threads</strong>.</p>
<p>Debugging the application on my local workstation worked quite fine, however on OpenWrt-targets &#8211; ARM as well as MIPS &#8211; it behaved rather strange: stack corruptions, missing traces, weird signals got issued&#8230;</p>
<p>After quite some time of debugging the debug issue, we found out the issue is caused by a <strong>stripped version of libpthread.so</strong>.</p>
<p>Stripped &#8211; not in the sense of a more lightweight but compatible version of the pthread library &#8211; but stripped by the utility &#8220;strip&#8221;, which purges all debug- and &#8220;other unneeded&#8221; symbols out of binaries to reduce their size, which usually is applied on all binaries by the OpenWrt framework automatically.</p>
<p>Usually binaries stripped by &#8220;strip&#8221; are still fully-fledged binaries, still usable with GDB (however without debugging symbols available of course). Applying strip on libpthread.so* however, it seems to strip out also stuff needed by GDB following and tracing threads. Without these symbols / meta-information not needed for running the actual application, but for tracking its threads, GDB results in mentioned issues above.</p>
<p>One might ask why someone is debugging binaries without debug symbols compiled in &#8211; reasons are obvious:</p>
<ul>
<li>there&#8217;s not enough storage available</li>
<li>there&#8217;s not enough RAM available</li>
<li>using gdbserver and having the binaries with debug symbols compiled in on another machine communicating with gdbserver</li>
</ul>
<p>To check whether an object got stripped or not is quite easy using the &#8220;file&#8221; util:</p>
<blockquote><p>$ file build_dir/target-arm_v5te_uClibc-0.9.30.1_eabi/root-foo/lib/libpthread-0.9.30.1.so<br />
build_dir/target-arm_v5te_uClibc-0.9.30.1_eabi/root-foo/lib/libpthread-0.9.30.1.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked (uses shared libs), <strong>stripped</strong></p></blockquote>
<blockquote><p>$ file staging_dir/target-arm_v5te_uClibc-0.9.30.1_eabi/root-foo/lib/libpthread-0.9.30.1.so<br />
staging_dir/target-arm_v5te_uClibc-0.9.30.1_eabi/root-foo/lib/libpthread-0.9.30.1.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked (uses shared libs), <strong>not stripped</strong></p></blockquote>
<p><strong>Long story short: </strong>When debugging applications involving threads, always use a non-stripped version of libpthread.so, even if debug symbols are not needed!</p>
]]></content:encoded>
			<wfw:commentRss>http://nanl.de/blog/2011/02/gdb-behaves-strange-when-debugging-threads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ben NanoNote able to control radio power sockets</title>
		<link>http://nanl.de/blog/2011/02/ben-nanonote-able-to-control-radio-power-sockets/</link>
		<comments>http://nanl.de/blog/2011/02/ben-nanonote-able-to-control-radio-power-sockets/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 03:17:51 +0000</pubDate>
		<dc:creator>mirko</dc:creator>
				<category><![CDATA[embedded systems]]></category>
		<category><![CDATA[English articles]]></category>
		<category><![CDATA[OpenWrt]]></category>
		<category><![CDATA[qi-hardware]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://nanl.de/blog/?p=527</guid>
		<description><![CDATA[The Ben NanoNote is now able to switch radio controlled power sockets, too! The rfm12 433MHz module, produced by HopeRF,  is attached to the microSD port of the Ben NanoNote, which pins are exposed via an microSD card dummy adapter. The System-on-a-chip used inside the Ben NanoNote (ingenic JZ47XX) allows us to put the microSD [...]]]></description>
			<content:encoded><![CDATA[<p><strong>The <a href="http://www.qi-hardware.com/products/ben-nanonote/">Ben NanoNote</a> is now able to switch radio controlled power sockets, too!</strong></p>
<p>The <a href="http://www.hoperf.com/rf_fsk/rfm12.htm">rfm12 433MHz module, produced by HopeRF</a>,  is attached to the microSD port of the Ben NanoNote, which pins are exposed via an microSD card dummy adapter.</p>
<div class="wp-caption alignnone" style="width: 503px"><a href="http://nanl.de/blog/wp-content/uploads/rfm12_microsd1.jpg"><img title="rfm12_microsd" src="http://nanl.de/blog/wp-content/uploads/rfm12_microsd1.jpg" alt="" width="493" height="439" /></a><p class="wp-caption-text">rfm12 module attached to a microSD dummy</p></div>
<p>The System-on-a-chip used inside the Ben NanoNote (ingenic JZ47XX) allows us to put the microSD pins into GPIO mode, so we can <a href="http://nanl.de/blog/2011/01/rfm12-under-linux-and-remote-controlled-power-sockets/">(as already done for the first device, the Netgear WGT634u router, I connected an rfm12-module to)</a> create and export an SPI bus on top of them to be able communicating with the module.</p>
<p>That way there&#8217;s no need of opening the device and/or soldering anything anywhere &#8211; the module is attached directly to the microSD dummy which gets simply inserted into microSD slot of the NanoNote.</p>
<div id="attachment_528" class="wp-caption alignnone" style="width: 491px"><a href="http://nanl.de/blog/wp-content/uploads/rfm12_nanonote1.jpg"><img class="size-full wp-image-528" title="rfm12_nanonote" src="http://nanl.de/blog/wp-content/uploads/rfm12_nanonote1.jpg" alt="" width="481" height="322" /></a><p class="wp-caption-text">rfm12 module attached to NanoNote running ncurses UI for switching power sockets</p></div>
<p>I wrote a basic but fully working ncurses frontend using the rfm12 library listing configured devices waiting for getting switched.</p>
<p>There&#8217;s also a ready-to-use XMLRPC daemon available which exposes all configured devices and provides functions for controlling them, so UIs for controlling devices are not limited to run on the same system the rfm12 module is installed on.</p>
<div id="attachment_539" class="wp-caption alignnone" style="width: 510px"><a href="http://nanl.de/blog/wp-content/uploads/rfm12_nanonote_ncurses-ui1.jpg"><img class="size-full wp-image-539" title="rfm12_nanonote_ncurses-ui" src="http://nanl.de/blog/wp-content/uploads/rfm12_nanonote_ncurses-ui1.jpg" alt="" width="500" height="417" /></a><p class="wp-caption-text">ncurses UI for switching configured radio controlled power sockets on the Ben NanoNote</p></div>
<p>I&#8217;ve also written a little GUI in python using the qt4 toolkit, connecting to the master via XML-RPC:</p>
<div id="attachment_540" class="wp-caption alignnone" style="width: 520px"><a href="http://nanl.de/blog/wp-content/uploads/rfm12_pyqt-ui1.jpg"><img class="size-full wp-image-540" title="rfm12_pyqt-ui" src="http://nanl.de/blog/wp-content/uploads/rfm12_pyqt-ui1.jpg" alt="" width="510" height="135" /></a><p class="wp-caption-text">switching radio controlled power via a GUI using pyqt4</p></div>
<p>Several other frontends are work-in-progress as e.g. a GUI for the Android platform, as well as one based on qt4/QML being able to run e.g. on phones running Meego/Maemo as operating system &#8211; both using the XML-RPC interface.</p>
<p>So all major parts of the project are mostly finished now and the API is more or less fix.</p>
<p>The the whole project now consists of (a rough overview):</p>
<ol>
<li>the kernel module which communicates with the actual hardware (so the rfm12 module) and exposes a character device to userspace</li>
<li>the rfm12 library which</li>
<ul>
<li>connects to the kernel module</li>
<li>contains the device type specific data and code to modulate signals which control the actual power sockets</li>
<li>provides functions for reading / writing configuration files and controlling / switching devices</li>
</ul>
<li>applications using the library and its functions for actual controlling of devices, which could be / already are:</li>
<ul>
<li>UI applications linked directly against librfm12 (an ncurses frontend (shown above) is available yet)</li>
<li>daemons providing network interfaces (a daemon exporting functionality via XMLRPC is available yet , one doing the same but using JSON-RPC as underlying rpc method is going to be implemented soon)</li>
</ul>
<li>UIs running on different machines, using these RPC services  (e.g. above pyqt4  frontend; android- and qml-frontends are work-in-progress)</li>
</ol>
<p>Devices are getting configured via configuration files, describing the <strong>product type</strong> of the device, a <strong>name</strong> and the actual <strong>code </strong>which is used to identify devices of a certain product type group.</p>
<p>The config used by the applications shown on the photos / screenshots above just looks this:</p>
<blockquote>
<div id="_mcePaste">[socket_A]</div>
<div id="_mcePaste">label = &#8220;one&#8221;</div>
<div id="_mcePaste">product = &#8220;P801B&#8221;</div>
<div id="_mcePaste">code = &#8220;1111110000&#8243;</div>
<div id="_mcePaste">[socket_B]</div>
<div id="_mcePaste">label = &#8220;two&#8221;</div>
<div id="_mcePaste">product = &#8220;2272&#8243;</div>
<div id="_mcePaste">code = &#8220;1111110000&#8243;</div>
<div id="_mcePaste">[socket_C]</div>
<div id="_mcePaste">label = &#8220;three&#8221;</div>
<div id="_mcePaste">product = &#8220;2272&#8243;</div>
<div id="_mcePaste">code = &#8220;1111101000&#8243;</div>
</blockquote>
<p>One of the tasks I&#8217;m working on right now, is <strong>state sharing</strong>. While the list of configured devices and it&#8217;s states (on/off) is already shared among all XML-RPC clients (so having switched a unit in one client, others will fetch the changed state next time they poll/refresh), the state is not yet shared between several processes invoking the librfm12.</p>
<p>Issue is: Every process linked against librfm12 creates its own list of devices, including states &#8211; so every process has its own copy. Changes done in one process are not shared among others. This could be solved using IPC (System V shared memory, sockets every instance connects to, etc.).</p>
<p>That&#8217;s it &#8211; feedback and/or participation is highly appreciated!</p>
<div id="attachment_544" class="wp-caption alignnone" style="width: 599px"><a href="http://nanl.de/blog/wp-content/uploads/rfm12_nanonote_radiosockets1.jpg"><br />
<img class="size-full wp-image-544 " style="padding: 0px; margin: 0px; border: 0px none initial;" title="rfm12_nanonote_radiosockets" src="http://nanl.de/blog/wp-content/uploads/rfm12_nanonote_radiosockets1.jpg" alt="" width="589" height="335" /></a><p class="wp-caption-text">Ben NanoNote having an rfm12 module attached via microSD-port and several types of radio controlled power sockets</p></div>
<p>Source Code is still available on github: <a href="  Ben NanoNote having an rfm12 module attached via microSD-port and several types of radio controlled power sockets ">https://github.com/mirko/rfm12-ASK-for-linux</a> <img src='http://nanl.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://nanl.de/blog/2011/02/ben-nanonote-able-to-control-radio-power-sockets/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>RFM12 under Linux and remote controlled power sockets</title>
		<link>http://nanl.de/blog/2011/01/rfm12-under-linux-and-remote-controlled-power-sockets/</link>
		<comments>http://nanl.de/blog/2011/01/rfm12-under-linux-and-remote-controlled-power-sockets/#comments</comments>
		<pubDate>Mon, 03 Jan 2011 15:17:59 +0000</pubDate>
		<dc:creator>mirko</dc:creator>
				<category><![CDATA[embedded systems]]></category>
		<category><![CDATA[English articles]]></category>
		<category><![CDATA[OpenWrt]]></category>
		<category><![CDATA[qi-hardware]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://nanl.de/blog/?p=490</guid>
		<description><![CDATA[Currently I&#8217;m working on a project communicating and transmitting signals over the air with an 433 MHz radio module called &#8220;rfm12&#8220;, produced by HopeRF, soldered onto devices capable of running OpenWrt and having at least 3 accessible GPIO&#8217;s. Short story long: These radio modules are capable of sending / receiving over the ISM frequency band, [...]]]></description>
			<content:encoded><![CDATA[<p>Currently I&#8217;m working on a project communicating and transmitting signals over the air with an 433 MHz radio module called &#8220;<a href="http://www.hoperf.com/rf_fsk/rfm12.htm">rfm12</a>&#8220;, produced by HopeRF, soldered onto devices capable of running OpenWrt and having at least 3 accessible GPIO&#8217;s.</p>
<p><strong>Short story long:</strong></p>
<p>These radio modules are capable of sending / receiving over the ISM frequency band, as e.g. 433 MHz or 868 MHz and just cost about 5 Euros.</p>
<div id="attachment_515" class="wp-caption alignnone" style="width: 499px"><a href="http://nanl.de/blog/wp-content/uploads/rfm12_module1.jpg"><img class="size-full wp-image-515" title="RFM12 module" src="http://nanl.de/blog/wp-content/uploads/rfm12_module1.jpg" alt="" width="489" height="234" /></a><p class="wp-caption-text">RFM12 module</p></div>
<div id="attachment_500" class="wp-caption alignnone" style="width: 502px"><a href="http://nanl.de/blog/wp-content/uploads/rfm12_and_adapterboard1.jpg"><img class="size-large wp-image-500" title="RFM12 and adaptor board" src="http://nanl.de/blog/wp-content/uploads/rfm12_and_adapterboard1-1024x535.jpg" alt="" width="492" height="256" /></a><p class="wp-caption-text">RFM12 module soldered onto eval board</p></div>
<p>The idea was to get the module working on several embedded boards running Linux, e.g. routers, microcomputers such as the <a href="http://en.qi-hardware.com/wiki/Ben_NanoNote" target="_blank">NanoNote</a>, etc. via a generic software interface.</p>
<p>The rfm12 module is controlled via the 4-wire protocol <a href="http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus">SPI</a> which basically is based on toggling pins between the machine&#8217;s logic-levels (high/low) at an individual non-specified clock-speed (<a href="http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus">http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus</a>).</p>
<p>Since most of mentioned boards do not own a native SPI bus, but several <a href="http://en.wikipedia.org/wiki/General_Purpose_Input/Output">GPIO&#8217;s</a> (most LED&#8217;s are connected via GPIO&#8217;s on such devices), SPI can be &#8220;emulated&#8221; by toggling these GPIO&#8217;s in a specific way (also called &#8220;<a href="http://en.wikipedia.org/wiki/Bit-banging">bitbanging</a>&#8220;).</p>
<p><strong>That way there&#8217;s no need for any other electronic peripherals such as microcontrollers, semiconductors, resistors, etc. &#8211; the chip is directly connected with the board &#8211; everything is done in software.</strong></p>
<p>Inspired by the project &#8220;<a href="http://www.ethersex.de/index.php/Ethersex">ethersex</a>&#8221;  &#8211; a project programming and maintaining a software for Atmel AVR  micro-controllers used for home- / building automation &#8211; and <a href="http://ethersex.de/index.php/Funk2Duo">an approach  of soldering the module onto a specific router, communicating via SPI over GPIO&#8217;s</a> (however used code is rather old, unmaintained and board-specific)  &#8211; the idea came up to write a generic linux kernel module to support the module from within linux directly.</p>
<p>Based on the ideas realised with the ethersex project, I decided to aim my project on being able to switch remote controlled power sockets of which I own several (to each other incompatible) modules.</p>
<p>Because the rfm12 module is (only) capable of doing FM (modulating payload data on top of the frequency), but lot&#8217;s of devices are controlled via AM (most remote controlled power sockets included), we emulate AM by simply turning the module on and off in a specific sequence.</p>
<p>Since this operation is timing critical and needs to be atomic, we need to do basic stuff in the kernel space rather than from userspace.</p>
<p>The whole project is going to consist of 4 major parts:</p>
<ul>
<li>the rfm12 driver as kernel module which provides an API (accessible via a character device) to the userspace</li>
<li>an userspace library which contains all the information and protocol (meta)data for such remote controllable devices, providing an (more or less) generic interface and configuration of devices</li>
<li>an actual application using the library, so controlling the devices &#8211; maybe exporting the available functions via RPC (json, xml, etc.) to provide network access</li>
<li>a remote usable UI (for mobile devices as phones (android/meego), web-related, qt/gtk&#8230;)</li>
</ul>
<p>My testing device is an old Netgear WGT634U I had in spare which has a broadcom 47xx SoC working in and 4 unused GPIO&#8217;s available.</p>
<div id="attachment_505" class="wp-caption alignnone" style="width: 485px"><a href="http://nanl.de/blog/wp-content/uploads/rfm12_wgt634u1.jpg"><img class="size-full wp-image-505" title="Netgear WGT634U + RFM12 module" src="http://nanl.de/blog/wp-content/uploads/rfm12_wgt634u1.jpg" alt="" width="475" height="467" /></a><p class="wp-caption-text">RFM12 module directly connected to a Netgear WGT634U router</p></div>
<p>Implemented yet is support for the most common radio controlled sockets sold &#8211; the ones which have a 2272/2262 IC built in (including these Chinese versions which get on fire &#8211; <a href="http://ec.europa.eu/consumers/dyna/rapex/create_rapex.cfm?rx_id=142" target="_blank">http://ec.europa.eu/consumers/dyna/rapex/create_rapex.cfm?rx_id=142</a> #25) and the ones using an P801B chip.</p>
<div id="attachment_517" class="wp-caption alignnone" style="width: 528px"><a href="http://nanl.de/blog/wp-content/uploads/radio_controlled_power_sockets1.jpg"><img class="size-full wp-image-517" title="Radio controlled power sockets" src="http://nanl.de/blog/wp-content/uploads/radio_controlled_power_sockets1.jpg" alt="" width="518" height="286" /></a><p class="wp-caption-text">radio controlled power sockets: 2272, P801B, 2262</p></div>
<p>I also have a set of radio controlled <a href="http://www.pollin.de/shop/dt/NTY0OTQ0OTk-/Haustechnik/Installationsmaterial/Schalter_Steckdosen/Funk_Dimmer_Set_HouseLight_FD_UP003.html">dimmers</a> which protocol I&#8217;m going to implement soon&#8230;</p>
<p>For now the source code is hosted on github: <a href="https://github.com/mirko/rfm12-ASK-for-linux">https://github.com/mirko/rfm12-ASK-for-linux</a> &#8211; there&#8217;s no project site yet but will be created if the project is growing / interest is getting raised <img src='http://nanl.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>UPDATE</strong>: In case you&#8217;re willing to participate, you&#8217;re more than welcome! Just drop me an email&#8230; There&#8217;s lot&#8217;s of stuff I&#8217;d like to see implemented, especially usable (G)UI&#8217;s&#8230; but for sure it&#8217;s not just about me: patches, feedback, enhancements and feature-requests (in a certain extent) are highly appreciated!</p>
]]></content:encoded>
			<wfw:commentRss>http://nanl.de/blog/2011/01/rfm12-under-linux-and-remote-controlled-power-sockets/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>closing&#8230;</title>
		<link>http://nanl.de/blog/2010/11/closing/</link>
		<comments>http://nanl.de/blog/2010/11/closing/#comments</comments>
		<pubDate>Sun, 21 Nov 2010 17:47:15 +0000</pubDate>
		<dc:creator>mirko</dc:creator>
				<category><![CDATA[Bali (Indonesia)]]></category>
		<category><![CDATA[English articles]]></category>
		<category><![CDATA[misc]]></category>
		<category><![CDATA[My life]]></category>
		<category><![CDATA[Trips]]></category>

		<guid isPermaLink="false">http://nanl.de/blog/?p=475</guid>
		<description><![CDATA[Being back home for almost two month now, I finally find some time to close this category, my trip to Bali. I&#8217;ve been in Tanah Lot &#8211; an area where a rather famous temple of the same denominator is located. It&#8217;s kind of an island during high tide but accessible when tide is low. Because [...]]]></description>
			<content:encoded><![CDATA[<p>Being back home for almost two month now, I finally find some time to close this category, my trip to Bali.</p>
<p>I&#8217;ve been in Tanah Lot &#8211; an area where a rather famous temple of the same denominator is located. It&#8217;s kind of an island during high tide but accessible when tide is low.</p>
<p>Because of it&#8217;s formation, location and a spring of freshwater inside, a priest declared it as an holy place in the 15th century.</p>
<p>Seriously, it&#8217;s an amazing place (however flooded by tourists and locals trying to sell stuff).</p>

<a href='http://nanl.de/blog/2010/11/closing/dscf1481/' title='DSCF1481'><img width="150" height="150" src="http://nanl.de/blog/wp-content/uploads/DSCF14811-150x150.jpg" class="attachment-thumbnail" alt="DSCF1481" title="DSCF1481" /></a>
<a href='http://nanl.de/blog/2010/11/closing/dscf1490/' title='DSCF1490'><img width="150" height="150" src="http://nanl.de/blog/wp-content/uploads/DSCF14901-150x150.jpg" class="attachment-thumbnail" alt="DSCF1490" title="DSCF1490" /></a>
<a href='http://nanl.de/blog/2010/11/closing/dscf1502/' title='DSCF1502'><img width="150" height="150" src="http://nanl.de/blog/wp-content/uploads/DSCF15021-150x150.jpg" class="attachment-thumbnail" alt="DSCF1502" title="DSCF1502" /></a>

<p>After Tanah Lot I got back to Sanur, wanted to stay there just a few days and then move to the so called Gili islands&#8230;</p>
<p>&#8230;however unfortunately I got ill, got the <a href="http://en.wikipedia.org/wiki/Dengue_fever">Dengue fever</a>.</p>
<p>I don&#8217;t want to elaborate my almost last 10 days on Bali, however it was everything but nice and I do not wish anyone getting this bloody fever &#8211; seriously&#8230;</p>
<p><strong>Closing statement:</strong></p>
<p>It was great (apart from the fever I got)!</p>
<p>Seriously, Bali is no place where you&#8217;re going to struggle in any way&#8230; the Balinese economy is based on tourism, so you can get there almost every (western) stuff &#8211; it&#8217;s everything but a survival training (assumed you&#8217;re not getting ill).</p>
<p>Bali is a perfect mix of paradise-like beach and sea (have a look at the photos posted a few posts below) and cultural experiences (despite the tourism the Balinese people try hard to keep and practise their culture) like their huge amount of temples, sacrificial offerings several times a day, performances, etc.</p>
<p>There <strong>is </strong>lot&#8217;s of tourism, and partially too much of it for sure (for example Kuta and surroundings) &#8211; however the locals are <strong>really</strong> lovely and open-minded, it&#8217;s quite easy to socialise and get in touch with them&#8230;</p>
<p>Sharing some time of their everyday life is a definite recommendation if you&#8217;re not just there for beach, sea and sun but interested as well in their daily grind and culture.</p>
<p>They are more than pleased to show you around, quiet interested in western politics, habits, views, etc. &#8211; answering your questions in exchange for yours <img src='http://nanl.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>To those Balinese / Indonesian I met there, reading this:</p>
<p><strong>Thanks you so much for the great time !!<br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://nanl.de/blog/2010/11/closing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>comments, twitter&#8230;</title>
		<link>http://nanl.de/blog/2010/09/comments-twitter/</link>
		<comments>http://nanl.de/blog/2010/09/comments-twitter/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 10:14:24 +0000</pubDate>
		<dc:creator>mirko</dc:creator>
				<category><![CDATA[Bali (Indonesia)]]></category>
		<category><![CDATA[Brussels (Belgium)]]></category>
		<category><![CDATA[Dalian (china)]]></category>
		<category><![CDATA[embedded systems]]></category>
		<category><![CDATA[English articles]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[German articles]]></category>
		<category><![CDATA[misc]]></category>
		<category><![CDATA[My life]]></category>
		<category><![CDATA[Openmoko]]></category>
		<category><![CDATA[OpenWrt]]></category>
		<category><![CDATA[qi-hardware]]></category>
		<category><![CDATA[Taipei (Taiwan)]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Trips]]></category>
		<category><![CDATA[Windows Mobile]]></category>

		<guid isPermaLink="false">http://nanl.de/blog/?p=467</guid>
		<description><![CDATA[I recognized just a few hours ago, there were comments written, which needed to be approved&#8230; Did so now and tried to respond to them &#8211; sorry for the delay and thanks a lot for your input/contributions! As most people reading my blog do know already anyway and I no longer feel ashamed of using [...]]]></description>
			<content:encoded><![CDATA[<p>I recognized just a few hours ago, there were comments written, which needed to be approved&#8230;</p>
<p>Did so now and tried to respond to them &#8211; sorry for the delay and thanks a lot for your input/contributions!</p>
<p>As most people reading my blog do know already anyway and I no longer feel ashamed of using it&#8230;</p>
<p>My twitter username: <strong>foobarbablub</strong> &#8211; respectively the twitter page: <a href="http://twitter.com/foobarblablub">http://twitter.com/foobarblablub</a></p>
<p>Polluting the twitter cloud with statements / impressions I don&#8217;t think they&#8217;re worth a whole blog post&#8230; most tweets are <strong>not</strong> related to technical / computer stuff by the way &#8211; used language is mostly English&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://nanl.de/blog/2010/09/comments-twitter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ubud</title>
		<link>http://nanl.de/blog/2010/09/ubud/</link>
		<comments>http://nanl.de/blog/2010/09/ubud/#comments</comments>
		<pubDate>Sun, 05 Sep 2010 14:20:22 +0000</pubDate>
		<dc:creator>mirko</dc:creator>
				<category><![CDATA[Bali (Indonesia)]]></category>
		<category><![CDATA[English articles]]></category>
		<category><![CDATA[My life]]></category>
		<category><![CDATA[Trips]]></category>

		<guid isPermaLink="false">http://nanl.de/blog/?p=442</guid>
		<description><![CDATA[I moved from Sanur to Ubud today, which is located in the center of Bali &#8211; staying here for at least three days. Actually I wanted to go there by taxi, however in the morning I met three really nice local guys in my age, who offered to drive me there for free after I [...]]]></description>
			<content:encoded><![CDATA[<p>I moved from Sanur to Ubud today, which is located in the center of Bali &#8211; staying here for at least three days.</p>
<p>Actually I wanted to go there by taxi, however in the morning I met three really nice local guys in my age, who offered to drive me there for free after I told them I&#8217;m going to go to Ubud today&#8230; (however) by motorcycle.</p>
<p>Considering the traffic conditions on Bali I really was not sure about whether taking this offer would be a good idea&#8230; however I agreed &#8211; no risk no fun&#8230; &#8211; it was an awesome experience!</p>
<p>So I collected all my stuff, threw it in my backpack and met with these guys &#8211; four people on two motorcycles, lurching through the traffic about 40 minutes from Sanur to Ubud having all my stuff on my back.<br />
Watching the traffic from this point of view it seems much more and less scary at the same time. You&#8217;re now part of this chaos, praying the guy in front of you driving the motorcycle is doing everything right.<br />
However it just works &#8211; what seems to be the worst chaos ever from the outside, from the inside everything seems to be smooth, everybody is seems to be relaxed, just trying to find out whether this gap is big enough to get through&#8230;</p>
<p>The accomodation is really simple, but quite nice &#8211; just a room with a bed in and a kind of open-air shower and WC. Tea and coffee the whole day and breakfast included for about 10USD / night.</p>

<a href='http://nanl.de/blog/2010/09/ubud/dscf1210/' title='DSCF1210'><img width="150" height="150" src="http://nanl.de/blog/wp-content/uploads/DSCF12101-150x150.jpg" class="attachment-thumbnail" alt="DSCF1210" title="DSCF1210" /></a>
<a href='http://nanl.de/blog/2010/09/ubud/dscf1211/' title='DSCF1211'><img width="150" height="150" src="http://nanl.de/blog/wp-content/uploads/DSCF12111-150x150.jpg" class="attachment-thumbnail" alt="DSCF1211" title="DSCF1211" /></a>

]]></content:encoded>
			<wfw:commentRss>http://nanl.de/blog/2010/09/ubud/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>successfully arrived on Bali</title>
		<link>http://nanl.de/blog/2010/09/successfully-arrived-on-bali/</link>
		<comments>http://nanl.de/blog/2010/09/successfully-arrived-on-bali/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 04:05:13 +0000</pubDate>
		<dc:creator>mirko</dc:creator>
				<category><![CDATA[Bali (Indonesia)]]></category>
		<category><![CDATA[English articles]]></category>
		<category><![CDATA[My life]]></category>
		<category><![CDATA[Trips]]></category>

		<guid isPermaLink="false">http://nanl.de/blog/?p=409</guid>
		<description><![CDATA[I successfully arrived in Bali yesterday in the evening. Flight was (as always) not quite enojoyable (Amsterdam -&#62; Singapore more than 12 hours) &#8211; however it was bearable. I was surprised actually by the service offered by KLM and Singapore Airlines in a positive way (food was surprisingly great: both offered fish &#8211; first time [...]]]></description>
			<content:encoded><![CDATA[<p>I successfully arrived in Bali yesterday in the evening. Flight was (as always) not quite enojoyable (Amsterdam -&gt; Singapore more than 12 hours) &#8211; however it was bearable.<br />
I was surprised actually by the service offered by KLM and Singapore Airlines in a positive way (food was surprisingly great: both offered fish &#8211; first time I got fish offered on an airplane as regular meal within economy class; Singapore Airlines additionally had real metal cutlery and a big portion of awesome ice-cream afterwards, for a flight of just two hours).</p>
<p>Met a German couple on the plane going to do professional diving somewhere in the south of Bali for three weeks. They offered me to visit them there and taking a deep look into the water with professional diving equipment. From what they told it has to be really incredible and if any way possible, I&#8217;m going to take that offer whenever I&#8217;ll be in this area.</p>
<p>On the final flight from Singapore to Bali I met an English guy, who is living on Bali with his Balinese wife and daugther for quite some time now and offered me to stay with them in their place for a couple of days which offer I thankfully took, as I had no clue anyway what to do after dropping out of the airplane (I in case of doubt I would have aimed a hostel near the airport mentioned in my guide).<br />
These three people (actually four, there is an attendant living with them who is treated as part of the family) are really lovely, doing everything to make my stay enjoyable &#8211; well, I got in touch with the guy just two hours ago on the plane!</p>
<p>Their place &#8211; they call it &#8220;simple&#8221; &#8211; is wonderful; the whole kind-of 2nd floor is mine, within an own (bed)room, bathroom and an area with chairs and table which is opened to the inside of the whole area which in fact is a little garden &#8211; if I want to just &#8220;relax&#8221; they said&#8230;</p>
<p>Just take a look by yourself:</p>

<a href='http://nanl.de/blog/2010/09/successfully-arrived-on-bali/dscf1170-2/' title='DSCF1170'><img width="150" height="150" src="http://nanl.de/blog/wp-content/uploads/DSCF117011-150x150.jpg" class="attachment-thumbnail" alt="DSCF1170" title="DSCF1170" /></a>
<a href='http://nanl.de/blog/2010/09/successfully-arrived-on-bali/dscf1142/' title='DSCF1142'><img width="150" height="150" src="http://nanl.de/blog/wp-content/uploads/DSCF11421-150x150.jpg" class="attachment-thumbnail" alt="DSCF1142" title="DSCF1142" /></a>
<a href='http://nanl.de/blog/2010/09/successfully-arrived-on-bali/dscf1146/' title='DSCF1146'><img width="150" height="150" src="http://nanl.de/blog/wp-content/uploads/DSCF11461-150x150.jpg" class="attachment-thumbnail" alt="DSCF1146" title="DSCF1146" /></a>
<a href='http://nanl.de/blog/2010/09/successfully-arrived-on-bali/dscf1148/' title='DSCF1148'><img width="150" height="150" src="http://nanl.de/blog/wp-content/uploads/DSCF11481-150x150.jpg" class="attachment-thumbnail" alt="DSCF1148" title="DSCF1148" /></a>
<a href='http://nanl.de/blog/2010/09/successfully-arrived-on-bali/dscf1151/' title='DSCF1151'><img width="150" height="150" src="http://nanl.de/blog/wp-content/uploads/DSCF11511-150x150.jpg" class="attachment-thumbnail" alt="DSCF1151" title="DSCF1151" /></a>
<a href='http://nanl.de/blog/2010/09/successfully-arrived-on-bali/dscf1152/' title='DSCF1152'><img width="150" height="150" src="http://nanl.de/blog/wp-content/uploads/DSCF11521-150x150.jpg" class="attachment-thumbnail" alt="DSCF1152" title="DSCF1152" /></a>

<p>When writing this text it&#8217;s about 4 &#8216;o clock local time &#8211; bloody jetlag&#8230; _right now_ I just did see Bali at night (arrived at 9 &#8216;o clock); I&#8217;m really curious about how this all looks by day.</p>
<p>I took a walk in the area nearby at about 11PM and have to admit &#8211; I don&#8217;t really feel comfortable just walking around alone&#8230; Overall people offering you every kind of services in a very aggressive way, trying to rip off tourists.<br />
However walking around in this area, tired and a little bit agitated because of the long flight, just wanna have everybody shut-up, might not have been the appropriate preconditions facing the situation in an open-minded way.</p>
<p><strong>UPDATE: </strong>That was really just the first impression&#8230; the people are nice and kind, seriously. Yes, they want to sell their stuff quite often and quite everywhere, however you get used to it&#8230; just saying no, starting ignoring them or taking with them about all the world and his wife or whatever elese  <img src='http://nanl.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So much for now &#8211; as there are lot of things I&#8217;d like to see/visit very close by the place I&#8217;m currently staying, I think I&#8217;ll keep staying here for a couple of days &#8211; trying to figure out where to go and what to do next.</p>
]]></content:encoded>
			<wfw:commentRss>http://nanl.de/blog/2010/09/successfully-arrived-on-bali/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

