openHABian hassle-free openHAB Setup

Worked well - thanks a lot.

I am still seeing this in the logs after OH2 startup:

21:58:35.370 [WARN ] [vider.SimpleGeneratorHostKeyProvider] - Unable to read key /var/lib/openhab2/etc/host.key: java.io.EOFException
21:58:35.423 [ERROR] [vider.SimpleGeneratorHostKeyProvider] - Overwriting key (host.key) is disabled: using throwaway java.security.KeyPair@6f7c23

You don’t have to handle jar files to install habmin. You can easily install it through
PaperUI.

I suspected as much, but I don’t see Habadmin listed in the Addons page. Is it labeled as something else?

Edit: Nevermind. I’m just apparently blind. Thanks. :slight_smile:

The good news is that I got my Pi connected on WiFi. It’s been running with no issues at all and I love OpenHAB once again :slight_smile:

The downside is that I haven’t discovered the root cause. The only thing a did differently was to run across the hall to disconnect the ethernet cable the moment I issued the shudown command. In other words it connected fine to WiFi only on reboot without ethernet. I’m not sure if that was intended all along?

These are the exacts things I did:

  1. Wrote image openhabian-ua-netinst-20161216-git52cc420 to SD card
  2. Powered up, waited 45 mins + 15 to initialise itself - OK
  3. Checked OpenHAB connected(ethernet) - OK
  4. Checked samba connection to OPENHABIAN - OK
  5. Connected SSH to the Pi on OPENHABIAN port 8080 - OK
  6. Ran menu option 1. Update
  7. Ran menu option 2. Basic Setup
  8. Changed password
  9. Changed time zone
  10. Added WiFi credentials via menu option
  11. Rebooted without ethernet
  12. Voila!

If anything I hope that helps anyone who encounters the same thing.

A package has arrived. Spoiler Time! Thanks @Kai

5 Likes

Dear Thom,

after the update last week my openhab continues to lead the next build;

openHAB 2.0.0~20170108170225-1 (Build #733)

Is there a way to fix this?

I’m having the same hosts.key issue as @philKrylc
My system was working fine using an install from late December, but I decided to do a clean install with the new packages. Now I periodically see this in the log:

10:40:34.952 [WARN ] [.ssh.OpenSSHGeneratorFileKeyProvider] - Unable to read key /var/lib/openhab2/etc/host.key: org.apache.commons.ssl.ProbablyNotPKCS8Exception: asn1 parse failure: java.lang.IllegalArgumentException: DEREncodable must be one of: DERSequence, DERSet, DERTaggedObject
10:40:34.995 [ERROR] [.ssh.OpenSSHGeneratorFileKeyProvider] - Overwriting key (host.key) is disabled: using throwaway java.security.KeyPair@12928b

How do I fix this problem?

Thanks,
Scott

That is interesting. There has been a change related to hosts.key (by me), so let’s hope this is not a bigger issue.

@philKrylc @Noircogi Could you please test two things for me:

  • Log in to the Karaf remote console (Beware that you may need a few minutes on first try as the RPi needs some time) After you were successfully logged in check the logs again.

  • Delete hosts.key sudo rm /var/lib/openhab2/etc/host.key and restart openhab2. Does the error still show?

What do you mean? The “-1”?

I had previously tried deleting host.key, but just did it again as a test. On the first reboot after doing that, there is the long pause when trying to start karafshell. In fact this time, it went so long that it timed out and reported a connection failure. I tried to connect again and it worked.

On the first start-up after deleting host.key, you just see the warning message above, without the error. The host.key file is re-generated, but with zero length, just like every time with the new install.

On the second start after deleting, you see both the warning and the error in the log.

One other key difference I’ve noticed.

In the past, when starting the built-in “karafshell” shortcut, it would be prompted for my sudo password, but not for the openhab password. With the new install, I’m prompted for the sudo password, then also the openhab password.

I have no idea what it means. I copied from Putty.

Yesterday the update remained suspended and I have fixed this with.

sudo apt install openhab2-addons openhab2-addons-legacy

Okay, for your information: The reason for the change you seem to have trouble with is that I want to eliminate this:

You can find all the details here: Generate karaf ssh key during installation · Issue #15 · openhab/openhab-linuxpkg · GitHub

Seems like the error you are seeing has something to do with internal key generation. Would you please try to generate it yourself? This is what actually is planned to be done in the future while package installation.

rm /var/lib/openhab2/etc/host.key
openssl genrsa -out /var/lib/openhab2/etc/host.key 4096
systemctl restart openhab2.service

Is the error still present? (I’m using such a key myself and do not see your error)

Wow, somebody is using this alias :smiley: I’ve only mentioned it once or twice :slight_smile: It is defined here and is with it’s internal use of “sudo” actually something I wanted to do exchange. Sooo, asking fo the sudo password is to be expected. The fact that client is now also asking for the password might be something that the change introduced. We might need to look into that. It’s not critical though.

I will create a ticket for all of this as soon as the problem and a solution are found. Prematurely mentioning @Kai and @Benjy here…

1 Like

I’m sorry for not being able to follow you.

  1. You’ve executed this command …
  2. You’re now seeing a newer release date …
  3. Your problem is solved?

Using a self-generated key seems to avoid the error/warning. It also creates a valid 5k-byte file unlike the automatic system which creates a zero-length file.

I did “sudo bash” then pasted in your commands above, then had to “chown openhab:openhab host.key” to get the permissions right.

Even after that, I’m still prompted for both passwords by karafshell, so something has definitely changed there.

This did it for me. It now working fine, also after a restart - thanks!

Edit: @ThomDietrich, with OH2 RC1 this does not work.

Is that the big one with Wfifi & Bluetooth module?

I was told it’s one of the first prototypes with the Wifi module. :wink:

That was to be expected :wink: RC1 didn’t include this change

1 Like

Any idea on how to fix the log errors or get a valid key?

  1. Delete hosts.key and restart openHAB. Should generate a key just as the last few months.

  2. just ignore the error and wait for 2.0 final

Hello together,

i wanna switch my raspberry pi with openhab2 from the pi3 to the pi2 model b…Can i just switch the SC-Cards or do i need to set something up?

Ty :slight_smile: