|
Post by papa on Nov 17, 2023 16:26:24 GMT
Introduction A couple years ago, I installed Linux & openHAB 3 on an older laptop (See here.) When things are going OK, I generally let them run. This is especially true with Linux which I only use for openHAB & Arduino IDE. When one is unfamiliar with something, trying to fix one problem can lead to other problems. Other than Linux bugging me about updating, the system had been working well. Then a few months ago, my gateways starting losing connection with the MQTT broker (Mosquitto). A Linux reboot & a manual correction of one variable took care of things. However that disconnect problem began reoccurring every month or so. The problem & fix were a little annoying, but could be more serious when I was away from the computer & could not reboot it. The following describes how I tried to fix the problem, how the "fix" did cause (worse) problems, & how I recovered openHAB (I think). Next: The Problematic Fix
|
|
|
Post by papa on Nov 17, 2023 16:36:30 GMT
The Problematic Fix
As I said, Linux had bugged me about updating, so I gave that a try in Linux terminal:
The result was openHAB was broken. I could not get the openHAB interface in my browser. The openHAB log showed many errors.
What Went Wrong?
Linux upgraded openHAB along with the rest of the installs. Since I had not instructed Linux otherwise, it upgraded my openHAB 3 to the latest openHAB version, an early version of a major upgrade: openHAB 4. According to my research, openHAB 4 is not that reliable yet. Moreover it requires Java 17 not Java 11 as before.
Next: How I Recovered OpenHAB
|
|
|
Post by papa on Nov 17, 2023 16:49:18 GMT
How I Recovered OpenHAB More research suggested downgrading openHAB to a more stable (& compatible) version. Preliminary precaution: As shown here, I did a backup of my openHAB configuration. Using Linux Terminal, I followed the downgrading directions in the official openHAB docs:
apt-cache showpkg openhab showed several available versions from openHAB 3.0.0-1 to openHAB 4.0.0-1. Before openHAB 4.0.0-1 were versions 3.4.4-2 & 3.4.4-1
In Linux Terminal, I executed sudo apt-get install openhab=3.4.4-1 The results in Linux Terminal: Next: Java 17 ?? & a Working OpenHAB
|
|
|
Post by papa on Nov 17, 2023 19:36:50 GMT
Java 17 ?? & a Working OpenHAB
From the Terminal message just above, I thought, "Oh, I must install Java 17." I tried to install the recommended Zulu 17. I was told that there is no version for my machine. Before I tried another flavor of Java 17, I tried to raise the openHAB interface on my browser. Yay, after the openHAB downgrade, everything seems to be working fine. For now, I did not further try to upgrade to Java 17.
Bottom Line Thoughts
In doing typical Linux updates, openHAB will also be "upgraded," possibly to a broken condition. As shown above, downgrading to a previous openHAB version may fix the problem.
Did my upgrading Linux & openHAB fix the original problem (Gateways disconnecting from the MQTT broker)? I'll be watching to see
|
|
|
Post by papa on Nov 18, 2023 20:04:22 GMT
Followup According to this post & its thread, the warning about Java 17 is wrong. Java 11 is still OK for OpenHAB 3.
Seems like Java 17 might mostly work with openHAB 3, but cause some problems.
Next: A Different Approach
|
|
|
Post by papa on Dec 23, 2023 21:17:46 GMT
A Different Approach Avoid an Update of OpenHAB Until We're Ready
As said earlier, I only use Linux for openHAB & Arduino IDE. So I learn more about Linux when I need it. I researched how to update Linux, but avoid updating certain packages. This site gave several methods to prevent updating of a specific package. I used only the first method, dpkg. See the following ways to use dpkg.
Put a package on hold: echo "<package-name> hold" | sudo dpkg --set-selections
Remove the hold: echo "<package-name> install" | sudo dpkg --set-selections
Display the status of all your packages: dpkg --get-selections
Display the status of a single package: dpkg --get-selections <package-name>
Show all packages on hold: dpkg --get-selections | grep "\<hold$"
Next: Using dpkg with OpenHAB
|
|
|
Post by papa on Dec 23, 2023 21:25:09 GMT
Using dpkg with OpenHAB Preliminary precaution: As shown here, do a backup of the openHAB configuration. Display the Status of openHAB (install latest update)
[terminal command:] dpkg --get-selections openhab [result:] openhab install Command openHAB to hold at it's current version
[terminal command:] echo "openhab hold" | sudo dpkg --set-selections [enter Linux password] Display the Status of openHAB (hold, don't update)
[terminal command:] dpkg --get-selections openhab [result:] openhab hold Display All Packages on Hold
[terminal command:] dpkg --get-selections | grep "\<hold$" [result:] openhab hold Next: Update Linux without Breaking OpenHAB
|
|
|
Post by papa on Dec 23, 2023 21:29:13 GMT
Update Linux without Breaking OpenHAB Terminal Commands:
sudo apt-get update sudo apt-get upgrade The result from the hold was openHAB was working fine. I could get the openHAB interface in my browser. Disadvantage: We miss any updates in openHAB 3. The method in this post could update Linux & the latest openHAB 3 version without breaking openHAB
|
|