I rebuit a clean Raspbian image on Rpi2 and installed openhab using apt-get (per github)
Some things such as auto booting worked way better using apt-get than my previous attempt from zip, but…
I have had no luck getting openhab-designer (windows) to connect via samba and I think it has something to do with a user “openhab” on things in the configuration directory. I don’t I have an openhab user (I think I have just root and pi).
From the windows computer I can log in to the samba share on the RPi2,
I can run designer and point it to the RPi2 share, but the “Configurations” pane in the upper left is always empty rather than containing Items, Persistensce, Rules, etc.
If I put the configurations directory on a NAS storage device with no security then designer opens it fine and the “Configurations” pane works fine.
If you installed using apt-get you now have an openHAB user and openHAB is running as that user.
Since you are sharing /etc/openhab/configurations over Samba you need to make sure that whatever user that your Samba clients are connecting as have full read/write permission on that folder.
Thanks sihui and Rich - you have helped me understand my problem.
I copied the “configurations” work that I did on a previous system to my NAS (network drive).
Rebuilt RPi2, reinstalled OpenHAB and then copied the configurations directory back to RPi2 which probably jazzed up the ownership/security.
What should security be on my /etc/openhab/configurations/ and it’s underlying files?
Using “ls -l” Mine are now: configurations: drwxrwxrwx 8 root root 4096 Dec 15 10:23 configurations
And within configurations: -rwxrwxrwx 1 pi pi 70693 Dec 12 17:33 default.cfg drwxrwxrwx 2 root root 4096 Dec 15 10:23 items -rwxrwxrwx 1 pi pi 2525 Jul 31 12:03 logback_debug.xml -rwxrwxrwx 1 pi pi 2311 Jul 31 12:02 logback.xml -rwxrwxrwx 1 pi pi 70695 Jul 31 12:03 openhab_default.cfg drwxrwxrwx 2 root root 4096 Dec 15 10:23 persistence drwxrwxrwx 2 root root 4096 Dec 15 10:23 rules drwxrwxrwx 2 root root 4096 Dec 15 10:23 scripts drwxrwxrwx 2 root root 4096 Dec 15 10:23 sitemaps drwxrwxrwx 2 root root 4096 Dec 15 10:23 transform -r--r----- 1 openhab openhab 24 Jul 31 12:02 users.cfg
can someone that has installed via apt-get and has things working tell me what they have for: cd /etc/openhab/configurations/ ls -l
I actually source control my configurations using git. So what I did was create a repository in my home directory for the configs(and webapps) and soft link that folder to /etc/openhab. But I don’t share my configs over Samba so YMMM.
rich@chimera:~$ ls -l /etc/openhab
lrwxrwxrwx 1 root root 33 Jun 17 10:51 /etc/openhab -> /home/rich/Documents/code/openhab
rich@chimera:~$ ls -l /etc/openhab/configurations/
total 176
drwxr-xr-x 2 rich rich 4096 Oct 14 15:21 items
-rw-r--r-- 1 rich rich 69900 Oct 23 15:14 openhab.cfg
-rw-r--r-- 1 root root 70695 Jul 31 15:43 openhab_default.cfg
drwxr-xr-x 2 rich rich 4096 Oct 8 13:38 persistence
drwxr-xr-x 2 rich rich 4096 Sep 1 14:39 rules
drwxr-xr-x 2 rich rich 4096 Dec 11 15:22 scripts
drwxr-xr-x 2 rich rich 4096 Oct 23 12:44 sitemaps
drwxr-xr-x 2 rich rich 4096 Aug 3 13:12 transform
-rw-r--r-- 1 rich rich 28 Jun 17 10:44 user.cfg.old
-r--r----- 1 openhab openhab 42 Jun 18 08:51 users.cfg
You need to have everything under user:group openhab:openhab.
In addition to that I had to chmod all files to 0777.
Since then Designer under Windows is able to read/write config files on Raspberry.
My issue ended up being caused because I used samba to share the /etc/openhab/configurations directory.
I needed to share it’s parent directory:
/etc/openhab/
So in designer, it asks for the configurations directory and you point it to the configurations directory but designer appears to rely on the ability to look one level up from that directory in order to fully function.
Can I ask, what is in your SMB global settings? I’m trying to share my /etc/openhab2 folder through SMB, bu thave no luck getting write permissions from my macbook.
I’ve added both user pi and user openhab to the smb users using smbpasswd -a [USER]
I’ve been trying since last night with the default config file, but I chose to go bare bones to give myself a break
[global]
;server string = Samba Server Version %v
security = USER
;log file = /var/log/samba/log.%m
;max log size = 50
;idmap config * : backend = tdb
;hosts allow = 10.0.1.0/24
;cups options = raw
[openhab2]
path = /etc/openhab2/
force user = openhab
;available = yes
;read only = no
;browseable = yes
;public = no
;writeable = yes
;create mask=0777
;directory mask=0777
;only guests=no