openHABian hassle-free openHAB Setup

And I’m back with yet another update. I had some spare time the last two days and worked on a lot of still missing details.

openHABian has reached version v0.9 and it’s at my personal “Definition of Done”. Sure, a few optional components will still be added and some small bugs might be found, but the core system and the openhabian-config menu are at a state of conceptional completeness.
I am welcoming everyone to use openHABian and actively take part in improving it by proposing new ideas or finding bugs.

New in this version:

  • Fix: the bash shell prompt wrap was broken by custom PS1
  • Fix: the provided bashrc was messing with SFTP
  • Fix: A major bug with the locale settings has been patched (waiting on Issue response)
  • rpi-config is now preinstalled as well, you should use it once
  • The early menu version was overhault and now includes a lot more options
  • Execute the menu in the console with sudo openhabian-config (similar to sudo raspi-config)
  • Now included:
    • Java 8 by WebUpd8Team
    • Homegear
    • Mosquitto
    • Bind Karaf Console to all interfaces
  • The menu can now update itself! :sunglasses:
  • Many small fixes
  • All changes…

Once again, I want to point out that the project was initially used to build and then configure a Raspberry Pi but has since then evolved and can now also be used on other Debian/Ubuntu based systems. Testers, arise! :wink:

openHABian v0.9 represents a solid base and with the integrated updater, you will be able to benefit from additions over time without the need to redo your whole system. I’ll leave this version here for testing and will turn it into the final v1.0 if no big problems present themselves.

Flash, Fiddle, Enjoy!!

4 Likes

Is there a list of all the included apps somewhere?

Great work!

I have two questions:

  1. What’s the status on InfluxDB+Grafana. Did you manage to get it into the system?
  2. I installed openHABian a while back (before the fancy configuration menu, :-)). Is there any recommended way to upgrade to v0.9 apart from doing a complete reinstall?

Yeah, that was also the first question which came to my mind.

Furthermore, regarding the major bug with the locale settings: How can I repair this bug manually?

Hi,

Looking good, however i am a bit confused now. Do i just write the image and off i go as per pre-menu editions, or do i need to write it to the sd card, wait 45 mins then do option 2,3,4,5?

Then again, when i want to update, do i need to do option 1, then 2,3,4,5 or just option 1 and 4

Sorry for such a basic question. I think the instructions need a bit of an update to help new users get it going.

Hey guys! While I spent the last days coding, now I need to start upgrading the documentation, you are totally right. Okay let me try to answer you all, hopefully this information will soon be available in the first post.

Everything that’s added to the minimal Raspbian can be found in openhab-setup.sh but let’s summarize:

  • screen vim nano mc vfu bash-completion htop curl wget multitail git bzip2 zip unzip xz-utils software-properties-common
  • rpi-update
  • raspi-config oracle-java8-jdk apt-transport-https samba bc sysstat
  • Oracle Java 8 by WebUpd8Team (what most know as revision 101 needed for my.openhab)
  • openhab2-offline
  • FireMotD
  • etckeeper
  • OPTIONAL: homegear homegear-homematicbidcos homegear-homematicwired
  • OPTIONAL: mosquitto
  • OPTIONAL: KNX installation script from here
  • OPTIONAL: owserver ow-shell usbutils

Thank you :wink: Not yet but with the core and menu (inkl. update) finished, this can now be added without any further implications. I’m still eager to add the combo, let’s hope it works out :wink: If you by any chance got around trying it, let me know.

I’m optimistic that upgrading will be easier from here on out. The reinstall would be the cleanest I guess but there’s no need really. What you need to do is, you need to manually pull the latest changes from the openhabian GitHub repository and then select a few options from the menu to reapply certain changes.

Out of my mind, that should do:

# Update to newest version
cd /opt/openhabian
sudo chown -R pi .
git fetch origin
git reset --hard origin/master
git clean -f

# Make openhab-config globally available
sudo ln -s /opt/openhabian/openhabian-setup.sh /usr/local/bin/openhabian-config

# Execute the menu
sudo openhabian-config

Select the second option (“Basic Setup”) to reapply the basic steps. I suspect your version to mostly differ in this area. Namely, this step will call these functions: locale_timezone_settings first_boot_script memory_split basic_packages needed_packages bashrc_copy vimrc_copy

After that you may call the other options (3, 4, 5) just to be sure, I can’t recall big changes in them the last few days.

The only step left out after you did the above is the installation of FireMotD. Execute these commands manually (if you care).

Good luck!

The same way than above, just update through the menu or pull manually as described above (depends on your current version) and then execute the second option, which includes locale_timezone_settings.

Yes on the first. The original idea of a self-configuring RPi image didn’t change. If you just want a openHAB+Samba system, you do not need to touch the menu or even the ssh console once.
Menu options 2,3,4,5 are there to (a) apply the latest changes on an older installation as seen above or (b) for other systems that are not based on the provided RPi image.

If you flash the openHABian image to your Raspberry Pi today and you want to do an update of openHAB in two weeks, you do not need the menu at all. Just do a normal sudo apt update && sudo apt upgrade as always. You only need to execute openhabian-config if you want to install one of the optional components or if I tell you so here (for example like with the locales problem discussed above). In this case it would of course bbe a good idea to first select option 1 and then proceed with the newest menu version.

I don’t think that openhabian-config updates are a must (from here on out). If you got a working Linux setup on your Raspberry Pi and you do regular upgrades through sudo apt update && sudo apt upgrade, you should be fine :wink:

If anything stayed unclear please let me know!

Has anyone tried the latest release? I’ve just tried to make a clean install and couldn’t get it to go. I can connect via SSH but no OH related directories are created. Also no Samba. But mc, nano etc. are installed. LED of my RPi3 is red (sometimes with a yellow blink).

Any suggestions @ThomDietrich? I have a log file on my pi, but without samba I am not sure how to get it on my MAC.

FTR: The older version of the script worked flawlessly on my rpi3.

I will try a second run now.

Forget about my last post. Second run went without problems. Maybe I was too impatient or did something wrong the first time.

kudos to you, mate! This is just friggin’ amazing! ^^ #dancing

2 Likes

Hey @jaydee73 great that it went well the second time but that shouldn’t happen. I’m aware of the downside, that the setup can fail at any step where something is downloaded from the internet (server timeouts,…) I don’t know what to do there. I hope to not have to build retries into all steps. While testing I never hat random failures…

At least the fact, that your setup was not successful should be made clear . You should see the LED blinking quickly, the openhabian-install-failed file in your home and all the details in /var/log/raspiban...log. Did you have the feeling you knew what’s going on?

@KjetilA I have been looking at Go compiling for a bunch of minutes now. Go is a prerequisite of InfluxDB. The steps to come do not seem to be easier… http://www.aymerick.com/2015/10/07/influxdb-telegraf-grafana-raspberry-pi.html
Lalalaaa

OK. I haven’t gotten around to try myself yet, but I wonder; do you have to compile InfluxDB?

According to the web site they already have a set of pre-compiled binaries for ARM available for download:

https://www.influxdata.com/downloads/

Grafana, on the other hand, does not have pre-compiled binaries for ARM (at least none that I could find).

I haven’t searched for an openhabian-install-failed file (as I wasn’t aware such a file could exist), but I took a look at the log. The log was about 57kb in size, so something did happened. :wink: As I said, the OS seemed to be installed correctly. Also some tools (mc etc.). But all OH related directories were missing. I could not dive deeper into the log (my little child had other plans… :wink: ), so I simply made a second try. So: Sorry, I don’t know what was going on.

Ah yes, I saw that. The tutorial was just one of the resources I used.
Sadly my experiments yesterday ended with Go.

apt install make ruby-dev gcc rpm bison
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
source /home/pi/.gvm/scripts/gvm
gvm listall
gvm install go1.4 -B
gvm use go1.4
export GOROOT_BOOTSTRAP=$GOROOT
gvm install go1.7 #or go1.6 or go1.5 or go1.5.4

The last command always fails. I’ll get my hands on a RPi 3 in the next few days. With my RPi1B+ the compile steps take ages and who knows, maybe there are problems with ARMv6 I’m not aware of. Would you be willing to try?
Let’s have further discussions in the related GitHub Issue

I plan to upgrade my RPI3 to your latest image (v0.9) this weekend - if I can find the time. When that is done, I’ll have a go at installing/compiling InfluxDB and let you know the result.

1 Like

Nice. Good luck!
While you are at it, would you be interested in also helping to get the wifi-only setup running? This should be possible by simply putting a wpa_supplicant.conf in the config folder of your SD card, but @Vincent didn’t have much success trying this :-/

Edit: Only if “upgrading” includes a reinstall, which, as I recall, was not your intention…

Yes, by “upgrading” I really meant complete reinstall.

I’ll have a look and see what I can do. My cable connection far “out-speeds” my WiFi connection, however, so I have a feeling I would rather like to do the download on the cable connection, :slight_smile:

Trying to use openhabian with a Razberry. I can not get the port dev/ttyAMA0 to be recognized in Openhab. Anyone had any luck with openhabian and Razberry?

Hey @Skalleno, could you reveal a few more details? I do not own a Razberry but from what I know, you need to first switch ttyAMA0 from serial port to peripheral mode. This can be either done though configuration files or raspi-config. Any luck with this?

http://elinux.org/RPi_Serial_Connection#Connection_to_a_microcontroller_or_other_peripheral

Please let us know if you where successful, I’ll probably make this a default for openHABian.

Tried to change the setting in raspi-config, but no luck. Z-Wave serial controller has yhe following error: Serial Error: Port dev/ttyAMA0 does not exist, in earlier openhab versions i think you had to add the serial port to start.sh. Can not find that here.
The port does show up when running this command ls -la /dev/ttyAMA0.