Karaf on Synology

Hi guys,
I want to see realtime logs from openHAB, is this some way how to start Karaf or some other tool for real time logs?
I need to debug Mqtt because openHAB sometime missed some messages and I need to find why.

Thanks

You can log into Karaf console by

ssh -p 8101 openhab@localhost

Password is habopen. There you can set debugging level and tail the log

log:set DEBUG org.openhab.binding.mqtt
log:tail

Thanks Martin,
I already tried this but:

ssh -p 8101 openhab2@192.168.1.x

or

ssh -p 8101 openhab@192.168.1.x`

always I got Connection refused… any idea why?

I have never tried to ssh into Karaf from outside where Karaf is running. If you’re on the console of the server running openhab(2) it always work with localhost (ie. 127.0.0.1). When you say you have tried… have you tried using “localhost” as the servername?

When I put “localhost” as server name I got after longer time timeout.
After fourth try I finally got response and it is working

My way is:

  1. ssh to server ssh -p 8101 openhab@192.168.1.x
  2. ssh to openhab using ssh -p 8101 openhab@localhost
  3. got timeout 3 time and now it works

Thanks a lot

Thank you for sharing how to get into a Synology Karaf console! Getting the password was the key to my problems . . . with the new zWave binding

Best, Jay

You can log into Karaf console by

ssh -p 8101 openhab@localhost

Sorry, where should I write this ?

Antoine
PS: Openhab is very confusing for me.

I use windows to connect to the Raspberry with the WinSCP program and after the connection I open a session with Putty.

With my Nas it does not work

ssh -p 8101 openhab@localhost

but I use the command

ssh -p 8101 openhab@127.0.0.1

Reviving this topic…

I have a Synology 218. Trying to get Karaf working to get real time logging.

Since I don’t know if I can run locally the -ssh command on the NAS, I opened and admin console on a PC on the network.

As per the documentation in “Bind Consoles to All Interfaces” I changed the ip adress to 0.0.0.0 in the runtime.cfg.

I tried different command without success:

PS C:\WINDOWS\system32> ssh -p 8101 openhab:habopen@192.168.1.0
ssh: connect to host 192.168.1.0 port 8101: Connection timed out
PS C:\WINDOWS\system32> ssh -p 8101 openhab:habopen@192.168.1.0
ssh: connect to host 192.168.1.0 port 8101: Connection timed out
PS C:\WINDOWS\system32> ssh -p 8101 openhab:habopen@127.0.0.1
ssh: connect to host 127.0.0.1 port 8101: Connection refused

Anybody has this working?

I have to SSH into the Synology NAS first then from there SSH into port 8101. I can’t go directly into OH Karaf via Windows; takes 2 steps.

Here’s the command I use once I get into my Synology NAS via SSH.

ssh -p 8101 openhab@localhost

Best, Jay

Got it working from a pc:

1 - Open a Windows powershell in the pc (on win10)
2 - type ssh -p 8101 openhab@192.168.1.xxx (diskstation adress)
3 - System will ask for password, enter habopen (and change it after for improved security). If you succed you’ll see “openhab>”
4 - To see a log in real time enter log:tail

1 Like

I was also just debugging karaf on synology - and i think i found the problem.
for security reasons the login shell for all users not in administrators group is set (and reset on every reboot) to “/sbin/nologin” in /etc/passwd
See:

So you could add the openhab account to the administrator group on synology or create a script as described in the linked article.

besides that be sure to set the password for the user also in etc/users.properties and restart openhab for the changes to take effect synoservice -restart pkgctl-openHAB