openHABian testing

No, this happend to me o a fresh install done in unattended mode.
Even openHAB 4M3 was installed, the wrong path is used here.

I tried many different options, almost all I can think of and I always ended up with either 3.4.4 or openHAB2.

“You didn’t select any of the 4X options.”

The option that I think would make sense the most is

  • (1) (*) release most recommended version that supports openHAB 4 (openHAB branch)
  • then 02 | Upgrade System Update all installed software packages (incl. openHAB) to their latest version

which ends up with 3.4.4

I then tried 03 | Install openHAB Install or upgrade to openHAB 3, → same result.

An 41 option will end up with OH2 (All warn about OH2 and I tried it once and ended up with a corrupt openHAB install, so I had to purge SD card and start from scratch)
│42 | Upgrade to latest openHAB Upgrade OS environment to openHAB current release → also ended up with 3.4.4

So which option or sequence do you like me to try and record? What 4x option do you think of?

Was anyone successful with the latest openhabian / openhabian-config to upgrade from a downloaded 3.x version to 4.0? And if, what options did you use?

You obviously cannot upgrade your release version as OH4 is not released yet, so you need to switch to milestone using the corresponding 4x option first.

The code I asked you about determines how openhabian proceeds. For the system you showed the output for, it should not result in OH2 being installed.

Send the output of

source /opt/openhabian/functions/helpers.bash
set -x
openhab4_is_installed && echo 4
openhab3_is_installed && echo 3
openhab2_is_installed && echo 2

Here you go

set -x
openhab4_is_installed && echo 4
openhab3_is_installed && echo 3
openhab2_is_installed && echo 2
+ openhab4_is_installed
++ dpkg -s openhab
++ grep --color=auto Config-Version
++ cut '-d ' -f2
++ cut -d. -f1
+ [[ '' =~ 4 ]]
+ return 1
+ openhab3_is_installed
++ dpkg -s openhab
++ grep --color=auto Config-Version
++ cut '-d ' -f2
++ cut -d. -f1
+ [[ '' =~ 3 ]]
+ return 1
+ openhab2_is_installed
++ dpkg -s openhab2
++ grep --color=auto Status
++ cut '-d ' -f2
+ [[ '' =~ ^(install|hold)$ ]]
+ return 1

so you need to switch to milestone using the corresponding 4x option first.

I now used “41 openHAB Milestone Install or switch to the latest openHAB Milestone Build” but then canceled it during installation (not to break the whole setup) because I saw in the logs that it retrieves OH2 stuff, see recording

oh_set_to_milestone.txt (53.5 KB)

Can you tell me which menu entry exactly you are referring to, so I don’t misunderstand you? :pray:

PS: btw, if it would help to track down the issue more efficiently, I am happy to offer you a session/call between us.

that’s weird and the reason for OH3 not being detected as installed

Ensure you are on main branch and update openhabian-config on start then try again
with logging on. 41 milestone is the correct option.

All with the Firemot issue, also provide the above command outputs and try the update fix, eventually.

dpkg -s openhab

Package: openhab
Status: install ok installed
Priority: optional
Section: java
Installed-Size: 112411
Maintainer: https://community.openhab.org
Architecture: all
Source: openhab
Version: 3.4.4-2
Replaces: openhab2 (<< 3.0.0~)
Depends: adduser
Recommends: zip, unzip
Suggests: default-jre | java11-runtime | java11-runtime-headless
Breaks: openhab2 (<< 3.0.0~)
Conflicts: openhab2, openhab-runtime, openhab2-online, openhab2-offline
Conffiles:
 /etc/default/openhab a792803febd6308aa964bd1830c920c7
 /etc/profile.d/openhab.sh 15b9e8bd388eac8596feb055f335e71e
 /etc/openhab-cli/command-overrides.sh 8cd755c6f3b4ba095af80bc77c76e927
 /etc/openhab/rules/readme.txt f2780c3cb08c0cc211e70d1dd2b2af38
 /etc/openhab/icons/classic/readme.txt 011f31d40515c2fac27cced93642b105
 /etc/openhab/sounds/doorbell.mp3 70574f7e973f11bb455aede67937da85
 /etc/openhab/sounds/barking.mp3 cbec913d66083aef95c985138268d09f
 /etc/openhab/things/readme.txt b5f79f235cbd6b00988f2f55a64f1382
 /etc/openhab/transform/en.map f61a41a4e7ad91652408a0f97037f9d2
 /etc/openhab/transform/de.map cda3ddd36f115257078eba6591a11946
 /etc/openhab/transform/readme.txt 232ab644e3b46a7a635edd3ba62065e3
 /etc/openhab/items/readme.txt f9812990e58a5c7c6b6c20416e551c94
 /etc/openhab/persistence/readme.txt 8efee3cf25f59daf4ff1f13f5d9e5bcd
 /etc/openhab/services/addons.cfg 7cf20b604cefefa5dc39fe5405411800
 /etc/openhab/services/runtime.cfg 197fb8034df044f72c5cca2c3a634f88
 /etc/openhab/services/readme.txt cb77ecf2c8c08d77dd3a4112b784c065
 /etc/openhab/sitemaps/readme.txt 6e91a52ebe47eb41e1d0fa355521a80f
 /etc/openhab/html/index.html 4777d08e4312bb0c964fceadbe670625
 /etc/openhab/html/readme.txt 20c91c90ba105a0478219bfe026d2260
 /etc/openhab/scripts/readme.txt 69033952a19ce0d58630a2485dadffc4
 /var/lib/openhab/etc/users.properties 805b7f0597b49f522663ccf052ca5c4d
 /var/lib/openhab/etc/org.ops4j.pax.logging.cfg e32d03d5faa08ee147f7b262dbead148
 /var/lib/openhab/etc/log4j2.xml cf79edb74d784c1649af9cea80833028
 /var/lib/openhab/etc/shell.init.script 8468362135a22053da687ddd1b6acc48
 /var/lib/openhab/etc/java.util.logging.properties adb9f5b39047b64b12a6dc4834afc76e
 /var/lib/openhab/etc/scripts/shell.completion.script ac0e1a959777126397265ed304c8fe5c
 /var/lib/openhab/etc/scripts/shell.colors.script 00a54900d8a1fe0bdc83f8d719938ce8
 /var/lib/openhab/etc/keystore 936040b89edd5ef52bbe60b4250ad05e
 /var/lib/openhab/etc/org.ops4j.pax.web.cfg 3afafbfbbd3abf44e3f1b3b0d21034bd
 /var/lib/openhab/etc/org.openhab.voice.cfg a1ecde6c004db8ac15a47ea2600e3a6c
 /var/lib/openhab/etc/equinox-debug.properties 383caa00ead275df972aaf251bea6b11
 /var/lib/openhab/etc/org.openhab.audio.cfg 767b9bf993fa6c74ac5a90758d92a026
 /var/lib/openhab/etc/keys.properties 5ee372301f22fad02165bad62d3d2149
Description: openhab
 Linux installation package for openHAB.
Homepage: www.openhab.org

openhab-cli info

openhabian@openhabian:~ $ openhab-cli info

Version:     3.4.4 (Build)

User:        openhab (Active Process 59358)
User Groups: openhab tty dialout audio bluetooth gpio

Directories: Folder Name      | Path                        | User:Group
             -----------      | ----                        | ----------
             OPENHAB_HOME     | /usr/share/openhab          | openhab:openhab
             OPENHAB_RUNTIME  | /usr/share/openhab/runtime  | openhab:openhab
             OPENHAB_USERDATA | /var/lib/openhab            | openhab:openhab
             OPENHAB_CONF     | /etc/openhab                | openhab:openhab
             OPENHAB_LOGDIR   | /var/log/openhab            | openhab:openhabian
             OPENHAB_BACKUPS  | /var/lib/openhab/backups    | openhab:openhab

URLs:        http://192.168.178.153:8080
             https://192.168.178.153:8443

Branch: → Selected Main on 01

I am now on

which is weird compared to above because above I was on the 5th of June, now I am back on the 4th of June! :man_shrugging:

Selected 02 → just to be sure

and ONLY NOW it is retrieving 4.0.0 m3

Get:1 JFrog testing/main arm64 openhab all 4.0.0~M3-1 [103 MB]

and the result I am indeed on

Which I don’t understand why?!Maybe because the openhabian-config version has changed (see above)?

cheers
Stefan

I will cleanly install the system tomorrow from scratch and try again to reproduce it, I guess.

Your dkpg produced a different output than mine w.r.t. the version check.
I adjusted the code again.

Given there’s newer Raspi OS, I’ve also built a new image.
Please try with this one:

1 Like

Ok, downloaded it and currently installing. I will tell you tomorrow, how it went.

UPDATE:

So, installed that version and it directly comes up with openHAB 4 M3

The only thing that isn’t completely right is the intro message, I guess:

openHAB () under the logo

and the fact that it wants to read something in openHAB2

sed: can’t read /var/lib/openhab2/etc/version.properties: No such file or directory

openhabian config says

openHABian Configuration Tool — [main]{2023-06-08T21:18:26+02:00}(dd99ed3)

Note hat

dpkg -s ‘openhab’ 2>/dev/null | grep Config-Version
still delivers an empty result

The branch is set to

I wonder if this setting still makes sense (downgrade to OH 2)

I haven’t done anything additionally, so let me know if should provide you with more information before I update to the snapshot

Edit ~/.bash_profile the line that sets OHPKG so it reads
if openhab2_is_installed; then OHPKG="openhab2"; else OHPKG="openhab"; fi

It needs to be Version not Config-Version.
What do the code lines in /opt/openhabian/functions/helpers.bash look like for this on your system ?

1 Like

I replaced

if openhab3_is_installed; then OHPKG=“openhab”; else OHPKG=“openhab2”; fi

to

if openhab2_is_installed; then OHPKG=“openhab2”; else OHPKG=“openhab”; fi

and then logged out and in again. Result looks good

dpkg -s ‘openhab’ 2>/dev/null | grep Version
still an empty result

sudo dpkg-query -l | grep openhab
ii openhab 4.0.0~M3-1 all openhab
ii openhab-addons 4.0.0~M3-1 all openhab-addons

Note that openhabian-config has changed its version again (you may know but I just want you to tell which version I am on)

openHABian Configuration Tool — [main]{2023-06-09T09:26:20+02:00}(fea501d)

I think this is what you are looking for

## Function to check if openHAB is running on the current system. Returns
## 0 / true if openHAB is running and 1 / false if not.
##
##    openhab_is_running()
##
openhab_is_running() {
  if openhab_is_installed && [[ $(systemctl is-active openhab) == "active" ]]; then return 0; else return 1; fi
}

## Functions to check it a given supported program is installed should be placed below here

## Function to check if openHAB 2 is installed on the current system. Returns
## 0 / true if openHAB is installed and 1 / false if not.
##
##    openhab2_is_installed()
##
openhab2_is_installed() {
  if [[ $(dpkg -s 'openhab2' 2> /dev/null | grep Status | cut -d' ' -f2) =~ ^(install|hold)$ ]]; then return 0; else return 1; fi
}
## Function to check if openHAB 3 is installed on the current system. Returns
## 0 / true if openHAB is installed and 1 / false if not.
##
##    openhab3_is_installed()
##
openhab3_is_installed() {
  #if [[ $(dpkg -s 'openhab' 2> /dev/null | grep Status | cut -d' ' -f2) =~ ^(install|hold)$ ]]; then return 0; else return 1; fi
  #if [[ $(dpkg -s 'openhab' 2> /dev/null | grep Config-Version | cut -d ' ' -f2 | cut -d '.' -f1) = 3 ]]; then return 0; else return 1; fi
  if [[ $(dpkg -s 'openhab' 2> /dev/null | egrep '^Version' | cut -d ' ' -f2 | cut -d '.' -f1) = 3 ]]; then return 0; else return 1; fi
}
## Function to check if openHAB is installed on the current system. Returns
## 0 / true if openHAB is installed and 1 / false if not.
##
##    openhab_is_installed()
##
openhab4_is_installed() {
  if [[ $(dpkg -s 'openhab' 2> /dev/null | egrep '^Version' | cut -d ' ' -f2 | cut -d '.' -f1) = 4 ]]; then return 0; else return 1; fi
}
## Function to check if openHAB is installed on the current system. Returns
## 0 / true if openHAB is installed and 1 / false if not.
##
##    openhab_is_installed()
##
openhab_is_installed() {
  if openhab2_is_installed || openhab3_is_installed || openhab4_is_installed; then return 0; else return 1; fi
}

Here is the full file, just in case:
helpers.bash.txt (21.7 KB)

Hi, I just have a question.
MAybe someone can help me.
I’m currently running Openhab 3.4.4 on a “older” openhabian installation.
Now I’m thinking of doing a new installation of openhabian 1.8 (mainly in order to move to a new software platform (bulls eye))

So the question is:
If I install openhabian 1.8 on a new hardware and I create a Openhab 3.4.4 Backup on my productive system,
can I restore the 3.4.4 backup on a new openhabiab 1.8 / Openhab 4.0 system?

Of course I have to change/adapt all my system settings e.g cronjobs, backups, monitoring on the new system.
I would assume there’s no other possibility to upgrade the current system to openhabian 1.8 and Openhab 4.0?

Thank you in advance!

1 Like

Generally the answer is no. You should match the version from the backup to the version of OH it’s being restored on. However, with the new upgrade tool I don’t know if the answer is still yes.

But the general process would be to have openHABian install 3.4.4 on the new system first, restore the backup, and then upgrade OH to 4.0. That ensures that all the automated upgrade steps between the two happen. There are a lot of changes that can take place behind the scenes that apt and the upgrade tool handle for you above and beyond the stuff you typically deal with like Things, Items, et al.

1 Like

I missed this when I tried to be a guinea pig for an earlier openHAB 4 release, which is probably why I encountered a number of problems that I gave up trying to resolve, both because it was consuming time of the developers and because it stopped being fun for me. I’m going to try again when the next Milestone comes out, and will follow this progression. It was nice to clean up and modernize my basic openhabian.

Anyone to read this and to perform the upgrade ahead of OH4 release, please help with documenting the upgrade process and write a wrap up of the required steps.
No lengthy descriptions of your system just mention the Dos and Don’ts, which openHABian menus you chose in what order. If you try menu 03 you must not be on release as that obviously isn’t available yet. Also check java --version OH4 requires JDK17 there’s a 4x menu to install Java but I don’t know if it also gets installed as part of dependencies or some such.
I’d like to have a tested upgrade script that we can make available to anyone as part of the OH4 release notes.
The more testers the better as the upgrade process heavily depends on the state your system is in which is something developers including myself don’t know and cannot test or simulate.
So please join the community effort.
Thank you.

1 Like

2 posts were split to a new topic: OH4 install issues

Hi,

I tried to install JAVA 17 on my testsystem in order to prepare it for a OH4.0.0M3 Update:

openhabian@homesrv5:~ $ java --version
openjdk 11.0.9 2020-10-20 LTS
OpenJDK Runtime Environment Zulu11.43+88-CA (build 11.0.9+11-LTS)
OpenJDK Client VM Zulu11.43+88-CA (build 11.0.9+11-LTS, mixed mode)

openhabian@homesrv5:~ $ uname -a
Linux homesrv5 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l GNU/Linux

cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Installation with openhabian-config failed with the following error:

2023-06-29_11:12:36_CEST [openHABian] Checking for root privileges... OK
2023-06-29_11:12:36_CEST [openHABian] Loading configuration file '/etc/openhabian.conf'... OK
2023-06-29_11:12:36_CEST [openHABian] openHABian configuration tool version: [openHAB3]{2023-05-25T01:23:54-05:00}(606c74a)
2023-06-29_11:12:36_CEST [openHABian] Checking for changes in origin branch openHAB3... Updates available... UPDATING
2023-06-29_11:12:40_CEST [openHABian] Updating myself... mv: der Aufruf von stat für '/opt/openhabian/docs/NEWS.md' ist nicht möglich: Datei oder Verzeichnis nicht gefunden
OK - Commit history (oldest to newest):

2472b1a - no ExitOOM java opt (vor 2 Stunden) <Markus Storm> E
 functions/openhab.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

openHABian configuration tool successfully updated.
Visit the development repository for more details: https://github.com/openhab/openhabian
The tool will now restart to load the updates... OK
2023-06-29_11:12:41_CEST [openHABian] Checking for root privileges... OK
2023-06-29_11:12:42_CEST [openHABian] Loading configuration file '/etc/openhabian.conf'... OK
2023-06-29_11:12:42_CEST [openHABian] openHABian configuration tool version: [openHAB3]{2023-06-29T08:55:48+02:00}(2472b1a)
2023-06-29_11:12:42_CEST [openHABian] Checking for changes in origin branch openHAB3... OK
2023-06-29_11:12:46_CEST [openHABian] Switching to branch openHAB3... OK
2023-06-29_11:12:46_CEST [openHABian] Adding slightly tuned bash configuration files to system... OK
2023-06-29_11:13:15_CEST [openHABian] Updating Linux package information... OK
2023-06-29_11:13:18_CEST [openHABian] Fetching OpenJDK 17... FAILED
2023-06-29_11:13:22_CEST [openHABian] Installing OpenJDK 17... FAILED
2023-06-29_11:13:37_CEST [openHABian] Checking for default openHABian username:password combination... OK
2023-06-29_11:13:37_CEST [openHABian] We hope you got what you came for! See you again soon ;)

Any idea how to solve it?

When asking for help, you need to provide at least the minimum of information:
enable openhabian debug mode
explain what you did. which menu option did you use ?

Greetings Markus,

I successfully installed OH4 using openhabian v1.8 -32 bit image on a RaspberryPI4 2GB

(openhabian-pi-raspios32-202306251506-gitb1e94d8-crc6a90b686.img.xz)

I am still running OH2 on my old rpi3b :smiley: but looking forward to migrating everything to OH4.

Cheers!

With an ‘empty’ OH config you mean ? Or did you manage to migrate yours ?

Well then you have to take care of all the potential issues in migration OH2->3 prior to (or in addition to) the migration from 3 to 4. As 2-> involves openHABian specific changes, if you want to keep your system I suggest you make it two migration steps.

Thank you. I decided to start 100% fresh and do things in accordance with latest guidance and set everything up from the start. Currently I have nothing :slight_smile: just working on getting the Airquality binding working and then i will start with some of the rest.

I just want to gain some familiarity and running on SD card for now, but want to run on SSD like my other setup, so I don’t want to get too far along until I clean up my architecture.