<?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>Blog @ SIB Visions &#187; RaspberryPi</title>
	<atom:link href="http://blog.sibvisions.com/tag/raspberrypi/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sibvisions.com</link>
	<description>Blog @ SIB Visions</description>
	<lastBuildDate>Mon, 13 Apr 2026 09:47:01 +0000</lastBuildDate>
		<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>JVx application on embedded devices</title>
		<link>https://blog.sibvisions.com/2015/02/19/jvx-application-on-embedded-devices/</link>
		<comments>https://blog.sibvisions.com/2015/02/19/jvx-application-on-embedded-devices/#comments</comments>
		<pubDate>Thu, 19 Feb 2015 15:58:41 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[IoT]]></category>
		<category><![CDATA[JVx]]></category>
		<category><![CDATA[RaspberryPi]]></category>

		<guid isPermaLink="false">http://blog.sibvisions.com/?p=3775</guid>
		<description><![CDATA[In the last weeks, we did many experiments with JVx on Raspberry Pi, especially using a Pi as server for JVx applications. Our vision was that the business logic could run on a Pi without Java application server like Tomcat or Jetty. Our example application was a simple sensor recorder. We read temperature data and [...]]]></description>
			<content:encoded><![CDATA[<p>In the last weeks, we did many experiments with JVx on Raspberry Pi, especially using a Pi as server for JVx applications. Our vision was that the business logic could run on a Pi without Java application server like Tomcat or Jetty. Our example application was a simple sensor recorder. We read temperature data and stored the read data into a JavaDB (on the same device). We knew that Jetty and Tomcat worked on a Pi but it was not necessary to run an application server without web content.</p>
<p>We tried different implementations:</p>
<ul>
<li><strong>Fun</strong>
<p>A recorder class that saved data directly in the JavaDB. A good old Java application with one DBStorage because plain JDBC was painful.</li>
<li><strong>Because JVx can do that</strong>
<p>A simple recorder client with embedded JVx server. The client was a simple class with a DirectServerConnection. The server saved retrieved temperature data in the JavaDB.</li>
<li><strong>Production</strong>
<p>The same simple recorder client but the server run standalone. The DirectServerConnection was replaced with a Netconnection.</li>
</ul>
<p>The first implementation was for fun only and not relevant for our tests. Our Pi should be a server that measures data and allows accessing data from JavaDB (for charts). Some real client applications could use the temperature server for integrating temperature data. The same application could use other Sensor data from different RasPis (measuring lux, webcam, ...) - a RasPi (sensor) network.</p>
<p>The big problem was that JVx server didn't work without an application server. It worked embedded and via http, but we didn't have a plain socket implementation. It wasn't a JVx problem because the server component was ready for socket connections but we didn't have a Socket server. We made some experiments with vert.x and the result was a nice socket server. We also used JVx with vert.x Http server. Both implementations are available on <a href="https://github.com/sibvisions/jvx.vert.x">GitHub</a>. It worked like a charm but we didn't like the library dependencies. We already had a socket server API for our product VisionX, but it wasn't decoupled. Now it is!</p>
<p>We used the VisionX socket API and merged it in our applications library. After some modifications and bugfixes, in JVx, it's now possible to use it without additional dependencies. It's a simple socket server for JVx server component. We've used this server to run VisionX and had no problems. VisionX is a huge JVx application and if VisionX works, all other JVx applications will work.</p>
<p>It's very simple to use the the socket server:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">NetServer server <span class="sy0">=</span> <span class="kw1">new</span> NetServer<span class="br0">&#40;</span><span class="st0">&quot;servername&quot;</span>, 556<span class="br0">&#41;</span><span class="sy0">;</span><br />
server.<span class="me1">start</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>The server has a main method and you can use it without additional coding. Simply set the system properties <strong>server.hostname</strong>, <strong>server.port</strong>.</p>
<p>To open a connection, simply call:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">IConnection con <span class="sy0">=</span> <span class="kw1">new</span> NetConnection<span class="br0">&#40;</span><span class="st0">&quot;servername&quot;</span>, 556<span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>MasterConnection appcon <span class="sy0">=</span> <span class="kw1">new</span> MasterConnection<span class="br0">&#40;</span>con<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
appcon.<span class="me1">setApplicationName</span><span class="br0">&#40;</span><span class="st0">&quot;tempsensor&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
appcon.<span class="me1">setUserName</span><span class="br0">&#40;</span><span class="st0">&quot;user&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
appcon.<span class="me1">setPassword</span><span class="br0">&#40;</span><span class="st0">&quot;password&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
appcon.<span class="me1">open</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>Not really rocket-science and just works!</p>
<p>The only problem was the server name and port configuration, for every client. Not really cool in a "sensor network". So we started a simple Broadcaster. It's a simple class that checks the network for existing servers. It's easy to use on client-side:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">List<span class="sy0">&lt;</span>ConnectInfo<span class="sy0">&gt;</span> liConInfo <span class="sy0">=</span> Broadcaster.<span class="me1">search</span><span class="br0">&#40;</span><span class="st0">&quot;MyAPP&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>and the server side isn't too complex:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">Broadcaster broadcaster <span class="sy0">=</span> <span class="kw1">new</span> Broadcaster<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
broadcaster.<span class="me1">setServerPort</span><span class="br0">&#40;</span>556<span class="br0">&#41;</span><span class="sy0">;</span><br />
broadcaster.<span class="me1">setIdentifier</span><span class="br0">&#40;</span><span class="st0">&quot;MyAPP&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
broadcaster.<span class="me1">start</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>The result contains a list of available hostnames and ports for the first found server. It's still space for a better solution, but I think that's the reason why vert.x uses <a href="https://hazelcast.org/">hazelcast</a>.</p>
<p>To cut a long story short: It's now possible to use complete JVx applications without Java application server, especially on embedded devices like RaspberryPi.</p>
<p>Sure, it's still recommended to use an application server if your device serves web content or a whole web application e.g. with JVx' vaadin UI (see <a href="https://blog.sibvisions.com/2015/01/08/iot-window-shutter-control-with-jvx-vaadin-and-raspberrypi/">IoT: Window shutter control</a>).</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2015/02/19/jvx-application-on-embedded-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RaspberryPi + 1-wire + i2c + camera and kernel pain</title>
		<link>https://blog.sibvisions.com/2015/01/26/raspberrypi-1-wire-i2c-camera-and-kernel-pain/</link>
		<comments>https://blog.sibvisions.com/2015/01/26/raspberrypi-1-wire-i2c-camera-and-kernel-pain/#comments</comments>
		<pubDate>Mon, 26 Jan 2015 13:01:58 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[RaspberryPi]]></category>

		<guid isPermaLink="false">http://blog.sibvisions.com/?p=3635</guid>
		<description><![CDATA[Our last research project was real fun: Build a Webcam with temp and light sensor to do some home/office automation.
We took a RaspberryPi model B, temp sensor (DS18B20) and light sensor (TSL45315).
The temp sensor had a 1-wire interface and the Internet had many tutorials to connect the sensor to a RasPi. It should be a [...]]]></description>
			<content:encoded><![CDATA[<p>Our last research project was real fun: Build a <strong>Webcam with temp and light sensor</strong> to do some home/office automation.</p>
<p>We took a RaspberryPi model B, <a href="http://www.watterott.com/de/Temperatur-Sensor-Wasserdicht-DS18B20">temp sensor (DS18B20)</a> and <a href="http://www.watterott.com/de/TSL45315-Breakout">light sensor (TSL45315)</a>.</p>
<p>The temp sensor had a 1-wire interface and the Internet had many tutorials to connect the sensor to a RasPi. It should be a trivial job, if you read the tutorials and it should be ready in max. 10 minutes. <strong>Should</strong>!</p>
<p>The theory wasn't the reality and the tutorials didn't cover our environment, because we had a new Raspbian ISO with kernel 3.16 and 3.18 some hours later.</p>
<p>We tried to connect the sensor as described (with and without pullup resistor, with parasite power and without) but it wasn't detected. It was horrible because the driver was loaded without problems and logged a simple success message.<br />
We didn't find information about the problem because we didn't see an error. It simply did nothing and the filesystem didn't contain the relevant files and directories. Our <strong>/sys/bus/w1/devices</strong> directory was clean and empty. After some hours error searching, without any ideas we tried an older Raspbian image with kernel 3.6 and our sensor worked out-of-the-box without modifications. We saw additional log information from the 1-wire module which we didn't have with our 3.18 kernel. So we knew that something has changed in the kernel or kernel config... </p>
<p>But we weren't happy because the whole thing should work with an up-to-date setup. After we knew that the kernel caused our problems, we tried to find a solution and found: <a href="http://www.raspberrypi.org/forums/viewtopic.php?t=97216&#038;p=676793">http://www.raspberrypi.org/forums/viewtopic.php?t=97216&#038;p=676793</a> (first posting on 2nd page). There was a hint about the device tree. With this information, we found: <a href="https://github.com/raspberrypi/documentation/blob/master/configuration/device-tree.md">https://github.com/raspberrypi/documentation/blob/master/configuration/device-tree.md</a></p>
<p>We disabled the device-tree by adding <strong>device_tree=</strong> to our config.txt and everything worked after a reboot, with our 3.18 kernel. So far so good.</p>
<p>It also worked with <strong>device_tree_overlay=overlays/w1-gpio-overlay.dtb</strong>. This option was our preferred one  because it didn't disable the device_tree.</p>
<p>After our temp sensor worked without problems we connected the Raspicam and made some tests. Everything worked without problems. The last piece of our project was the light sensor. It was a littly bit tricky to use the sensor with our Pi because the source code example wasn't available for Java/Pi4J, but here it is:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">I2CBus bus <span class="sy0">=</span> I2CFactory.<span class="me1">getInstance</span><span class="br0">&#40;</span>I2CBus.<span class="me1">BUS_1</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>I2CDevice device <span class="sy0">=</span> bus.<span class="me1">getDevice</span><span class="br0">&#40;</span>0x29<span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>device.<span class="me1">write</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw4">byte</span><span class="br0">&#41;</span><span class="br0">&#40;</span>0x80 <span class="sy0">|</span> 0x0A<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="kw4">byte</span><span class="br0">&#91;</span><span class="br0">&#93;</span> byData <span class="sy0">=</span> <span class="kw1">new</span> <span class="kw4">byte</span><span class="br0">&#91;</span>1<span class="br0">&#93;</span><span class="sy0">;</span><br />
device.<span class="me1">read</span><span class="br0">&#40;</span>byData, 0, 1<span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="kw3">System</span>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span>byData<span class="br0">&#91;</span>0<span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="kw3">System</span>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&quot;Power on...&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>device.<span class="me1">write</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw4">byte</span><span class="br0">&#41;</span><span class="br0">&#40;</span>0x80 <span class="sy0">|</span> 0x00<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
device.<span class="me1">write</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw4">byte</span><span class="br0">&#41;</span>0x03<span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="kw3">System</span>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&quot;Config...&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>device.<span class="me1">write</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw4">byte</span><span class="br0">&#41;</span><span class="br0">&#40;</span>0x80 <span class="sy0">|</span> 0x01<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
device.<span class="me1">write</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw4">byte</span><span class="br0">&#41;</span>0x00<span class="br0">&#41;</span><span class="sy0">;</span> &nbsp; <span class="co1">//M=1, T=400ms</span><br />
<span class="co1">//device.write((byte)0x01); &nbsp; //M=2, T=200ms</span><br />
<span class="co1">//device.write((byte)0x02); &nbsp; //M=4, T=100ms</span></p>
<p>byData <span class="sy0">=</span> <span class="kw1">new</span> <span class="kw4">byte</span><span class="br0">&#91;</span>2<span class="br0">&#93;</span><span class="sy0">;</span></p>
<p><span class="kw1">while</span> <span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; device.<span class="me1">write</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw4">byte</span><span class="br0">&#41;</span><span class="br0">&#40;</span>0x80 <span class="sy0">|</span> 0x04<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; device.<span class="me1">read</span><span class="br0">&#40;</span>byData, 0, 2<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw4">int</span> l <span class="sy0">=</span> byData<span class="br0">&#91;</span>0<span class="br0">&#93;</span> <span class="sy0">&amp;</span> 0xFF<span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw4">int</span> h <span class="sy0">=</span> byData<span class="br0">&#91;</span>1<span class="br0">&#93;</span> <span class="sy0">&amp;</span> 0xFF<span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw4">int</span> lux <span class="sy0">=</span> <span class="br0">&#40;</span>h <span class="sy0">&lt;&lt;</span> 8<span class="br0">&#41;</span> <span class="sy0">|</span> <span class="br0">&#40;</span>l <span class="sy0">&lt;&lt;</span> 0<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; lux <span class="sy0">*=</span> <span class="nu0">1</span><span class="sy0">;</span> &nbsp; <span class="co1">//M1</span><br />
&nbsp; &nbsp; <span class="co1">//lux *= 2; &nbsp; //M2</span><br />
&nbsp; &nbsp; <span class="co1">//lux *= 4; &nbsp; //M4</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw3">System</span>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span>lux<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw3">Thread</span>.<span class="me1">sleep</span><span class="br0">&#40;</span>1000<span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>We compared the output with an Arduino board and the values were "the same".</p>
<p>It wasn't possible to use the light sensor without required modules. We simply added <strong>device_tree_param=i2c1=on</strong> to our config.txt and I2C worked. You should install</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;"><span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> i2c-tools</div>
</div>
<p>to verify connected sensors, via:</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;">i2cdetect <span class="re5">-y</span> <span class="nu0">1</span></div>
</div>
<p>After we thought that everything will work, we put all pieces together: temp sensor, cam, light sensor.<br />
During development, we didn't use all parts together - only the relevant sensor, to rule out errors.</p>
<p>Everything worked fine after starting the Pi, but the cam stopped capturing after some minutes... frustrating.<br />
So again we tried to find an error without detailed information and without logs. We thought it might be a module loading problem and found some hints: <a href="https://github.com/raspberrypi/linux/issues/435">https://github.com/raspberrypi/linux/issues/435</a>. But nothing worked for us. The only working solution was: <strong>disable the device tree</strong> <img src='https://blog.sibvisions.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>The whole system is up and running for some days and there we no problems.</p>
<p>We currently don't know what's the problem with the device tree or what we should configure to avoid problems, but if you have similar problems, this posting could help. If you have a working solution with the device tree... leave a comment <img src='https://blog.sibvisions.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2015/01/26/raspberrypi-1-wire-i2c-camera-and-kernel-pain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rolladen steuern mit Pi</title>
		<link>https://blog.sibvisions.com/2013/06/12/rolladen-steuern-mit-pi/</link>
		<comments>https://blog.sibvisions.com/2013/06/12/rolladen-steuern-mit-pi/#comments</comments>
		<pubDate>Wed, 12 Jun 2013 08:23:13 +0000</pubDate>
		<dc:creator>mhandsteiner</dc:creator>
				<category><![CDATA[Media]]></category>
		<category><![CDATA[RaspberryPi]]></category>

		<guid isPermaLink="false">http://blog.sibvisions.com/?p=2267</guid>
		<description><![CDATA[


&#160;
Im aktuellen JavaAktuell wurde ein Artikel über die Ansteuerung von Rolläden mittels Raspberry Pi veröffentlicht. Bei JavaAktuell handelt es sich um ein Magazin des iJUG (Interessenverbund der Java User Groups). Das Magazin richtet sich an Java Entwickler und die Artikel werden von Anwendern, die spezialisten in Ihrem Gebiet sind, verfasst.
Wer die aktuelle Ausgabe noch nicht [...]]]></description>
			<content:encoded><![CDATA[<table>
<tr>
<td><a href="http://blog.sibvisions.com/wp-content/uploads/2013/06/raspi.png" rel="lightbox[2267]"><img src="http://blog.sibvisions.com/wp-content/uploads/2013/06/raspi-150x150.png" alt="RasPi mit Fernbedienung" title="raspi" width="150" height="150" class="size-thumbnail wp-image-2272" /></a></td>
<td style="width: 10px;">&nbsp;</td>
<td>Im aktuellen <a href="http://www.ijug.eu/java-aktuell/das-magazin.html">JavaAktuell</a> wurde ein Artikel über die Ansteuerung von Rolläden mittels Raspberry Pi veröffentlicht. Bei JavaAktuell handelt es sich um ein Magazin des iJUG (Interessenverbund der Java User Groups). Das Magazin richtet sich an Java Entwickler und die Artikel werden von Anwendern, die spezialisten in Ihrem Gebiet sind, verfasst.</p>
<p>Wer die aktuelle Ausgabe noch nicht in seinen Händen hält, kann <a href="http://blog.sibvisions.com/wp-content/uploads/2013/06/RasPi_Rolladen_steuern.pdf">hier</a> schon mal in den Artikel reinlesen.</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2013/06/12/rolladen-steuern-mit-pi/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
