How-to Article on MakeUseOf

How do I give it permissions

2015-09-20 00:18:34.174 [INFO ] [.service.AbstractActiveService] - ZWave Refresh Service has been started
2015-09-20 00:18:34.407 [INFO ] [b.z.i.protocol.ZWaveController] - Starting Z-Wave controller
2015-09-20 00:18:34.410 [INFO ] [b.z.i.protocol.ZWaveController] - Z-Wave timeout is set to 5000ms. Soft reset is false.
2015-09-20 00:18:34.412 [INFO ] [b.z.i.protocol.ZWaveController] - Connecting to serial port /dev/ttyACM0
2015-09-20 00:18:34.688 [ERROR] [b.z.i.protocol.ZWaveController] - Serial Error: Port /dev/ttyACM0 does not exist****

pi@OpenHAB ~ $ dmesg | grep tty
[    0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2709.boardrev=0xa01041 bcm2709.serial=0x46efd952 smsc95xx.macaddr=B8:27:EB:EF:D9:52 bcm2708_fb.fbswap=1 bcm2709.disk_led_gpio=47 bcm2709.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x3ea00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
[    0.002119] console [tty1] enabled
[    0.195713] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 83, base_baud = 0) is a PL011 rev2
[    0.695948] console [ttyAMA0] enabled
[    4.037204] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 1180.153287] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device


pi@OpenHAB ~ $ ls -l /dev/ttyACM0
crw-rw---T 1 root dialout 166, 0 Dec 31  1969 /dev/ttyACM0
pi@OpenHAB ~ $ grep dialout /etc/group
dialout:x:20:pi,openhab

so…added

-Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0:/dev/ttyAMA0

per this post: https://groups.google.com/forum/m/#topic/openhab/PHVs33PqINE

Running start_debug.sh in a terminal windows and it is showing zwave communications between nodes. But…HABmin does not show my nodes. What now?

Please copy the first part of the logfile showing the zwave binding starting up…

chown

Ok, now for weirdness…

I opened habmin today, and low and behold, there were my nodes!

Just for giggles, restarted the pi, restarted openhab, now when I open habmin, no nodes.

I can see zwave communication in the start_debug.sh.

What now?

So debug the process. Something you did prior to today in a bash shell made this work correctly until you rebooted, wiping out whatever transient goodness you did in that shell. (Canonical example: you installed something or changed something where you should have put it into your .bash_profile, did not, so when you reboot its gone.)

Replay that prior shell session in your head. You’ve had a lot going on, so unless you have really good paper or electronic records of it, your recollection will be faulty. Make some notes on paper about what you recall.

Sort out what you know from from you sort-of-know. Take your paper list of what you did. Be prepared to reboot multiple times. Whenever something does not work–reboot and start again. You need to find the working path. (You had one, just have to find it again and make it sticky).

I install oh2 and habmin2, but then Uninstaller them, that’s all I did. I couldn’t get them to pull up in a browser.

OK. Suggest you make some notes and go back to stage zero – ie a NOOBS raspbian blank slate. Trying to untangle an OS-level mess is generally not worth the effort.
Goto NOOBS.
Update all.
Follow the video on Pi 2 install.
Write down every command you type and results. Better yet do a {command}|tee| …wrong syntax, but essentially use “tee” to see the output and also create a log copy of result for the record.

So, I think I found the problem. In the start.sh, adding -Dgnu…
After console, have to put a /.

But then again I lost the nodes in habmin again, though I saw proper startup in the log file.

So, I have decided to install habmin2.

Again, install instructions are vague. From what I read, download master.zip and put that in Web apps folder under a folder of habmin2. Put .jar in add-ons folder, and remove habmin jar. Now, when I start it, there is the login screen. What credentials shall I use here? If none, it stays offline.

Forget what I said above, I had the OH2 jar file instead of OH1. Still can’t see the nodes though. Below is from log, shows proper initalization. Just don’t know what Im missing…

2015-09-22 00:33:53.527 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'demo.sitemap'
2015-09-22 00:33:54.722 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'db4o.persist'
2015-09-22 00:33:54.837 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'rrd4j.persist'
2015-09-22 00:33:54.870 [INFO ] [.z.internal.ZWaveActiveBinding] - Update config, port = /dev/ttyACM0
2015-09-22 00:33:54.872 [INFO ] [.z.internal.ZWaveActiveBinding] - Update config, healtime = 2
2015-09-22 00:33:54.874 [INFO ] [.z.internal.ZWaveActiveBinding] - Update config, softReset = false
2015-09-22 00:33:54.875 [INFO ] [.z.internal.ZWaveActiveBinding] - Update config, masterController = true
2015-09-22 00:33:54.883 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'logging.persist'
2015-09-22 00:33:54.896 [INFO ] [.service.AbstractActiveService] - ZWave Refresh Service has been started
2015-09-22 00:33:54.985 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'exec.persist'
2015-09-22 00:33:55.076 [INFO ] [b.z.i.protocol.ZWaveController] - Starting Z-Wave controller
2015-09-22 00:33:55.079 [INFO ] [b.z.i.protocol.ZWaveController] - Z-Wave timeout is set to 5000ms. Soft reset is false.
2015-09-22 00:33:55.081 [INFO ] [b.z.i.protocol.ZWaveController] - Connecting to serial port /dev/ttyACM0
2015-09-22 00:33:55.130 [ERROR] [.p.internal.PersistenceManager] - Failed to schedule job for strategy [exec.everyMinute, 0 * * * * ?] with cron expression org.quartz.ObjectAlreadyExistsException: Unable to store Job : 'exec.everyMinute', because one already exists with this identification.
2015-09-22 00:33:55.371 [INFO ] [b.z.i.protocol.ZWaveController] - Serial port is initialized
2015-09-22 00:33:55.614 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'demo.rules'
2015-09-22 00:33:59.386 [INFO ] [rialApiGetInitDataMessageClass] - NODE 1: Node found
2015-09-22 00:33:59.391 [INFO ] [rialApiGetInitDataMessageClass] - NODE 2: Node found
2015-09-22 00:33:59.394 [INFO ] [rialApiGetInitDataMessageClass] - ZWave Controller using Controller API
2015-09-22 00:33:59.396 [INFO ] [rialApiGetInitDataMessageClass] - ZWave Controller is Primary Controller
2015-09-22 00:33:59.398 [INFO ] [rialApiGetInitDataMessageClass] - ------------Number of Nodes Found Registered to ZWave Controller------------
2015-09-22 00:33:59.400 [INFO ] [rialApiGetInitDataMessageClass] - # Nodes = 2
2015-09-22 00:33:59.401 [INFO ] [rialApiGetInitDataMessageClass] - ----------------------------------------------------------------------------

Must be a permissions issue, but I don’t know how to figure this out.

restart and now this:

2015-09-22 01:05:14.095 [INFO ] [.z.internal.ZWaveActiveBinding] - Update config, port = /dev/ttyACM0
2015-09-22 01:05:14.098 [INFO ] [.z.internal.ZWaveActiveBinding] - Update config, healtime = 2
2015-09-22 01:05:14.148 [INFO ] [.z.internal.ZWaveActiveBinding] - Update config, softReset = false
2015-09-22 01:05:14.151 [INFO ] [.z.internal.ZWaveActiveBinding] - Update config, masterController = true
2015-09-22 01:05:14.196 [INFO ] [.service.AbstractActiveService] - ZWave Refresh Service has been started
2015-09-22 01:05:14.300 [INFO ] [b.z.i.protocol.ZWaveController] - Starting Z-Wave controller
2015-09-22 01:05:14.350 [INFO ] [b.z.i.protocol.ZWaveController] - Z-Wave timeout is set to 5000ms. Soft reset is false.
2015-09-22 01:05:14.353 [INFO ] [b.z.i.protocol.ZWaveController] - Connecting to serial port /dev/ttyACM0
RXTX fhs_lock() Error: opening lock file: /var/lock/LCK..ttyACM0: File exists.
 testRead() Lock file failed
RXTX fhs_lock() Error: opening lock file: /var/lock/LCK..ttyACM0: File exists.
XŘž testRead() Lock file failed
RXTX fhs_lock() Error: opening lock file: /var/lock/LCK..ttyACM0: File exists.
�� testRead() Lock file failed
2015-09-22 01:05:14.767 [ERROR] [b.z.i.protocol.ZWaveController] - Serial Error: Port /dev/ttyACM0 does not exist
2015-09-22 01:05:15.730 [INFO ] [.service.AbstractActiveService] - NTP Refresh Service has been started

just a guess, but the stale lock file which cannot be removed may be left over from an earlier attempt running as a different user and the current user does not have permissions to clean it up.

I’d sudo rm the lock file and try again

Should I also chown that directory to the user openhab?

Also, what are all the directories that user openhab need access too? Should I chown all these directories?

I would sudo rm the stale lock file. sudo chown the openhab subtree only. Run as the openhab user.

Then the new lock file will be created by that user and subsequent attempts to delete (ie at OH startup) should succeed since the openhab user is the creator/owner of the (now-stale) lock file.

Make sense ?

Ok, I will try it.

ok, i did that, and the nodes load up in the log again, but still arent visible in habmin. at this point, i just want to start over with a clean install. are you willing to walk me through exactly what you have done, maybe then i will be on the same page as you and if im still having issues, then maybe it could be hardware issue. it would be really great if you could walk me through.

Before you toast everything, let’s do a little “horsy-doggy-ducky”.

So (being overly explicit)…when you say the “nodes load up in the log again” , do you mean they show in the zwave log ? (configured in logback.xml)…you should have this set to a DEBUG level until this gets straightened out.

Again being overly explicit, in my own logback.xml (or logback_debug.xml ), (hit by ./start.sh and ./start_debug.sh, respectively) I have the following entries:


        logs/zwave.log
        
        
            logs/zwave-%d{yyyy-ww}.log.zip
        
            30
        
        
            %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{30}[:%line]- %msg%n%ex{5}
        
    

and


        
    

IF the nodes show in the zwave log, you’ll see the nodes getting acquired by the controller and (pretty voluminous) chatter along the network. At the near beginning of the log you’ll find a listing of the node numbers that are known to the controller (this is before all the “is it dead/alive/Schodinger’s node” chatter.

If you do not see the nodes listed at the near-beginning of the zwave log, then you should look at your node inclusion/exclusion discipline. (Been bit by this myself). Are the nodes included in your controller ? I don’t mean included by habmin, I mean have you walked around to your devices, z-stick in hand, put your z-stick into inclusion mode and seen the lights flashing with the “I’ve got you” signalling. (word of advice, given the number of times your been round the barn here, you’ll like be tempted to try an re-include your devices. I would recommend that for each device, you first do an “exclude” cycle before any “include”.)

If you do see the nodes at the beginning of the zwave log, then you have to look at the detailed messages in the DEBUG log to see what might be going on here. I’ll (of course) defer to @chris on the details, but deep in the log weeds you can find useful info sometimes.

When I go to a terminal and type /opt/openhab/start.sh. the pi starts up which is what I refer to as log. I get open port, port inialized, node 1 found, node 2 found, etc

I added per zwave binding page at github in logback.xml. now, how do I view it?