Author Topic: Supporting the ACT Solutions ZCU201 USB Z-wave Interface  (Read 91431 times)

cyr

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Supporting the ACT Solutions ZCU201 USB Z-wave Interface
« Reply #75 on: January 26, 2008, 11:32:00 am »
I did some munching to the spcp8x5 code and managed to compile and load the module on 0704. If somebody feels like sending me a ZCU201...


Thanks for the patch, I got the module to compile for my kernel (2.6.21.5) and it loaded.

However, when I loaded the module with my ZCU201 plugged in, this is what I got in my kernel log:

Code: [Select]
Jan 24 18:17:55 kira kernel: usbcore: registered new interface driver usbserial
Jan 24 18:17:55 kira kernel: drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
Jan 24 18:17:55 kira kernel: usbcore: registered new interface driver usbserial_generic
Jan 24 18:17:55 kira kernel: drivers/usb/serial/usb-serial.c: USB Serial Driver core
Jan 24 18:17:55 kira kernel: drivers/usb/serial/usb-serial.c: USB Serial support registered for <NULL>
Jan 24 18:17:55 kira kernel: spcp8x5 2-2:1.0: <NULL> converter detected
Jan 24 18:17:55 kira kernel: usb 2-2: <NULL> converter now attached to ttyUSB0
Jan 24 18:17:55 kira kernel: usb 2-2: <NULL> converter now attached to ttyUSB1
Jan 24 18:17:55 kira kernel: usb 2-2: <NULL> converter now attached to ttyUSB2
Jan 24 18:17:55 kira kernel: usb 2-2: <NULL> converter now attached to ttyUSB3
Jan 24 18:17:55 kira kernel: usb 2-2: <NULL> converter now attached to ttyUSB4
Jan 24 18:17:55 kira kernel: usb 2-2: <NULL> converter now attached to ttyUSB5
Jan 24 18:17:55 kira kernel: usb 2-2: <NULL> converter now attached to ttyUSB6
Jan 24 18:17:55 kira kernel: usb 2-2: <NULL> converter now attached to ttyUSB7
Jan 24 18:17:55 kira kernel: usb 2-2: <NULL> converter now attached to ttyUSB8
Jan 24 18:17:55 kira kernel: usb 2-2: <NULL> converter now attached to ttyUSB9
Jan 24 18:17:55 kira kernel: usb 2-2: <NULL> converter now attached to ttyUSB10
Jan 24 18:17:55 kira kernel: usb 2-2: <NULL> converter now attached to ttyUSB11
Jan 24 18:17:55 kira kernel: usb 2-2: <NULL> converter now attached to ttyUSB12
Jan 24 18:17:55 kira kernel: usb 2-2: <NULL> converter now attached to ttyUSB13
Jan 24 18:17:55 kira kernel: usbcore: registered new interface driver spcp8x5
Jan 24 18:17:55 kira kernel: /usr/src/spcp8x5/spcp8x5.c: SPCP8x5 USB to serial adaptor driver v0.01

I didn't expect the driver to register 14 devices :)

I'm not much of a kernel hacker, so I have real idea how to debug this...

Worse things happened when I tried actually opening the device (ttyUSB0) in my test program...

Code: [Select]
Jan 24 20:15:10 kira kernel: BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000
Jan 24 20:15:10 kira kernel:  printing eip:
Jan 24 20:15:10 kira kernel: cf988866
Jan 24 20:15:10 kira kernel: *pde = 00000000
Jan 24 20:15:10 kira kernel: Oops: 0000 [#1]
Jan 24 20:15:10 kira kernel: Modules linked in: spcp8x5(F) usbserial(F) rfcomm(F) l2cap(F) wlan_tkip wlan_xauth ipt_MAS$
Jan 24 20:15:10 kira kernel: CPU:    0
Jan 24 20:15:10 kira kernel: EIP:    0060:[<cf988866>]    Tainted: PF      VLI
Jan 24 20:15:10 kira kernel: EFLAGS: 00010086   (2.6.21.5 #4)
Jan 24 20:15:10 kira kernel: EIP is at spcp8x5_close+0x56/0x190 [spcp8x5]
Jan 24 20:15:10 kira kernel: eax: c1ce6ad0   ebx: 00000246   ecx: c9dede80   edx: c9dede74
Jan 24 20:15:10 kira kernel: esi: 00000000   edi: 00000000   ebp: ca9b6a00   esp: c9dede60
Jan 24 20:15:10 kira kernel: ds: 007b   es: 007b   fs: 00d8  gs: 0033  ss: 0068
Jan 24 20:15:10 kira kernel: Process zw_serial (pid: 7459, ti=c9dec000 task=c1ce6ad0 task.ti=c9dec000)
Jan 24 20:15:10 kira kernel: Stack: c0102ab3 ca9b6a00 cf98a5c0 ca9b6a08 c2280ca0 00000000 c1ce6ad0 c010e870
Jan 24 20:15:10 kira kernel:        c653911c c653911c ca9b6a00 c2280ca0 c6539000 ca9b6a08 cf9aa343 cd8027f8
Jan 24 20:15:10 kira kernel:        c01d880f cf9aff40 c6f954e0 fffffe00 c6539000 0bc00000 c6f954e0 00000100
Jan 24 20:15:10 kira kernel: Call Trace:
Jan 24 20:15:10 kira kernel:  [<c0102ab3>] common_interrupt+0x23/0x30
Jan 24 20:15:10 kira kernel:  [<c010e870>] default_wake_function+0x0/0x10
Jan 24 20:15:10 kira kernel:  [<cf9aa343>] serial_open+0x103/0x160 [usbserial]
Jan 24 20:15:10 kira kernel:  [<c01d880f>] kobject_get+0xf/0x20
Jan 24 20:15:10 kira kernel:  [<c01f58fd>] tty_open+0x14d/0x2c0
Jan 24 20:15:10 kira kernel:  [<c0152c60>] chrdev_open+0x70/0x130
Jan 24 20:15:10 kira kernel:  [<c0152bf0>] chrdev_open+0x0/0x130
Jan 24 20:15:10 kira kernel:  [<c014ed7f>] __dentry_open+0xaf/0x1c0
Jan 24 20:15:10 kira kernel:  [<c014ef45>] nameidata_to_filp+0x35/0x40
Jan 24 20:15:10 kira kernel:  [<c014ef9b>] do_filp_open+0x4b/0x60
Jan 24 20:15:10 kira kernel:  [<c014effa>] do_sys_open+0x4a/0xe0
Jan 24 20:15:10 kira kernel:  [<c014f0cc>] sys_open+0x1c/0x20
Jan 24 20:15:10 kira kernel:  [<c01027c6>] sysenter_past_esp+0x5f/0x89
Jan 24 20:15:10 kira kernel:  =======================
Jan 24 20:15:10 kira kernel: Code: 18 b8 70 e8 10 c0 89 54 24 14 8d 54 24 14 89 44 24 1c 8b 45 04 05 1c 01 00 00 e8 36 $
Jan 24 20:15:10 kira kernel: EIP: [<cf988866>] spcp8x5_close+0x56/0x190 [spcp8x5] SS:ESP 0068:c9dede60
Jan 24 20:16:14 kira kernel: usb 2-2: USB disconnect, address 2
Jan 24 20:16:14 kira kernel: BUG: unable to handle kernel paging request at virtual address 0100012c
Jan 24 20:16:14 kira kernel:  printing eip:
Jan 24 20:16:14 kira kernel: c011f1d3
Jan 24 20:16:14 kira kernel: *pde = 00000000
Jan 24 20:16:14 kira kernel: Oops: 0002 [#2]
Jan 24 20:16:14 kira kernel: Modules linked in: spcp8x5(F) usbserial(F) rfcomm(F) l2cap(F) wlan_tkip wlan_xauth ipt_MAS$
Jan 24 20:16:14 kira kernel: CPU:    0
Jan 24 20:16:14 kira kernel: EIP:    0060:[<c011f1d3>]    Tainted: PF      VLI
Jan 24 20:16:14 kira kernel: EFLAGS: 00010202   (2.6.21.5 #4)
Jan 24 20:16:14 kira kernel: EIP is at queue_work+0x3/0x30
Jan 24 20:16:14 kira kernel: eax: cefee8c0   ebx: cefee8c0   ecx: 00000000   edx: 0100012c
Jan 24 20:16:14 kira kernel: esi: 00000008   edi: c2280ca0   ebp: c475ac18   esp: ce049ea4
Jan 24 20:16:14 kira kernel: ds: 007b   es: 007b   fs: 00d8  gs: 0000  ss: 0068
Jan 24 20:16:14 kira kernel: Process khubd (pid: 512, ti=ce048000 task=c1225af0 task.ti=ce048000)
Jan 24 20:16:14 kira kernel: Stack: c3646c01 cf9a99d4 c3647b68 ca8a69a0 cf852543 c475ac00 c475ac18 cf98a4e0

etc. etc.

I had to reboot the machine.


hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Supporting the ACT Solutions ZCU201 USB Z-wave Interface
« Reply #76 on: January 26, 2008, 11:44:13 am »
I had to reboot the machine.

ok, i'll look into that.. i hoped to come by with those little mods, but i have to go through the whole code.

I'll provide a new module soon.

best regards,
Hari
rock your home - http://www.agocontrol.com home automation

cyr

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Supporting the ACT Solutions ZCU201 USB Z-wave Interface
« Reply #77 on: January 26, 2008, 11:50:37 am »
Great, I'll be happy to test it (although not on my router/asterisk machine this time I think  ;) ).

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Supporting the ACT Solutions ZCU201 USB Z-wave Interface
« Reply #78 on: January 26, 2008, 12:08:52 pm »
Great, I'll be happy to test it (although not on my router/asterisk machine this time I think  ;) ).
sorry, it was meant to be a test ;) i don't have the device myself, so i can't try..

i've made some changes and it should now register all usb stuff correctly (you should not get plenty of devices any more). But be aware, i still have 3 warnings left (initialization from incompatible pointer type).

I'm looking at that at the moment but if you are not faint hearted you may try that in between (v0.02):
[link removed - crashes]

best regards,
Hari
« Last Edit: January 26, 2008, 12:30:57 pm by hari »
rock your home - http://www.agocontrol.com home automation

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Supporting the ACT Solutions ZCU201 USB Z-wave Interface
« Reply #79 on: January 26, 2008, 12:20:38 pm »
Great, I'll be happy to test it (although not on my router/asterisk machine this time I think  ;) ).
sorry, it was meant to be a test ;) i don't have the device myself, so i can't try..

i've made some changes and it should now register all usb stuff correctly (you should not get plenty of devices any more). But be aware, i still have 3 warnings left (initialization from incompatible pointer type).

I'm looking at that at the moment but if you are not faint hearted you may try that in between (v0.02):
[link removed - crashes]



best regards,
Hari


ok, wait another 15 minutes, i found the problem and am fixing it.
« Last Edit: January 26, 2008, 12:31:23 pm by hari »
rock your home - http://www.agocontrol.com home automation

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Supporting the ACT Solutions ZCU201 USB Z-wave Interface
« Reply #80 on: January 26, 2008, 12:23:32 pm »
ok, lets try that:

http://vt100.at/spcp8x5.ko-003

no guarantees ;)

i'm still verifying some low level routines.

best regards,
Hari
rock your home - http://www.agocontrol.com home automation

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Supporting the ACT Solutions ZCU201 USB Z-wave Interface
« Reply #81 on: January 26, 2008, 12:40:14 pm »
ok, lets try that:

http://vt100.at/spcp8x5.ko-003

no guarantees ;)

i'm still verifying some low level routines.

best regards,
Hari
i had not seen that you are not using 2.6.20 so I have committed the actual version into the trunk:
http://svn.charonmedia.org/trac.cgi/browser/home/hari/spcp8x5
rock your home - http://www.agocontrol.com home automation

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Supporting the ACT Solutions ZCU201 USB Z-wave Interface
« Reply #82 on: January 26, 2008, 08:26:00 pm »
nobody?
rock your home - http://www.agocontrol.com home automation

cyr

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Supporting the ACT Solutions ZCU201 USB Z-wave Interface
« Reply #83 on: January 27, 2008, 09:31:45 am »
I'll try it out later today when I get back home.

Thanks!

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Supporting the ACT Solutions ZCU201 USB Z-wave Interface
« Reply #84 on: January 27, 2008, 12:40:16 pm »
I'll try it out later today when I get back home.

Thanks!
ok,
best regards,
Hari
rock your home - http://www.agocontrol.com home automation

cyr

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Supporting the ACT Solutions ZCU201 USB Z-wave Interface
« Reply #85 on: January 27, 2008, 05:46:21 pm »
It works!

No crash, and my little Z-Wave test software works as well.

I just turned on some lights via Linux for the first time...

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Supporting the ACT Solutions ZCU201 USB Z-wave Interface
« Reply #86 on: January 27, 2008, 05:48:55 pm »
perfect ;)

could you please tell me the usb id's (man./device).
If you want you could try to add the id to the ZWave device template. That should make it plug and play in lmce after the module is loaded (maybe even gets autoloaded after depmod and such)

best regards and thank you for testing,
Hari

ps: could you please provide me with the actual dmesg output?

EDIT: totallymaxed reported the id's: "Vendor ID is 04FC and Product ID is 0201."
« Last Edit: January 27, 2008, 06:26:53 pm by hari »
rock your home - http://www.agocontrol.com home automation

cyr

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Supporting the ACT Solutions ZCU201 USB Z-wave Interface
« Reply #87 on: January 27, 2008, 07:39:39 pm »
Code: [Select]
usbcore: registered new interface driver usbserial
drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
drivers/usb/serial/usb-serial.c: USB Serial Driver core
drivers/usb/serial/usb-serial.c: USB Serial support registered for SPCP8x5
usbcore: registered new interface driver spcp8x5
/usr/src/spcp8x5/spcp8x5.c: SPCP8x5 USB to serial adaptor driver v0.03
usb 2-2: new full speed USB device using uhci_hcd and address 3
usb 2-2: configuration #1 chosen from 1 choice
spcp8x5 2-2:1.0: SPCP8x5 converter detected
usb 2-2: SPCP8x5 converter now attached to ttyUSB0

And I can confirm the vendor/product ID.

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Supporting the ACT Solutions ZCU201 USB Z-wave Interface
« Reply #88 on: January 27, 2008, 07:47:02 pm »
And I can confirm the vendor/product ID.
ok. Maybe you want to try it on lmce, too?

best regards,
Hari
« Last Edit: January 27, 2008, 07:49:01 pm by hari »
rock your home - http://www.agocontrol.com home automation

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Supporting the ACT Solutions ZCU201 USB Z-wave Interface
« Reply #89 on: January 27, 2008, 08:37:42 pm »
Great Work Hari!!!
The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.