openHABian hassle-free openHAB Setup

$ apt -y install screen vim nano mc vfu bash-completion htop curl wget multitail git bzip2 zip unzip xz-utils software-properties-common man-db whiptail acl usbutils
Reading package lists... Done
Building dependency tree
Reading state information... Done
acl is already the newest version.
bash-completion is already the newest version.
bzip2 is already the newest version.
curl is already the newest version.
git is already the newest version.
htop is already the newest version.
mc is already the newest version.
multitail is already the newest version.
nano is already the newest version.
screen is already the newest version.
software-properties-common is already the newest version.
unzip is already the newest version.
vfu is already the newest version.
vim is already the newest version.
wget is already the newest version.
whiptail is already the newest version.
whiptail set to manually installed.
xz-utils is already the newest version.
zip is already the newest version.
The following packages were automatically installed and are no longer required:
  lua5.1 triggerhappy
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libusb-1.0-0
Suggested packages:
  groff www-browser
The following NEW packages will be installed:
  libusb-1.0-0 usbutils
The following packages will be upgraded:
  man-db
1 upgraded, 2 newly installed, 0 to remove and 43 not upgraded.
1 not fully installed or removed.
Need to get 1,217 kB of archives.
After this operation, 1,385 kB of additional disk space will be used.
Get:1 http://archive.raspberrypi.org/debian/ jessie/main man-db armhf 2.7.5-1~bpo8+1 [979 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main libusb-1.0-0 armhf 2:1.0.19-1 [42.4 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main usbutils armhf 1:007-2 [196 kB]
Fetched 1,217 kB in 0s (1,904 kB/s)
Preconfiguring packages ...
(Reading database ... 39252 files and directories currently installed.)
Preparing to unpack .../man-db_2.7.5-1~bpo8+1_armhf.deb ...
Unpacking man-db (2.7.5-1~bpo8+1) over (2.7.0.2-5) ...
Selecting previously unselected package libusb-1.0-0:armhf.
Preparing to unpack .../libusb-1.0-0_2%3a1.0.19-1_armhf.deb ...
Unpacking libusb-1.0-0:armhf (2:1.0.19-1) ...
Selecting previously unselected package usbutils.
Preparing to unpack .../usbutils_1%3a007-2_armhf.deb ...
Unpacking usbutils (1:007-2) ...
Processing triggers for mime-support (3.58) ...
Setting up initramfs-tools (0.120+deb8u3) ...
update-initramfs: deferring update (trigger activated)
Setting up man-db (2.7.5-1~bpo8+1) ...
Installing new version of config file /etc/manpath.config ...
Updating database of manual pages ...
Setting up libusb-1.0-0:armhf (2:1.0.19-1) ...
Setting up usbutils (1:007-2) ...
Processing triggers for initramfs-tools (0.120+deb8u3) ...
ln: failed to create hard link ‘/boot/initrd.img-4.9.0-2-rpi2.dpkg-bak’ => ‘/boot/initrd.img-4.9.0-2-rpi2’: Operation not permitted
cp: error writing ‘/boot/initrd.img-4.9.0-2-rpi2.dpkg-bak’: No space left on device
cp: failed to extend ‘/boot/initrd.img-4.9.0-2-rpi2.dpkg-bak’: No space left on device
dpkg: error processing package initramfs-tools (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.19-18+deb8u9) ...
Errors were encountered while processing:
 initramfs-tools
[master 1b6faf5] committing changes in /etc after apt run
 Author: pi <pi@openHABianPi>
 1 file changed, 1 insertion(+), 1 deletion(-)###############################################....................]
Updating FireMotD available updates count ...
E: Sub-process /usr/bin/dpkg returned an error code (1)

Hey guys,

i see that the errors says no space left on device…but i cannot understand why i got a 16GB sd card in the RPI2…So what could this be or how can i see how much space is left or something…

TIA
:slight_smile:

You may use the usual linux commands: df -h

1 Like
[16:57:55] pi@openHABianPi:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev             10M     0   10M   0% /dev
tmpfs           185M  4.6M  181M   3% /run
/dev/mmcblk0p2  7.1G  2.5G  4.2G  38% /
tmpfs           463M     0  463M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           463M     0  463M   0% /sys/fs/cgroup
tmpfs           463M   32K  463M   1% /tmp
/dev/mmcblk0p1  128M  128M  2.0K 100% /boot
tmpfs            93M     0   93M   0% /run/user/1000
[16:58:08] pi@openHABianPi:~$ 

It seems boot reaches 100% how can i extend that space!?

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!