Another Aeon Gen 5 Issue - No Device

That one can be accomplished by changing udev rules on most systems. Here is an example: http://unix.stackexchange.com/questions/147494/how-can-i-set-device-rw-permissions-permanently-on-raspbian

Should work on most distributions including DSM, though I have not tried it.

Thanks Jim,

For whom it might be useful:

Created a file named openhab-zwave.rules in /lib/udev/rules.d with this content:
ACTION==“add”, KERNEL==“ttyACM0”, MODE=“0660”, GROUP=“dialout”

(See the previous posts for why the group setting)

Works great !

Oh boy, next challenge.

So now the settings for the /dev/ttyACM0 are right, but…

How to get the settings for /var/lock set right after reboot?

It’s these commands:

  • chown -R root.uucp /var/lock
  • chmod -R g+w /var/lock/

I tried 2 scenario’s:
1 - create a xxx.conf file with these commands in the folder /etc/init
2 - added the commands to the startup file start_runtime.sh

Both strategies didn’t work.

Anyone any suggestions on what might be the problem or the solution?

OK, done !

This worked for me to add a startup script for owner and rights of usb serial lock on my Synology:

create script file =filename=.sh in /usr/syno/etc.defaults/rc.d

set rwx as 755

contents:


start_modules(){
echo ls -l /dev/tty* >> /volume1/Public/tmp/zwavelog.txt
chown -R root.uucp /var/lock
chmod -R g+w /var/lock
}

stop_modules(){
echo “do nothing”
}

case “$1” in

start)
start_modules
;;

stop)
stop_modules
;;

*)
echo “usage: $0 { start | stop }” >&2
exit 1
;;

esac

exit 0


Supper find

I’m new to OpenHAB and I’m having the same problem as LeoVe.
I’m running a Synology DS1815+ with DSM 6.07321 I have OpenHAB 1.8.2, the latest HABmin, and the demo running.

I plugged in the Aeon Gen 5 z-wave stick and the Synology sees the device and assigns it /dev/ttyACM0, it even shows it plugged into the system via the control panel.

[ 25.111311] cdc_acm 2-2:1.0: This device cannot do calls on its own. It is not a modem.
[ 25.120340] cdc_acm 2-2:1.0: ttyACM0: USB ACM device
[ 25.128397] usbcore: registered new interface driver cdc_acm

I followed these steps as per the previous posts:

  • created a dialout group via DSM
  • created a uucp group via DSM
  • assigned the openhab user to both groups via DSM
  • ran chown -R root.dialout /dev/ttyACM0 as root
  • ran chmod 660 /dev/ttyACM0 as root
  • ran chown -R root.uucp /var/lock as root
  • ran chmod -R g+w /var/lock/ as root
  • Created a file named openhab-zwave.rules in /lib/udev/rules.d with this content:
  • ACTION==“add”, KERNEL==“ttyACM0”, MODE=“0660”, GROUP=“dialout” as root
  • restarted the DSM, and reran ran chown -R root.uucp /var/lock as root & ran chmod -R g+w /var/lock/ as root

When I run ls -l /dev/ttyACM0 I get:

  • crw-rw---- 1 root dialout 166, 0 Mar 31 02:09 /dev/ttyACM0

My openhab.log still tells me:

23:46:38.991 [ManagedService Update Queue] ERROR o.o.b.z.i.protocol.ZWaveController - Serial Error: Port /dev/ttyACM0 does not exist

23:46:38.997 [org.openhab.core.internal.logging.OSGILogListener$NLogListener@99d7fe9] ERROR OSGi - port : Port /dev/ttyACM0 does not exist
org.openhab.binding.zwave.internal.protocol.SerialInterfaceException: Port /dev/ttyACM0 does not exist

Did I miss a step? I realize that the lock permissions will need to be reassigned every reboot without a script, but I can’t get it to run at all.

Try to just reinstall the package spk so that all files from openhab have the correct permissions.
The rest of the commands i use to exept the 660 is not needed in 5.2, i do not have 6 installed

Normally it should not mather what stick or port.

Grtz

I have reinstalled several times. I can run the debug as root and I can see my devices nodes 2, 3, &4 and they send update events.

However I don’t see the values updating on the UI (standard) and if I go back to launching from DSM now I get a does not exist even though it is there. I even tired adding -Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0 to start.sh as suggested on another thread. no dice.

19:31:06.357 [ManagedService Update Queue] INFO  o.o.b.z.i.protocol.ZWaveController - Starting Z-Wave controller
19:31:06.358 [ManagedService Update Queue] INFO  o.o.b.z.i.protocol.ZWaveController - Z-Wave timeout is set to 5000ms. Soft reset is false.
19:31:06.358 [ManagedService Update Queue] INFO  o.o.b.z.i.protocol.ZWaveController - Connecting to serial port /dev/ttyACM0
19:31:06.421 [ManagedService Update Queue] ERROR o.o.b.z.i.protocol.ZWaveController - Serial Error: Port /dev/ttyACM0 does not exist
19:31:06.426 [NTP Refresh Service] INFO  o.o.c.service.AbstractActiveService - NTP Refresh Service has been started
19:31:06.426 [NTP Refresh Service] DEBUG o.o.binding.ntp.internal.NtpBinding - There is no existing NTP binding configuration => refresh cycle aborted!
19:31:06.434 [org.openhab.core.internal.logging.OSGILogListener$NLogListener@4233cd6] ERROR OSGi - port : Port /dev/ttyACM0 does not exist
org.openhab.binding.zwave.internal.protocol.SerialInterfaceException: Port /dev/ttyACM0 does not exist

config

################################ Z-Wave  Binding ######################################
#
# The Z-Wave controller port. Valid values are e.g. COM1 for Windows and /dev/ttyS0 or
# /dev/ttyUSB0 for Linux
zwave:port=/dev/ttyACM0

# Z-Wave nightly heal time. This is the hour (eg 2AM) at which the automatic nightly
# network heal will be performed.
zwave:healtime=4
#zwave:masterController=True

items

group All
Group Main_Floor	(All)
Group Basement		(All)
Group Second_Floor	(All)
Group Doors			(All)
Group Batteries		(All)

Contact frontdoor_sensor    "Front door is [%s]"                   	<door>				(Doors,Main_Floor)          		{zwave="2:command=BASIC"}
Number  frontdoor_battery   "Front door sensor battery [%d %%]"    	<battery>       	(Batteries)                			{zwave="2:command=BATTERY"}

Contact sidedoor_sensor    "Side door is [%s]"                     	<door>	            (Doors,Main_Floor)          		{zwave="3:command=BASIC"}
Number  sidedoor_battery   "Side door sensor battery [%d %%]"      	<battery>   	    (Batteries)               			{zwave="3:command=BATTERY"}

Contact Motion_Main_Floor "Motion [MAP(motion.map):%s]" 			<motion>			(Main_Floor) 						{zwave="4:command=sensor_binary,respond_to_basic=true" }
/*Number Alarm_Main_Floor "Alarm: [%s]" 													(Main_Floor) 						{zwave="4:command=alarm" }*/
Number Temp_Main_Floor "Temperature: [%.1f °C]" 					<temperature>		(Main_Floor) 						{zwave="4:command=sensor_multilevel,sensor_type=1,sensor_scale=0" }
Number Humid_Main_Floor "Humidity: [%.0f %%]" 											(Main_Floor) 						{zwave="4:command=sensor_multilevel,sensor_type=5" }
Number Lumin_Main_Floor "Luminance: [%.0f Lux]" 										(Main_Floor) 						{zwave="4:command=sensor_multilevel,sensor_type=3" }
Number UV_Main_Floor "Luminance: [UV index %d]" 										(Main_Floor) 						{zwave="4:command=sensor_multilevel,sensor_type=27" }
Number Battery_Main_Floor "Battery: [%d %%]" 						<battery> 			(Batteries) 						{zwave="4:command=battery" }

sitemp

sitemap piggpin label="Home"
{
  Frame label="Pig Pen" {
  	Text label="Main Floor" icon="groundfloor"{
  		Group item=Main_Floor
  		Text item=frontdoor_sensor
  		Text item=sidedoor_sensor
  		Text item=Temp_Main_Floor
  		
  }
  Text label="Second Floor" icon="firstfloor"{
  	Group item=Second_Floor
  	}
  Text label="Basement" icon="cellar"{
  	Group item=Basement
  	}  
  }
}

I got some feedback from a friend and he suggested that I edit the start-stop-status.sh and add chmod 777 /dev/ttyACM0 and chmod 777 /run/lock/

It worked. I know that 777 is bad juju but I tried that on the command line for the device and it didn’t help. Wan it /run/lock? I already had /var/lock set as root.uucp and openhab was added to the group.

First thing, never run openhab as root, it will change a lot of files on synology, other systems no problem i think.

The last comment i see that you change rights on the device and its lockfile en thats correct, that is how it works for me to.
Search google for how to install openhab on xpenology, you will find a tut i wrote in the old forums.

Grtz

After the last update Synology replaced the lock files, the .sh file in my post needs to be amended, this worked for me:

NasTV> cat /usr/syno/etc.defaults/rc.d/S98openhabzwave.sh

start_modules(){
echo ls -l /dev/tty* >> /volume1/Public/tmp/zwavelog.txt
chown -R root.uucp /run/lock
chmod -R g+w /run/lock
chown -R root.uucp /var/lock
chmod -R g+w /var/lock
}
stop_modules(){
echo “do nothing”
}
case “$1” in
start)
start_modules
;;
stop)
stop_modules
;;
*)
echo “usage: $0 { start | stop }” >&2
exit 1
;;
esac
exit 0

Another Synology/Z-Stick problem…

I’m running OpenHAB2 on a DS214play, and finally (after trying a million different things from different webpages, including some of what’s above) got OpenHAB2 to see the z-stick when I ran start.sh from the commandline as root. If I run it from the package manager OpenHAB2 tells me that /dev/ttyACM0 doesn’t exist.

Can someone please advise me of the best way to cure this (what I guess is a rights) issue so that I can run Openhab as a normal package?

Thanks.

After further testing I discovered that my startup script wasn’t executing, presumably because it wasn’t 755’d as specified here:-
https://developer.synology.com/developer-guide/integrate_dsm/run_with_system_boot.html

It wouldn’t let me change the status of the script in the startup directory (/usr/local/etc/rc.d/ for DSM6), but it would let me delete it.

So I created and 755’d the file in another directory, and then moved it to the startup directory, and then everything worked as it should.

Thank gawd. :slight_smile:

correction. The 6.1 DSM update have deleted my /lib/udev/rules.d/openhab-zwave.rules file.

I re-created it, rebooted, and everything is working again.

My stick in inserted in the ttyACM0, and in the ttyACM1 i have my Velbus system connected.
When i want to add the Z-wave stick i can only select the ttyACM1…

I ran the following commands to view the permissions.
It looks fine to me.

ls -la /dev/ttyACM0

Standard output/error:
crwxrwxrwx 1 root root 166, 0 Dec 19 10:44 /dev/ttyACM0

ls -la /dev/ttyACM1

Standard output/error:
crwxrwxrwx 1 root root 166, 1 Dec 19 11:34 /dev/ttyACM1

I already executed the sudo chmod 666 /dev/ttyACM0
with no results.

Quick question…

(Keeping in mind that I only use a Velbus USB connection)

Is your machine assigning the same ttyACM port to each device when it reboots?

To get around this, can you see a by-name folder (symlink) for the USB devices?

@MDAR how can i see if its assigning the same ttyACM port to each device when it reboots?
And where can i see the by-name folder?

Below some screenshots

When i looked in the openHAB-zwave.sh at first it has twice the same line “sudo chmod 777 /dev/ttyACM0”

I have changed it to this–>
Capture
Capture2

its wierd, the zwave stick is Online, but i can not select it from the dropdown


And when i edit it is shows notting in the Serial port…

when i click the serial port dropdown i see the ttyACM1(Velbus usb connection)

Hi

I’ve had a look on my Ubuntu machine and I found the folders I was thinking of here -

/dev/serial/by-id

Or

/dev/serial/by-path

Use ls -l to see that the contents are actually symlinks back to the appropriate/dev/ttyACMxxxx

You might also like to take a look at this article I found

Blogs Dr. Tayyar GUZEL

How to Give Persistent Names To USB-Serial Devices on Ubuntu 14.04

Hi @dafdegiraf

Quick update.

My curiosity got the better of me.

I tried to load VelServ to allow openHAB2 to access my Velbus installation with this command…

./velserv -d /dev/serial/by-id/usb-Velleman_Projects_VMB1USB_Velbus_USB_interface-if00

And it works perfectly :smile: