openHABian hassle-free openHAB Setup

Tags: #<Tag:0x00007f433869aaa0> #<Tag:0x00007f433869a960> #<Tag:0x00007f433869a870>

Yes it simply doesn’t work. Download failed. 503 Moved temporarily:

Okay, never experienced anything similar. Possibly a problem with your locale/timezone settings or the DNS server used in your network. Just try flashing the image again, hopefully it will work a second time. if you by any chance did that before, do not change installer-config.txt.

Will be able to try&report back tomorrow again. Thx in advance

The issue has been resolved by Oracle. It seems they fixed the links because I can download the JDK packages within Firefox, too. I started from scratch now again anyways and flashed the image onto my sdcard.

While trying to install Grafana / Influxdb from menu (opened with sudo):

Everyone,
please pay close attention to

Do not upgrade 2016-11-11

I want to emphasize, that apt upgrade is currently in fact breaking your openHAB system.
This is a short time error which will probably be solved soon.
Please stay clear from upgrading for a couple of days.

A fresh openHABian installation will also be unable to start openHAB.
In all cases this is only a temporary problem and you will be able to apt upgrade to the soon to be released working release.

Update - Fix available 2016-11-13

A solution is available.

  • New installations are no problem anymore.
  • Users who did an upgrade in between and are desperately waiting for an upgrade: Do it now! sudo apt update && sudo apt -y upgrade
  • Users still on a previous build, you may also update now.

Everyone: There might still be smaller problems. If you are on a stable setup right now, it wouldn’t hurt to wait for a few more days for things to settle…

If you have all or most settings for your system in the configuration folder under /etc/openhab2/ it’s also a good idea to do a clean reinstallation:

# Make backup
cp -arp /etc/openhab2 /home/pi/openhab2-conf-bak

# Remove and reinstall openHAB
sudo apt update
sudo apt purge openhab2-offline
sudo apt install openhab2-offline

# Restore Backup
#sudo rm -rf /etc/openhab2
sudo cp -arp /home/pi/openhab2-conf-bak /etc/openhab2
sudo systemctl restart openhab2.service

Additional openHABian step: You will see this error:

I’ve already implemented the needed changes in openHABian. Please execute sudo openhabian-config, then first select “Update” to retrieve these changes, then select “Basic Setup” to apply them to your system.

1 Like

This also affects a clean install.
It results in a broken OH2 Installation

But this post might show a solution:

Yes, I have tested this on a openHABian install and it should do the trick for now, for clarity:

cp /usr/share/openhab2/runtime/karaf/etc/* /var/lib/openhab2/etc/

sudo sed -i -e 's|/usr/share/openhab2/runtime/karaf/bin/|/usr/share/openhab2/runtime/bin/|g' /etc/init.d/openhab2 /usr/lib/systemd/system/openhab2.service
sudo sed -i -e 's|OPENHAB_USERDATA="${OPENHAB_HOME}/userdata"|OPENHAB_USERDATA="/var/lib/openhab2"|g' /usr/share/openhab2/runtime/bin/oh2_dir_layout
sudo sed -i -e 's|OPENHAB_CONF="${OPENHAB_HOME}/conf"|OPENHAB_CONF="/etc/openhab2"|g' /usr/share/openhab2/runtime/bin/oh2_dir_layout
sudo sed -i -e 's|OPENHAB_LOGDIR="${OPENHAB_USERDATA}/logs"|OPENHAB_LOGDIR="/var/log/openhab2"|g' /usr/share/openhab2/runtime/bin/oh2_dir_layout

sudo systemctl daemon-reload
sudo service openhab2 start
2 Likes

Thank Benjy, running the above worked for me, however as per the comment from ThomDietrich, dont upgrade at the moment.

I needed to do a fresh install this morning and didn’t think to look at the site first.

Hi,
saw this too late - and made an update today.
Now I can’t start the Karaf console anymore. I get:
ssh: connect to host localhost port 8101: Connection refused

Could this have the same cause?

After doing the changes mentioned by Benjy, it should work again. You might need to restart openHAB once or twice to kickstart the reinitialization.

Everyone, a fix for the problems from the last few days is available.

I’ve updated the posting a few comments up with all details: openHABian hassle-free openHAB Setup

Firstly, thank you for your hard work in pulling this together, the manual setup process is very frustrating and this is very well thought through and executed.

I noticed the openhab.log and events.log are located in /var/log/openhab2/, so I added this folder to the samba config file by using nano to edit the file

sudo nano /etc/samba/smb.conf

and pasting the following at the end of the file

[openHAB-logs]
  comment=openHAB2 logs
  path=/var/log/openhab2/
  browseable=Yes
  writeable=no
  only guest=no
  public=no
  create mask=0777
  directory mask=0777

That way I can access the logs from my windows device without having to login to the RaPi using Putty.

Any possibility of enhancing the OpenHABian RaPi image to include this and expose the logs via samba?

Hey @BlinkyBill, thanks!

That’s an excellent idea. I did not think of it yet as I am using the ssh console plus the alias command openhablog. Of course a solution without the need for SSH is desirable. Did you see this alternative idea: https://github.com/ThomDietrich/openhabian/issues/28
Would you prefer this solution over the solution in samba? Feel invited to comment on the issue!

Thanks again for your project @ThomDietrich,

The frustrating thing with using Putty t access the logs is it’s not very friendly to filter, search, etc. Then there is the challenge to copy that info to the text tool of your choice …

I use Notepad++ to view the logs, as it has great find, count etc. functionality. I also use it to edit sitemaps, rules, etc.

I’d prefer samba to access the logs directly, so I can easily search etc. If you go with the approach discussion in https://github.com/ThomDietrich/openhabian/issues/28 this would be great to view the log tail, but if someone wants more search horsepower, they will probably copy/paste to the tool of their choice (so make that easy to do).

Thanks again.

Oh Linux actually offers all of this in more than powerful ways. Notepad++ is nice and my daily driver on a windows PC as well but it can not compete. Anyhow I do of course understand that you are used to Notepad++ and want to look at logs there instead of learning to work with new tools.

If you are actually interested, check he tutorials here: https://linuxjourney.com - Tools you might find useful are tail (look), grep (filter & find), wc (count), vim (complex edits), piping (copy to…) and so on. That’s definitely better than “probably copy/paste to the tool of their choice”.

Yet again openHABian is intended to address a wide user base and Yes, I have no problem sharing the openhab log folder. I’ll not have the time today. If you know how, please feel free to create a Pull Request, otherwise just a simple Issue. Thanks!

Thanks for your insight. I totally agree with your comments about the power of linux, but I’m confined in a windows world to access RaPis etc. Yes, I could dual-boot into ubuntu, but the rest of my non-openhab world is on windows, so I would be constantly toggling between the two.

What would you suggest the best log viewing solution would be for someone who only has a windows device to access their RaPi?

Thank you again.

Just successfully installed: openhabian-ua-netinst-20160915-git9e034e7.img (steady heartbeat green light). Connected to the openHAB2 portal (8080). Using the PAPER UI, installed the WeMo binding and searched for WeMo things. It found none, so I set up a couple manually (WeMo switch & WeMo lightswitch) using the appropriate UDNs (WeMo called them 'Device ID’s). Both items show in the Control panel of the Paper UI, but do not work. Am I missing something? FYI, I’m new to Linux and RPi3.

openHABian is the system you used to get openHAB2 onto your RPi. Everything from here on out is unrelated. You might need to read up on the binding documentation,check your log or follow guides posted here in the forum. These are the things I would do and I can only help you this far without knowing what “do not work” means…

Hey @BlinkyBill, I thought about what you asked. My preferred solution is putty definitely. There is no more direkt, responsive and capable solution out there plus its what you get with every base Linux system. You can define a putty configuration to automatically start tracking your log files and by the use of grc you can color them to increase visibility. Let me know if you are interested in details.

I’m not against your samba solution, I’m however certain that it’s the worse alternative… Still I see the appeal and as I said, please create a GitHub PullRequest/Issue.

Did you check the linked issue? Frontail might be for you.

Another solution I was thinking to implement for a longer time is logstash to store and filter log messages. However this is probably another level of interest