OH after apt install on Raspberry Raspian

I’m writing this post just to help who has installe OH from apt install and need to further customize the installation for properuse. This would have been very helpfull for me so I just want to put it on writing.

JAVA
First step is that you do not have to care about the JAVA install.
Raspian cames with JAVA 11 installed but this is not compatible with OH 2.5 (it will be with OH 3.0).
When you install OH 2.5 from apt install, this also install the ZULU 8.
After that you only have to verify the correct java alternative selection:

java –version
sudo update-alternatives --config java

Than, in order to have the openhab-cli console you also have to check that the Java Home is well defined:

echo $JAVA_HOME
sudo nano /etc/environment

You have to select the folder of the ZULU 8 install that you have selected above but not stopping at the Java folder :

JAVA_HOME="/usr/lib/jvm/zulu-embedded-8-armhf"

SAMBA/CIFS
In order to access things and items from Laptop, you have to install SAMBA/CIFS and configure your shares. You can follow this procedure:


At the end you will need to configure your share as it follows:
sudo nano /etc/samba/smb.conf

At the end of the file add:

[openHAB2-conf]
comment=openHAB2 site configuration
path=/etc/openhab2
browseable=Yes
writeable=Yes
only guest=no
public=no
create mask=0777
directory mask=0777
veto files =/Thumbs.db/.DS_Store/..DS_Store/.apdisk/.*/
delete veto files = yes
force user = openhab
force group = openhab

You can do the same also with path=/var/lib/openhab2 and path=/srv.

Do not forget to create the user openhab under samba :slight_smile:
sudo smbpasswd -a openhab
In this way if widows will ask user and password you will use this.

I will try to keep this post updated as fas as I find something that is worth to be mentioned in here.

Cheers

You have heard about openHABian, haven’t you ?
It does Java, Samba and more - automatically.

1 Like

Of course I heard about openHABian and for sure this is the fastest and easiest solution for who has a new pi devoted to OH.
In my case I started with a pi already configured for several other tasks and I preferred to install OH from apt rather than reinstall all my stuff over openHABian.

AT the end I spent some time but I learned something :slight_smile:

Anyhow, shoud I start again from scratch , I would start from openHABian :wink: