Zigbee and zwave manual install script

Yep, I tried that and it kicked back a bunch more:

zzManualInstaller.sh: line 1: $’\r’: command not found
zzManualInstaller.sh: line 2: $’\r’: command not found
zzManualInstaller.sh: line 3: $’\r’: command not found
zzManualInstaller.sh: line 4: $’\r’: command not found
zzManualInstaller.sh: line 5: $’\r’: command not found
zzManualInstaller.sh: line 6: $’\r’: command not found
zzManualInstaller.sh: line 7: html: No such file or directory
zzManualInstaller.sh: line 8: head: No such file or directory
zzManualInstaller.sh: line 9: meta: No such file or directory
zzManualInstaller.sh: line 10: link: No such file or directory
zzManualInstaller.sh: line 11: link: No such file or directory
zzManualInstaller.sh: line 12: link: No such file or directory
zzManualInstaller.sh: line 13: link: No such file or directory
zzManualInstaller.sh: line 14: link: No such file or directory
zzManualInstaller.sh: line 15: link: No such file or directory
zzManualInstaller.sh: line 16: link: No such file or directory
zzManualInstaller.sh: line 17: $’\r’: command not found
zzManualInstaller.sh: line 18: $’\r’: command not found
zzManualInstaller.sh: line 19: $’\r’: command not found
zzManualInstaller.sh: line 20: link: No such file or directory
zzManualInstaller.sh: line 21: link: No such file or directory
zzManualInstaller.sh: line 22: $’\r’: command not found
zzManualInstaller.sh: line 23: $’\r’: command not found
zzManualInstaller.sh: line 24: link: No such file or directory
zzManualInstaller.sh: line 25: $’\r’: command not found
zzManualInstaller.sh: line 26: $’\r’: command not found
zzManualInstaller.sh: line 27: $’\r’: command not found
zzManualInstaller.sh: line 28: meta: No such file or directory
zzManualInstaller.sh: line 29: $’\r’: command not found
zzManualInstaller.sh: line 30: title: No such file or directory
zzManualInstaller.sh: line 31: meta: No such file or directory
zzManualInstaller.sh: line 32: link: No such file or directory
zzManualInstaller.sh: line 33: link: No such file or directory
zzManualInstaller.sh: line 34: meta: No such file or directory
zzManualInstaller.sh: line 35: $’\r’: command not found
zzManualInstaller.sh: line 36: $’\r’: command not found
zzManualInstaller.sh: line 37: syntax error near unexpected token `<’

I think you may have issues in the file. Did you download a zip file from the repo? Or copy and paste from the web page. I’m thinking you did the latter, and it included some HTML. If you want to copy and paste, select the Raw option.

OMG I’m an idiot. Stand by…

Yes, I am embarrassed. It’s the simple things…Thanks for checking on me.

1 Like

I’m seeing a possible issue after upgrading the Zigbee binding, where the binding cannot start due to the serial port being in use. An OH restart resolved this.

Also, there are times, like when a build is running, that the jars downloaded are no good, and the script will timeout starting the binding. If this happens, look in the addons directory and check if the file sizes. What I was seeing were file sizes that were way too small, and all the same (182B). If they look odd, wait a bit and run the script again.

Hi there, do you think you could help me starting my xbee xstick USB key ?
Here is my problem:

Thanks !!

Hi @5iver
I´m having huge problems with your latest script for manual install/upgrade zigbee/z-wave… When trying to upgrade zigbee, this happens:

[09:49:22] openhabian@openHABianPi:/usr/share/openhab2/addons$ sudo -u openhab bash zzManualInstaller.sh

This script is capable of downloading and manually installing the latest development or snapshot builds of the Z-Wave and Zigbee bindings, and/or the openhab-transport-serial
feature. The script must reside inside the addons folder and be executed on the machine running OpenHAB. 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 installation
of the openhab-transport-serial feature. After using this script, you can uninstall the bindings by deleting their jars from addons, or you can use this script.

!!!!! If you have manually added the Zigbee or Z-Wave binding to your addons.cfg file, 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
#? 1
grep: ../conf/services/addons.cfg: No such file or directory


Zigbee binding: The OpenHAB snapshot binding will be downloaded, but Which libraries would you like to use?
!!!!! DO NOT select 'ZigBee Library snapshot' unless Chris has specifically instructed you to do so !!!!!
1) OpenHAB baseline (included in OpenHAB snapshot)
2) ZigBee Library release (pre-OpenHAB snapshot)
3) ZigBee Library snapshot (still in development)
4) Exit
#? 2


Note: the pre-OpenHAB snapshot Zigbee libraries may not yet be compatible with the current openHAB snapshot Zigbee binding
or bridges. Enter the requested version of the Zigbee libraries [clear field to exit]
[Use backspace to modify, enter to accept. The latest version is 1.1.10.] 1.1.10

     *****     SUMMARY     *****

Addons path: /usr/share/openhab2/addons
OpenHAB account: openhab
Requested action: Install or upgrade Zigbee binding
Current OpenHAB snapshot version:
Requested Zigbee version: ZigBee Library release (pre-OpenHAB snapshot)
Requested Zigbee library version: 1.1.10

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

Uninstalling any managed binding(s) and 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
... a 'No matching bundles' error mesage is normal, if a binding had not been previously installed.

Backing up and uninstalling any unmanaged installs of Zigbee...
syntax error at (user-supplied code), near "."                  done.

Downloading new Zigbee jars... done.

Installing unmanaged Zigbee binding...

!!!!! It has taken more than two minutes to install the Zigbee binding, so exiting !!!!!

[09:57:19] openhabian@openHABianPi:/usr/share/openhab2/addons$

I get no lib files in the addons folder afterwards

Btw… I grapped a fresh copy of your script from the 19. january and used that for the above.

You’ve added openhab to sudoers… that’s not safe and is untested with the script. You appear to have permissions issues… try switching to the openhab account to run the script…

su openhab

If you get the same, you’ll need to provide what permissions are set in the addons directory. But nobody else has reported an issue, and I know some people using the script on using openhabian. So, it seems like there is something different about your setup.

Also, bintray has had some issues recently, which could have prevented you from being able to download the jars, but it appears to be back up now.

I’ve pushed an update that will compare the version of the script that you are running with the version in GH, and upgrade the script for you if different…

zzManualInstaller.sh

Added version check
Fixed addons.cfg check for apt installations
1 Like

I know there are something different on my system… I can´t SSH to openhab using openhab username/pw. I have to use openhabian.
But I can enter Karafe fine using openhab username/password. I have not got enough Linux knowledge to solve this issue or even how to search for it. This is probably not going to be fixed on my system, before I install a fresh copy of openhab 2.5, when it´s released, as I have given up trying to solve it.

But, you´re script has been working fine for several months even though I´ve had this issue. This is why I thought there was another change somewhere. which could be this…

I´m pretty sure this is the cause of the issue. I´ll give the script a new try one of these days, as I´m using 1.1.10 right now, and the latest is 1.1.11 as far as I know.

tried the script on a ubuntu 18.04 installation with the stable openhab2 packages (2.4.0) no good
couple of things

you are using the command “rename” which does not exist in bash, maybe use mv?

for some reason it is trying to access folders that do not exist for example it thinks my karaf installation is in
/usr/share/openhab2/userdata/etc
but it is actually in /var/lib/openhab2/etc/

I did my best to only use native commands… missed that one. I’ve changed this.

There is nothing in the script that is doing anything in /usr/share/openhab2/userdata/etc. For a repository installation, addons are in /usr/share/openhab2/addons/, and from there, the client console is located at ../runtime/bin/client. I assume you’re seeing errors when running the script… could you please post them?

as i’ve fixed my issue i’m reluctant to try it again on my production machine

ill install openhab on a fresh vm and test it for you tho and give you the errors I encounter


Uninstalling any managed binding(s) and 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
... a 'No matching bundles' error mesage is normal, if a binding had not been previously installed.

Backing up and uninstalling any unmanaged installs of Zigbee...
mv: cannot stat '*.jar': No such file or directory



!!!!! It has taken more than two minutes to uninstall the Zigbee binding, so exiting !!!!!


this is on a fresh ubuntu 18.10 server installation with zulu 8 jvm installed, no other software is installed on the vm

I used the current script from your github repo, the rename error is gone

Those errors are from the /runtime/bin/client script and others have reported them. They usually turn out to be account/permissions related. The script must be run by the account that runs OH, which is typically openhab, from the addons directory while OH is running. Could you show more of the output from the script, starting with command that was used to execute it?

Maybe drive space…

It’s probably time for me to get a repository installation setup :slightly_smiling_face:. Thank you for taking the time to help troubleshoot this!

I ran it as the openhab user

 sudo -u openhab ./zzManualInstaller.sh

there is plenty df free space on the disk

/dev/mapper/openhab2test--vg-root  8.9G  3.2G  5.2G  39% /


!!!!! If you have manually added the Zigbee or Z-Wave binding to your addons.cfg file, 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
#? 1


Zigbee binding: The OpenHAB snapshot binding will be downloaded, but Which libraries would you like to use?
!!!!! DO NOT select 'ZigBee Library snapshot' unless Chris has specifically instructed you to do so !!!!!
1) OpenHAB baseline (included in OpenHAB snapshot)
2) ZigBee Library release (pre-OpenHAB snapshot)
3) ZigBee Library snapshot (still in development)
4) Exit
#? 1

     *****     SUMMARY     *****

Addons path: /usr/share/openhab2/addons
OpenHAB account: openhab
Requested action: Install or upgrade Zigbee binding
Current OpenHAB snapshot version: 2.5.0
Requested Zigbee version: OpenHAB baseline (included in OpenHAB snapshot)
Requested Zigbee library version: 1.1.6

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

Uninstalling any managed binding(s) and 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
... a 'No matching bundles' error mesage is normal, if a binding had not been previously installed.

Backing up and uninstalling any unmanaged installs of Zigbee...
mv: cannot stat '*.jar': No such file or directory


!!!!! It has taken more than two minutes to uninstall the Zigbee binding, so exiting !!!!!

1 Like

Just one more bit of info for me to reproduce this… could you please run pwd from where you launched the script from?

/usr/share/openhab2/addons

1 Like

Hi, I get the same error.

sudo -u openhab ./zzManualInstaller.sh
Script version: 1.0.2

This script is capable of downloading and manually installing the latest development or snapshot builds of the Z-Wave and Zigbee bindings, and/or the openhab-transport-serial
feature. The script must reside inside the addons folder and be executed on the machine running OpenHAB. 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 installation
of the openhab-transport-serial feature. After using this script, you can uninstall the bindings by deleting their jars from addons, or you can use this script.

!!!!! If you have manually added the Zigbee or Z-Wave binding to your addons.cfg file, 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
#? 3


Z-Wave binding: Would you like to download the OpenHAB snapshot or development version?
!!!!! DO NOT select 'Development' unless Chris has specifically instructed you to do so !!!!!
1) OpenHAB snapshot
2) Development
3) Exit
#? 1


Zigbee binding: The OpenHAB snapshot binding will be downloaded, but Which libraries would you like to use?
!!!!! DO NOT select 'ZigBee Library snapshot' unless Chris has specifically instructed you to do so !!!!!
1) OpenHAB baseline (included in OpenHAB snapshot)
2) ZigBee Library release (pre-OpenHAB snapshot)
3) ZigBee Library snapshot (still in development)
4) Exit
#? 1

     *****     SUMMARY     *****

Addons path: /usr/share/openhab2/addons
OpenHAB account: openhab
Requested action: Install or upgrade both bindings
Current OpenHAB snapshot version: 2.5.0
Requested Z-Wave version: OpenHAB snapshot
Requested Zigbee version: OpenHAB baseline (included in OpenHAB snapshot)
Requested Zigbee library version: 1.1.6

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

Uninstalling any managed binding(s) and installing openhab-serial-transport...
mkdir: das Verzeichnis »/usr/share/openhab2/userdata/tmp“ kann nicht angelegt werden: Datei oder Verzeichnis nicht gefunden
KARAF_BASE is not valid: /usr/share/openhab2/userdata
... a 'No matching bundles' error mesage is normal, if a binding had not been previously installed.

Backing up and uninstalling any unmanaged installs of Zigbee...
mv: Aufruf von stat für '*.jar' nicht möglich: Datei oder Verzeichnis nicht gefunden

Backing up and uninstalling any unmanaged installs of Z-Wave...
mv: Aufruf von stat für '*.jar' nicht möglich: Datei oder Verze done. nicht gefunden


!!!!! It has taken more than two minutes to uninstall the Zigbee binding, so exiting !!!!!

pwd

/usr/share/openhab2/addons

Disk Space via df

/dev/mapper/System-Root    51475068   30299464   18576452   62% /

ls -la

drwxr-xr-x 3 openhab openhab  4096 Apr  3 22:40 .
drwxr-xr-x 4 openhab openhab  4096 Mär 26 00:08 ..
drwxr-xr-x 4 openhab openhab  4096 Apr  3 22:21 archive
-rw-r--r-- 1 openhab openhab    70 Dez 17 09:01 README
-rwxr-xr-x 1 openhab openhab 35314 Apr  3 22:15 zzManualInstaller.sh

System Infos

Distributor ID: Ubuntu
Description:    Ubuntu 18.10
Release:        18.10
Codename:       cosmic

4.18.0-16-generic x86_64

java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

@SMHRambo and @Nozlaf, I setup a package installation and was able to use this to run the script…

sudo -E -u openhab bash zzManualInstaller.sh