Can not start Z-Wave binding: ZWaveBinding is not defined

Discussions about Z-Way software and Z-Wave technology in general
hightower
Posts: 6
Joined: 07 Mar 2015 16:49

Can not start Z-Wave binding: ZWaveBinding is not defined

Post by hightower » 07 Mar 2015 17:20

I Am trying to get raZberry working on an upgraded raspbmc installation, on raspberry pi.

No interfering references to ttyAMA0 from /etc/inittab or

Razberry hardware module is installed correctly (how can I test communication from command line?).

I have installed the z-wave software with "wget -q -O - razberry.z-wave.me/install | sudo bash".
Also tried v1.7.2 and v2.0.1-rc15. Same issue with all of them.

After installation, I used http port 8083 "ZWay Home automation UI > Preferences > Modules > Peripherals" to add Th ZWave module (Z-Wave binding), stating "/dev/ttyS0" for "Serial port to Z-Wave dongle".

When I reboot, I get this in /var/log/z-way-server.log:

[2015-03-07 15:16:26.017] [core] --- Starting module Z-Wave binding
[2015-03-07 15:16:26.155] [core] Notification: critical (z-wave): Can not start Z-Wave binding: ReferenceError: ZWaveBinding is not defined

What to do / where to look next?

I saw a post mentioning that ttyAMA0 may be configured incorrectly on raspbmc, can anyone help me re-configure correctly?

pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Can not start Z-Wave binding: ZWaveBinding is not define

Post by pz1 » 07 Mar 2015 17:33

hightower wrote:Th ZWave module (Z-Wave binding), stating "/dev/ttyS0" for "Serial port to Z-Wave dongle".
Use /dev/ttyAMA0 for RaZberry

hightower
Posts: 6
Joined: 07 Mar 2015 16:49

Re: Can not start Z-Wave binding: ZWaveBinding is not define

Post by hightower » 07 Mar 2015 18:31

I tried both /dev/ttyS0 and /dev/ttyAMA0, same result.
/dev/ttyS0 does not exist, so the problem is before communication...

I just tried this:
pi@raspbmc:/opt/z-way-server$ sudo /etc/init.d/z-way-server stop
Stopping z-way-server: done.
pi@raspbmc:/opt/z-way-server$ cd /opt/z-way-server
pi@raspbmc:/opt/z-way-server$ sudo ./z-way-server
./z-way-server: error while loading shared libraries: libzcommons.so: cannot open shared object file: No such file or directory

What shall I install to get libzcommons.so?

pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: Can not start Z-Wave binding: ZWaveBinding is not define

Post by pofs » 07 Mar 2015 22:48

It is a part of z-way distribution, so try to re-install it.

hightower
Posts: 6
Joined: 07 Mar 2015 16:49

Re: Can not start Z-Wave binding: ZWaveBinding is not define

Post by hightower » 08 Mar 2015 02:20

Same issue after umpteenth run of the install script. libzcommons.so is in /opt/z-way-server/libs, so it's probably just not having the correct environment setting for running the z-way-server binary in the shell causing the message.

Can I configure "debug logging" for the z-way-server, to find out what is going wrong when attempting to load the ZWave module?

Can I clean out all z-way configuration and start over from scratch, doing a vanilla install? I hadn't upgraded the raspbmc installation when first installing z-way.

What do I need to delete to accomplish that?

pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: Can not start Z-Wave binding: ZWaveBinding is not define

Post by pofs » 08 Mar 2015 14:19

Search the forum, you need to specify LD_LIBRARY_PATH when manually running z-way-server.

hightower
Posts: 6
Joined: 07 Mar 2015 16:49

Re: Can not start Z-Wave binding: ZWaveBinding is not define

Post by hightower » 08 Mar 2015 21:44

Ok, but I am really not interested in running z-way-server manually, I just tried it in an attempt to get more information pointing to the origin of my problem. The z-way-server keeps running when started as a server :-)

The ZWave module fails to load: Can not start Z-Wave binding: ReferenceError: ZWaveBinding is not defined :-(

I don't know how to debug why it fails to load!

Hints, tips, stuff to try will be appreciated!

BTW: I found another thread on the forum, that found /etc/init/ttyAMA0.conf starting a getty on /dev/ttyAMA0, so i commented that out.

I stopped the z-way-server and ran this script (from another post), which shows that the razberry module is present on /dev/ttyAMA0:
#!/bin/bash

# initialise
port=/dev/ttyAMA0

# set port
stty -F $port cs8 raw 115200

# test port
echo -ne "\x01\x03\x00\x07\xFB" >$port
a=($(xxd -p -l 12 -c 2 <$port))
b=$(printf %.d 0x${a[3]})

# evaluate
if [ "$b" = "327" ]; then
echo z-wave.me
fi

From /var/log/z-way-server.log:
[2015-03-08 01:19:06.821] [core] Loading module RoundRobinScenes from modules/RoundRobinScenes
[2015-03-08 01:19:06.827] [core] Executing script: /*** RoundRobinScenes Z-Way HA module ******************************************* ...
[2015-03-08 01:19:06.830] [core] Loading module ZWave from modules/ZWave
[2015-03-08 01:19:06.854] [core] Executing script: /*** Z-Wave Binding module ******************************************************** ...
[2015-03-08 01:19:06.883] [core] Instantiating module 2 from class ZWave
[2015-03-08 01:19:06.889] [core] --- Starting module Z-Wave binding
[2015-03-08 01:19:06.966] [core] Notification: critical (z-wave): Can not start Z-Wave binding: ReferenceError: ZWaveBinding is not defined
[2015-03-08 01:19:06.970] [core] Loading module ScheduledScene from modules/ScheduledScene

pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: Can not start Z-Wave binding: ZWaveBinding is not define

Post by pofs » 08 Mar 2015 21:52

You obviously have library load failure (probably because some dependency is missing). When started manually, z-way-server will print reason the module fails to load into console.

hightower
Posts: 6
Joined: 07 Mar 2015 16:49

Re: Can not start Z-Wave binding: ZWaveBinding is not define

Post by hightower » 10 Mar 2015 01:42

Obviously...

pi@raspbmc:/opt/z-way-server$ LD_LIBRARY_PATH=libs ./z-way-server
Z-Way version v2.0.0 from 2014-12-08 19:54:26 +0300 (build a064f5408850947aed035bc9170e1fa04f0fd2ec)
Looking for modules in ./modules
Module modenocean.so loaded
cURL 7.26.0 likely has DNS timeout bug. Please update cURL. Disabling sync DNS timeouts for now.
Module modhttp.so loaded
Failed to load module modzwave.so: libarchive.so.12: cannot open shared object file: No such file or directory
Module moddhs.so loaded
Module modhomekit.so loaded
Module modws.so loaded
Using default configuration file config.xml
...

So, libarchive12 seem to be missing on raspbmc.

So I did this:
sudo apt-get install libarchive12
/etc/init.d/z-way-server stop
/etc/init.d/z-way-server start

Now it works, my danfoss living connect thermostats are connected :-)

Thanks for all your help.

Chopper_Rob
Posts: 5
Joined: 07 Jan 2015 00:13

Re: Can not start Z-Wave binding: ZWaveBinding is not define

Post by Chopper_Rob » 24 Apr 2015 20:21

Thanks hightower, this fixed my issue.

Post Reply