X10 Community Forum

💬General Category => Mac/Linux & Open Source and the X10 Home => Topic started by: neo11 on June 15, 2010, 02:12:32 PM

Title: Powerlinc II
Post by: neo11 on June 15, 2010, 02:12:32 PM
Hi all. Anyone have any experience with this beast (1132B i think). :) If not I guess it's hacky tweaky
time here. I have a Red-hat system running 2.6.33 kernel on a AMD 64 platform. Any pointers would be
nice. I don't really expect anything to be out there but it don't hurt to ask the guru's I have no problem
poking at it with C,Jave etc, but don't want to duplicate anything already out there. Thanks People.
 
Title: Re: Powerlinc II
Post by: Brian H on June 15, 2010, 04:15:32 PM
I have a few of them, but only where used with their TesterLinc Signal tester and their custom WGL V572 receiver kit.

If you have not gotten the users manual and technical documentation there are links on the sales page.

http://www.smarthome.com/1132B/PowerLinc-Serial-TW523-X10-Interface-with-12VDC-Output/p.aspx

PowerLinc II sounds more like their 2414U USB and 2414S serial Insteon Power Line Controller or the 2412U USB and 2412S Serial Power Line Modem. They can do Insteon and X10 signaling. The 2414S is now discontinued and the 2412S is back ordered for another month and a half.
Title: Re: Powerlinc II
Post by: pconroy on June 15, 2010, 04:37:58 PM
Like Brandt said - see if you can post the model number.
I have an earlier version of the 1132B - and it's easy to program.

I believe it's *Wish* that has support built it for it already.
IIRC - Wish is the project name that builds /dev/x10/xxxxx entries on Linux to control the device.
Title: Re: Powerlinc II
Post by: neo11 on June 15, 2010, 04:44:44 PM
Thanks for the reply. I see hat the powerlink II allows for attachment of TW523/PSC05 in addition
to a computer serial port. I have a couple of these also. Information on the use of these things is
murky at best. Is the testerlink product available from smart home also ?
Thanks ++
 
Title: Re: Powerlinc II
Post by: pconroy on June 15, 2010, 04:55:57 PM
what device are you looking at?
can you post a URL?
Title: Re: Powerlinc II
Post by: neo11 on June 15, 2010, 05:01:17 PM
Like Brandt said - see if you can post the model number.
I have an earlier version of the 1132B - and it's easy to program.

I believe it's *Wish* that has support built it for it already.
IIRC - Wish is the project name that builds /dev/x10/xxxxx entries on Linux to control the device.

 The model no of the thing I have. is 1132B, That's the number printed on the units label.
The box it came in says PowerLinc II Model 1132B. Thats all I can see from outside.  Would
be most excellent if you could give a url to *Wish* so I could check it out.
Thanks ++  :)%
Title: Re: Powerlinc II
Post by: neo11 on June 15, 2010, 05:08:07 PM
what device are you looking at?
can you post a URL?

This is the URL of this device
http://www.smarthome.com/1132B/PowerLinc-Serial-TW523-X10-Interface-with-12VDC-Output/p.aspx
Title: Re: Powerlinc II
Post by: Brian H on June 15, 2010, 06:31:44 PM
Thanks for the confirmation. That is the one I thought it maybe
You are correct. I looked at one of mine and the box does say PowerLinc II.

The Insteon ones say PowerLinc V2  ???
Title: Re: Powerlinc II
Post by: pconroy on June 16, 2010, 01:16:22 AM
Like Brandt said - see if you can post the model number.
I have an earlier version of the 1132B - and it's easy to program.

I believe it's *Wish* that has support built it for it already.
IIRC - Wish is the project name that builds /dev/x10/xxxxx entries on Linux to control the device.

 The model no of the thing I have. is 1132B, That's the number printed on the units label.
The box it came in says PowerLinc II Model 1132B. Thats all I can see from outside.  Would
be most excellent if you could give a url to *Wish* so I could check it out.
Thanks ++  :)%

http://wish.sourceforge.net/

and spend some time here:

http://www.linuxha.com/athome/index.html

good luck!
Title: Re: Powerlinc II
Post by: neo11 on June 17, 2010, 12:43:22 PM
Thats a really cool couple of links. Thanks. Is there anywhere that has a list of X-10 commands
for this thing?

Thanks again
Title: Re: Powerlinc II
Post by: Brian H on June 17, 2010, 12:48:21 PM
http://www.smarthome.com/manuals/1132B_Programming.pdf
http://www.smarthome.com/manuals/1132B_web.pdf
http://www.smarthome.com/manuals/man-1136.pdf
Title: Re: Powerlinc II
Post by: pconroy on June 17, 2010, 06:06:16 PM
If you have the serial version - it's pretty easy.
open() the port.
start write()'ing and read()'ing bytes.

I should have Java and 'C' code lying around somewhere to get you started if you'd like it.
Title: Re: Powerlinc II
Post by: neo11 on June 17, 2010, 06:29:53 PM
If you have the serial version - it's pretty easy.
open() the port.
start write()'ing and read()'ing bytes.

I should have Java and 'C' code lying around somewhere to get you started if you'd like it.

Would appreciate looking at that . C for me no problemo. Java too. Thanks++  :)%
Have done alot of C C++ Java and linux driver work. Just don't know the commands
to shove at it. Oh and one off topic question , how the h*ll do you get your avatar to
show up ?
Thanks++
Title: Re: Powerlinc II
Post by: Alan V on June 17, 2010, 07:09:13 PM

...how the h*ll do you get your avatar to
show up ?
Thanks++


Try making it 65 by 65 pixels.  Then it should work.
Title: Re: Powerlinc II
Post by: neo11 on June 17, 2010, 07:39:44 PM

...how the h*ll do you get your avatar to
show up ?
Thanks++


Try making it 65 by 65 pixels.  Then it should work.

Thanks it did !  :)%
Title: Re: Powerlinc II
Post by: pconroy on June 17, 2010, 11:05:27 PM
I'll try to assemble some relevant snippets and get them to you.

Java serial port programming is a little bit of a pain - you have to download some extra libs.
If you have your heart set on Java - you can start prepping your environment to give Java access to the serial port.
Google away for that one.

C/C++ will be able to open the ports without hassle.

Jesse Peterson wrote some good Java code.
"heyu" is a C program that accesses the port - but finding what you're after in that code base can be a little daunting if you've not looked at it before.

Here, I pulled up my IDE.
This is the open() code I use:

// -----------------------------------------------------------------
int X10Controller::connect (const string portName, const int baudRate)
{
    setPortName( portName );

    //
    //  open up the serial port
    struct  termios     adtio;
    int     portstatus;

    if ((this->portNum = open( this->portName.c_str(), O_RDWR | O_NOCTTY | O_NONBLOCK)) < 0)    {
        std::cout << "Unable to open the X10Controller on serial device " << this->portName << "\n";
        this->isOpen = false;
    } else {
        //
        // We want full control of what is set and simply reset the entire adtio struct
        memset( &adtio, 0, sizeof( adtio ) );

        // Serial control options
        adtio.c_cflag &= ~PARENB;      // No parity
        adtio.c_cflag &= ~CSTOPB;      // One stop bit
        adtio.c_cflag &= ~CSIZE;       // Character size mask
        adtio.c_cflag |= CS8;          // Character size 8 bits
        adtio.c_cflag |= CREAD;        // Enable Receiver
        adtio.c_cflag &= ~HUPCL;       // No "hangup"
        adtio.c_cflag &= ~CRTSCTS;     // No flowcontrol
        adtio.c_cflag |= CLOCAL;       // Ignore modem control lines

        // Baudrate, for newer systems
        cfsetispeed( &adtio, baudRate );
        cfsetospeed( &adtio, baudRate );

        // Serial local options: adtio.c_lflag
        // Raw input = clear ICANON, ECHO, ECHOE, and ISIG
        // Disable misc other local features = clear FLUSHO, NOFLSH, TOSTOP, PENDIN, and IEXTEN
        // So we actually clear all flags in adtio.c_lflag
        adtio.c_lflag = 0;

        // Serial input options: adtio.c_iflag
        // Disable parity check = clear INPCK, PARMRK, and ISTRIP
        // Disable software flow control = clear IXON, IXOFF, and IXANY
        // Disable any translation of CR and LF = clear INLCR, IGNCR, and ICRNL
        // Ignore break condition on input = set IGNBRK
        // Ignore parity errors just in case = set IGNPAR;
        // So we can clear all flags except IGNBRK and IGNPAR
        adtio.c_iflag = IGNBRK|IGNPAR;

        // Serial output options
        // Raw output should disable all other output options
        adtio.c_oflag &= ~OPOST;

        adtio.c_cc[ VTIME ] = 10;           // timer 1s
        adtio.c_cc[ VMIN ] = 0;             // blocking read until 1 char

        if (tcsetattr( this->portNum, TCSANOW, &adtio ) < 0) {
            // cout << "Unable to initialize serial device";
        } else {
            tcflush( this->portNum, TCIOFLUSH );

            //
            // Set DTR low and RTS high and leave other ctrl lines untouched
            ioctl( this->portNum, TIOCMGET, &portstatus);    // get current port status
            portstatus &= ~TIOCM_DTR;
            portstatus |= TIOCM_RTS;
            ioctl( this->portNum, TIOCMSET, &portstatus );    // set current port status

            this->isOpen = true;
        }
    }

    return ( this->isOpen ? this->portNum : 0 );
}   // open

Title: Re: Powerlinc II
Post by: neo11 on June 17, 2010, 11:14:46 PM
I have no great love of Java just that I can use it if I have to . Java is a pig and a
pain sometimes. C,C++ is fine . The snippet you sent is great thanks. OO in C++
is faster which is an issue for control systems I would think. A hacking I will go eh?
  B:(
Title: Re: Powerlinc II
Post by: pconroy on June 18, 2010, 06:50:07 PM
Well, we're off in the weeds, but I'll toss out I have no love for C++.  I much prefer Java and am glad that I only do C++ when forced.   ;D
I agree Java is a pig - which is why I turned to C and C++ for this, as it's running on my 450MHz PII, ten year old, twenty dollar, craigslist laptop, with 256MB.  My 36K C executable (statically linked too) would be 36MB or more in Java.   rofl

Anyway - once the port is opened, the nice thing about the Powerlinc, is that 0x0D will end all xmissions. You can loop and read bytes until you hit 0X0D.

My write code:
// -----------------------------------------------------------------
int     X10Controller::writeData (byte *buffer, unsigned int bufLen)
{
    if (!this->isOpen)
        return 0;

    int numWritten = (int) write( this->portNum, buffer, bufLen );
    tcdrain( this->portNum );   // wait for all output written
    return numWritten;
}


I can post my read code, but it probably isn't what you wanted.
I implemented the serial port read as a separate thread - that thread plucks chars off the port and stuffs them into a buffer.
Other threads, lock the buffer, pluck characters out, and move the buffer pointers.

To start off you're going to want to do, more or less:

do {
   read();
until (buf[ 0 ] = 0x0D);


One thing to watch for is that I ended up reading a ton of NAKs (0x15), NULLs (0x00) in the stream.
I felt the only way to make sense of the data was to skip over those.

Also started getting some 0xC5s and the end too, before I gave up on the unit.
Title: Re: Powerlinc II
Post by: neo11 on June 18, 2010, 08:12:24 PM
Well, we're off in the weeds, but I'll toss out I have no love for C++.  I much prefer Java and am glad that I only do C++ when forced.   ;D
I agree Java is a pig - which is why I turned to C and C++ for this, as it's running on my 450MHz PII, ten year old, twenty dollar, craigslist laptop, with 256MB.  My 36K C executable (statically linked too) would be 36MB or more in Java.   rofl

Anyway - once the port is opened, the nice thing about the Powerlinc, is that 0x0D will end all xmissions. You can loop and read bytes until you hit 0X0D.




Thanks a bunch for your input  >! Didnt want you to have to get your weed wacker out  :'(
Also didnt want to start a language war  ;). They generate more heat then light unfortunately.
Please excuse as I truncated your code in the quote in the interest of saving bandwidth. This
looks the kind of stuff I had to do for terminal emulation code .  It's nice to see some real world
experience with this stuff.  I shall quote you copiously in anything I come up with. :)%. Just a
couple of questions . I read someplace that the baudrate of this things serial port is 19200. Is that
true?  and does this unit accept the PSC05/523 commands ? Before I start in earnest I need to
get a filter for my computers UPS as I found it's a major signal sucker (eats x10 signals).
This is way cool I should have something working pretty soon. Thanks++
 #:)

Title: Re: Powerlinc II
Post by: Brian H on June 19, 2010, 06:45:49 AM
There is a 1132B programming manual available on the 1132B's sales page link in your earlier post.
It says 9600 baud; 8 bit; 1 stop bit; no parity.
It also shows the PSC05/TW523 pins on the 1132B's interface connector.
I have used an 1132B with a WGL V572 all house code transceiver. It uses the PSC05/TW523 to send X10 power line signals.
The PSC05/TW523 is not serial. You physically have to toggle control lines to send and receive X10 signals. You have to do all the encoding of the data to properly toggle the control lines in sync with the zero crossing signal. There is also a link to a PSC05 manual on the 1132Bs sales page in your earlier post.

You may have seen the 2412S PLM's specifications. It is 19,200 baud; 8 bit; 1 stop bit; no parity
The 2412S PLM uses a completely different set of commands to do things versus the 1132B.

There is data on the 2412S here:
http://www.madreporite.com/insteon/insteon.html
Title: Re: Powerlinc II
Post by: neo11 on June 19, 2010, 09:32:35 PM
There is a 1132B programming manual available on the 1132B's sales page link in your earlier post.
It says 9600 baud; 8 bit; 1 stop bit; no parity.
It also shows the PSC05/TW523 pins on the 1132B's interface connector.
I have used an 1132B with a WGL V572 all house code transceiver. It uses the PSC05/TW523 to send X10 power line signals.
The PSC05/TW523 is not serial. You physically have to toggle control lines to send and receive X10 signals. You have to do all the encoding of the data to properly toggle the control lines in sync with the zero crossing signal. There is also a link to a PSC05 manual on the 1132Bs sales page in your earlier post.

You may have seen the 2412S PLM's specifications. It is 19,200 baud; 8 bit; 1 stop bit; no parity
The 2412S PLM uses a completely different set of commands to do things versus the 1132B.

There is data on the 2412S here:
http://www.madreporite.com/insteon/insteon.html

Thanks guys. Mucho info has been provided , This board is WAY COOL !  >! Don't think I could have got
this info anywhere else. I am impressed with the technical knowledge available here. This in no way
normal for most devices I have tried to work with. Even those I have worked with as a
contractor for a manufacturer  :o. Almost scary but Great  :)% . Enough of my babbling
now on to work >*<.
Title: Re: Powerlinc II
Post by: neo11 on July 10, 2010, 10:20:24 PM
Well, found something I really didnt want to know, looks like I threw away $40.00. After fooling around
with a scope and a serial sniffer program, found no activity at all in the serial interface, not even a
RS232 voltage on the DB9 cable. So I did the unthinkable and took the thing apart. There is no intelligence
at all in this thing. Just a power supply and a pass through 3 prong socket plug. Sucks . I guess I have to
buy something else but cant tell from the web page I ordered it on. No wonder nobody knows anything
about it. I could have made a 12v power supply for about $20.00 . Maybe I can find out how to still use it
but there nothing there , not even a processor chip. I am kinda pissed as you prolly can tell. Thanks for
the help anyways guys. Dont buy thing thinking to use it with your computer. If anyone knows anything
to make this thing something other then a paperweight , please speak up.  >*< Maybe I have to get a
PSC05 or something. I have one in my junk box.  ::)
Title: Re: Powerlinc II
Post by: Brian H on July 11, 2010, 10:04:31 AM
My 1132B definitely has electronics in it. The controller and RS232 ICs are surface mounted on the back of the PC Board and not visible.
If you just removed the top cover and saw the power supply components and AC pass through outlet pins. You may have thought there was no Processor and RS232 ICs in it.

Near the right edge of the board near J4 {Firmware programming connector} is there a silk screened PowerLinc II?

On mine with the serial cable. Pin 2, RX Data to PC,  is about -9.76 volts when referenced to the Pin 5 common.
My RS232 breakout box with a dual color LED is not fast enough to see the swing but on an analog meter the pointer does kick toward the plus side. When an X10 signal is received from the power line.

On the RJ45 style connector. Pin 1 RX Data to PC is -9.76 volts referenced to pin 7 common and pin 2 raw +12 Volts is about 20 volts with no load with reference to again pin 7 common.

If there is no RS232 voltage on pin 2 to pin 5 of the DB9 cable from the 1132B. The RS232 cable or the PowerLinc II maybe defective.

Since the PowerLinc II does not have hardware handshaking. Make sure your RS232 port is not wanting a handshake.

Any chance you have a computer that can run the PowerLinc Synapse {on the sale page}  program to test it?

PSC05 is not a serial device.
Title: Re: Powerlinc II
Post by: pconroy on July 11, 2010, 11:45:44 AM
Also - I have an older Powerlinc Serial.
I don't know where you live Neo, but I live in Colorado.

I'd be willing to ship you mine, temporarily, to see if you can get your software going.
Or we can swap units - temporarily, as I'm pretty sure you don't want mine long term - to see if we can get each others to work.

:)

Good luck!
Title: Re: Powerlinc II
Post by: neo11 on July 11, 2010, 04:03:03 PM
My 1132B definitely has electronics in it. The controller and RS232 ICs are surface mounted on the back of the PC Board and not visible.
If you just removed the top cover and saw the power supply components and AC pass through outlet pins. You may have thought there was no Processor and RS232 ICs in it.

Near the right edge of the board near J4 {Firmware programming connector} is there a silk screened PowerLinc II?

On mine with the serial cable. Pin 2, RX Data to PC,  is about -9.76 volts when referenced to the Pin 5 common.
My RS232 breakout box with a dual color LED is not fast enough to see the swing but on an analog meter the pointer does kick toward the plus side. When an X10 signal is received from the power line.

On the RJ45 style connector. Pin 1 RX Data to PC is -9.76 volts referenced to pin 7 common and pin 2 raw +12 Volts is about 20 volts with no load with reference to again pin 7 common.


If there is no RS232 voltage on pin 2 to pin 5 of the DB9 cable from the 1132B. The RS232 cable or the PowerLinc II maybe defective.

Since the PowerLinc II does not have hardware handshaking. Make sure your RS232 port is not wanting a handshake.

Any chance you have a computer that can run the PowerLinc Synapse {on the sale page}  program to test it?

PSC05 is not a serial device.

Thanks for this info. My ignorance is not in doubt here. That I got prematurely pissed is probably correct. :-[  I did buy this thing
so It's my problem . I will look at this thing with your info in mind. I wouldn't pitch in any event. Thanks for the information and it just
goes to prove that it pays to ask somebody that knows WTF they are doing when you don't  :-[ I understand the PSC05 is not a serial
device. I will poke around in my cable box to see if I have a way of hooking my windows laptop to the unit. The laptop has a Db25 serial
cable plug not a Db9. Is an older Think pad T42 laptop. Boy, when your jump to conclusions sometimes you hit the ground hard  :o ouch.
Title: Re: Powerlinc II
Post by: neo11 on July 11, 2010, 04:31:07 PM
My 1132B definitely has electronics in it. The controller and RS232 ICs are surface mounted on the back of the PC Board and not visible.
If you just removed the top cover and saw the power supply components and AC pass through outlet pins. You may have thought there was no Processor and RS232 ICs in it.

Near the right edge of the board near J4 {Firmware programming connector} is there a silk screened PowerLinc II?

On mine with the serial cable. Pin 2, RX Data to PC,  is about -9.76 volts when referenced to the Pin 5 common.
My RS232 breakout box with a dual color LED is not fast enough to see the swing but on an analog meter the pointer does kick toward the plus side. When an X10 signal is received from the power line.

On the RJ45 style connector. Pin 1 RX Data to PC is -9.76 volts referenced to pin 7 common and pin 2 raw +12 Volts is about 20 volts with no load with reference to again pin 7 common.

If there is no RS232 voltage on pin 2 to pin 5 of the DB9 cable from the 1132B. The RS232 cable or the PowerLinc II maybe defective.

Since the PowerLinc II does not have hardware handshaking. Make sure your RS232 port is not wanting a handshake.

Any chance you have a computer that can run the PowerLinc Synapse {on the sale page}  program to test it?

PSC05 is not a serial device.

Oh BTW the silk screen Powerlinc II is as you describe so all is not lost for me I guess.
Title: Re: Powerlinc II
Post by: neo11 on July 11, 2010, 05:25:27 PM
My 1132B definitely has electronics in it. The controller and RS232 ICs are surface mounted on the back of the PC Board and not visible.
If you just removed the top cover and saw the power supply components and AC pass through outlet pins. You may have thought there was no Processor and RS232 ICs in it.

Near the right edge of the board near J4 {Firmware programming connector} is there a silk screened PowerLinc II?

On mine with the serial cable. Pin 2, RX Data to PC,  is about -9.76 volts when referenced to the Pin 5 common.
My RS232 breakout box with a dual color LED is not fast enough to see the swing but on an analog meter the pointer does kick toward the plus side. When an X10 signal is received from the power line.

On the RJ45 style connector. Pin 1 RX Data to PC is -9.76 volts referenced to pin 7 common and pin 2 raw +12 Volts is about 20 volts with no load with reference to again pin 7 common.

If there is no RS232 voltage on pin 2 to pin 5 of the DB9 cable from the 1132B. The RS232 cable or the PowerLinc II maybe defective.

Since the PowerLinc II does not have hardware handshaking. Make sure your RS232 port is not wanting a handshake.

Any chance you have a computer that can run the PowerLinc Synapse {on the sale page}  program to test it?

PSC05 is not a serial device.

Of coarse , you are correct. Downloaded the synapse program and ran on my laptop and the powerlinc works fine. I however don't
evidently  :-[ . The powerlinc was found and could control some appliance modules I had hooked up previously. At least I know it
works. That's a fabulous step for me. Now I can troubleshoot the computer comm problem. Probably as you say a handshake problem.
Thanks++ for the tips. As always , you guys ROCK !
Title: Re: Powerlinc II
Post by: Brian H on July 11, 2010, 06:02:13 PM
Glad you are making some progress.
Title: Re: Powerlinc II
Post by: pconroy on July 11, 2010, 11:18:58 PM
Time to compare our code that opens the serial port, would be my next guess.
Title: Re: Powerlinc II
Post by: neo11 on July 12, 2010, 02:54:38 AM
Time to compare our code that opens the serial port, would be my next guess.

Ok, When I get to that point. Right now I am just sniffing the power line stuff via the powerlinc.
I have gotten to the point were I can see the traffic. (Wiring problem in the computers serial port).
The powerlinc is working ok now after fixing that. Now going around to find all the signal suckers and
noise generators in the house. This to insure I have a stable signal environment in which to work.
I am using a program called slsniff to watch the serial traffic. I am using this so I can be sure that
my Linux box can see the traffic. Also have the source code. To this point , it can. I am having some
intermittent strangeness with X-10 stuff but it's not software related as it happens with a palm remote
HR12a-> TM751 so its probably a noise issue somewhere in the house. Want to ferret that out before
I have another stupidity attack (blaming the wrong thing like I did before  ;). )  Very frustrating when
you can't depend on your working environment. Many computers/devices have been hammered to death
from that  ::). But I think I am on my way to doing something other then whine   8). Now on to reading
about the X-10 troubleshooting info on this board. Thanks a lot for your help along with Brian H for setting
me straight. Still say U guys ROCK #:) 
Title: Re: Powerlinc II
Post by: pconroy on July 12, 2010, 05:30:20 PM
As long as you're making headway.  :)
Title: Re: Powerlinc II
Post by: neo11 on July 12, 2010, 07:55:35 PM
As long as you're making headway.  :)

I actually think I am making good headway  on this. :)%. After information posted by you  Brian H, and
others,I got things going  ;D , The ship has left the dock and I see no water on the deck  :o. I am now
looking at the environment here . If I run into something strange you will definitely be the one I will ask
for help if thats ok with you. Just so happy the thing appears to work  :)% The help offered by guys on
this forum has been steller !  :)% . Almost scary  ;D