Tutorial: compiling open-zwave-control-panel


#21

@zakharm Awesome! Glad to hear it. Yeah this is why I asked about OZWCP documentation in my original reply on this thread. Intuitively you assume you should check the USB option since the controller is USB… but I guess not.

I would love to see a demonstration of how to actually use the control panel just to do simple stuff like adding, removing, and configuring devices. I have clicked around trying to do simple things like remove a device to see if I could then add it back but couldn’t get it to work. For instance I have tried highlighting a device (a zwave dimmer switch) selecting the remove node function, and then clicking the go button and I don’t recall seeing any kind of productive response in the terminal output or on the control panel other then the go button turning yellow. I still have more experimenting to do.


#22

Is anyone able to point me at the dockerfile for the current docker image. I would very much like to try re-compiling it for Arm as i would like to run it alongside my current HA image, without all the effort of having to install it on the bare metal?

Thanks

Gareth


#23

I think this is it:


#24

I agree. I had no problem getting the OZWCP up and running using the new RPI AIO Installer but I can’t figure out how to use the control panel. I’ve got my Sigma UZB working and identifying some sensors but I’m not sure what all of the configurations settings do. Ironically, when I search for instructions on how to use the CP all I find is how to compile it.


#25

I’m having problems compiling open-zwave-control-panel in Ubuntu 16.04. I had to change mktmp(…) to mkdtemp(…) since the compiler said mktmp is dangerous and told me to use either mkstmp or mkdtmp. And yes, libgnutls28-dev is installed in my server.

[email protected]:~/.src/open-zwave-control-panel$ make g++ -c -Wall -Wno-unknown-pragmas -Wno-inline -Werror -Wno-format -g -DDEBUG -ggdb -O0 -I ../open-zwave//cpp/src -I ../open-zwave//cpp/src/command_classes/ -I ../open-zwave//cpp/src/value_classes/ -I ../open-zwave//cpp/src/platform/ -I ../open-zwave//cpp/src/platform/unix -I ../open-zwave//cpp/tinyxml/ -I ../libmicrohttpd/src/include -o webserver.o webserver.cpp g++ -o ozwcp -g ozwcp.o webserver.o zwavelib.o ../open-zwave//libopenzwave.a -lgnutls /usr/local/lib/libmicrohttpd.a -pthread -ludev /usr/local/lib/libmicrohttpd.a(connection.o): In function `do_read': /home/grayson/.src/libmicrohttpd/src/daemon/connection.c:1501: undefined reference to `gnutls_strerror' /usr/local/lib/libmicrohttpd.a(connection.o): In function `do_write': /home/grayson/.src/libmicrohttpd/src/daemon/connection.c:1548: undefined reference to `gnutls_strerror' /usr/local/lib/libmicrohttpd.a(connection.o): In function `MHD_connection_get_pollfd': /home/grayson/.src/libmicrohttpd/src/daemon/connection.c:855: undefined reference to `gnutls_record_get_direction' /usr/local/lib/libmicrohttpd.a(connection.o): In function `MHD_get_connection_info': /home/grayson/.src/libmicrohttpd/src/daemon/connection.c:2401: undefined reference to `gnutls_cipher_get' /home/grayson/.src/libmicrohttpd/src/daemon/connection.c:2406: undefined reference to `gnutls_protocol_get_version' /usr/local/lib/libmicrohttpd.a(daemon.o): In function `parse_options_va': /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:1785: undefined reference to `gnutls_priority_deinit' /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:1786: undefined reference to `gnutls_priority_init' /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:1792: undefined reference to `gnutls_strerror' /usr/local/lib/libmicrohttpd.a(daemon.o): In function `recv_tls_adapter': /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:385: undefined reference to `gnutls_record_recv' /usr/local/lib/libmicrohttpd.a(daemon.o): In function `send_tls_adapter': /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:417: undefined reference to `gnutls_record_send' /usr/local/lib/libmicrohttpd.a(daemon.o): In function `MHD_cleanup_connections': /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:1171: undefined reference to `gnutls_deinit' /usr/local/lib/libmicrohttpd.a(daemon.o): In function `MHD_add_connection': /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:977: undefined reference to `gnutls_init' /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:978: undefined reference to `gnutls_priority_set' /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:984: undefined reference to `gnutls_credentials_set' /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:1008: undefined reference to `gnutls_transport_set_ptr' /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:1010: undefined reference to `gnutls_transport_set_pull_function' /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:1013: undefined reference to `gnutls_transport_set_push_function' /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:1018: undefined reference to `gnutls_certificate_server_set_request' /usr/local/lib/libmicrohttpd.a(daemon.o): In function `MHD_get_timeout': /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:1235: undefined reference to `gnutls_record_check_pending' /usr/local/lib/libmicrohttpd.a(daemon.o): In function `MHD_stop_daemon': /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:2585: undefined reference to `gnutls_priority_deinit' /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:2587: undefined reference to `gnutls_certificate_free_credentials' /usr/local/lib/libmicrohttpd.a(daemon.o): In function `MHD_start_daemon_va': /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:2439: undefined reference to `gnutls_priority_deinit' /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:1979: undefined reference to `gnutls_priority_init' /usr/local/lib/libmicrohttpd.a(daemon.o): In function `MHD_TLS_init': /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:484: undefined reference to `gnutls_certificate_allocate_credentials' /usr/local/lib/libmicrohttpd.a(daemon.o): In function `MHD_init_daemon_certificate': /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:443: undefined reference to `gnutls_certificate_set_x509_trust_mem' /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:461: undefined reference to `gnutls_certificate_set_x509_key_mem' /usr/local/lib/libmicrohttpd.a(daemon.o): In function `MHD_start_daemon_va': /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:2108: undefined reference to `gnutls_priority_deinit' /usr/local/lib/libmicrohttpd.a(daemon.o): In function `MHD_init': /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:2714: undefined reference to `gcry_control' /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:2715: undefined reference to `gnutls_global_init' /usr/local/lib/libmicrohttpd.a(daemon.o): In function `MHD_fini': /home/grayson/.src/libmicrohttpd/src/daemon/daemon.c:2726: undefined reference to `gnutls_global_deinit' /usr/local/lib/libmicrohttpd.a(connection_https.o): In function `MHD_tls_connection_handle_write': /home/grayson/.src/libmicrohttpd/src/daemon/connection_https.c:108: undefined reference to `gnutls_handshake' /usr/local/lib/libmicrohttpd.a(connection_https.o): In function `MHD_tls_connection_handle_read': /home/grayson/.src/libmicrohttpd/src/daemon/connection_https.c:62: undefined reference to `gnutls_handshake' /usr/local/lib/libmicrohttpd.a(connection_https.o): In function `MHD_tls_connection_handle_idle': /home/grayson/.src/libmicrohttpd/src/daemon/connection_https.c:167: undefined reference to `gnutls_record_check_pending' /home/grayson/.src/libmicrohttpd/src/daemon/connection_https.c:164: undefined reference to `gnutls_bye' collect2: error: ld returned 1 exit status Makefile:71: recipe for target 'ozwcp' failed make: *** [ozwcp] Error 1


#26

after finally getting ozwcp to compile, I had the same problem as those above, namely, the HID error. Turns out that the Aeon Gen5, while USB, should not use the “USB” checkbox. Thanks to those above who helped solve this!! Finally able to get it working!


#27

if u installing on pi, there are some lines in ur Makefile you need to change (/open-zwave-control-panel/Makefile)
the Make file is made for Mac, so you need to uncomment the linux build part and comment out the mac build part

hope this help


#28

If anybody else is running open-zwave-control-panel on a Raspberry Pi (or other Debian-based OS), and uses Ansible to manage it, you might find this Ansible role useful:

It’s mostly just copying the instructions that aceat64 posted up above, with some extra goodies, such as running as a non-root user, and systemd integration (which will automatically shut down the home assistant service to run ozwcp, if it’s been set up with https://github.com/mechaxl/ansible-homeassistant).

Check it out and feel free to star it on Github if you find it useful at all. Thanks!


#29

I need help with ozwcp on ubuntu. I think i did the setup correct, the make test was running “ok” on all tests. But how the hell do i start ozwcp?
On web i found sometime people starting it with sudo ./ozwcp -p 8888, but on my machine i only get command not found. Maybe i miss something, hopefully someone here can help me get it running.


#30

It’s in the open-zwave-control-panel directory after you “make” in it.


#31

@SnapETom something tells me if he can build ozwcp, he should know how to run the binary :wink: probably something else

FWIW for anyone reading this, you do not need to run it as root/sudo … and if you don’t specify the port, it will automatically pick one (8090 I think by default).


#32

For me it doesn’t work unless I run it as root.

I’m with everybody else who would like to know how to use it, now that it’s up and running.


#33

The ability to run it as a user other than root depends on that user being in the dialout group, or the Zwave device having permissions for anyone to read/write (ie. “chmod 666 /dev/ttyACM0”)


#34

I have followed the instructions here to the letter but am having trouble compiling owzcp.

[email protected]:~/open-zwave-control-panel $ make g++ -o ozwcp -g ozwcp.o webserver.o zwavelib.o ../open-zwave/libopenzwave.a -lgnutls /usr/local/lib/libmicrohttpd.a -pthread -framework IOKit -framework CoreFoundation -lresolv g++: error: IOKit: No such file or directory g++: error: CoreFoundation: No such file or directory g++: error: unrecognized command line option ‘-framework’ g++: error: unrecognized command line option ‘-framework’ Makefile:71: recipe for target 'ozwcp' failed make: *** [ozwcp] Error 1

Following the advice in the comments on the posts, I edited the Makefile to uncomment out the lines for Linux, but I get the same error above.

If I then comment out the lines for OS X as well, I get:

[email protected]:~/open-zwave-control-panel $ make
g++ -c -Wall -Wno-unknown-pragmas -Wno-inline -Wno-format -g -DDEBUG -ggdb -O0 -I ../open-zwave/cpp/src -I ../open-zwave/cpp/src/command_classes/ -I ../open-zwave/cpp/src/value_classes/ -I ../open-zwave/cpp/src/platform/ -I ../open-zwave/cpp/src/platform/unix -I ../open-zwave/cpp/tinyxml/ -I /usr/local/include/ -o ozwcp.o ozwcp.cpp
g++ -c -Wall -Wno-unknown-pragmas -Wno-inline -Wno-format -g -DDEBUG -ggdb -O0 -I ../open-zwave/cpp/src -I ../open-zwave/cpp/src/command_classes/ -I ../open-zwave/cpp/src/value_classes/ -I ../open-zwave/cpp/src/platform/ -I ../open-zwave/cpp/src/platform/unix -I ../open-zwave/cpp/tinyxml/ -I /usr/local/include/ -o webserver.o webserver.cpp
g++ -c -Wall -Wno-unknown-pragmas -Wno-inline -Wno-format -g -DDEBUG -ggdb -O0 -I ../open-zwave/cpp/src -I ../open-zwave/cpp/src/command_classes/ -I ../open-zwave/cpp/src/value_classes/ -I ../open-zwave/cpp/src/platform/ -I ../open-zwave/cpp/src/platform/unix -I ../open-zwave/cpp/tinyxml/ -I /usr/local/include/ -o zwavelib.o zwavelib.cpp
g++ -o ozwcp -g ozwcp.o webserver.o zwavelib.o ../open-zwave/libopenzwave.a  /usr/local/lib/libmicrohttpd.a -pthread -ludev -lresolv
webserver.o: In function `Webserver::SendTopoResponse(MHD_Connection*, char const*, char const*, char const*, char const*)':
/home/pi/open-zwave-control-panel/webserver.cpp:338: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'

Any advice? This is on a RPi3


#35

I think it built - You do have to uncomment the Linux lines and comment out the OS X lines. I only see a warning in the second output, not an error.


#36

You are correct, sorry it has been a while since I used Linux.


#37

Man I am confused. The All In One installation says it installs open-zwave control panel but I can’t find it for the life of me.

Do I have to install it myself or is the documentation correct that it is installed with the RPI AIO ?


#38

As mentioned here:

To launch the OZWCP web application:

  • Make sure Home Assistant is not running! So stop that first
  • Login to Raspberry Pi ssh [email protected]_raspberry_pi_ip
  • Change to the ozwcp directory cd /srv/homeassistant/src/open-zwave-control-panel/
  • Launch the control panel sudo ./ozwcp -p 8888
  • Open a web browser to http://your_pi_ip:8888
  • Specify your zwave controller, for example /dev/ttyACM0 and hit initialize

#39

Thanks, sorry if I missed some of this stuff. I am just getting confused by posts with inacurate information mixed with posts with more current accurate data. Newbie but starting to get it, haha

How do I Stop HASS first. When I installed AIO it is running but the service isn’t installed. So I don’t follow how it is set up. The stop command results in the following.

Failed to stop [email protected]: Unit [email protected] not loaded.

I think it has something to do with HASS running in the virtual environment by default with AIO install but I haven’t figured out how it is controlled.

UPDATE: Never mind, found the correct command.

sudo systemctl stop home-assistant.service


#40

I tried many times, still not working. Please see below