Author Topic: TrickleStar ZWave auto detection script - testers needed  (Read 2710 times)

esev

  • Veteran
  • ***
  • Posts: 87
    • View Profile
    • Eric Severance
TrickleStar ZWave auto detection script - testers needed
« on: October 16, 2010, 07:31:36 am »
I've been trying to get as many devices as possible in my setup to be automatically detected.  I have a TrickleStar USB ZWave controller, and according to the wiki page for the device, it uses the USB ID of a generic serial port adapter.  So using the USB ID alone for PnP detection is not a good solution.  This is where the attached auto detection script is needed. The script sends a ZWave Version request to the serial port.  If is receives a valid ZWave response than it assumes this USB device is a ZWave controller.

To use, place the script into /usr/pluto/pnp.  Then modify the device template for ZWave (1754).  Follow the directions on this wiki page to add a new PnP entry - use 067b2303 as the vendor model id and ZWave.sh for the PNP detection script (or whatever name you saved the script as).

http://wiki.linuxmce.org/index.php/ZWave_DeviceTemplate_PlugAndPlay

If you have a TrickleStar ZWave adapter, or a Prolific Technology, Inc. PL2303 Serial Port, give this a try.  Let me know if you have any troubles with the script.
Eric Severance
My setup

huh

  • Guru
  • ****
  • Posts: 235
    • View Profile
Re: TrickleStar ZWave auto detection script - testers needed
« Reply #1 on: October 18, 2010, 06:56:22 am »
Sweet- nice to see you're making this plug and play.  I have the 300ZW-US-W Tricklestar and after doing as you say below, following the quick reload I plugged in my tricklestar and the blue screen appeared that stated that I plugged in a z-wave device.  I forget what it said, but I think it asked if I wanted to use it.  Whatever the options, I clicked the affirmative and was kicked back to the UI. 

As with the Z-Wave template for the Aeon Lab Z-Wave dongle, I was expecting to be prompted by Sarah to confirm that I have XX lights already installed, but I was not.

Now, I already have the Aeon Labs dongle plugged in and (mostly) controlling my Z-Wave devices.  I have a rogue device that I cannot delete from the dongle that does not exist to any of my z-wave devices, but that is another story- that's what I got the Tricklestar....

At any rate, I hope to delete all of my z-wave devices tomorrow, associate them to my Trickelstar 200ZW-US-W and get everything up and working.

I have yet to get the 300ZW working with LMCE.  I always get the red light fail indicator on the 200ZW after going through the process of adding the inclusion remote as the first node as instructed here:
http://wiki.linuxmce.com/index.php/Z-Wave

Please let me know if you would like me to check/test anything.  Else, I plan to delete my z-wave tomorrow (Monday) night and readd the devices.

Thanks


esev

  • Veteran
  • ***
  • Posts: 87
    • View Profile
    • Eric Severance
Re: TrickleStar ZWave auto detection script - testers needed
« Reply #2 on: October 18, 2010, 07:15:10 am »
Please let me know if you would like me to check/test anything.  Else, I plan to delete my z-wave tomorrow (Monday) night and readd the devices.

Thanks much for giving this a try!  I just need one thing so I can make sure the script worked as expected.  Can you post a copy of any /var/log/pluto/*ZWave.sh* files?  If they aren't there, would you mind unplugging the 300ZW, deleting the device it created, and plugging it back in?  That should kick off the auto-detection again and generate a new file.

As with the Z-Wave template for the Aeon Lab Z-Wave dongle, I was expecting to be prompted by Sarah to confirm that I have XX lights already installed, but I was not.

If you haven't previously used the 300ZW to control your lights Sarah won't show up.  I think the ZWave dongle's have a memory of the devices they've been paired with before - if there weren't any pairings, there won't be any lights to install.

I always get the red light fail indicator on the 200ZW after going through the process of adding the inclusion remote as the first node as instructed here:

I had this happen to me also.  I had to reset all the devices and try a few times before it took.

Thanks again for helping test this script out!
--Eric
Eric Severance
My setup

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2421
    • View Profile
    • ago control
Re: TrickleStar ZWave auto detection script - testers needed
« Reply #3 on: October 18, 2010, 12:30:56 pm »
why do you want people to add the 067b2303 as vendor/model id?

br Hari
rock your home - http://www.agocontrol.com home automation

esev

  • Veteran
  • ***
  • Posts: 87
    • View Profile
    • Eric Severance
Re: TrickleStar ZWave auto detection script - testers needed
« Reply #4 on: October 18, 2010, 02:13:11 pm »
why do you want people to add the 067b2303 as vendor/model id?

br Hari

Hi Hari,

Did this work for you without the vendor id?  I tried removing the vendor id, and only specifying the PNP detection script, but the device was never detected for me.  I then re-added the vendor id and it was detected right away.

I think (but haven't verified) this happens because device 1811 (Generic Serial Adapter) is also using that vendor id.  I figured the PnP plugin chose 1811 because the vendor id matched.  But if both ZWave and 1811 have the same vendor id, then the PnP plugin is forced to run the detection scripts.

Is there something I'm doing wrong?
Eric Severance
My setup

esev

  • Veteran
  • ***
  • Posts: 87
    • View Profile
    • Eric Severance
Re: TrickleStar ZWave auto detection script - testers needed
« Reply #5 on: October 18, 2010, 04:00:32 pm »
Hari,

I see you have some pl2303 USB/Serial adapters in your setup.  If you have a chance, could you verify that this script doesn't incorrectly detect them as ZWave devices?

TIA
--Eric
Eric Severance
My setup

bongowongo

  • wants to work for LinuxMCE
  • **
  • Posts: 826
    • View Profile
Re: TrickleStar ZWave auto detection script - testers needed
« Reply #6 on: October 18, 2010, 05:15:49 pm »
My PLCBus USB uses the same usb/serial converter (recognized in lsusb as pl2303 USB/Serial adapter), that would mean that my system would detect it as zwave controller too?

esev

  • Veteran
  • ***
  • Posts: 87
    • View Profile
    • Eric Severance
Re: TrickleStar ZWave auto detection script - testers needed
« Reply #7 on: October 18, 2010, 05:30:45 pm »
My PLCBus USB uses the same usb/serial converter (recognized in lsusb as pl2303 USB/Serial adapter), that would mean that my system would detect it as zwave controller too?

I'm hoping not, but that's why I'm asking for testers. :)  It looks like there might be several devices that all use that same USB vendor ID.  I think LinuxMCE can only auto detect USB devices by their vendor ID.  Correct me if I'm wrong, but if two USB devices share the same vendor ID, then to be properly auto detected, each device needs to have its own PNP detection script.

The PNP detection script sends commands that only one specific device should respond to and makes sure it gets a valid response back from that device.  In the case of this script, it sends a ZWave formatted query to the device asking for Version information from the device.  If the device responds to that query, and the response contains the string "Z-Wave" then the script tells LinuxMCE that this is a ZWave device.

I'm hoping that other devices that use the same pl2303 won't respond the same way to a ZWave command.  If that is the case, the script is supposed to tell LinuxMCE that the device isn't a ZWave device.

Would you be willing to try this out on your system?  You'd have to make the changes I mentioned in the first post, delete your PLCBus USB, and then quick reload the router.  If the script works correctly, it shouldn't add a new ZWave device to your system.  If you are able to test, please post any /var/log/pluto/*ZWave.sh* files that get created during the detection process so that I can verify the script works as expected.
Eric Severance
My setup

bongowongo

  • wants to work for LinuxMCE
  • **
  • Posts: 826
    • View Profile
Re: TrickleStar ZWave auto detection script - testers needed
« Reply #8 on: October 18, 2010, 06:33:34 pm »
Ok at my test setup I have a
Bus 001 Device 004: ID 067b:2305 Prolific Technology, Inc. PL2305 Parallel Port inserted. Should that conflict with your script (just for testing).
-=Edit=-
Never mind, I already see it is a 2305 and not 2303
I will try to buy a simple usb -> serial........and see if that gets detected as a zwave later.

esev

  • Veteran
  • ***
  • Posts: 87
    • View Profile
    • Eric Severance
Re: TrickleStar ZWave auto detection script - testers needed
« Reply #9 on: October 18, 2010, 08:19:36 pm »
Just so there isn't any confusion on what I'm asking, see the attached screenshot for what the new Plug & Play section of the ZWave device template (1754) should look like.

The intent of the script is two-fold.
1. It will allow the Tricklestar 300ZW ZWave device to be detected and automatically added to LinuxMCE
2. It will not add a ZWave device when an ordinary USB/serial adapter is added to the system.

For this to work correctly, both the Vendor Model ID and the PNP detection script need to be added to the Plug & Play section of the device template.  If only the Vendor Model ID is added there is a risk of similar Serial devices being incorrectly detected as a ZWave interface.  If only the PNP detection script is added, the 300ZW ZWave device will never get detected.

If my understanding of how the PnP plugin works is correct, using both the Vendor Model ID and the PNP detection script should cause LinuxMCE to run the PNP detection script any time a device with Vendor Model ID 067b2303 is plugged in.  If the detection script determines this is a ZWave interface, it'll inform LinuxMCE to add a new ZWave device using the ZWave template.  If the detection script cannot determine if this is a ZWave device, it is supposed to fail gracefully and let LinuxMCE know that this device is NOT a ZWave interface.  In the case of this script failing, LinuxMCE should choose another device template that also uses the 067b2303 Vendor Model ID.

I'm able to verify that one half of this is working properly: that the script automatically detects my 300ZW dongle as a ZWave device.  But I don't have any USB/Serial adapters to test to make sure the script fails gracefully, not adding a ZWave device, when a pl2303 USB/Serial adapter is added to the system.

If you can test that this script works for either of its intended purposes, please post any /var/log/pluto/*ZWave.sh* log files that get created when LinuxMCE does its auto-detection.  That will help me know whether or not the script worked properly.   Thanks in advance for anyone who is able to test this!!

BTW: I'm basing all this off what is described on the wiki page for the Plug&Play plugin.  If that page is out of date, please let me know.
Eric Severance
My setup

bongowongo

  • wants to work for LinuxMCE
  • **
  • Posts: 826
    • View Profile
Re: TrickleStar ZWave auto detection script - testers needed
« Reply #10 on: October 18, 2010, 08:49:34 pm »
darnit, I cannot test then. I have no zwave.

esev

  • Veteran
  • ***
  • Posts: 87
    • View Profile
    • Eric Severance
Re: TrickleStar ZWave auto detection script - testers needed
« Reply #11 on: October 19, 2010, 04:04:27 am »
I picked up a USB/serial converter tonight.  The pl2303 chipset must be pretty common because the serial adapter that I picked up luckily matches the vendor id on the TrickleStar.

I can now confirm that the script does what it was intended to do.  I'll submit this as a Trac ticket to get it included in LinuxMCE.  It'll be a nice addition to have this automatically detected right out-of-the-box. I'm guessing most folks will buy these TrickleStar dongles when getting started with ZWave, as they are highly recommended according to the wiki page.
Eric Severance
My setup

huh

  • Guru
  • ****
  • Posts: 235
    • View Profile
Re: TrickleStar ZWave auto detection script - testers needed
« Reply #12 on: October 19, 2010, 07:03:59 am »
Unfortunately got tied up tonight- but I have at least 4 different zwave devices (I am assuming because I have 4 different numbers in front of the .ZWave.log files.  All but one is empty- this is in the one:

Code: [Select]
05      10/18/10 8:22:21.869            ^[[33;1mGoing to rotate logs...^[[0m <0xb6227b90>
05      10/18/10 10:01:42.004           ^[[33;1mNo callback received: await_callback: 56 timer: 31^[[0m <0xb7229b90>
05      10/18/10 10:19:05.335           ^[[33;1mNo callback received: await_callback: 158 timer: 31^[[0m <0xb7229b90>
05      10/18/10 10:59:53.227           ^[[33;1mNo callback received: await_callback: 143 timer: 31^[[0m <0xb7229b90>
05      10/18/10 11:22:52.443           ^[[33;1mNo callback received: await_callback: 23 timer: 31^[[0m <0xb7229b90>
05      10/18/10 11:49:56.072           ^[[33;1mNo callback received: await_callback: 182 timer: 31^[[0m <0xb7229b90>
05      10/18/10 12:19:02.283           ^[[33;1mNo callback received: await_callback: 98 timer: 31^[[0m <0xb7229b90>
05      10/18/10 12:58:20.919           ^[[33;1mNo callback received: await_callback: 74 timer: 31^[[0m <0xb7229b90>
05      10/18/10 13:09:36.655           ^[[33;1mNo callback received: await_callback: 140 timer: 31^[[0m <0xb7229b90>
05      10/18/10 13:22:54.915           ^[[33;1mNo callback received: await_callback: 218 timer: 31^[[0m <0xb7229b90>
05      10/18/10 15:38:57.924           ^[[33;1mNo callback received: await_callback: 254 timer: 31^[[0m <0xb7229b90>
05      10/18/10 17:16:53.707           ^[[33;1mNo callback received: await_callback: 65 timer: 31^[[0m <0xb7229b90>
05      10/18/10 17:30:43.035           ^[[33;1mNo callback received: await_callback: 146 timer: 31^[[0m <0xb7229b90>
05      10/18/10 18:06:54.707           ^[[33;1mNo callback received: await_callback: 104 timer: 31^[[0m <0xb7229b90>
05      10/18/10 18:24:28.063           ^[[33;1mNo callback received: await_callback: 207 timer: 31^[[0m <0xb7229b90>
05      10/18/10 18:57:12.659           ^[[33;1mGoing to rotate logs...^[[0m <0xb6227b90>
05      10/18/10 20:47:44.311           ^[[33;1mNo callback received: await_callback: 30 timer: 31^[[0m <0xb7229b90>
05      10/18/10 21:13:18.043           ^[[33;1mNo callback received: await_callback: 179 timer: 31^[[0m <0xb7229b90>
05      10/18/10 21:15:23.892           ^[[33;1mNo callback received: await_callback: 192 timer: 31^[[0m <0xb7229b90>
05      10/18/10 21:47:03.587           ^[[33;1mNo callback received: await_callback: 122 timer: 31^[[0m <0xb7229b90>

I am using a usb to serial adapter to control my LG tv.  How do you know if it has the pl2303 chipset?  If it does, I can test that as well.  According to the web admin pages, my usb-to-serial is using device template #1811.  I don't know if that means anything, but when I unplug it, wait for the system to recognized that my tv has been unplugged, and then replug it back it.  When the blue (pre-Sarah screen) appear stating that I have plugged in a device, it lists the device as a usb-to-serial device, not as z-wave.

FWIW

bongowongo

  • wants to work for LinuxMCE
  • **
  • Posts: 826
    • View Profile
Re: TrickleStar ZWave auto detection script - testers needed
« Reply #13 on: October 19, 2010, 09:27:45 am »
It will tell if you use lsusb, in bash, on the device it is plugged in.

esev

  • Veteran
  • ***
  • Posts: 87
    • View Profile
    • Eric Severance
Re: TrickleStar ZWave auto detection script - testers needed
« Reply #14 on: October 19, 2010, 01:53:45 pm »
Unfortunately got tied up tonight- but I have at least 4 different zwave devices (I am assuming because I have 4 different numbers in front of the .ZWave.log files.  All but one is empty- this is in the one:

Thanks huh!  Looks like it detected your ZWave device properly.  Would you still happen to have any of the /var/log/pluto/*ZWave.sh* files around?  Or have they been deleted?  An example filename is Spawn_PNP Detection 9435 ZWave.sh_19831.log.  Inside you should see one of two things.  Either this if the script detected a ZWave device:
Code: [Select]
ZWave Detection script queue 9435, serial port /dev/ttyUSB0
\06\01\10\01\15Z-Wave 2.36\00\01\91
It is a ZWave interface
RESP: OK

Or this if it was unable to detect a ZWave device
Code: [Select]
ZWave Detection script queue 9897, serial port /dev/ttyUSB0
It's not a ZWave interface
RESP: OK

Thanks so much for giving this a try!
Eric Severance
My setup