Cannot get OpenHab/Demo to run

Hi everyone

I have spent about three days reading up on everything openhab and wanted to start putting everything into practice over the holidays.

After installing openHab 1.7.1 on a rPi I seem to be running into quite a few problems early. After (so far unsuccessfully) trying to get the Samba server to run I skipped that part and went about installing the demo.

Unfortunately, this doesnt seem to work either, I am getting the following error message:

2015-12-31 16:15:42.757 [WARN ] [.u.component.AbstractLifeCycle] - FAILED SelectChannelConnector@0.0.0.0:8080: java.net.BindException: Die Adresse wird bereits verwendet
java.net.BindException: Die Adresse wird bereits verwendet

2015-12-31 16:15:44.567 [WARN ] [.u.component.AbstractLifeCycle] - FAILED SslSelectChannelConnector@0.0.0.0:8443: java.net.BindException: Die Adresse wird bereits verwendet
java.net.BindException: Die Adresse wird bereits verwendet

Since I am running a Baikal server I suspected that there is a port conflict. Where exactly would I change ports?
I found lots of conflicting information in the forum:
Some people suggested the port to be changed in:
-opt/openhab/server/eclipse.ini
-directly in start.sh
-etc/default/open

Changing the port to 8081 in any of these three has yielded no results. Same error message.
Also I found out that there are additional OpenHab files in usr/share/openhab/ ?
This folder was never mentioned in any of the tutorials that I read so far…whats the difference betwen the files in there and the ones in opt/openhab/ ?

Thanks guys (and girls) for taking the time…

Nick

If you install openHAB via apt-get, it puts files in /etc/openhab, /var/log/openhab, /usr/share/openhab, etc/init.d, and one or two more places. This is generally preferred because it makes upgrading to new releases easy, it runs the server under an openhab user instead of root, and it takes care of autostarting the server on boot. Unfortunately, there are a few tutorials out there that don’t describe this path.

It seems as if you did the apt-get install, as well as unzipping into /opt/openhab, creating two sets of files in different places.

I recommend you copy any config changes you want to keep to a safe place, remove all bits of openHAB from your system (including any startup files in /etc/init.d), and install only with apt-get. See this wiki for steps.

Thanks watou for the very swift reply.

You are right, after manually downloading and installing openhab I actually installed it via apt-get as well.
Unfortunately I am a long-time Windows user and only started fiddling with Linux after buying the rPi last year.

Do you suggest to simply delete opt/openhab manually first and then do apt-get remove ?

Do you suggest to simply delete opt/openhab manually first and then do apt-get remove ?

I don’t think the order of removal matters, just that it’s thorough! Then a clean apt-get install of the packages you want and set your config under /etc/openhab.

ok I think i got rid of everything and did a clean apt-get re-install.

I actually had to change permissions of etc/openhab/ to “pi”, in order to populate the sitemap and items, but in the end that did the trick.

Thanks a million!

(Im sure I´ll be back with additional stuff in the coming days/weeks once Im trying to include the bindings ;))

Please be aware of which user account that openHAB is running under, vs. the user you login as. You may again have issues with file permissions otherwise. For simplicity, I login to a prompt using the openhab account, same account that the server is running under, so I don’t have that class of issue. Of course there are other approaches, too, and hopefully yours works well for you!

Have fun!

I am running the rPi in headless mode and usually access it through ssh as “pi”. I dont understand enough of Linux yet to anticipate if thats gonna bring me into trouble at some point?

I guess you are referring to the fact I installed openHab as “root” and am now accessing the conig files as “pi”?

Thanks for bearing with me. I really appreciate your input and the time you are taking!

Linux/Unix is a lot to take in at first! Basically, when you install openHAB via apt-get, the install process helpfully creates a user named openhab, just like the Raspian operating system came with pi and root users. When the openHAB server is running, it’s running under the openhab account, so that account has to be able to read configuration files, write log files, and many other permission-required things. It would be “less good” to run the openHAB server as the root user, because that user can do anything, including delete important files, access sensitive information in case you’re hacked, etc. It’s best to do as little as possible as the root user (superuser). Some files after installation are owned by root, but I’ve never seen that be a problem because the openhab user can still read them. You could use the chown command to change ownership of any file under an openhab subdirectory to the openhab user and it shouldn’t hurt.

The most important thing to remember is, if you hit a wall where openHAB can’t access some file, look at its ownership and permissions and make sure the openhab user can read or write it as it needs to.

Lastly, if you decide to add hardware that connects via a USB serial device, it works similarly to normal files, where you will have to make sure the user that’s running the openHAB server process (openhab by default, as mentioned above) has the permission to access it.

Thats a good point, especially the very last one. After toying around (and getting to work) my Hues, my next step was to be installing the Z-Wave USB ZME_UZB1. So that is very good to bear in mind.

I will see if my Baikal Server has a problem with me just ssh-ing into the rPi as “Openhab” instead of “Pi” and maybe get rid of the “pi” account altogether. Either way I will still have quite some reading to do, so lets see. It´s definitely good to have the whole permission topic on the radar for any future deadends I might be getting myself into.

Now it´s time to get ready for the new year diner anyway, no more geeking around.

Thanks again watou and happy new year!
N

1 Like