Z-wave on Ubuntu 11.10 in VM on MacMiniServer

Forum about Domotiga Open Source Home Automation for Linux.

Moderator: RDNZL

mrqnapper
Member
Member
Posts: 234
Joined: Sat Jun 25, 2011 1:08 pm

Z-wave on Ubuntu 11.10 in VM on MacMiniServer

Post by mrqnapper »

I'm trying to set up the z-wave mudule in Domotiga (latest svn update-version). In Ubuntu 11.10, running on my MacMini2011server (Lion) in a VirtualBox VM (also latest version).

Followed all instructions and patches, ect. on the domotiga.nl/wiki. All looking very promising:) Then after a restart, enabled the z-wave interface in domotoga. Pluged in the Aeon Z Stick S2 in the MacMiniServer and... having a look at the z-wave commander shows nothing! Ok, after many restarting, digging in the settings from the VirtualboxVM, the MacMini and all the other progs involved did not managed to get this working.

Now this is what the z-wave wrapper log file shows. So it has something to do with the serial port, it says? But how to get that right? Anyone having the same set-up and know how to get this working? Thanks.

Code: Select all

2012-04-06 21:18:45:975 Trying to open serial port /dev/ttyUSB10 (attempt 1)
2012-04-06 21:18:45:975 ERROR: Cannot open serial port /dev/ttyUSB10. Error code 2
2012-04-06 21:18:45:975 ERROR: Failed to open serial port /dev/ttyUSB10
2012-04-06 21:18:45:975 WARNING: Failed to init the controller (attempt 37)
2012-04-06 21:19:15:976 Wait::Multiple res=-1 num=1 >
2012-04-06 21:19:15:977   Opening controller /dev/ttyUSB10
2012-04-06 21:19:15:977 Trying to open serial port /dev/ttyUSB10 (attempt 1)
2012-04-06 21:19:15:978 ERROR: Cannot open serial port /dev/ttyUSB10. Error code 2
2012-04-06 21:19:15:978 ERROR: Failed to open serial port /dev/ttyUSB10
2012-04-06 21:19:15:978 WARNING: Failed to init the controller (attempt 38)
2012-04-06 21:19:45:979 Wait::Multiple res=-1 num=1 >
2012-04-06 21:19:45:979   Opening controller /dev/ttyUSB10
2012-04-06 21:19:45:980 Trying to open serial port /dev/ttyUSB10 (attempt 1)
2012-04-06 21:19:45:980 ERROR: Cannot open serial port /dev/ttyUSB10. Error code 2
2012-04-06 21:19:45:980 ERROR: Failed to open serial port /dev/ttyUSB10
2012-04-06 21:19:45:980 WARNING: Failed to init the controller (attempt 39)

User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Z-wave on Ubuntu 11.10 in VM on MacMiniServer

Post by RDNZL »

Maybe first try the MinOZW application in the open-zwave example directory, simply change the serial port and compile it.
Do you see a device being detected when you plug/unplug the stick?
Use dmesg for that.
Regards, Ron.
mrqnapper
Member
Member
Posts: 234
Joined: Sat Jun 25, 2011 1:08 pm

Re: Z-wave on Ubuntu 11.10 in VM on MacMiniServer

Post by mrqnapper »

Ron using dmesg I do not see any stick plugged in or out mentioned in that list.

Now looking into the virtualboxVM config one can activate a serial port there.
Settings are:
COM1
Port Modus: Host pipe or Host Machine (apparaat) or RAW
Port/ Path: ...

The port path I do not know what this should be (in the virtualboxVM manual it says: can be: /tmp but that gives an error.

Further found the MinOZW but how to use that?

part from the dmesg listing:

Code: Select all

[    1.150127] udevd[85]: starting version 173
[    1.332172] usb 2-1: new full speed USB device number 2 using ohci_hcd
[    1.488792] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
[    1.488800] e1000: Copyright (c) 1999-2006 Intel Corporation.
[    1.489087] e1000 0000:00:03.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
[    1.489154] e1000 0000:00:03.0: setting latency timer to 64
[    1.734396] input: VirtualBox USB Tablet as /devices/pci0000:00/0000:00:06.0/usb2/2-1/2-1:1.0/input/input3
[    1.734573] generic-usb 0003:80EE:0021.0001: input,hidraw0: USB HID v1.10 Mouse [VirtualBox USB Tablet] on usb-0000:00:06.0-1/input0
[    1.734590] usbcore: registered new interface driver usbhid
[    1.734591] usbhid: USB HID core driver

User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Z-wave on Ubuntu 11.10 in VM on MacMiniServer

Post by RDNZL »

The MinOZW is a standalone program, you change the hardcode serial port, compile it and run it in your cli, it discovers your z-wave network and reports about it.
But since you don't even see any log action when plug is plugged in, it's an OS/VirtualBox issue.
I don't know much about your VirtualBox config, so here a random list of possible causes:
Did you install the guest additions in Ubuntu?
Is there an active USB host in the VM?
Did you have an USB filter configured (not sure if that's still needed with current versions)
With VirtualBox 4 and higher you need to install the extension pack for all license types to get USB 2 support.
Regards, Ron.
mrqnapper
Member
Member
Posts: 234
Joined: Sat Jun 25, 2011 1:08 pm

Re: Z-wave on Ubuntu 11.10 in VM on MacMiniServer

Post by mrqnapper »

Ok,

What do you mean with "guest additions" ? This part form the Wiki: $ sudo apt-get install libudev-dev libxmlrpc-core-c3-dev ?
I have installed all the extensions for virtualbox and tried to create an USB filter as well. But did not make much difference.

Anyone else out there having the same set-up and got it working?
mrqnapper
Member
Member
Posts: 234
Joined: Sat Jun 25, 2011 1:08 pm

Re: Z-wave on Ubuntu 11.10 in VM on MacMiniServer

Post by mrqnapper »

After some fiddling around now ubuntu sees the Aeon stick device:)

<code>
@Unbuto-VirtualBox:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 002 Device 008: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x Composite Device
</code>

Still in domotiga it's not available in the z-wave commander screen? on the Ubuntu usb sign I can see the settings of the stick like the id, serial etc.
mrqnapper
Member
Member
Posts: 234
Joined: Sat Jun 25, 2011 1:08 pm

Re: Z-wave on Ubuntu 11.10 in VM on MacMiniServer

Post by mrqnapper »

After some more digging the internet I managed to locate the device with:

ls -al /dev/serial/by-id:

showing: lrwxrwxrwx 1 root root 13 2012-04-07 22:35 usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0 -> ../../ttyUSB0

Than in the Domotig settings, changed ttyUSB10 into ttyUSB0 and now I have the controller showing up in the commander.

Only the second line with info is still empty:
so no Chiptype Rev, API/ZDK version

So is there still something missing? Will this be filled later?
mrqnapper
Member
Member
Posts: 234
Joined: Sat Jun 25, 2011 1:08 pm

Re: Z-wave on Ubuntu 11.10 in VM on MacMiniServer

Post by mrqnapper »

This is the info I now have in the xml file!
So the Stick has been recognised. So now what? :)

Code: Select all

?xml version="1.0" encoding="utf-8" ?>
<Driver xmlns="http://code.google.com/p/open-zwave/" version="3" home_id="0x014d02f4" node_id="1" api_capabilities="0" controller_capabilities="8">
        <Node id="1" name="" location="" basic="2" generic="2" specific="1" type="Static PC Controller" listening="true" frequentListening="false" beaming="true" routing="fal$
                <Manufacturer id="0086" name="Aeon Labs">
                        <Product type="0002" id="0001" name="Z-Stick S2" />
                </Manufacturer>
                <CommandClasses>
                        <CommandClass id="32" name="COMMAND_CLASS_BASIC" version="1" after_mark="true" create_vars="true">
                                <Instance index="1" />
                                <Value type="byte" genre="all" instance="1" index="0" label="Basic" units="" read_only="false" write_only="false" verify_changes="false" poll_$
                        </CommandClass>
                </CommandClasses>
        </Node>
</Driver>

Would be nice to have one device working today:) (I have a AN158 plug, already waiting to get connected. Does not appear in my commander screen right now?)
So what steps to take now?

As mentioned before in the z-wave Commander, the fields are not all filled with info right now (see previous post).

This is a part of the log file:

Code: Select all

2012-04-08 16:06:50:557 Wait::Multiple res=-1 num=1 >
2012-04-08 16:06:51:058 Wait::Multiple res=-1 num=1 >
2012-04-08 16:06:51:561 Wait::Multiple res=-1 num=1 >
2012-04-08 16:06:52:062 Wait::Multiple res=-1 num=1 >
2012-04-08 16:06:52:563 Wait::Multiple res=-1 num=1 >
2012-04-08 16:06:53:063 Wait::Multiple res=-1 num=1 >
2012-04-08 16:06:53:564 Wait::Multiple res=-1 num=1 >
2012-04-08 16:06:54:065 Wait::Multiple res=-1 num=1 >
2012-04-08 16:06:54:565 Wait::Multiple res=-1 num=1 >
2012-04-08 16:06:55:066 Wait::Multiple res=-1 num=1 >
2012-04-08 16:06:55:566 Wait::Multiple res=-1 num=1 >
2012-04-08 16:06:56:067 Wait::Multiple res=-1 num=1 >
2012-04-08 16:06:56:567 Wait::Multiple res=-1 num=1 >
2012-04-08 16:06:57:069 Wait::Multiple res=-1 num=1 >

j.hoekstra
Member
Member
Posts: 255
Joined: Thu Jun 25, 2009 2:09 pm
Location: Enschede, The Netherlands

Re: Z-wave on Ubuntu 11.10 in VM on MacMiniServer

Post by j.hoekstra »

Easiest is probably to use the S2 to add the AN158 to the network, after plugging it in again and starting domotige(of re-enable z-wave) you should see it in the commander. Then you know which node-id to use for adding it as a device in domotiga itself.
mrqnapper
Member
Member
Posts: 234
Joined: Sat Jun 25, 2011 1:08 pm

Re: Z-wave on Ubuntu 11.10 in VM on MacMiniServer

Post by mrqnapper »

Thanks, I did not think of that (obvious), since I have my MacMiniserver and other stuff on the attic.. I will try this after the Easter Eggs!
uAlex73
Member
Member
Posts: 218
Joined: Sun Jan 01, 2012 3:42 pm
Contact:

Re: Z-wave on Ubuntu 11.10 in VM on MacMiniServer

Post by uAlex73 »

As said in this thread, if you want to try out Z-Wave in ten VM (I use VMWare Fusion), the steps are easy:
- Include your switch through the S2 stick procedure
- Normally the S2 stick shows up as /dev/ttyUSB0
- If running in VM recompile the "cp210x.so" driver, to allow a greater timeout:
a) get the kernel sources
b) find the "cp210x.c" source
c) replace "300);" with "1500);"
d) Compile
e) Install the *.so module (S2 stick needs to be unplugged)
f) reboot

ps. "Wait::Multiple res=-1 num=1 >" can be ignored ... myself removed it from the OZW source code, just to not get the warning
DomotiGa / Z-Wave / RFXCom / Visonic PowerMaster / Home Assistant / Zigbee2MQTT / DSMR Reader / Toon1 (rooted)
mrqnapper
Member
Member
Posts: 234
Joined: Sat Jun 25, 2011 1:08 pm

Re: Z-wave on Ubuntu 11.10 in VM on MacMiniServer

Post by mrqnapper »

Now the Easter Eggs are passed Had some more time to try further. First tried with the stick as J. Hoekstra advised. Did not succeed (Yet :). Also tried directly form the Commander but does not work either.
I still have the feeling something in the set-up is not right. This is how the commander looks right now. Still missing some info? Right?

Image
j.hoekstra
Member
Member
Posts: 255
Joined: Thu Jun 25, 2009 2:09 pm
Location: Enschede, The Netherlands

Re: Z-wave on Ubuntu 11.10 in VM on MacMiniServer

Post by j.hoekstra »

Don't have chiptype and version via open-zwave wrapper either, do have devices though.
Did the S2 indicate it added the device? Also the commander needs to be restarted sometimes to reflect the latest changes(other software via open-zwave seem to have the same problem as well).
mrqnapper
Member
Member
Posts: 234
Joined: Sat Jun 25, 2011 1:08 pm

Re: Z-wave on Ubuntu 11.10 in VM on MacMiniServer

Post by mrqnapper »

1.
I now finally have the AN158 included as a device (by taking out the stick and include it in the stick, than after inserting it again. And restarting things several times (also the VM) as you suggested). Its now in the commander visible as node 5. Now tried to click it on or off in the commander but no result. So I think I need to put some values into the commander? What need to be in the config / association fields?

2.
Also created a new device in Domotiga. So I have value 1 = on and value 2 = off
Next (assuming I get the plug working) how to read / see the power consumption?

3.
In time when I have some more Z-wave devices, do I need to connected them in the same way over and over? Or can you tell the commander to search for "neighbours" for finding and including the new devices in the network?

Thanks, Wiechert.
j.hoekstra
Member
Member
Posts: 255
Joined: Thu Jun 25, 2009 2:09 pm
Location: Enschede, The Netherlands

Re: Z-wave on Ubuntu 11.10 in VM on MacMiniServer

Post by j.hoekstra »

mrqnapper wrote:1.
I now finally have the AN158 included as a device (by taking out the stick and include it in the stick, than after inserting it again. And restarting things several times (also the VM) as you suggested). Its now in the commander visible as node 5. Now tried to click it on or off in the commander but no result. So I think I need to put some values into the commander? What need to be in the config / association fields?
Actually on/off should just work, you're sure you selected the right(as I understand there's only one) device?
Config is for configuring parameters as you find in the manual for update-timing etc..
Association is used for grouping several modules together(ie several independant lights which you'd like to switch al at once, associate them with a switch and it will rule them all ;)).
2.
Also created a new device in Domotiga. So I have value 1 = on and value 2 = off
Next (assuming I get the plug working) how to read / see the power consumption?
It comes in automatically as Value2(you should be able to see it in the commander if power is being used.) Value2 is actual Watt, Value3 seems to be cumulative usage(total power used thus far).
3.
In time when I have some more Z-wave devices, do I need to connected them in the same way over and over? Or can you tell the commander to search for "neighbours" for finding and including the new devices in the network?

Thanks, Wiechert.
That's where you would use the add-button on the commander for, set device to inclusion mode(explained in manual) then press add, after a while it's added. Experience shows that commander doesn't reflect this right away and closing and opening commander shows you this change. OTOH, it might be easier to just take the stick, include with that and then go back to PC and add them in software.
The neighbours function as I understand it, is to update the network(ie after adding or removing nodes). Routes will get updated so that a node added inbetween 2 other nodes can be used for routing.
Post Reply

Return to “DomotiGa Forum”