<?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>Raspberry Pi &#8211; BeatificaBytes</title>
	<atom:link href="https://www.BeatificaBytes.be/category/raspberry-pi/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.BeatificaBytes.be</link>
	<description>The Joys of Computing</description>
	<lastBuildDate>Wed, 05 Jan 2022 20:27:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8</generator>
	<item>
		<title>Install Z-Stick &#038; ConBee II on RPI/Openhabian</title>
		<link>https://www.BeatificaBytes.be/install-z-stick-conbee-ii-on-rpi-openhabian/</link>
					<comments>https://www.BeatificaBytes.be/install-z-stick-conbee-ii-on-rpi-openhabian/#comments</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Wed, 05 Jan 2022 20:27:15 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[OpenHab]]></category>
		<category><![CDATA[ZigBee]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=5198</guid>

					<description><![CDATA[Here is how to configure properly an Aeotec Z-Stick Gen5 and a Conbee II stick on a RPI 4 installed with Openhabian (running OpenHab 3)]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">Here is how to configure properly an Aeotec Z-Stick Gen5 and a Conbee II stick on a RPI 4 installed with Openhabian (running OpenHab 3)</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b2767b71cdb"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b2767b71cdb'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b2767b71cdb" class="collapseomatic_content ">
<p style="text-align: justify;">First, be sure that openhabian can access the serial ports. The easiest is to configure that via openhabian-config &gt; System Settings &gt; Serial Port:</p>
<blockquote>
<p>sudo openhabian-config </p>
</blockquote>
<p style="text-align: justify;">You can also do it with raspi-config &gt; Interfacing Options &gt; Serial :</p>
<blockquote>
<p>sudo apt-get install raspi-config<br />sudo raspi-config</p>
<p>&gt; Would you like a login shell accessible over serial? → <strong>No</strong><br />&gt; Would you like the serial port hardware to be enabled? → <strong>Yes</strong></p>
</blockquote>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Next, check that the sticks are well plugged with the command:</p>
<blockquote>
<p>lsusb</p>
</blockquote>
<p style="text-align: justify;">You should see something like</p>
<blockquote>
<p>Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<br /><strong>Bus 001 Device 011: ID <span style="color: #0000ff;">1cf1</span>:<span style="color: #008000;">0030</span> Dresden Elektronik ZigBee gateway [ConBee II]</strong><br /><strong>Bus 001 Device 005: ID <span style="color: #0000ff;">0658</span>:<span style="color: #008000;">0200</span> Sigma Designs, Inc. Aeotec Z-Stick Gen5 (ZW090) &#8211; UZB</strong><br />Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub<br />Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub</p>
</blockquote>
<p style="text-align: justify;">In order to always have the USB sticks mounted on the same &#8220;port&#8221;, instead of being assigned once on /dev/ttyACM0, once on /dev/ttyACM1, &#8230; create a UDEV Rule file:</p>
<blockquote>
<p>sudo nano /etc/udev/rules.d/99-usb-serial.rules</p>
</blockquote>
<p style="text-align: justify;">Type the following, using the ID of the USB sticks found above, in this file:</p>
<blockquote>
<p>SUBSYSTEM==&#8221;tty&#8221;, ATTRS{idVendor}==&#8221;<span style="color: #0000ff;">0658</span>&#8220;, ATTRS{idProduct}==&#8221;<span style="color: #008000;">0200</span>&#8220;, SYMLINK+=&#8221;ttyUSB-ZWave&#8221;, GROUP=&#8221;dialout&#8221;, MODE=&#8221;0666&#8243;<br />SUBSYSTEM==&#8221;tty&#8221;, ATTRS{idVendor}==&#8221;<span style="color: #0000ff;">1cf1</span>&#8220;, ATTRS{idProduct}==&#8221;<span style="color: #008000;">0030</span>&#8220;, SYMLINK+=&#8221;ttyUSB-ZigBee&#8221;, GROUP=&#8221;dialout&#8221;, MODE=&#8221;0666&#8243;</p>
</blockquote>
<p style="text-align: justify;">If you didn&#8217;t prepare openhabian for ZigBee via sudo openhabian-config &gt; System Settings &gt; Serial Port, grant the following access for openhab :</p>
<blockquote>
<p>sudo adduser openhab dialout<br />sudo adduser openhab tty</p>
</blockquote>
<p style="text-align: justify;">Now, reboot (sudo reboot) and test if symlink was created with the command :</p>
<blockquote>
<p>ls /dev/tty*</p>
</blockquote>
<p style="text-align: justify;">You should see</p>
<blockquote>
<p>/dev/ttyUSB-ZigBee<br />/dev/ttyUSB-ZWave</p>
</blockquote>
<p style="text-align: justify;">Add edit openhab config file to add the symlinks to the PATH variable for Java (NB: for openhab 2, the file is namge openhab2 !!):</p>
<blockquote>
<p>sudo nano /etc/default/openhab</p>
</blockquote>
<p style="text-align: justify;">Search the line with EXTRA_JAVE_OPTS and modify accordingly to complete the parameter &#8216;Dgnu.io.rxtx.SerialPorts&#8217;:</p>
<blockquote>
<p>EXTRA_JAVA_OPTS=&#8221;-Xms192m -Xmx320m <strong><span style="color: #0000ff;">-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB-ZWave:/dev/ttyUSB-ZigBee</span></strong>&#8220;</p>
</blockquote>
<p style="text-align: justify;">Now, reboot again (sudo reboot) and install Phoscon, the application to manage the ZigBee devices. The easiest is to install it (on port 8081 as recommended) via openhabian-config &gt; Optional Components &gt; deCONZ:</p>
<blockquote>
<p>sudo openhabian-config</p>
</blockquote>
<p style="text-align: justify;">You can also look <a href="https://phoscon.de/en/raspbee/install#raspbian" target="_blank" rel="noopener noreferrer">here</a> on the phoscon website for a manual setup</p>
<p style="text-align: justify;">If you have a RPI 4B, also update the WiringPI like this:</p>
<blockquote>
<p>cd /tmp<br />wget https://project-downloads.drogon.net/wiringpi-latest.deb<br />sudo dpkg -i wiringpi-latest.deb</p>
</blockquote>
<p style="text-align: justify;">You can now open phoscon to login and search for ZigBee devices on http://&lt;your RPI IP&gt;:8081</p>
<p>If after a reboot, this UI is not available, then enable manually the service:</p>
<blockquote>
<p>sudo systemctl enable deconz</p>
</blockquote>
<p>If you want to change the port of Phoscon, edit the parameter &#8216;http-port&#8217; in this file:</p>
<blockquote>
<p>sudo nano /lib/systemd/system/deconz.service</p>
</blockquote>
<p> </p>
<p style="text-align: justify;">Finally, install the following addons (Bindings) in OpenHab :</p>
<ul style="text-align: justify;">
<li>&#8220;Dresden Elektronik deCONZ Binding&#8221;</li>
<li>&#8220;Z-Wave Binding&#8221;</li>
</ul>
<p style="text-align: justify;">The ConBee gateway will be detected automatically by OpenHab and appear twice in the &#8216;Inbox&#8217;: once as Deconz and once as Hue (indeed, it emulates a Philips Hue Bridge). If it was not detected automatically, open the Phoscon UI &gt; Gateway &gt; Advanced (Gear Icon at the bottom of the page) and CLick on &#8220;Authenticat App&#8221;. Then add the Thing manually into OpenHab using the Scan button of:</p>
<blockquote>
<p>OpenHab UI &gt; Administration &gt; Parameters &gt; Things &gt; + (Add Thing) &gt; Dresden Elektronik deCONZ Binding</p>
</blockquote>
<p> </p>
<p style="text-align: justify;">The Zwave gateway will only appear if you add it explicitly into OpenHab:</p>
<blockquote>
<p>OpenHab UI &gt; Administration &gt; Parameters &gt; Things &gt; + (Add Thing) &gt; Z-Wave Binding &gt; Z-Wave Serial Controller</p>
<p>In the field Serial Port, type manually &#8216;/dev/ttyUSB-ZWave&#8217; (without the quotes) and click &#8216;Create Thing&#8217;</p>
</blockquote>
<p style="text-align: justify;">Wait for about 10 seconds and the gateway will soon become online.</p>
<p style="text-align: justify;">Et voilà.</p>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_5198" class="pvc_stats total_only  " data-element-id="5198" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/install-z-stick-conbee-ii-on-rpi-openhabian/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>RPI 4/Openhabian into an Argon One Case</title>
		<link>https://www.BeatificaBytes.be/rpi-openhabian-into-an-argon-one-case/</link>
					<comments>https://www.BeatificaBytes.be/rpi-openhabian-into-an-argon-one-case/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Wed, 05 Jan 2022 18:17:10 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[OpenHab]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=5195</guid>

					<description><![CDATA[  If you installed Openhabian onto an RPI hosted into an Argon Once Case, here is how to configure the Argon One.]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">If you installed Openhabian onto an RPI hosted into an Argon Once Case, here is how to configure the Argon One.</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b2767b73acd"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b2767b73acd'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b2767b73acd" class="collapseomatic_content ">
<p style="text-align: justify;">Install the scripts to manage to Argon One&#8217;s features:</p>
<blockquote>
<p>sudo curl https://download.argon40.com/argon1.sh | bash</p>
</blockquote>
<p style="text-align: justify;">Configure the fan cooler, for example depending on the temperature, with the command:</p>
<blockquote>
<p>sudo argonone-config</p>
</blockquote>
<p style="text-align: justify;">Select the option 2 and type 10 for 55 °C, 55 for 60 °C and 100 for 65 °C, meaning that the fan speed will by 10% at 55 °C, etc&#8230;</p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">In order to configure the Argon One to turn on automatically after a power failure, you have first to enable the i2C. The easiest is to do it with the raspi-config command, which can be installed with:</p>
<blockquote>
<p>sudo apt-get install raspi-config</p>
</blockquote>
<p style="text-align: justify;">Then run it:</p>
<blockquote>
<p>sudo raspi-config</p>
</blockquote>
<p style="text-align: justify;">And go to the menu &#8220;Interface option&#8221;, and select the entry &#8220;I2C&#8221; to enable the loading of the I2C kernel module.</p>
<p style="text-align: justify;">Now you can check that it works with the command:</p>
<blockquote>
<p>i2cdetect -y 1</p>
</blockquote>
<p style="text-align: justify;">And finally set the Power-On feature with the command:</p>
<blockquote>
<p>i2cset -y 1 0x01a 0xfe</p>
</blockquote>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Now, you can press the power button of the Argon One :</p>
<ul style="text-align: justify;">
<li>twice to reboot</li>
<li>+3 sec to shutdown and power off</li>
<li>+5 sec to force the shutdown</li>
</ul>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Et voilà</p>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_5195" class="pvc_stats total_only  " data-element-id="5195" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/rpi-openhabian-into-an-argon-one-case/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Xiamo Aqara and Openhab on Raspberry Pi</title>
		<link>https://www.BeatificaBytes.be/xiamo-aqara-and-openhab-on-raspberry-pi/</link>
					<comments>https://www.BeatificaBytes.be/xiamo-aqara-and-openhab-on-raspberry-pi/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Sun, 16 May 2021 14:00:05 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[OpenHab]]></category>
		<category><![CDATA[Xiaomi]]></category>
		<category><![CDATA[ZigBee]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=4963</guid>

					<description><![CDATA[A few notes on using Xiaomi Aqara Sensors and Switches with Openhab 3.]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">A few notes on using Xiaomi Aqara Sensors and Switches with Openhab 3.</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b2767b7553a"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b2767b7553a'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b2767b7553a" class="collapseomatic_content ">
<p style="text-align: justify;">I am using a Zigbee USB key <a href="https://phoscon.de/en/conbee2" target="_blank" rel="noopener noreferrer">Conbee II</a> from <a href="https://www.dresden-elektronik.de/produkte.html" target="_blank" rel="noopener noreferrer">Dresen Eletronik</a>.</p>
<p style="text-align: justify;">It is plugged into the Raspberry Pi with a USB cable extension to put it away from the other keys used on this RPi, like my Sigma Z-Wave controller.</p>
<p style="text-align: justify;">I am sing OpenHab 3 (previously OpenHab 2).</p>
<p style="text-align: justify;">Opposite to the Sigma Z-Wave USB key, there is not <a href="https://community.openhab.org/t/raspberry-pi-make-serial-usb-ports-persistent-via-symlinks/35847" target="_blank" rel="noopener noreferrer">mount issue</a> after a reboot due to the usb port id increasing&#8230; (See also <a href="https://www.freva.com/fr/2019/06/20/attribuer-des-noms-de-port-usb-fixes-a-votre-raspberry-pi/" target="_blank" rel="noopener noreferrer">a solution</a> in French).</p>
<p style="text-align: justify;">I am using the <a href="https://phoscon.de/en/raspbee2/install#raspbian" target="_blank" rel="noopener noreferrer">Phoscon App</a> to connect and manage devices via the Conbee II key. The App is accessible on the http port 80 of the Raspberry.</p>
<p style="text-align: justify;">To connect a new Xiaomi Aqara device,</p>
<ol style="text-align: justify;">
<li>&#8220;Add a Sensor&#8221; or a &#8220;Add a Switch&#8221; within Phoscon. Pick the type &#8220;Other&#8221;.</li>
<li>Press the reset button for 5 sec. The blue led should turn on and start blinking after 5 sec. Release the button immediately when it starts blinking. The led will then turn on for 2 or 3 sec and then blink 3 times. It means that the connection is established.</li>
<li>A few second later, the device will appear in Phoscon.</li>
</ol>
<p style="text-align: justify;">To get the Things into Openhab, Add the Binding &#8220;Dresen Eletronik DeCONZ Binding&#8221; and &#8220;Scan&#8221; for devices.</p>
<p style="text-align: justify;">I am using with success:</p>
<ul style="text-align: justify;">
<li>Multi Sensors : with values for Temperature, Humidity and Pressure</li>
<li>Door and Window Sensors: with Status Opened / Closed</li>
<li>A Cube : with events Pushed (various direction), Rotation, Shacked</li>
<li>Wireless Mini Switch : One Button Control with 4 events: Single Press, Double Press, Long Press and Long Press Release</li>
</ul>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Notice: </p>
<ul style="text-align: justify;">
<li>after a few month using the Door Sensors on my Garage Door, it stopped to send events&#8230; The problem was that the captor part was attached on a metal upright which ended to be magnetized by the magnet part moving around&#8230;</li>
</ul>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_4963" class="pvc_stats total_only  " data-element-id="4963" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/xiamo-aqara-and-openhab-on-raspberry-pi/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>USB ports used by openHab&#8217;s Z-Wave Controller change after each reboot on RPI</title>
		<link>https://www.BeatificaBytes.be/usb-ports-used-by-openhabs-z-wave-controller-change-after-each-reboot-on-rpi/</link>
					<comments>https://www.BeatificaBytes.be/usb-ports-used-by-openhabs-z-wave-controller-change-after-each-reboot-on-rpi/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Wed, 07 Apr 2021 12:34:16 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[OpenHab]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=4958</guid>

					<description><![CDATA[Usually, USB keys get assigned a new port such as /dev/ttyACM0, /dev/ttyACM1, etc&#8230;, each time they are unplugged and replugged into the RPI or if [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">Usually, USB keys get assigned a new port such as /dev/ttyACM0, /dev/ttyACM1, etc&#8230;, each time they are unplugged and replugged into the RPI or if the RPI reboots. A solution consists in making these ports permanent via <em>symlinks</em>.</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b2767b76e91"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b2767b76e91'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b2767b76e91" class="collapseomatic_content ">
<p style="text-align: justify;">This &#8220;feature&#8221; is a problem as the specified device may not be recognized anymore by configured softwares, like the Z-Wave Binding or openHab.</p>
<p style="text-align: justify;">See a definitive solution <a href="https://community.openhab.org/t/raspberry-pi-make-serial-usb-ports-persistent-via-symlinks/35847" target="_blank" rel="noopener noreferrer">here</a>: make serial USB ports persistent via <em>symlinks</em>.</p>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_4958" class="pvc_stats total_only  " data-element-id="4958" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img loading="lazy" decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/usb-ports-used-by-openhabs-z-wave-controller-change-after-each-reboot-on-rpi/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to remote access MySQL  on openHabian (RPI 4)</title>
		<link>https://www.BeatificaBytes.be/how-to-remote-access-mysql-on-openhabian-rpi-4/</link>
					<comments>https://www.BeatificaBytes.be/how-to-remote-access-mysql-on-openhabian-rpi-4/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Sun, 27 Sep 2020 10:22:20 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[MySQL]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=4841</guid>

					<description><![CDATA[I wanted to use phpMyAdmin on a Synology to access a MySQL running on a RPI with openHabian. Here is my how-to:]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">I wanted to use phpMyAdmin on a Synology to access a MySQL running on a RPI with openHabian. Here is my how-to:</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b2767b78619"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b2767b78619'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b2767b78619" class="collapseomatic_content ">
<p style="text-align: justify;">First connect on your openHabian using a ssh console.</p>
<p style="text-align: justify;">Obviously, you need MySQL to be installed and configured:</p>
<blockquote>
<p style="text-align: justify;">sudo apt update</p>
<p style="text-align: justify;"><span style="font-size: inherit;">sudo apt upgrade</span></p>
<p style="text-align: justify;"><span style="font-size: inherit;">sudo apt install mariadb-server</span></p>
<p style="text-align: justify;"><span style="font-size: inherit;">sudo mysql_secure_installation</span></p>
</blockquote>
<p style="text-align: justify;">Then, double check that MySQL is running and listening on port 3306<br />netstat -plantu | grep 3306</p>
<p style="text-align: justify;">If nothing is displayed by this command, MySQL is not listening on the port 3306.</p>
<p style="text-align: justify;">Enter MySQL as root with the command:</p>
<blockquote>
<p style="text-align: justify;">sudo mysql -uroot -p</p>
</blockquote>
<p style="text-align: justify;">Check the port used by MySQL</p>
<blockquote>
<p>SHOW GLOBAL VARIABLES LIKE &#8216;PORT&#8217;;</p>
</blockquote>
<p style="text-align: justify;">Then, type the following MySQL commands to create an account and a database, and grant both local and remote access for this account on the database:</p>
<blockquote>
<p>CREATE USER &#8216;&lt;YourAccount&gt;&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;&lt;YourPassword&gt;&#8217;;</p>
<p>CREATE DATABASE &lt;YourDatabase&gt;;</p>
<p>GRANT ALL PRIVILEGES ON &lt;YourDatabase&gt;.* TO &#8216;&lt;YourAccount&gt;&#8217;@&#8217;localhost&#8217;;</p>
<p>GRANT ALL PRIVILEGES ON *.* to &#8216;&lt;YourAccount&gt;&#8217;@&#8217;169.254.0.%&#8217; identified by &#8216;&lt;YourAccountPassword&gt;&#8217; WITH GRANT OPTION;</p>
<p>FLUSH PRIVILEGES;</p>
</blockquote>
<p style="text-align: justify;">Here above, I do grant access from all machines in my local network with &#8216;169.254.0.%&#8217;. One can restrict access to one machine with its specific address, such as : &#8216;169.254.0.200&#8217;</p>
<p style="text-align: justify;">Now, edit 50-server.cnf and configure MySQL to not listen anymore on its local IP only (simply comment the line bind-address) :</p>
<blockquote>
<p style="text-align: justify;">sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf</p>
</blockquote>
<pre style="text-align: justify;"># Instead of skip-networking the default is now to listen only on<br /># localhost which is more compatible and is not less secure.<br />#bind-address = 127.0.0.1</pre>
<p style="text-align: justify;">Finally, restart MySQL for the changes above to be applied:</p>
<blockquote>
<p style="text-align: justify;">sudo service mysqld restart</p>
</blockquote>
<p style="text-align: justify;">You can now edit the config of phpMyAdmin to access the MySQL on your RPI. If it is running on Synology, look <a href="https://www.beatificabytes.be/how-to-add-multiple-hosts-in-phpmyadmin-on-synology/" target="_blank" rel="noopener noreferrer">here</a>.</p>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_4841" class="pvc_stats total_only  " data-element-id="4841" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img loading="lazy" decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/how-to-remote-access-mysql-on-openhabian-rpi-4/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Install Java 8 SDK and OpenHab 2 on Raspberry Pi Desktop for RPI 4</title>
		<link>https://www.BeatificaBytes.be/install-java-8-sdk-and-openhab-2-on-raspberry-pi-desktop-for-rpi-4/</link>
					<comments>https://www.BeatificaBytes.be/install-java-8-sdk-and-openhab-2-on-raspberry-pi-desktop-for-rpi-4/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Wed, 15 Jul 2020 21:59:46 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[OpenHab]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=4811</guid>

					<description><![CDATA[I wanted to install OpenHab 2 on my RPI 4 which is running the latest Raspberry Pi Desktop. But I was missing Java 8 which [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">I wanted to install OpenHab 2 on my RPI 4 which is running the latest Raspberry Pi Desktop. But I was missing Java 8 which is a prerequisite and unfortunately not available anymore as a stable version, for Debian 10, due to a security issue.</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b2767b7a0f7"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b2767b7a0f7'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b2767b7a0f7" class="collapseomatic_content ">
<p style="text-align: justify;">First, here is the version of Raspberry Pi Desktop I have:</p>
<pre style="padding-left: 40px;"><strong>$ cat /etc/os-release</strong><br />PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"<br />NAME="Raspbian GNU/Linux"<br />VERSION_ID="10"<br />VERSION="10 (buster)"<br />VERSION_CODENAME=buster<br />ID=raspbian<br />ID_LIKE=debian<br />HOME_URL="http://www.raspbian.org/"<br />SUPPORT_URL="http://www.raspbian.org/RaspbianForums"<br />BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"</pre>
<p style="text-align: justify;">Trying to install Java 8 SDK was resulting in errors like:</p>
<pre style="padding-left: 40px;"><strong>$ sudo apt-get install openjdk-8-jdk</strong><br />Reading package lists... Done<br />Building dependency tree<br />Reading state information... Done<br />E: Unable to locate package </pre>
<p style="text-align: justify;">Or like:</p>
<pre style="padding-left: 40px;">Reading package lists... Done<br />Building dependency tree<br />Reading state information... Done<br />Package openjdk-8-jdk is not available, but is referred to by another package.<br />This may mean that the package is missing, has been obsoleted, or<br />is only available from another source<br />However the following packages replace it:<br />openjdk-8-jdk-headless<br />E: Package 'openjdk-8-jdk' has no installation candidate</pre>
<p style="text-align: justify;">My Package sources were:</p>
<pre style="padding-left: 40px;">deb http://ftp.debian.org/debian/ buster main contrib non-free<br />deb http://security.debian.org/ buster/updates main contrib non-free<br />deb http://ftp.debian.org/debian/ buster-updates main contrib non-free</pre>
<p style="text-align: justify;">The solution was to add a <a href="https://www.debian.org/releases/index.en.html" target="_blank" rel="noopener noreferrer">new source</a> with the &#8216;unstable&#8217; arm-hf packages in /etc/apt/sources.list.d/raspi.list (&#8216;sid&#8217; is the codename for unstable):</p>
<pre style="padding-left: 40px;">$ <strong>echo 'deb http://ftp.debian.org/debian sid main' | sudo tee -a /etc/apt/sources.list.d/</strong></pre>
<p style="text-align: justify;">Next, do:</p>
<pre style="padding-left: 40px;">$ sudo apt-get update<br />$ sudo apt install gcc-8-base<br />$ sudo apt-get install openjdk-8-jdk</pre>
<p style="text-align: justify;">NB.: without installing gcc-8-base, you would get an error like this :</p>
<pre style="padding-left: 40px;">Reading package lists... Done<br />Building dependency tree<br />Reading state information... Done<br />Some packages could not be installed. This may mean that you have<br />requested an impossible situation or if you are using the unstable<br />distribution that some required packages have not yet been created<br />or been moved out of Incoming.<br />The following information may help to resolve the situation:<br /><br />The following packages have unmet dependencies:<br />libc6-dev : Breaks: libgcc-8-dev (&lt; 8.4.0-2~) but 8.3.0-6+rpi1 is to be installed<br />E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.</pre>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Now, you can install OpenHab 2:</p>
<pre style="padding-left: 40px;">$ wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -<br />$ sudo apt-get install apt-transport-https<br />$ echo 'deb https://dl.bintray.com/openhab/apt-repo2 stable main' | sudo tee /etc/apt/sources.list.d/openhab2.list<br />$ sudo apt-get update</pre>
<p style="padding-left: 40px; text-align: justify;">If you get an error like this one:</p>
<pre style="padding-left: 80px;">E: The repository 'https://openhab.jfrog.io/openhab/openhab-linuxpkg unstable Release' is not signed.<br />N: Updating from such a repository can't be done securely, and is therefore disabled by default.<br />N: See apt-secure(8) manpage for repository creation and user configuration details.</pre>
<p style="padding-left: 40px; text-align: justify;">Then do:</p>
<pre style="padding-left: 80px;">$ echo 'deb [trusted=yes] https://dl.bintray.com/openhab/apt-repo2 stable main' | sudo tee /etc/apt/sources.list.d/openhab2.list</pre>
<p style="text-align: justify;">Finally, do:</p>
<pre style="padding-left: 40px;">$ sudo apt-get install openhab2<br />$ sudo apt-get install openhab2-addons<br />$ sudo systemctl daemon-reload<br />$ sudo systemctl enable openhab2.service<br />$ sudo adduser openhab dialout<br />$ sudo adduser openhab tty<br /><br /></pre>
<p>Edit /etc/default/openhab2 to add access for Java to the serial ports (ex.:for Zwave keys)</p>
<pre style="padding-left: 40px;">$ nano /etc/default/openhab2 <br /><br />EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0"</pre>
<p style="text-align: justify;">It should output:</p>
<pre style="padding-left: 40px;">openhab2.service - openHAB 2 - empowering the smart home<br />Loaded: loaded (/usr/lib/systemd/system/openhab2.service; disabled; vendor preset: enabled)<br />Active: active (running) since Wed 2020-07-15 21:57:07 BST; 28min ago<br />Docs: https://www.openhab.org/docs/<br />https://community.openhab.org<br />Main PID: 26101 (java)<br />Tasks: 101 (limit: 4915)<br />Memory: 212.3M<br />CGroup: /system.slice/openhab2.service<br />└─26101 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/openhab2 -Dfelix.cm.dir=/var/li<br /><br />Jul 15 21:57:07 Helios systemd[1]: Started openHAB 2 - empowering the smart home.</pre>
<p> </p>
<p>As far as I am concerned, I share via smb the various folders</p>
<p>Edit /etc/samba/smb.conf</p>
<p>$ sudo nano /etc/samba/smb.conf</p>
<pre style="padding-left: 40px;">[openHAB2-userdata]comment=openHAB2 userdata<br />path=/var/lib/openhab2<br />browseable=Yes<br />writeable=Yes<br />only guest=no<br />public=no<br />create mask=0777<br />directory mask=0777<br /><br />[openHAB2-conf]comment=openHAB2 site configuration<br />path=/etc/openhab2<br />browseable=Yes<br />writeable=Yes<br />only guest=no<br />public=no<br />create mask=0777<br />directory mask=0777<br /><br />[openHAB2-logs]comment=openHAB2 logs<br />path=/var/log/openhab2<br />browseable=Yes<br />writeable=Yes<br />only guest=no<br />public=no<br />create mask=0777<br />directory mask=0777<br /><br />[openHAB2-backups]comment=oepnHAB2 backups<br />path=/var/lib/openhab2/backups<br />browseable=Yes<br />writeable=Yes<br />only guest=no<br />public=no<br />create mask=0777<br />directory mask=0777</pre>
<p>Restart the Samba service:</p>
<pre style="padding-left: 40px;">$ sudo systemctl restart smbd.service</pre>
<p> </p>
<p>Start openHab with:</p>
<pre style="padding-left: 40px;">$ sudo systemctl start openhab2.service<br />$ sudo systemctl status openhab2.service<br /><br /></pre>
<p style="text-align: justify;">It can take 15&#8242; to be initialized, but soon you should be able to access openHab on your RPI on port 8080!</p>
<p> </p>
<p>Do a backup with:</p>
<pre style="padding-left: 40px;">$ sudo ./usr/share/openhab2/runtime/bin/backup</pre>
<p>Restore a backup with:</p>
<pre style="padding-left: 40px;">$ sudo systemctl stop openhab2.service<br />$ sudo ./usr/share/openhab2/runtime/bin/restore /var/lib/openhab2/backups/openhab2-backup-....<br />$ sudo systemctl start openhab2.service</pre>
<p style="text-align: justify;">It will take long minutes to restart!</p>
<p> </p>
<p>More details about installing openHAb on Linux <a href="https://www.openhab.org/docs/installation/linux.html" target="_blank" rel="noopener noreferrer">on the official page</a>.</p>
<p style="text-align: justify;">Et voilà!</p>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_4811" class="pvc_stats total_only  " data-element-id="4811" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img loading="lazy" decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/install-java-8-sdk-and-openhab-2-on-raspberry-pi-desktop-for-rpi-4/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Use a Z-Wave Controller USB Key with openHAB in Docker on a RPI 4</title>
		<link>https://www.BeatificaBytes.be/use-a-z-wave-controller-usb-key-with-openhab-in-docker-on-a-rpi-4/</link>
					<comments>https://www.BeatificaBytes.be/use-a-z-wave-controller-usb-key-with-openhab-in-docker-on-a-rpi-4/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Sun, 28 Jun 2020 16:22:09 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[OpenHab]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=4803</guid>

					<description><![CDATA[It took me quite some hours to be able to use my Aeotec Z-Stick Gen5 (ZW090) key within my Docker image of openHAB, running on [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">It took me quite some hours to be able to use my Aeotec Z-Stick Gen5 (ZW090) key within my Docker image of openHAB, running on a Raspberry Pi 4 (with a Raspberry Pi OS). Here are all the tips I used.</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b2767b7c019"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b2767b7c019'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b2767b7c019" class="collapseomatic_content ">
<p style="text-align: justify;">First, before plugging the controller  in your RPI, configure it to see the Serial Ports. Connect onto your RPI within a SSH Console (ex.: via Putty)  and type the command:</p>
<p style="padding-left: 40px; text-align: justify;">sudo raspi-config</p>
<p style="padding-left: 40px; text-align: justify;">Use &#8220;5 interfacing Options&#8221; &gt; &#8220;P6 Serial&#8221; &gt; &#8220;Yes&#8221; &gt; &#8220;Ok&#8221;</p>
<p style="padding-left: 40px; text-align: justify;">And now reboot.</p>
<p style="text-align: justify;">Next, back into a SSH conscole, check what USB devices already exists with the command:</p>
<p style="padding-left: 40px; text-align: justify;">lsusb</p>
<pre style="padding-left: 40px;">Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<br />Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub<br />Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub</pre>
<p style="text-align: justify;">And flush the kernel and boot logs:</p>
<p style="padding-left: 40px; text-align: justify;">sudo dmesg -c &gt;&gt; ~/dmesg-`date +%d%m%Y`.log</p>
<p style="text-align: justify;">Then, plug your Z-Wave Controller USB Key in a USB Port and check that it&#8217;s detected and mounted properly:</p>
<p style="padding-left: 40px; text-align: justify;">lsusb</p>
<pre style="padding-left: 40px;">Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<br />Bus 001 Device 009: ID 0658:0200 Sigma Designs, Inc. Aeotec Z-Stick Gen5 (ZW090) - UZB<br />Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub<br />Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub</pre>
<p style="padding-left: 40px; text-align: justify;">dmesg</p>
<pre style="padding-left: 40px;">[ 3124.779069] usb 1-1.4: new full-speed USB device number 9 using xhci_hcd<br />[ 3124.919928] usb 1-1.4: New USB device found, idVendor=0658, idProduct=0200, bcdDevice= 0.00<br />[ 3124.919942] usb 1-1.4: New USB device strings: Mfr=0, Product=0, SerialNumber=1<br />[ 3124.919953] usb 1-1.4: SerialNumber: 32303136-3131-3033-3030-303031383932<br />[ 3124.926704] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device</pre>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">&#8220;lsusb&#8221; should show you a new device. Ex.: Aeotec Z-Stick Gen5 (ZW090) &#8211; UZB.</p>
<p style="text-align: justify;">And &#8220;dmesg&#8221; must should you the mount point: cdc_acm 1-1.4:1.0: <span style="color: #ff0000;">ttyACM0</span>: USB ACM device.</p>
<p style="text-align: justify;">If you don&#8217;t see the mount point, then you possibly have a device not supported by the RPI 4. It seems that it is the case with the old Aeotec &#8220;Z-Stick Gen5&#8221;. &#8220;New Z-Stick Gen5&#8221; and &#8220;Z-Stick Gen5+&#8221; should however be compatible. But <a href="https://github.com/raspberrypi/linux/issues/3027" target="_blank" rel="noopener noreferrer">there is a trick</a>: plug your key on the RPI 4 via a USB HUB (2.0 or 3.0).</p>
<p style="text-align: justify;">I presume that the Docker Image is already up and running. If not, <a href="https://community.openhab.org/t/running-openhab-2-in-docker/14267" target="_blank" rel="noopener noreferrer">install it</a>.</p>
<p style="padding-left: 40px; text-align: justify;">sudo useradd -r -s /sbin/nologin openhab<br />usermod -a -G openhab pi<br />mkdir /opt/openhab<br />mkdir /opt/openhab/conf<br />mkdir /opt/openhab/userdata<br />mkdir /opt/openhab/addons<br />chown -R openhab:openhab /opt/openhab</p>
<p style="text-align: justify;">Check the id of the user openhab with:</p>
<p style="padding-left: 40px; text-align: justify;">id openhab</p>
<pre style="padding-left: 40px;">uid=999(openhab) gid=994(openhab) groups=994(openhab)</pre>
<p style="text-align: justify;">Grant access on the Serial Port for the user &#8216;openhab&#8217;:</p>
<p style="padding-left: 40px; text-align: justify;">sudo chmod 777 /dev/<span style="color: #ff0000;">ttyACM0</span><br />sudo chown openhab /dev/<span style="color: #ff0000;">ttyACM0</span></p>
<p style="text-align: justify;">And use the uid and gid found above in the following command, setting the ttyA* found previously and specifying the version to be used:</p>
<p style="padding-left: 40px; text-align: justify;">docker run &#8211;name openhab &#8211;net=host &#8211;device=/dev/<span style="color: #ff0000;">ttyACM0</span> -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro -v /opt/openhab/conf:/openhab/conf -v /opt/openhab/userdata:/openhab/userdata -v /opt/openhab/addons:/openhab/addons -d -e USER_ID=&lt;<span style="color: #ff0000;">uid</span>&gt; -e GROUP_ID=&lt;<span style="color: #ff0000;">gid</span>&gt; &#8211;restart=always openhab/openhab:<span style="color: #ff0000;">latest</span></p>
<p style="padding-left: 40px; text-align: justify;"> </p>
<p style="text-align: justify;">Now, using Portainer (because it&#8217;s easy), open a console within openhab&#8230; Portainer is not yet installed ? Do it with:</p>
<p style="padding-left: 40px; text-align: justify;">docker run -d -p 9000:9000 -p 8000:8000 &#8211;name portainer1 &#8211;restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer:/data portainer/portainer:latest</p>
<p style="text-align: justify;">Go to the page http://&lt;Your RPI IP&gt;:9000, open the Containers and click on the &#8220;Exec Console&#8221; icon of &#8216;openhab&#8217; container:</p>
<p style="text-align: justify;" data-wp-editing="1"><a href="http://www.beatificabytes.be/wp-content/uploads/2020/06/Pasted-8.png"><img loading="lazy" decoding="async" class="wp-image-4805  aligncenter" src="http://www.beatificabytes.be/wp-content/uploads/2020/06/Pasted-8.png" alt="" width="328" height="133" /></a></p>
<p style="text-align: justify;">Grant the same accesses inside the image than on the RPI:</p>
<p style="padding-left: 40px; text-align: justify;">sudo chmod 777 /dev/<span style="color: #ff0000;">ttyACM0</span><br />sudo chown openhab /dev/<span style="color: #ff0000;">ttyACM0</span></p>
<p style="padding-left: 40px; text-align: justify;">chown -R openhab:openhab /opt/openhab</p>
<p style="text-align: justify;">Now restart the &#8216;openhab&#8217; container (with the icon Restart <img src="https://s.w.org/images/core/emoji/15.1.0/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> ). It will take some minutes to be available. But once you can get into it, go to the Things and configure the Controller to use the Serial Port <span style="color: #ff0000;">ttyACM0</span>:</p>
<p style="text-align: justify;"><a href="http://www.beatificabytes.be/wp-content/uploads/2020/06/Pasted-9.png"><img loading="lazy" decoding="async" class="wp-image-4806  aligncenter" src="http://www.beatificabytes.be/wp-content/uploads/2020/06/Pasted-9.png" alt="" width="335" height="198" /></a></p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Et voilà</p>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_4803" class="pvc_stats total_only  " data-element-id="4803" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img loading="lazy" decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/use-a-z-wave-controller-usb-key-with-openhab-in-docker-on-a-rpi-4/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Raspberry Pi&#8217;s SD card full ?</title>
		<link>https://www.BeatificaBytes.be/raspberry-pis-sd-card-full/</link>
					<comments>https://www.BeatificaBytes.be/raspberry-pis-sd-card-full/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Sun, 28 Jun 2020 11:36:14 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=4788</guid>

					<description><![CDATA[Trying to update one of my Raspberry Pi Desktop, I see messages pretending that there is not enough free space ? ]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">Trying to update one of my Raspberry Pi Desktop, I see messages pretending that there is not enough free space ? </p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b2767b81bb0"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b2767b81bb0'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b2767b81bb0" class="collapseomatic_content ">
<p style="text-align: justify;">I saw that my Pi was full when I tried to update it with</p>
<p style="padding-left: 40px; text-align: justify;">sudo apt-get update &amp;&amp; sudo apt-get upgrade -y</p>
<pre style="padding-left: 40px;"> Error writing to output file - write (28: No space left on device)</pre>
<p>I could also see that there was no free storage anymore as the system was unable to allocate the swap file:</p>
<p style="padding-left: 40px;">systemctl status dphys-swapfile.service</p>
<pre style="padding-left: 40px;">dphys-swapfile.service - dphys-swapfile - set up, mount/unmount, and delete a swap file<br />   Loaded: loaded (/lib/systemd/system/dphys-swapfile.service; enabled; vendor preset: enabled)<br />   Active: <span style="color: #ff0000;">failed</span> (Result: exit-code) since Sun 2020-06-28 12:35:15 BST; 4min 21s ago<br />[...]Jun 28 12:35:15 helios dphys-swapfile[327]: want /var/swap=100MByte, restricting to 50% of remaining disk size: <strong>0MBytes</strong><br />Jun 28 12:35:15 helios systemd[1]: <span style="color: #ff0000;">Failed to start dphys-swapfile - set up, mount/unmount, and delete a swap file</span>.</pre>
<p>And indeed, the swap file was 0B:</p>
<p style="padding-left: 40px;">free -h</p>
<pre style="padding-left: 40px;">      total   used   free   shared  buff/cache  available<br />Mem:  3.8Gi   285Mi  2.7Gi  11Mi    886Mi       3.4Gi<br />Swap: 0B      0B     0B</pre>
<p style="text-align: justify;">Start to investigate with:</p>
<p style="padding-left: 40px; text-align: justify;">sudo df -h</p>
<pre style="padding-left: 40px;">Filesystem      Size  Used Avail Use% Mounted on<br />/dev/root        29G   29G     0 100% /<br />devtmpfs        1.8G     0  1.8G   0% /dev<br />tmpfs           2.0G     0  2.0G   0% /dev/shm</pre>
<p style="text-align: justify;">Or use the version for Inode which won&#8217;t include the mounted drives</p>
<p style="padding-left: 40px; text-align: justify;">sudo df -i</p>
<pre style="padding-left: 40px;">Filesystem Inodes  IUsed  IFree   IUse% Mounted on<br />/dev/root  1895552 328167 1567385 18%   /<br />devtmpfs   117763  409    117354  1%    /dev<br />tmpfs      183811  1     183810   1%    /dev/shm</pre>
<p style="text-align: justify;">Check, in the output of those commands, that the size of the root partition (/dev/root) is close the the size of your SD (Here above, I have IUsed =~ 32G). If it is not the case, enlarge it with:</p>
<p style="padding-left: 40px; text-align: justify;">sudo raspi-config</p>
<p style="padding-left: 40px; text-align: justify;">7 Advanced Options &gt; A1 Expand Filesystem </p>
<p style="padding-left: 40px; text-align: justify;">(reboot)</p>
<p style="text-align: justify;">If the size of the root partition is maximum, then investigate to find the very large stuff with:</p>
<p style="padding-left: 40px; text-align: justify;">sudo du -xh / | grep -P &#8220;G\t&#8221;</p>
<pre style="padding-left: 40px;">1,2G /opt/openhab/userdata<br />1,2G /opt/openhab<br />1,2G /opt<br />1,3G /usr<br />11G  /var/lib/docker<br />11G  /var/lib<br />11G  /var<br />16G  /mnt/backup<br />16G  /mnt<br />29G  /</pre>
<p style="text-align: justify;">To only have the size of the first level folders, use:</p>
<p style="padding-left: 40px; text-align: justify;">sudo du -xh &#8211;max-depth=1 / | grep -P &#8220;G\t&#8221;</p>
<pre style="padding-left: 40px;">1.2G /opt<br />1.3G /usr<br />11G  /var<br />16G  /mnt<br />29G  /</pre>
<p style="text-align: justify;">Check, in the output of that command, if there as any folder or file which could be cleaned-up.</p>
<p style="text-align: justify;">You can also us this to navigate into your SD:</p>
<p style="padding-left: 40px; text-align: justify;">sudo mount &#8211;bind /  /mnt<br />sudo ncdu -x /mnt</p>
<pre style="padding-left: 40px;">-- /mnt ------------------------<br />15,1 GiB [##########] /mnt<br />10,6 GiB [###### ] /var<br />1,3 GiB [ ] /usr<br />1,2 GiB [ ] /opt<br />415,3 MiB [ ] /home<br />353,3 MiB [ ] /lib<br />9,3 MiB [ ] /bin</pre>
<p style="text-align: justify;">You can navigate in this table (with keys up and down) and open folders (press enter) to see the details of their content. Exit this table by pressing &#8220;q&#8221;.</p>
<p style="text-align: justify;">If by any accident, you don&#8217;t succeed to delete a large file or folder (especially if located under /media or /mnt), check that it&#8217;s not on a mounted drive. Auto-mount are usually in /etc/fstab and may only be :</p>
<p style="padding-left: 40px; text-align: justify;">cat /etc/fstab</p>
<p style="text-align: justify;">You can umount all at once with</p>
<p style="text-align: justify; padding-left: 40px;">sudo umount -a -t cifs -l</p>
<p> </p>
<p style="text-align: justify;">Regarding packages, You can cleanup some space with:</p>
<p style="padding-left: 40px; text-align: justify;">sudo apt-get autoremove</p>
<p style="padding-left: 40px; text-align: justify;">sudo rm -R /var/cache/</p>
<p style="padding-left: 40px; text-align: justify;">sudo mkdir -p /var/cache/apt/archives/partial<br />sudo touch /var/cache/apt/archives/lock<br />sudo chmod 640 /var/cache/apt/archives/lock<br />sudo apt-get clean</p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">If you are using docker,</p>
<p style="padding-left: 40px; text-align: justify;">you can check the space consumed with:</p>
<p style="padding-left: 80px; text-align: justify;">sudo du -sh /var/lib/docker/overlay2</p>
<p style="padding-left: 80px; text-align: justify;">docker system df</p>
<p style="padding-left: 40px; text-align: justify;">you can cleanup some space with:</p>
<p style="padding-left: 80px; text-align: justify;">docker system prune -a -f</p>
<p style="padding-left: 80px; text-align: justify;">docker system prune &#8211;all &#8211;volumes &#8211;force</p>
<p style="padding-left: 80px; text-align: justify;">docker volume rm $(docker volume ls -qf dangling=true)</p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">If using GitLab, you can cleanup some space with:</p>
<p style="padding-left: 40px; text-align: justify;">sudo gitlab-ctl registry-garbage-collect</p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Other useful commands:</p>
<p style="padding-left: 40px; text-align: justify;">sudo find / -type f -size +500M -exec ls -lh {} \;</p>
<p style="padding-left: 40px; text-align: justify;">sudo touch /forcefsck ; sudo reboot</p>
<p style="padding-left: 40px; text-align: justify;">sudo resize2fs /dev/mmcblk0p2 ; sudo reboot</p>
<p style="padding-left: 40px; text-align: justify;">After reboot check the resize status with:</p>
<p style="padding-left: 80px; text-align: justify;">systemctl status resize2fs_once.service</p>
<p style="padding-left: 80px; text-align: justify;">If you see the error &#8220;Failed to start LSB: Resize the root filesystem to fill partition&#8221;, you can disable the resize2fs with:</p>
<p style="padding-left: 120px; text-align: justify;">sudo systemctl disable resize2fs_once</p>
<p style="text-align: justify;"> </p>
<p>What was the issue in my own case: my remote folder for backup was not mounted anymore on /mnt/backup but the backup script run and stored a 16Gb file into the local folder /mnt/backup. I have been able to delete the local backup by commenting the related shared folder in /ect/stab, rebooting and then deleting /mnt/backup.</p>
<p>Et voilà!</p>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_4788" class="pvc_stats total_only  " data-element-id="4788" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img loading="lazy" decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/raspberry-pis-sd-card-full/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Run Raspberry Pi Desktop 4 in VMWare</title>
		<link>https://www.BeatificaBytes.be/run-raspberry-pi-desktop-4-in-vmware/</link>
					<comments>https://www.BeatificaBytes.be/run-raspberry-pi-desktop-4-in-vmware/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Sat, 27 Jun 2020 16:40:42 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Raspberry PI]]></category>
		<category><![CDATA[VMWare]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=4782</guid>

					<description><![CDATA[Instead of testings new softwares or configs on my actual RPI, I do it in a VM Machine. Much easier to rollback if I do [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">Instead of testings new softwares or configs on my actual RPI, I do it in a VM Machine. Much easier to rollback if I do a mistake. There are many videos on YouTube to explain how to install the Raspberry Pi Desktop in VMWare.</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b2767b83609"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b2767b83609'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b2767b83609" class="collapseomatic_content ">
<p style="text-align: justify;">The ISO image of Raspberry Pi Desktop is available <a href="https://www.raspberrypi.org/downloads/raspberry-pi-desktop/" target="_blank" rel="noopener noreferrer">here</a>.</p>
<p style="text-align: justify;">I did create an VM, as illustrated <a href="https://www.youtube.com/watch?v=an3ha0j4rrE" target="_blank" rel="noopener noreferrer">here</a>, with:</p>
<ul style="text-align: justify;">
<li>4GB Memory</li>
<li>32GB Hard Disk(SCSI)</li>
<li>USB 3 .1</li>
<li>And everything else &#8220;by default&#8221;
<ul>
<li>1 processor</li>
<li>NAT Network Adapter</li>
<li>&#8230;</li>
</ul>
</li>
</ul>
<p style="text-align: justify;">I did:</p>
<ul style="text-align: justify;">
<li>a &#8220;Graphical Install&#8221; of the Raspberry Pi Desktop</li>
<li>enable SSH</li>
<li>keep the password &#8220;raspberry&#8221; for the user pi (with auto-login enabled)</li>
<li>configure the keyboard for me (Belgian &#8211; Azerty)</li>
<li>configure to location as Brussels/Belgium</li>
<li>install the VMWare-Tools (screen resolution maximized automatically)</li>
<li>Create an icon &#8220;Desktop Update&#8221; to update the packages via: sudo apt-get update &amp;&amp; sudo apt-get upgrade -y</li>
</ul>
<p style="text-align: justify;">And <a href="https://www.beatificabytes.be/download/raspberryPi4.zip">here</a> attached in the resulting VM (a 4.5GB zip file). Download it, unzip and double click the file &#8220;Raspberry Pi 4.vmx&#8221; to open the VM into your VMWare Workstation.</p>
<p><img decoding="async" class="alignnone wp-image-4785 size-full" src="http://www.beatificabytes.be/wp-content/uploads/2020/06/Pasted-6.png" /></p>
<p style="text-align: justify;">Et voilà.</p>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_4782" class="pvc_stats total_only  " data-element-id="4782" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img loading="lazy" decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/run-raspberry-pi-desktop-4-in-vmware/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Create a Plex Media Player with a Raspberry 4</title>
		<link>https://www.BeatificaBytes.be/create-a-plex-media-player-with-a-raspberry-4/</link>
					<comments>https://www.BeatificaBytes.be/create-a-plex-media-player-with-a-raspberry-4/#comments</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Sun, 21 Jun 2020 11:22:47 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Plex]]></category>
		<category><![CDATA[Raspberry PI]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=4756</guid>

					<description><![CDATA[I used to run Rasplex on a RPI 2 to play movies from my Plex Media Server. Unfortunately Rasplex has not been updated to run [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">I used to run Rasplex on a RPI 2 to play movies from my Plex Media Server. Unfortunately Rasplex has not been updated to run on a RPI 4. Here is how to build PMP for RPI 4.</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b2767b856ea"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b2767b856ea'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b2767b856ea" class="collapseomatic_content ">
<p style="text-align: justify;"><span style="text-decoration: underline;"><strong>Install an OS on your RPI 4</strong></span></p>
<ol style="text-align: justify;">
<li>Download the &#8220;Raspberry Pi Imager&#8221; <a href="https://www.raspberrypi.org/downloads/" target="_blank" rel="noopener noreferrer">here</a>.</li>
<li>Download next the &#8220;Raspberry Pi OS (32-bit) with desktop&#8221; <a href="https://www.raspberrypi.org/downloads/raspberry-pi-os/" target="_blank" rel="noopener noreferrer">here</a> (the 64-bit is still only in beta. See <a href="https://www.raspberrypi.org/forums/viewtopic.php?f=117&amp;t=275370" target="_blank" rel="noopener noreferrer">here</a>). Unzip the file.
<ul>
<li>This is the smallest image (no extra softwares) with a Desktop (mandatory to display the Plex Media Player GUI)</li>
</ul>
</li>
<li>Install and Run the &#8220;Raspberry Pi Imager&#8221; to setup the &#8220;Raspberry Pi OS&#8221; on a micro-SD card.</li>
</ol>
<ul style="text-align: justify;">
<li style="list-style-type: none;">
<ul>
<li>Click on &#8220;Choose OS&#8221;</li>
</ul>
</li>
</ul>
<p style="padding-left: 80px; text-align: justify;"><img decoding="async" class="alignnone wp-image-4757 size-full" src="http://www.beatificabytes.be/wp-content/uploads/2020/06/Pasted.png" /></p>
<ul style="text-align: justify;">
<li style="list-style-type: none;">
<ul>
<li>Select &#8220;Use Custom&#8221;</li>
</ul>
</li>
</ul>
<p style="padding-left: 80px; text-align: justify;"><img decoding="async" class="alignnone wp-image-4758 size-full" src="http://www.beatificabytes.be/wp-content/uploads/2020/06/Pasted-1.png" /></p>
<ul style="text-align: justify;">
<li style="list-style-type: none;">
<ul>
<li>Pick the .img file &#8220;YYYY-MM-DD-raspios-buster-armhf.img&#8221; unzipped from the &#8220;Raspberry Pi OS (32-bit) with desktop&#8221; image.</li>
<li>Next Click &#8220;Choose SD&#8221; and &#8220;Write&#8221;.</li>
<li>Once the operation completed, install the micro-SD in your RPI 4 and turn it on. The Raspberry Pi Desktop will appear after some automatic reboots. Follow the setup of the Welcome screen. Steps are:
<ul>
<li>Setup the Country (use Page up and Page down in the Country Combo to scroll faster)</li>
<li>Change the Password of the user &#8216;pi&#8217;. ATTENTION: the keyboard layout is most probably not the right one. Untick the &#8220;Hide characters&#8221; option to check what you type!</li>
<li>Set Up Screen</li>
<li>Select Wireless Network (You can skip this step if the RPI is connected via ethernet). Again, untick the &#8220;Hide characters&#8221; option to check what you type!</li>
<li>Update Software</li>
<li>Click &#8220;Restart&#8221; on the last step &#8220;Setup Complete&#8221;</li>
</ul>
</li>
</ul>
</li>
</ul>
<p style="text-align: justify;"><span style="text-decoration: underline;"><strong>Configure your OS</strong></span></p>
<p style="text-align: justify;">Open a &#8220;Terminal&#8221; :</p>
<p style="padding-left: 40px; text-align: justify;"><img decoding="async" class="alignnone wp-image-4762 size-full" src="http://www.beatificabytes.be/wp-content/uploads/2020/06/Pasted-3.png" /></p>
<p style="text-align: justify;">First, type this command in the Terminal to check your IP address:</p>
<pre style="padding-left: 40px;">ifconfig</pre>
<p style="text-align: justify;">Type next <a href="https://www.raspberrypi.org/documentation/configuration/raspi-config.md" target="_blank" rel="noopener noreferrer">this command</a> to configure the os:</p>
<pre style="padding-left: 40px;">sudo raspi-config</pre>
<p style="text-align: justify;">Among other:</p>
<ul style="text-align: justify;">
<li>Configure your keyboard if required via &#8220;4 Localisation Options&#8221; &gt; &#8220;change keyboard layout&#8221;
<ul>
<li>If your keyboard is not in the list, use the Generic 100x-Key PC corresponding to your layout. Look the <a href="https://en.wikipedia.org/wiki/Keyboard_layout#/media/File:Physical_keyboard_layouts_comparison_ANSI_ISO_KS_ABNT_JIS.png" target="_blank" rel="noopener noreferrer">picture </a>of <a href="https://en.wikipedia.org/wiki/Keyboard_layout" target="_blank" rel="noopener noreferrer">this wiki</a> page for more details.</li>
<li>You can possibly also find more info about your keyboard <a href="https://deskthority.net/wiki/Category:List_of_all_keyboards" target="_blank" rel="noopener noreferrer">here</a>.</li>
</ul>
</li>
<li>Enable SSH via &#8220;5 Interfacing Options&#8221; &gt; &#8220;P2 SSH&#8221;</li>
<li>Give at least 512MB or more to your GPU via &#8220;7 Advanced Options&#8221; &gt; &#8220;Memory Split&#8221; (I did set 512. Using 1024 result in a black screen after reboot)</li>
<li><del>I gave the whole micro-SD card storage for the OS via &#8220;7 Advanced Options&#8221; &gt; A1 Expand File System&#8221;</del></li>
<li>I set the audio output on the HDMI port via &#8220;7 Advanced Options&#8221; &gt; A4 Audio&#8221;</li>
<li>NB.: I don&#8217;t use the 4Kp60 HDMI, but it can be configured via &#8220;7 Advanced Options&#8221; &gt; AA Pi 4 Video Output&#8221;</li>
<li>Finally, reboot to be sure that it still work.
<ul>
<li>If you have an issue, wait for 3 minutes and proceed with the next step here under.</li>
</ul>
</li>
</ul>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">You can now open a SSH console from your PC (E.g: using PuTTY) to connect on the IP address found previously and login with the user &#8216;pi&#8217; and the password you introduced during the installation.</p>
<p style="padding-left: 40px; text-align: justify;">You will possibly get a PuTTY Security Alert because of the ssh key fingerprint&#8230; Accept if you are sure that you are connecting safely to your RPI.</p>
<p style="padding-left: 40px; text-align: justify;">If it seems that your RPI didn&#8217;t reboot properly and you are not able to connect using SSH after a moment, they you probably have to redo to whole setup from scratch and try other configuration options within raspi-config</p>
<p style="padding-left: 40px; text-align: justify;">If it seems that your RPI didn&#8217;t reboot properly and you are able to connect via SSH, redo the configuration with the command sudo raspi-config (try to reset the &#8220;Memory Split&#8221; to 64 if you did change it).</p>
<p style="text-align: justify;">If you want to be sure that your OS is up-to-date, with the very latest fixes, type the following commands:</p>
<pre style="padding-left: 40px;">sudo apt-get update</pre>
<pre style="padding-left: 40px;">sudo apt-get full-upgrade</pre>
<p style="text-align: justify;">And finally disable the screen sleep with the command</p>
<pre style="padding-left: 40px;">sudo sed -i 's/#xserver-command=X.*/xserver-command=X -s 0 dpms/g' /etc/lightdm/lightdm.conf</pre>
<p style="text-align: justify;"><span style="text-decoration: underline;"><strong>Build PMP for your RPI 4</strong></span></p>
<p style="text-align: justify;">Use now the SSH console (to be able to copy/paste from here) to execute this:</p>
<pre style="padding-left: 40px;">sudo apt-get install -y autoconf automake libtool libharfbuzz-dev libfreetype6-dev libfontconfig1-dev libx11-dev libxrandr-dev libvdpau-dev libva-dev mesa-common-dev libegl1-mesa-dev yasm libasound2-dev libpulse-dev libuchardet-dev zlib1g-dev libfribidi-dev git libgnutls28-dev libgl1-mesa-dev libsdl2-dev cmake python3 python python-minimal git mpv libmpv-dev</pre>
<p style="text-align: justify;">Then these 3 commands:</p>
<pre style="padding-left: 40px;">wget <span class="hljs-symbol">https:</span>/<span class="hljs-regexp">/github.com/koendv</span><span class="hljs-regexp">/qt5-opengl-raspberrypi/releases</span><span class="hljs-regexp">/download/v</span>5.<span class="hljs-number">12.5</span>-<span class="hljs-number">1</span>/qt5-opengl-dev_5.<span class="hljs-number">12.5_</span>armhf.deb <br />sudo apt-get install -y ./qt5-opengl-dev_5.<span class="hljs-number">12.5_</span>armhf.deb<br />rm qt5-opengl-dev_5.<span class="hljs-number">12.5_</span>armhf.deb</pre>
<p style="text-align: justify;">And finally these:</p>
<pre style="padding-left: 40px;">mkdir ~/pmp<br /><span class="hljs-built_in">cd</span> ~/pmp<br />git <span class="hljs-built_in">clone</span> git://github.com/plexinc/plex-media-player<br /><span class="hljs-built_in">cd</span> plex-media-player/<br />mkdir build<br /><span class="hljs-built_in">cd</span> build<br />cmake -DCMAKE_BUILD_TYPE=Debug -DQTROOT=/usr/lib/qt5.12/ -DCMAKE_INSTALL_PREFIX=/usr/<span class="hljs-built_in">local</span>/ ..<br />make -j4<br />sudo make install</pre>
<p style="text-align: justify;">Now, PMP can be run. Go back to the Raspberry Pi Desktop, and type this command in a Terminal:</p>
<pre style="padding-left: 40px;">plexmediaplayer --fullscreen --tv &amp;</pre>
<p style="padding-left: 40px; text-align: justify;">In my case, the option &#8216;tv&#8217; is not convenient (I can&#8217;t see enough on the screen)&#8230;</p>
<p style="text-align: justify;">You will have to Sign In via the <a href="https://plex.tv/link" target="_blank" rel="noopener noreferrer">link page</a> of Plex.tv and next configure Plex Media Player.</p>
<p style="text-align: justify;"><span style="text-decoration: underline;"><strong>Configure PMP to launch at boot</strong></span></p>
<p style="text-align: justify;">Back into you SSH Console, on your PC, create a new user &#8216;plex&#8217; with a password:</p>
<pre style="padding-left: 40px;">sudo adduser plex<br />sudo adduser --disabled-password plex<br />sudo passwd -d plex<br /><br /><img decoding="async" class="alignnone wp-image-4763 size-full" src="http://www.beatificabytes.be/wp-content/uploads/2020/06/Pasted-4.png" /></pre>
<p style="text-align: justify;">Login as &#8216;plex&#8217; in your RPI desktop to run once PMP via a Terminal (Without this step, it will not be displayed full screen after an autologin):</p>
<pre style="padding-left: 40px;">plexmediaplayer --fullscreen --tv &amp;</pre>
<p style="text-align: justify;">Configure the user &#8216;plex&#8217; to autologin with a desktop session named &#8216;plex&#8217;:</p>
<pre style="padding-left: 40px;">sudo sed -i 's/#*user-session=.*/user-session=plex/g' /etc/lightdm/lightdm.conf<br />sudo sed -i 's/#*autologin-user=.*/autologin-user=plex/g' /etc/lightdm/lightdm.conf<br />sudo sed -i 's/#*autologin-user-timeout=.*/autologin-user-timeout=delay/g' /etc/lightdm/lightdm.conf</pre>
<p style="text-align: justify;">Create the &#8216;plex&#8217; desktop:</p>
<pre style="padding-left: 40px;">sudo nano /usr/share/xsessions/plex.desktop</pre>
<p style="text-align: justify;">and paste into it:</p>
<pre style="padding-left: 40px;">[Desktop Entry]Name=Plex<br />Comment=Plex Media Player<br />Exec=/usr/local/bin/plexmediaplayer<br />Icon=<br />Type=Application</pre>
<p style="text-align: justify;">And now reboot ! (It can take 3 long minutes !!):</p>
<pre style="padding-left: 40px;">sudo reboot</pre>
<p style="text-align: justify;">If there is a configuration issue with the desktop, edit the config via a SSH console and restart lightDM (the Desktop Manager):</p>
<pre style="padding-left: 40px;">sudo service lightdm restart</pre>
<p style="text-align: justify;">Tips: I had no issue with getting Plex Media Player in fullscreen but here are notes in case I would have to resize it:</p>
<pre style="padding-left: 40px;">sudo apt-get install -y xdotool<br />export DISPLAY=':0.0'<br />xdotool search --onlyvisible --maxdepth 1 ""<br />xdotool windowmove {window_id} {posx} {posy} windowsize {window_num} {sizex} {sizey}</pre>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">This is based on a post of Stueh on Plex forum (see <a href="https://forums.plex.tv/t/instructions-how-to-build-plex-media-player-on-raspberry-pi-4-b-under-raspbian/562633" target="_blank" rel="noopener noreferrer">here</a><span style="font-size: inherit;">)</span></p>
<p> </p>
<p>If you did configure Plex Media Player on a PC Screen and move next on TV Screen, it will most probably not fit that screen et the resolution will possibly not be correct. In that case, here is how I proceed:</p>
<ul>
<li>Log on your RPI using any SSH console on your mobile or Tablet (I presume that your PC is not next to your TV). I am using &#8220;RaspController&#8221; on Android</li>
<li>Edit the desktop to force an error. Hence, you will fallback on the default Desktop. Type in you SSL console : sudo nano /usr/shared/xsession/plex.desktop
<ul>
<li>Ex.: modify this line to define an invalid path: Exec=<strong>xxx</strong>/usr/local/bin/plexmediaplayer</li>
</ul>
</li>
<li>Now, restart LightDM
<ul>
<li>Either type this in your SSH console: sudo service lightdm restart</li>
<li>Or CTRL-ALT-Backspace on the keyboard of your RPI.</li>
</ul>
</li>
<li>You will get an error message because &#8216;<strong>xxx</strong>/usr/local/bin/plexmediaplayer&#8217; does not exist and next get a prompt to login.</li>
<li>Login as &#8216;pi&#8217; </li>
<li>Now, open the Start menu &gt; Preferences &gt; Raspberry Pi Configuration &gt; Display (or Interfaces). If you don&#8217;t see the &#8216;Start menu&#8217; because it is out of the screen, press the &#8216;Windows&#8217; key on your Keyboard.</li>
</ul>
<p style="padding-left: 80px;"><img decoding="async" class="alignnone wp-image-4778 size-full" src="http://www.beatificabytes.be/wp-content/uploads/2020/06/Pasted-5.png" /></p>
<ul>
<li>Next, change the resolution to fit the limitation of your TV:
<ul>
<li><strong>480p = DVD</strong>, old TV 720 x 480 pixels, format 16/9.</li>
<li><strong>720p</strong> = <strong>HD Ready,</strong> 1280 x 720 pixels, format 16/9.</li>
<li><strong>1080p =</strong> <strong>Full HD,</strong> 1920 x 1080 pixels, format 16/9.</li>
<li><strong>2160p</strong>, <strong>UHDTV1, </strong>3840 x 2160 pixels, format 16/9 (a.ka. <strong>UHD-4K</strong> or 4K).</li>
<li><strong>4320p</strong>, <strong>UHDTV2, </strong>7680 x 4320 pixels, format 16/9 (a.k.a <strong>UHD-8K</strong> or 8K).</li>
</ul>
</li>
<li>Then, open Plex Media Player (Start Menu &gt; &#8230;) and configure it in TV mode. If it does not fit the TV Screen, reduce the resolution.</li>
<li>Finally, log off (or restrat lightDM with CTRL-ALT-BACKSPACE) and login as &#8216;plex&#8217; to also run Plex Media Player and be sure it&#8217;s also well configured.</li>
<li>Ho, yes, sure: edit again the plex.desktop to remove the xxx in the path of the EXEC setting and reboot.</li>
</ul>
<p>Voilà</p>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_4756" class="pvc_stats total_only  " data-element-id="4756" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img loading="lazy" decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/create-a-plex-media-player-with-a-raspberry-4/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
