What is the process to install the snapshot build on rpi? I’ve done the oh1 build, but want to try out oh2 even though its still in alpha. Please help lead me in the right direction. Also, will it be possible down the road to migrate oh1 to oh2?
Typically it is a matter of downloading the latest successful build from cloudbees and unzip it.
In my case I’ve automated the step I’ll backing up the old dir, if you want I can share simple script for it
Once you changed over you will need to rewrite the config partly, as the migrated bindings (true OH2) require different config in many cases from the OH1 config.
If you’d be willing to share, that would be great. Also, what modifications are required?
This is what I use as simple update script to get the latest and replace the earlier install
updateOH2.sh:
#!/bin/sh
OH_RELEASE="openHAB2"
BASE="distribution-2.0.0-SNAPSHOT"
INSTALL_DIR="/opt/openhab2"
rm $BASE*
wget https://openhab.ci.cloudbees.com/job/$OH_RELEASE/lastSuccessfulBuild/artifact/distribution/target/$BASE-runtime.zip
wget https://openhab.ci.cloudbees.com/job/$OH_RELEASE/lastSuccessfulBuild/artifact/distribution/target/$BASE-addons.zip
#wget https://openhab.ci.cloudbees.com/job/openHAB/lastSuccessfulBuild/artifact/distribution/target/$BASE-greent.zip
#unzip with overwrites and not creating new files
unzip -f -o $BASE-addons.zip -d $INSTALL_DIR/addons/
#OH1 greent unzip greent (all files)
#unzip -o $BASE-greent.zip -d $INSTALL_DIR/webapps/
DATE=`date +%Y%m%H%M`
mv $INSTALL_DIR/runtime $INSTALL_DIR/runtime.$DATE
unzip -o $BASE-runtime.zip runtime/* -d $INSTALL_DIR/
chmod a+x $INSTALL_DIR/*.sh
cd $INSTALL_DIR/addons
wget https://github.com/cdjackson/HABmin2/blob/master/output/org.openhab.ui.habmin_2.0.0.SNAPSHOT-0.0.15.jar?raw=true -O org.openhab.ui.habmin_2.0.0.SNAPSHOT-0.0.15.jar
#https://github.com/cdjackson/HABmin2/blob/master/output/org.openhab.ui.habmin_2.0.0.SNAPSHOT-0.0.15.jar?raw=true
Where do I put this script? I’ll use nano to copy it. Also, you say it overwrites the previous. So does it automatically update every time there is an update available?, and do I need to have it installed the first time without this script in place, or can I put this script in place and it will do the initial install?
And it also appears you are getting habmin2 as well? That would be great.
Gentlemen
I appreciate the scripts. I am still new to linux, so please help. I assume I have to make either of these executable,is that correct, and how? I believe this because they won’t run when I type their names at command line.
Again, thank you for helping.
This is the part that makes the scripts executable
If you type from the command line replace the install dir part with your installation folder
For the first time install, you can follow the instructions from the oh site. But it is more or less extracting the 2 zip files to the install folder and removing all unnecessary bindings
So then in Jim’s script, I’d save it as is, then do the chmod?
Correct. That script makes some assumptions to make the install easier for you by creating directories if they do not exist. You can edit the script if you want to use other locations. You can do chmod +x filename where filename is the name you saved the script as, and then run it with ./filename. You need the ./ because chances are the file is not in your PATH. The PATH in Unix/Linux systems works the same as windows. It won’t run something that is not in the path unless you tell it “it is right here in this directory”. The period is always symbolic for the current directory.
The other option, if you do not want to make the file executable is to execute it it directly with the shell. That would look something like this: sh ./filename . This gets around the need to make the script executable because the shell is already executing and you are simply passing code to it to be run.
This script will likely need elevated privileges to run the first time. You can do this on Unix/Linux systems by using sudo in front of the commands, so sudo ./filename or sudo sh ./filename if did not do the chmod. It needs the elevated privs to create the directories in /opt.
Hope this helps!
Thanks, I’ll give it a shot.
I apologize for the constant questioning…
I got it to run, thanks for the chmod answer.
Now, question. …
Oh1 had the Webapps folder, did oh2 do away with that, and if so, where are all the habmin files kept?
Also, how do I access both paperui and habmin from the browser? I’ve tried a bunch of things and just can’t get it to work.
There should be an icon for for each on the main index page. You can get to it with http://IP:8080 or https://IP:8443 where IP is the IP of the machine it was installed on.
I’ll try it in the morning, thanks
Great, it works that way. Now, a couple more questions…
Does the site map creator not work in habmin2, so I’d have to create them manually, or use habmin1?
In oh1 I had to change the zwave settings in openhab.cfg, where do I change them in oh2?
I cannot see my zwave devices, this is why I ask.
I think I’ll just go back to oh1…don’t think oh2 is ready for me, or the other way around…at least yet.
On that note, how do I bind multiple nodes to one switch?
Guys, i want to try openhab 2 as well but how and where to install is not obvious.
It looks like the script from
marcel_verpaalen
will be great for UPDATES but how do I initially install?
Or how do I set up the directory of /opt/openhab2/ on a new install?
Is there a similar “first time” script?
Or do I need to build it myself in the same structure as openhab1? Such as:
/opt/openhab/
+/addons/
+/configurations/
+/contexts/
+/etc/
+/logs/
+/server/
+/sounds/
+/webapps/
+/workspace/
license.txt
readme.txt
start.bat
start.sh
start_debut.bat
start_debut.sh
I created a script that will get you going if you want to take a look at it feel free:
It is pretty simple and easy to modify to meet your needs.
This is helpful! I need the same for Windows. I will try and translate…