[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby X10 Interface to Firecracker CM17A

Jim Weirich

12/30/2004 3:17:00 PM

I've got my first cut at a Ruby interface to the CM17A firecracker X10
module ready for public review. I'm particularly interested in feedback
from folks using the Firecracker CM17A on windows boxes to give it a try.
Currently you need a compile environment to build the C extension, but if
feedback is good, I'll look into making a binary distribution for windows.

Usage is simple:

require 'x10/cm17a'
lamp = X10.device('a1')
lamp.on
lamp.off
# etc

The software is available as a gem (gem install x10-cm17a) or as a tarball
from http://rubyforge.org/frs/?gr....

Thanks.

--
-- Jim Weirich jim@weirichhouse.org http://onest...
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)



7 Answers

Carl Youngblood

1/7/2005 9:10:00 PM

0

Jim Weirich wrote:

>I've got my first cut at a Ruby interface to the CM17A firecracker X10
>module ready for public review. I'm particularly interested in feedback
>from folks using the Firecracker CM17A on windows boxes to give it a try.
>Currently you need a compile environment to build the C extension, but if
>feedback is good, I'll look into making a binary distribution for windows.
>
>Usage is simple:
>
> require 'x10/cm17a'
> lamp = X10.device('a1')
> lamp.on
> lamp.off
> # etc
>
>The software is available as a gem (gem install x10-cm17a) or as a tarball
>from http://rubyforge.org/frs/?gr....
>
>Thanks.
>
As I understand it Jim, you are interfacing with the firecracker unit on
your Mac, right? Does that mean you figured out how to connect to the
serial port? Or am I mistaken?

Thanks,
Carl


Jim Weirich

1/7/2005 9:28:00 PM

0


Carl Youngblood said:
> Jim Weirich wrote:
>
>>I've got my first cut at a Ruby interface to the CM17A firecracker X10
>>module ready for public review. I'm particularly interested in feedback
>>from folks using the Firecracker CM17A on windows boxes to give it a try.
>>Currently you need a compile environment to build the C extension, but if
>>feedback is good, I'll look into making a binary distribution for
>> windows.
>>
>>Usage is simple:
>>
>> require 'x10/cm17a'
>> lamp = X10.device('a1')
>> lamp.on
>> lamp.off
>> # etc
>>
>>The software is available as a gem (gem install x10-cm17a) or as a
>> tarball
>>from http://rubyforge.org/frs/?gr....
>>
>>Thanks.
>>
> As I understand it Jim, you are interfacing with the firecracker unit on
> your Mac, right? Does that mean you figured out how to connect to the
> serial port? Or am I mistaken?

The firecracker connects to the serial port of the computer and I have
tested it against both windows and linux boxes. I've not heard of anyone
who as tried it on a Mac yet (although if you have a Mac, live in the
Cincinnati area and would like to test it, I'd be glad to bring my
hardware and met with you to give it a try :).

--
-- Jim Weirich jim@weirichhouse.org http://onest...
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)



Mike Clark

1/7/2005 9:35:00 PM

0


On Jan 7, 2005, at 2:28 PM, Jim Weirich wrote:

> The firecracker connects to the serial port of the computer and I have
> tested it against both windows and linux boxes. I've not heard of
> anyone
> who as tried it on a Mac yet (although if you have a Mac, live in the
> Cincinnati area and would like to test it, I'd be glad to bring my
> hardware and met with you to give it a try :).

I've tried using several USB-to-serial adapters to connect a
Firecracker to my Mac, each time with no luck. I believe the problem
is due to a timing issue with the Firecracker, though I've never been
able to confirm it. Other X10 kits are available for the Mac, of
course, but the Firecracker specifically seems to be Mac-unfriendly.

Mike



Jim Weirich

1/7/2005 9:55:00 PM

0


Mike Clark said:
>
> On Jan 7, 2005, at 2:28 PM, Jim Weirich wrote:
>
>> The firecracker connects to the serial port of the computer and I have
>> tested it against both windows and linux boxes. I've not heard of
>> anyone
>> who as tried it on a Mac yet (although if you have a Mac, live in the
>> Cincinnati area and would like to test it, I'd be glad to bring my
>> hardware and met with you to give it a try :).
>
> I've tried using several USB-to-serial adapters to connect a
> Firecracker to my Mac, each time with no luck. I believe the problem
> is due to a timing issue with the Firecracker, though I've never been
> able to confirm it. Other X10 kits are available for the Mac, of
> course, but the Firecracker specifically seems to be Mac-unfriendly.

Hmmm... The firecracker works by toggling the RTS/DTR signals of the RS272
port. This signals are NOT the normal signals used for serial data, but
are normally used for handshaking (I think ... my RS232 knowledge is a bit
rusty). The key is that most serial ports allow software control of those
signals, either through IOCTL calls in Unix or windows systems calls in
Windows.

If the Mac has no native RS232 ports, and uses a USB to Serial bridge, one
must ask:

(1) Does the bridge allow control of the of the RTS/DTR signals,
(2) is that control exerted through the normal IOCTL calls, and
(3) Will the bridge communicate changes in a timely enough fashion to
support the protocol.

If (1) and (2) are true, and (3) is the problem, we could try slowing down
the protocol (it is somewhat self clocking so timing is real critical).
Slowing down the procotol would be a simple change in the C code extension
in the library.

--
-- Jim Weirich jim@weirichhouse.org http://onest...
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)



Mike Clark

1/7/2005 10:58:00 PM

0


On Jan 7, 2005, at 2:54 PM, Jim Weirich wrote:

> If the Mac has no native RS232 ports, and uses a USB to Serial bridge,
> one
> must ask:
>
> (1) Does the bridge allow control of the of the RTS/DTR signals,
> (2) is that control exerted through the normal IOCTL calls, and
> (3) Will the bridge communicate changes in a timely enough fashion to
> support the protocol.
>
> If (1) and (2) are true, and (3) is the problem, we could try slowing
> down
> the protocol (it is somewhat self clocking so timing is real critical).
> Slowing down the procotol would be a simple change in the C code
> extension
> in the library.

I think the Keyspan adapter supports (1) and (2):


http://www.keyspan.com/support/macosx/usa/do...
ReadMeOSXUSA18.txt

I'm not sure I tried that exact unit.

Mike



Carl Youngblood

1/7/2005 11:09:00 PM

0

Mike Clark wrote:

> I've tried using several USB-to-serial adapters to connect a
> Firecracker to my Mac, each time with no luck. I believe the problem
> is due to a timing issue with the Firecracker, though I've never been
> able to confirm it. Other X10 kits are available for the Mac, of
> course, but the Firecracker specifically seems to be Mac-unfriendly.
>
> Mike

Does X10 have a controller that uses some other type of interface?


Mike Clark

1/8/2005 4:50:00 PM

0


On Jan 7, 2005, at 4:09 PM, Carl Youngblood wrote:

> Does X10 have a controller that uses some other type of interface?

There are a variety of X10 controllers that interface with the computer
using USB. The Firecracker, however, only interfaces with a serial
port.

Mike