OpenZWave / open-zwave-control-panel

UNMAINTAINED - We are looking for someone to maintain ozwcp! The OpenZWave Control Panel (ozwcp for short) is an application built on the OpenZWave library that permits users to query, manage and monitor Z-Wave nodes and networks. It provides a web based user interface using AJAX principles.
Other
131 stars 72 forks source link

OZWCP as an API layer over OpenZWave #44

Closed rbaindourov closed 8 years ago

rbaindourov commented 8 years ago

Hi Guys!

Again, let me just say thanks for your hard work.

My demo of your control panel went so well this morning, that I have 2 days to modify it to be an API that I can poll data from!

We have our own UI that keeps track of history of device telemtry and helps visualize it. Planning to use this as the dashboard for a project where we wire up smart building.

I need advice on how to use the existing ozwcp code, and make modifications to it, so it functions as an API.

Now I know you mentioned that the front end is all AJAX. So that gives me hope that most of my work is done, and I just need to discover the RESTful end points.

Basically I need to poll for new devices, and then poll those devices for data, and status and I am planning to do this via OZWCP software. The PI and ZStick will basically be the gateway to my sensor network. For that reason, I will probably hard code things like the serial port, and initiliaze the zstick on server start up.

Can you guys maybe point me to some useful places in the code, or docs, or any advice at all really? I don't know, maybe there is an example in the open-zwave that does this already, exposes it as an Web Service?

Thanks.

mouni-sri commented 7 years ago

Hi rbaindourov,

I Tried to compile your code and run on beaglebone black using ./ozwcp -d -p . After executing this number i get an error saying cannot open serial port and later one more error is failed to open serial port.

2017-07-31 13:32:57.610 Always, OpenZwave Version 1.4.2692 Starting Up 2017-07-31 13:32:57.619 Info, Setting Up Provided Network Key for Secure Communications 2017-07-31 13:32:57.622 Warning, Failed - Network Key Not Set 2017-07-31 13:32:57.625 Info, mgr, Added driver for controller ��CF N�F M�F~D��V�}Dv� �= 2017-07-31 13:32:57.630 Info, Opening controller ��CF N�F M�F~D��V�}Dv� �= 2017-07-31 13:32:57.634 Info, Trying to open serial port ��CF N�F M�F~D��V�}Dv� �= (attempt 1) 2017-07-31 13:32:57.638 Error, ERROR: Cannot open serial port ��CF N�F M�F~D��V�}Dv� �=. Error code 2 2017-07-31 13:32:57.640 Error, ERROR: Failed to open serial port ��CF N�F M�F~D��V�}Dv� �= 2017-07-31 13:32:57.642 Warning, WARNING: Failed to init the controller (attempt 0) 2017-07-31 13:33:02.644 Info, Opening controller ��CF N�F M�F~D��V�}Dv� �= 2017-07-31 13:33:03.275 Info, Trying to open serial port ��CF N�F M�F~D��V�}Dv� �= (attempt 1) 2017-07-31 13:33:03.276 Error, ERROR: Cannot open serial port ��CF N�F M�F~D��V�}Dv� �=. Error code 2 2017-07-31 13:33:03.276 Error, ERROR: Failed to open serial port ��CF N�F M�F~D��V�}Dv� �= 2017-07-31 13:33:03.276 Warning, WARNING: Failed to init the controller (attempt 1) 2017-07-31 13:33:08.277 Info, Opening controller ��CF N�F M�F~D��V�}Dv� �= 2017-07-31 13:33:08.445 Info, Trying to open serial port ��CF N�F M�F~D��V�}Dv� �= (attempt 1) 2017-07-31 13:33:08.446 Error, ERROR: Cannot open serial port ��CF N�F M�F~D��V�}Dv� �=. Error code 2 2017-07-31 13:33:08.446 Error, ERROR: Failed to open serial port ��CF N�F M�F~D��V�}Dv� �= 2017-07-31 13:33:08.446 Warning, WARNING: Failed to init the controller (attempt 2) 2017-07-31 13:33:13.447 Info, Opening controller ��CF N�F M�F~D��V�}Dv� �= 2017-07-31 13:33:13.448 Info, Trying to open serial port ��CF N�F M�F~D��V�}Dv� �= (attempt 1) 2017-07-31 13:33:13.448 Error, ERROR: Cannot open serial port ��CF N�F M�F~D��V�}Dv� �=. Error code 2 2017-07-31 13:33:13.451 Error, ERROR: Failed to open serial port ��CF N�F M�F~D��V�}Dv� �= 2017-07-31 13:33:13.469 Warning, WARNING: Failed to init the controller (attempt 3) 2017-07-31 13:33:18.472 Info, Opening controller ��CF N�F M�F~D��V�}Dv� �= 2017-07-31 13:33:18.477 Info, Trying to open serial port ��CF N�F M�F~D��V�}Dv� �= (attempt 1) 2017-07-31 13:33:18.483 Error, ERROR: Cannot open serial port ��CF N�F M�F~D��V�}Dv� �=. Error code 2 2017-07-31 13:33:18.485 Error, ERROR: Failed to open serial port ��CF N�F M�F~D��V�}Dv� �= 2017-07-31 13:33:18.487 Warning, WARNING: Failed to init the controller (attempt 4) 2017-07-31 13:33:18.489 Detail, contrlr, Notification: DriverFailed 2017-07-31 13:33:18.491 Info, Notification: type DriverFailed:19 home 00000000 node 255 genre 0 class 0 instance 0 index 0 type 0 m_byte 0 PLease help me with this.

daradib commented 7 years ago

Try adding your user to the group that owns the serial port. For example:

sudo adduser myusername dialout

Replace myusername with your username and then logout/login.