openHABian hassle-free openHAB Setup

Hi @mstormi,

I was following your advice with removing mmcblk0. Then I ran amcleanup openhab-dir and after that I executed amcheck openhab-dir. The last command had a long run and came up with following log:

[18:01:20] backup@openHABianPi:/home/openhabian$ amcheck openhab-dir
Amanda Tape Server Host Check
-----------------------------
slot ?: volume ''
ERROR: Timeout trying to lock '/etc/amanda/openhab-dir/storagestate'
NOTE: host info dir /var/lib/amanda/openhab-dir/curinfo/openHABianPi does not exist
NOTE: it will be created on the next run.
NOTE: index dir /var/lib/amanda/openhab-dir/index/openHABianPi does not exist
NOTE: it will be created on the next run.
Server check took 1006.781 seconds

Amanda Backup Client Hosts Check
--------------------------------
Client check: 1 host checked in 2.314 seconds.  0 problems found.

The debug log of amcheck-device had some interesting lines:
[18:05:55] openhabian@openHABianPi:/var/log/amanda/server/openhab-dir$ sudo tail -f amcheck-device.20170730180206.debug
Sun Jul 30 18:02:06 2017: thd-0x167c400: amcheck-device: pid 3725 ruid 34 euid 34 version 3.3.6: start at Sun Jul 30 18:02:06 2017
Sun Jul 30 18:02:07 2017: thd-0x167c400: amcheck-device: pid 3725 ruid 34 euid 34 version 3.3.6: rename at Sun Jul 30 18:02:07 2017
Sun Jul 30 18:02:07 2017: thd-0x167c400: amcheck-device: chg-disk: Dir /srv/backup/slots
Sun Jul 30 18:02:07 2017: thd-0x167c400: amcheck-device: chg-disk: Using statefile '/etc/amanda/openhab-dir/storagestate’
Sun Jul 30 18:02:07 2017: thd-0x167c400: amcheck-device: Amanda::Taper::Scan::traditional stage 1: search for oldest reusable volume
Sun Jul 30 18:02:07 2017: thd-0x167c400: amcheck-device: Amanda::Taper::Scan::traditional no oldest reusable volume
Sun Jul 30 18:02:07 2017: thd-0x167c400: amcheck-device: Amanda::Taper::Scan::traditional stage 2: scan for any reusable volume
Sun Jul 30 18:18:53 2017: thd-0x167c400: amcheck-device: new Amanda::Changer::Error: type=‘fatal’, message='Timeout trying to lock ‘/etc/amanda/openhab-dir/storagestate’'
Sun Jul 30 18:18:53 2017: thd-0x167c400: amcheck-device: warning: Use of uninitialized value $volume_label in concatenation (.) or string at /usr/lib/amanda/amcheck-device line 121.

Sun Jul 30 18:18:53 2017: thd-0x167c400: amcheck-device: Amanda::Taper::Scan::traditional result: error=Timeout trying to lock '/etc/amanda/openhab-dir/storagestate'
Sun Jul 30 18:18:53 2017: thd-0x167c400: amcheck-device: pid 3725 finish time Sun Jul 30 18:18:53 2017

Any idea why no slot and volume is defined?
What should I do next? Run amdump?

Not sure if it would need to be defined at this stage.

Did you run amcheck/amdump as root at some stage in the past?
I’d check file permissions on the storagestate file and directory it’s in. both should be owned or at least be writable by the backup user) and eventually delete the file.
You need to run those commands as the backup user.

Then rerun amcheck and eventually amdump.
Now if all of that doesn’t help, your best option would be a post on the Amanda mailing list.

That should not happen but you are the second user to experience this. Please check the following discussion and provide all details you can:

Hi Thom,

How do you clear/delete the the log produced by “http://openhabianpi:9001/”?
I stopped OH service, deleted the log files, re started OH and then looked at the above address but it continued on from where it was.

My OH install is reasonably new and I’m trying to wade through all of the errors/warnings and make OH more functional and stable. Hence why I like to clear the logs after each significant change to see what is outstanding.

Could the “http://openhabianpi:9001/” also have provision for just displaying the OH log or Changed events as opposed to both?

Thanks,
Neil.

Hey,
the page just presents the normal openHAB logs. If you want to delete those: sudo rm -rf /var/log/openhab2/*

1 Like

Hey everyone, exciting news!

openHAB Generator

The idea of a hassle-free openHAB start goes a long way. openHABian provides a base system to work with openHAB but what comes next? @kubawolanin asked himself that question and developed a small handy tool to kickstart modeling your home. Learn all you need to know here:

The openHAB generator is now part of openHABian! Existing installations can install it via the openhabian-config menu, on new installation the generator will be installed by default. Execute the openHAB generator by executing either of these commands:

openhab-generator
# OR
cd /etc/openhab2 && yo openhab

Enjoy!

7 Likes

@mstormi

I solved it!

Okay, that was tricky. The permissions of storagestate were right. I tried to change it over and over - but no success. And then… I renamed the file with having a new storagestate created by restarting the process. The new file was empty, so I copied the content from the old to the new one … and everything worked!

So thank you very much for your assistance and patience.

Have a nice weekend!
HFM

You’re welcome.
Did you try to rename or delete the storagestate file and ‘restart the process’ (I’m assuming you refer to executing amcheck from the commandline) WITHOUT editing it ?
My guess is that that would have worked, too, so the ‘fix’ for anybody to come up with the same issue could be to simply delete the file.

Today I wanted to connect to my openhab Rasperry via PuTTy.

I allways get the error

grafik

The webserver “Openhab”, “PaperUI”, “Grafana” also the “hab:9001” is running without any error.

What do I have to do, to connect to my raspberry via ssh again?

I guess the openssh server crashed. This is very unusual!

Try to connect via keyboard and monitor directly to the Raspberry to reboot it.
Try to find the reason for the crash (sudo journalctl -u ssh -b -1)

That’s not possible.

In the place where the RPi is mounted I have no Monitor or Keyboard Access.

So the only way to restart is by switching OFF/ON the power supply.

Am I right?

May be afterwards I can still have a look to the journal.

If there is no way to connect a monitor and keyboard without switching the Raspberry off, a power off/on is your only chance to get access… Good luck! :wink:

Edit:

sudo journalctl -u ssh -b -1

the -b -1 is: since the reboot/startup before actual startup. So when rebooting multiple times, you will have to decrease the parameter to -b -2, -b -3 and so on.

I tried now twice.

The first time I had a little trafic on the ethernet port, but the RPi was not pingable.

On the second try there was no trafic at all.

I took an image from the sd-card and copied it to a new (bigger) one.

But it still does not reboot :frowning:

What can I do now?

I think the sd-card is not broken there is something wrong with the openHABian.

Is there a possible way to fix the image via a win10 PC?

Take the new sd card and make a new clean installation from scratch. Afterwards copy /etc/openhab2/ and possibly /var/lib/openhab2/ from the old installation to the new one.

Don’t lose time with trying to repair the old installation.

1 Like

I switched from a Rasüberry Pi to an Intel NUC based on Ubuntu. I’m a big fan of openHABian so i tried to install it on Ubuntu. Unfortunatlelly I was not able to install Zulu JDK via config tool:

$ apt -y install zulu-embedded-8 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package zulu-embedded-8
FAILED

The solution was to install Zulu JDK manually:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x219BD9C9
apt_source='deb http://repos.azulsystems.com/debian stable main'
apt_list='/etc/apt/sources.list.d/zulu.list'
echo "$apt_source" | sudo tee "$apt_list" > /dev/null
sudo apt-get update
sudo apt-get install zulu-8

Is this the way to go or how should Zulu JDK be installed on Ubuntu?

strange… with that repo added to your list (and apt-get update run), you should get:

root@rpi3:/home/pi# apt-cache search --names-only '^zulu-.*'
zulu-embedded-8 - Azul Systems Zulu Embedded is a binary distribution of OpenJDK

edit: oh…wait… Intel NUC running “regular” Ubuntu… then you should use the “regular” Zulu (like you did), not the embedded one for ARM systems.

Would It be possible to have karaf console in a web browser window, similar to frontail? Love this new feature, and the openhabian package is awesome!! great job!

There is a tool called: Apache Felix Web Console for this but if I am not wrong, you can’t issue console commands from it (but you can manage certain aspects of Karaf from this)…
Note: this is a more advanced tool and not really recommended for all users (I don’t use it).

check:

Installed openhabian yesterday, working like a charm

but… i cant reboot

try some changes to su root, but the password is not valid

[16:05:39] openhabian@openHABianPi:~$ sudo reboot

sudo: error in /etc/sudo.conf, line 0 while loading plugin `sudoers_policy’
sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner
sudo: fatal error, unable to load plugins

any ideas

Hello everybody,
i’m new in the world of openhab, linux and rasberry. After some days learning, everything seems ok, happy to be here with you.
Everething, not really, I want to use the command “sudo raspi-config” to enable the rpi camera module. It seems I need to do that on Karaf, but I’m front a strange behaviour (all that with putty) :
Connection to openhabian : OK
Change all passwords (all the same for now) : OK
openhabian@openHABianPi:~$ ssh openhab@localhost -p 8101 OK

Password authentication
Password: my_password

                          __  _____    ____
  ____  ____  ___  ____  / / / /   |  / __ )
 / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  |
/ /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ /
\____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/
    /_/                        2.1.0
                               - release build -

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown openHAB.

openhab>

OK
But, when I try a sudo, not OK !!! :

openhab> sudo raspi-config
Password: my_same_password
Error executing command: login failed
openhab>

What I’m missing ?
When I was trying to deal with GPIO and script, I used “sudo visudo” :

Defaults env_reset
Defaults mail_badpass
Defaults secure_path=“/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin”

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d
openhabian ALL=(ALL) NOPASSWD: /usr/bin/python

Thanks !
JR