Author Topic: XTB-232 via USB?  (Read 4214 times)

bkenobi

  • Hero Member
  • *****
  • Posts: 101
XTB-232 via USB?
« on: November 10, 2013, 07:57:41 AM »
I have a laptop I am looking to test HomeGenie (and other software potentially) with, but it does not have a RS232 port.  I have a USB to RS232 adapter, but I've heard that these don't work well with some devices.  Anyone know if this will have issues and if so with what?  If I try it and it fails right off the bat, it could be my settings.  On the other hand, I could try it and initially have success only to have issues later.  Just looking to hear any known experiences.

Off to try it anyway...   8)

Jeff

  • Administrator
  • Hero Member
  • *****
  • Posts: 205
    • Owner, JV Digital Engineering
Re: XTB-232 via USB?
« Reply #1 on: November 10, 2013, 11:53:05 AM »
I tested the XTB-232 myself on a windows XP computer with both an expensive Edgeport USB adapter and a cheapie I bought on eBay.  In both cases it worked fine.  I do not recall any problem report using the XTB-232 with any USB adapter since its release.

FYI, if anyone wants an Edgeport USB adapter, I have a few of the cable version left at a good price.  They are bulk packaged without documentation or drivers, but that can be downloaded from the manufacturer website.

Jeff
X10 automation since the BSR days...

bkenobi

  • Hero Member
  • *****
  • Posts: 101
Re: XTB-232 via USB?
« Reply #2 on: November 10, 2013, 08:22:07 PM »
My cheapo DealExtreme adapter (clone of PL-2303) seems to work on one machine but gives a driver error on the other.  It may not work well for testing, but oh well, I'm gonna try anyway.  I can't seem to find a reliable pin out for the XTB-IIR RJ11 pin out.  Rather than guess and check, does anyone have the correct pin out?  The primary issue is that I'm not sure how the connector pins are numbered (left to right, right to left, middle to outer, etc).

Pinouts:

RJ11               DB9
1   ZCD           ?   ???
2   Common    5   Signal Ground
3   X10 RX       3   Serial TX
4   X10 TX       2   Serial RX

Correct?  And what pin does the Zero Cross Detect hook up to?  Oh, and Pins are numbered left to right 1-4 with the latch facing down, right?
« Last Edit: November 10, 2013, 08:53:32 PM by bkenobi »

Jeff

  • Administrator
  • Hero Member
  • *****
  • Posts: 205
    • Owner, JV Digital Engineering
Re: XTB-232 via USB?
« Reply #3 on: November 10, 2013, 10:06:05 PM »
I can't seem to find a reliable pin out for the XTB-IIR RJ11 pin out.

The XTB-IIR digital port emulates the TW523 protocol.  It is not a standard serial port that can be connected to a computer - either RS232 or USB.  The TW523 protocol was defined by X10 before computers became a household item.  The protocol and pinout are defined in the X10 Technical Note that can be downloaded here:

    http://jvde.us/info/X10_protocol.pdf

Page 11 of that document defines the pinout and shows the expected interface.

The XTB-232 is a different animal, and is intended to connect directly to a computer.  Its protocol and pinout match the CM11A, which is defined in section 2 of this X10 document:

    http://jvde.us/info/CM11A_protocol.txt

To answer your other question, XTB-232 ground (pin 4) is on the right looking into the connector with the tab facing down toward the AC plug.

Jeff
« Last Edit: November 10, 2013, 10:12:26 PM by Jeff »
X10 automation since the BSR days...

bkenobi

  • Hero Member
  • *****
  • Posts: 101
Re: XTB-232 via USB?
« Reply #4 on: November 16, 2013, 12:05:04 PM »
I'm at a loss at the moment.  I have tried wiring this up in every way I can think of and I'm getting nothing.  The correct arrangement is supposed to be:

Code: [Select]
        Signal  DB9 Connector   RJ11 Connector
        SIN     Pin 2           Pin 1
        SOUT    Pin 3           Pin 3
        GND     Pin 5           Pin 4
        RI      Pin 9           Pin 2

I have wired up the connection that way and got nothing.  I switched the order thinking I had reversed pin1 and 4 on the RJ11, but that didn't work either.  I have been using a PL2303 clone (the only way I have access to serial on my laptop), but it hasn't worked out.  So, I tried the same adapter on my desktop with a couple LONG wires and couplers to make it reach the office.  The PL2303 did not work on that system either.  Likewise, that machine has no serial. 

My last resort is to try the HA server which does have serial.  I plugged the adapter directly into that system without the PL2303 and it still failed to connect.

Initially I tried using HomeGenie and then MisterHouse to connect to the XTB-IIR, but neither seemed to function.  Not knowing if this is hardware or software, I tried installing Home Domination which is listed to work with the XTB-232 on this site.  I tried that software on all 2 systems with no luck.  I was using the "send x10 command" dialog to send what are supposed to be raw x10 commands.

I'm not sure what else to try other than rewiring this thing again.  I really need to get a setup that I know will work (software primarily) so that I can move on with a config that I at least can trust will work with the right setup.

For reference, I know the XTB-IIR can send/receive commands through the XTB-232 emulator port as I was able to test that last year when working with my Arduino attic fan controller project.  In that test, everything worked absolutely beautifully!  This is quite opposite...

Jeff

  • Administrator
  • Hero Member
  • *****
  • Posts: 205
    • Owner, JV Digital Engineering
Re: XTB-232 via USB?
« Reply #5 on: November 16, 2013, 02:18:16 PM »
Maybe you are confused, but I am even more so.  Neither the XTB-IIR nor the XTB-523 were ever intended to connect to a computer serial port through a DB9 connector.  The XTB-523 is essentially the digital I/O portion of the XTB-IIR added to the XTBR plug-in unit.  Components and pinout are identical.

Even if it were possible to come up with a configuration to connect either the XTB-IIR or the XTB-523 to a computer, I am not aware of any PC-based automation program that will support the TW523 protocol.  Again, look at the X10 protocol document linked earlier.  That is not the kind of interface that can be provided directly by a PC serial port.  The timing is critical in the 100uS range.

The XTB-232 is a completely different unit.  It IS designed to connect to a computer serial port.  And it DOES work with a bunch of different PC-based automation programs that can use the X10 CM11A as a powerline interface.

To use an example, you're trying to put a DVD into a CD player, and expecting it to work.

Jeff
« Last Edit: November 16, 2013, 07:01:15 PM by Jeff »
X10 automation since the BSR days...

bkenobi

  • Hero Member
  • *****
  • Posts: 101
Re: XTB-232 via USB?
« Reply #6 on: November 16, 2013, 07:35:02 PM »
OK, I understand.  I was confused in that I thought the documentation of the XTB-IIR was a XTB-523 emulator which I thought was intended to be a RS232 interface.  Basically I was thinking the protocol and hookup were the same as the CM11A which does connect via the PC serial port.  I guess that explains why nothing has been working.

That being the case, is there a way to use the XTB-IIR with a computer to transmit/receive commands?  I can use my CM15A, but I was thinking it would just add an unnecessary layer.  The only way that I know would be possible would be using an Arduino as the interface.

Jeff

  • Administrator
  • Hero Member
  • *****
  • Posts: 205
    • Owner, JV Digital Engineering
Re: XTB-232 via USB?
« Reply #7 on: November 16, 2013, 08:26:45 PM »
The XTB-IIR and XTB-523 are TW523 emulators.  That is NOT RS232.  The XTB-232 is the one that emulates the computer RS232 serial interface.  The names should make it obvious which did what.

A number of controllers can use the XTB-523 or XTB-IIR as a powerline interface.  Included are Stargate, HomeVision, Ocelot, Leopard, Elk M1, Omni Pro II, Foard, DSC, and even the WGL V572A transceiver.  There are probably others that I am not familiar with.

As stated previously, there is no way to directly connect the XTB-IIR to a computer to send or receive X10 commands.  You need some piece of hardware that converts from the computer serial port protocol to the X10 TW523 protocol.  The CM15A, CM11A, XTB-232, and PowerLinc are some of the devices that can interface directly to a computer.  Your Arduino is probably the best choice to do the conversion from a computer to a TW523 interface.

Jeff

« Last Edit: November 16, 2013, 09:28:21 PM by Jeff »
X10 automation since the BSR days...

noam

  • Active Newbie
  • *
  • Posts: 7
Re: XTB-232 via USB?
« Reply #8 on: November 20, 2013, 06:28:15 AM »
OK, I understand.  I was confused in that I thought the documentation of the XTB-IIR was a XTB-523 emulator which I thought was intended to be a RS232 interface.  Basically I was thinking the protocol and hookup were the same as the CM11A which does connect via the PC serial port.  I guess that explains why nothing has been working.

That being the case, is there a way to use the XTB-IIR with a computer to transmit/receive commands?  I can use my CM15A, but I was thinking it would just add an unnecessary layer.  The only way that I know would be possible would be using an Arduino as the interface.
I'm currently using the XTB-IIR's TW-523 emulation port with an Arduino, with great results (so far).
I'm only using it to transmit commands (from the Arduino), but there are libraries for receiving as well (I think I got the demos working, but never went beyond that).
the connection to the Arduino is really simple, involving the four pins and a resistor (you'd have to look up the pinout - I don't have my code or my notes with me).

One of my "back burner" projects was an X10 controller based on an Arduino, Raspberry Pi, or BeagleBone Black. However, I haven't had nearly enough time to explore those any further.
Currently, my Arduino-based HVAC monitoring system is able to send X10 commands via the XTB-IIR to turn my attic fan (controlled by an X-10 compatible Insteon switch) on and off.

Take a look around for Arduino examples for X10. There are a bunch of them out there. Unfortunately, many of them hack a CM17A serial-to-RF transmitter, which doesn't help you in this case. I have looked at a few Arduino libraries for X10, and the best one I found is *really* complex (sorry, I don't have the link at the moment), but really neat at the same time. I'm not a very experienced programmer, so I wasn't able to make it do everything I initially wanted - so I put that on hold once I got my basic needs working.

bkenobi

  • Hero Member
  • *****
  • Posts: 101
Re: XTB-232 via USB?
« Reply #9 on: November 20, 2013, 10:30:39 AM »
That is actually what the goal was intended to be.  I wanted to use an embedded controller to send/receive commands through the XTB-IIR emulated TW523 port and then add on wireless via W800RF of some variant.  My initial thought was to connect that port directly to the Raspberry Pi and use the CM11A control built into one of the available programs, but then I realized that I was confusing this port with that on the XTB-232.  In any case, I'm not planning on going this route right now.  Instead, I'll get things up and running with a CM15A first and then toy with including an Arduino->XTB-IIR port somehow.  I'm currently waiting for my Raspberry Pi to be delivered so I can start playing.

Since I already have a system that's working (for the most part), this new controller will be used for testing until it's fully reliable (hopefully).  I'm seriously thinking about including some kind of camera interface in this too so I can trigger lights and video/image capture into one centrally located HA controller.  That's a big step down the road though.