Popular Content

Showing most liked content since 12/17/17 in all areas

  1. 1 like
    Hi, I just want to share some of my experiences with setting up and running the WZWave-library for the first time on a Linux machine. I think Dan is working on a "Linux Setup"-guide, just as his current "Mac Setup"-guide, in the meantime this short post just might get you going, I'm running Ubuntu but I think its applicable on any distribution. 1. First install Java JDK, if not already installed. I'm running Oracle JDK v.1.8, but OpenJDK should also work. Here is a nice guide if needed. 2. WZWave internally depends on the common used RXTX-library to be able the communicate with the ZWave controllers connected to your serial and USB-ports. We must thus install the RXTX-package, on Ubuntu this could be done like this: "sudo apt-get install librxtx-java". 3. On a Linux system you normally can't communicate directly with the hardware for security reasons, usless you have privileges to do so like the almighty root-user. We should add our user to a suitable user-group that has those privileges, to find out a suitable group run this command: "ls -la /dev/ttyS*". The output could look like this "crw-rw---- 1 root dialout 4, 64 aug 13 22:48 /dev/ttyS0", on Ubuntu and several other distributions the "dialout"-group is a suitable candidate. Add our user to the dialout-group using this command: "sudo adduser <YOUR USERNAME> dialout". 4. Create a Maven Java-project using your favorite development environment, see Example Client Code. 5. Start the application with the following parameter: "-Djava.library.path=/usr/lib/jni". It will point out for the RXTX-library where its drivers are stored (see step #2). Possible issues: If you keep getting this error when running the application "Something bad happened: gnu.io.NoSuchPortException" and your controller having a device name beginning with "ttyA....", try to add this additional parameter when starting the application: "-Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0". Some even created a symlink to get the RXTX-library on track. The parameter supports specifying several ports if needed, like this: "-Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0:/dev/ttyACM1:/dev/ttyACM2".