Zigbee and zwave manual install script

I seem to be doing something wrong.

I’m trying to run:

sudo -u openhab bash /usr/share/openhab2/zzManualInstall.sh --ACTION zwave --ZWAVE_BRANCH development
Querying configuration parameters...
mkdir: cannot create directory ‘/home/archive’: Permission denied
mkdir: cannot create directory ‘/opt/openhab2-backup’: Permission denied
mkdir: cannot create directory ‘/home/archive’: Permission denied

Downloading latest jar...
mv: cannot stat '/opt/openhab2/userdata/logs/zwave/zwave.log': No such file or directory
cp: cannot stat '/opt/openhab2': No such file or directory
diff: /opt/openhab2: No such file or directory
diff: /home/archive/20181008_230008_openhab2_full/openhab2: No such file or directory

Full backup successful...

Next step is to remove unneeded files. Do you wish to continue?
1) Yes
2) No
#?

What am I doing wrong?

Is this the path where you have your addons ??
I believe the script should be place in the same folder where your addons are located.

1 Like
  1. You are running the backup_and_update.sh script.

  2. You should not select the Development Z-Wave branch, since it has been merged into Master. The discussion above with Chris was in regards to removing the option from the script.

  3. You are not following the instructions in the README.

It requires to be executed from the addons directory on the openHAB server, using the same account that runs openHAB.

@stephanSH, I’m replying here, to keep the Zigbee thread cleaner. I’ve gotten very little feedback on the script, so this is helpful. I’ve been using it successfully for a while, but recently I’ve noticed a couple of issues, likely from OH changes, and plan to clean them up. To address your concerns…

I’ll mention the requirement of curl in the readme, and maybe add a check in the script and message that curl is not installed. Although, I could also use wget. Is that installed by default?

I’m not sure what you meant by this, but assume the context was in the other thread. Are you using the script with arguments? I’ve only been using the menus.

This should not have happened, and does not occur for me. I’m specifically removing any old versions, as having more than one installed will cause a lot of issues. Were there any errors when the script ran?

This definitely should not have happened. I’m thinking the script may have had an error and did not complete. Did you get a message saying it completed successfully?

How are you adding it to the addons.cfg? TMK, this is not possible, but you could be adding the serial binding, which will also install the serial transport. This is what I’ve done, since I was tired of installing it after every OH upgrade (I use snapshots).

Hi scott, thanks for your detailed replies.
I am relatively new to OH so the script was a great help for me and I only wanted to help others with my notes:

  • curl is fine - great idea to add it to the readme. wget is installed by default in ubuntu server 18.04.1
  • following the readme section I thougt I had to insert this value (1.1.7) in the script so chris helped me with the actual version and I thought others might be interested. I used the script with menus but changed that value before
  • the necessity for removal might be explained by the installation of the zigbee binding through PaperUI. I had one error (unfortunately I don’t remember exactly) but the script continued and afterwards it gave me a “completely successful” so I was just happy:-)
  • I added binding = serial1 in the addons.cfg - so after your explanation this is probably the binding. For me it had the same effect as the karaf command

I also use snapshots - but my actual problem is that the mqtt binding is updated which means a lot of work to change many item, but that is another topic…

Glad it helped! And thank you for the feedback. I haven’t heard much, so assumed nobody was using it, or it was working well. It’s worked fine for me until recently (the zwave binding gets upgraded but jasn’t been starting).

The current version should be read in from the repos. If you choose Development, this is displayed as the default, but can be changed…

Occasionally, the build servers are not accessible, or you could have an Internet issue. But I think when this happens, the script will error. The script wold benefit from more error checking, to at least message the user when there is a problem like this.

The script will remove manually installed jars, and bindings installed through Paper UI or Karaf. It sounds to me like the script was not able to get into Karaf when you ran it. This would have prevented the uninstall and installation of the serial transport. Is there anything peculiar to your setup? Are you sure you ran it with the account that runs OH, and entered the correct password?

The older mqtt binding is still available. If you have modified the binding line in addons.cfg, you’ll need to change it to mqtt1.

I believe many had used the scripts as chris had recommended them several times to solve problems. I don’t use zwave - so I had no problems.

great hint for future uses

That might have been the problem… I used it with sudo bash -u openhab …

Yes, I found it, but I don’t believe there is further development in the future so I will have to change it in the future…

Hi @5iver
I´m trying to run your script on a new setup (new Rpi with only one binding running). I discovered I could use it to install the transport-serial-feature.
But I get this error (Karaf). And i can not see if the transport-serial feature got installed.

This script is capable of downloading and manually installing the latest developme                                                     nt or master branch builds of the Z-Wave and Zigbee bindings, and/or the openhab-t                                                     ransport-serial
feature. The script must reside inside the addons folder and be executed on the ma                                                     chine running OH. Before a binding is installed, any previous versions will be
uninstalled. Any manually installed versions will also be backed up by moving them                                                      to addons/archive. The installation of any binding will also include the installa                                                     tion
of the opemnhab-transport-serial feature. After using this script, you can uninsta                                                     ll the bindings by deleting their jars from addons or you can use this script.\033                                                     [0m

!!!!! If you have manually added the Zigbee or Z-Wave binding to your addons.cfg f                                                     ile, they must be removed from the file or the old version will reinstall !!!!!

What would you like to do?
1) Install or upgrade Zigbee binding
2) Install or upgrade Z-Wave binding
3) Install or upgrade both bindings
4) Install the openhab-transport-serial feature
5) Uninstall Zigbee binding
6) Uninstall Z-Wave binding
7) Uninstall both bindings
8) Exit
#? 4

     *****     SUMMARY     *****

Addons path: /usr/share/openhab2/addons
OH account: openhab
Requested action: Install the openhab-transport-serial feature

Is this correct?
1) Yes, start now                      3) Exit
2) No, take me back to the first menu
#? 1

Installing openhab-serial-transport...
mkdir: cannot create directory ‘/usr/share/openhab2/userdata/tmp’: No such file or                                                      directory
KARAF_BASE is not valid: /usr/share/openhab2/userdata

Complete!

[12:11:25] openhabian@openHABianPi:/usr/share/openhab2/addons$

Sounds like your permissions may be an issue. How are you launching the script? Can you please try getting into Karaf using /usr/share/openhab2/runtime/bin/client?

1 Like

I really hate these permission issues in Linux :face_with_symbols_over_mouth:

I´m not sure how to do that or what you mean :frowning:
I normally enter Karaf by first entering a terminal using openhabian client. And the from the terminal using ssh -p 8101 openhab@localhost. From there I´m promted to write the pw for openhab, which works fine. And then I´m in Karaf.

Just enter the command from an openhabian terminal, instead of using ssh.

Ahh… I thought it was a path… Anyway… It´s working just fine:

[13:26:34] openhabian@openHABianPi:~$ /usr/share/openhab2/runtime/bin/client
Logging in as openhab

                          __  _____    ____
  ____  ____  ___  ____  / / / /   |  / __ )
 / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  |
/ /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ /
\____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/
    /_/                        2.4.0
                               Release Build

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown openHAB.

openhab>

OK… you can get into Karaf with the client script. How do you launch the script? Specifically, which account are you using?

Latest script, I´d grap a new copy the other day…

Launch it from terminal in /usr/share/openhab2/addons with:

sudo -u openhab bash zzManualInstaller.sh

@5iver does your wonder-script handle snapshot versions of the ZigBee libraries? If so, I might start to use this for test fixes/trials…

You can select snapshot or development. For both, it will install the snapshot binding (and bridges), and either the snapshot (from ci.openhab.org) or development (from Bintray) libraries. If development is selected, it will prompt for the version of the libraries that you want. For this prompt, it goes out and reads the latest version, and uses this value as the default (screenshot here).

Is this what you’re asking? I think what you are calling ‘snapshot versions of the Zigbee libraries’, the script calls the development version.

I’m not sure it’s what I’m asking :slight_smile: . To be clear, I’m talking about the Z-Smart Systems ZigBee libraries, not the binding.

I’m not really sure what the “development version” is… There are release versions (numbered 1.1.8, 1.1.9 etc) and there are snapshot versions (numbered 1.1.10-SNAPSHOT). If I remember correctly, the repository for the snapshot versions is different to the release version (it’s just the way Bintray handled snapshots).

I think (??) that what you are calling development libraries, are release versions, but not the ones in the openHAB target platform? If so, then we are talking different things…

(I hope that makes sense?).

Just the best term I could come up with to differentiate from what is available in the OH snapshots. At times, the version (at least the one I was aware of) of the libraries is newer than the one in the OH build, so development version seemed to fit. So there’s a snapshot, release, and the one in the OH snapshots…

You got it…

I should be able to add this as an option… just need a URL for the snapshot version. :slightly_smiling_face:

And we should decide on some more accurate names to use in the script. Release, prelease, and snapshot? Snapshot might lead people to think it’s the one in the OH snapshot though. Maybe snapshot, staging, and development?

Well, formally, there are only release and snapshot versions, so I would keep it at this. However, there are three options -:

  • OpenHAB baseline
  • Latest ZigBee Library release
  • Latest ZigBee Library snapshot

I would prefer to avoid these names as I’m already confused. I think we just need to make it clear (if that’s possible :slight_smile: ) that we are talking about the libraries, or the binding. I think it we start coming up with other names like staging or development, it will be confusing as these don’t really exist. We should just treat the binding and libraries as separate entities (which they are).

If Install Zigbee Binding is selected, I’ll pop a new menu which will allow selection of the library version. How about…

OpenHAB baseline (included in OH snapshot)
Latest ZigBee Library release
Latest ZigBee Library snapshot

To confirm, these are the “Latest Zigbee Library snapshot” libraries? Last update on Dec 3?

https://oss.jfrog.org/artifactory/oss-snapshot-local/com/zsmartsystems/zigbee/