x10 protocol DLL

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
griz
Enthusiast
Enthusiast
Posts: 167
Joined: Sun Jun 29, 2003 7:32 pm
Location: Canada

Post by griz »

I believe standard X10 equipment would be too slow to use a large building as a realtime/interactive video game display (PONG on a 8x18 matrix of windows). Once I've issued an X10 command on my powerlines it takes at least a second (sometimes longer) before the modules/devices respond.

As Fred mentioned, it's interesting to create a web server cgi that can control an X10 interface (via COM port). If you have a web server on your LAN you can control your X10 modules/appliances from any web browser/platform. Pocket PC via wireless is a great example of a portable X10 controller. Being able to do this from anywhere (the Internet) takes it to a new level. :)
ebs
Enthusiast
Enthusiast
Posts: 561
Joined: Fri Apr 25, 2003 11:08 pm

Post by ebs »

griz,

You're right. BlinkenLights was done using hardwired relays, not X10.

Eric
User avatar
griz
Enthusiast
Enthusiast
Posts: 167
Joined: Sun Jun 29, 2003 7:32 pm
Location: Canada

Post by griz »

Hi Fred

When I want to send an #X10_CMD_ALL_LIGHTS_ON command, how do I call it? The code below does not work, at least with my x10 devices (which work with the on/off commands just fine).

Code: Select all

CallFunction(0, "X10_SendModuleCommand", Controller, Asc(HomeID$), Val(UnitID$), #X10_CMD_ALL_LIGHTS_ON, 0)
Some of the commands work with all/select units and don't require HomeID/UnitID codes. What do I specify here? I have devices at A2 and A3 but how do I turn them both off with one command?
Fred
Administrator
Administrator
Posts: 18237
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

To be honnest, I'm not a x10 guru so I probably can't help much. From what I've seen, the commands are very devices dependant, which means than not all devices supports all commands. With my emitter/receiver, only the ON/OFF commands worked. None of the group commands worked. You can check the constants value but they should be ok...
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Does X10 work only with PC serial ports? I can't find information about this interfacing question.
But i've made several circuits to control ON/OFF of any AC devices, to check paper detection in ink-yet and termic printers, to analog control of filaments light bulb, to control coin-hoppers, step-motors, etc.
All of it using parallel port and/or serial port, relays, semiconductor-relays, AC-relays (contactors), MOSFET and bipolar transistors, triaks, optocouplers, and a little bit more, and of course a kernel driver (i use WinIO) if used under winxp, 2k, or nt. ...And of course too: PB :wink:

So, i can't understand a protocol which pretends to manage all; simply it is impossible, because each device is different. And it will be always veeeeery difficult to use, and veeery boring to read instructions.
Fred wrote:From what I've seen, the commands are very devices dependant, which means than not all devices supports all commands.
Of course, it is unavoidable because of the different functions of each device. It's not the same a washing machine that a calefactor or a filament light bulb, etc. For example you can control the light intensity of an incandescent filament of a light bulb, or the speed and direction of a DC motor or an AC triphasic electrical motor (using triaks), but you can't control the intensity of light of a fluorescent tube. And besides, for example the control of the freeze intensity for an electrical freezer is made in a different way than the control for a filement light, for example.

In conclusion: it is easier and faster to learn a little bit electronic than learn large manuals which always will be much more limited than what can be done with electronic circuits. In my opinion, of course. :wink:

Please take a look here, and save this link in a good place:
http://www.hut.fi/Misc/Electronics/circuits/
Its a veeeery good web, because author is very simple, clear and effective doing things. :wink:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
griz
Enthusiast
Enthusiast
Posts: 167
Joined: Sun Jun 29, 2003 7:32 pm
Location: Canada

Post by griz »

Does X10 work only with PC serial ports?
Serial and USB interfaces as far as I know, although most X10 software (like ActiveHome) will only communicate via a serial interface at this time.
So, i can't understand a protocol which pretends to manage all
X10 is very simple. Plug a lamp into an x10 module, and then into your home AC. Set it's address. From your computer you can now switch this lamp on/off. It isn't designed to do everything, but will interface with many real world appliances.
you can't control the intensity of light of a fluorescent tube
Well you could have several small flourescents, say 8, and switch some of them OFF to achieve a dimming effect...
it is easier and faster to learn a little bit electronic than learn large manuals which always will be much more limited than what can be done with electronic circuits.
I think it would be best to understand electronic circuits AND X10 and use them together. X10 makes your life easier. Have a look at
http://www.smarthome.com
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

griz wrote:Serial and USB interfaces as far as I know, although most X10 software (like ActiveHome) will only communicate via a serial interface at this time.
ok, then how i plug it to pc?
I can't imagine what x10 is.
griz wrote:X10 is very simple. Plug a lamp into an x10 module, and then into your home AC. Set it's address. From your computer you can now switch this lamp on/off.
But that is trivial to do without x10 :!:
griz wrote:Well you could have several small flourescents, say 8, and switch some of them OFF to achieve a dimming effect...
But it's not an analogic dimming :P
griz wrote:I think it would be best to understand electronic circuits AND X10 and use them together. X10 makes your life easier. Have a look at
http://www.smarthome.com
mmm... Are you a X10 seller? :P
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Max.²
Enthusiast
Enthusiast
Posts: 175
Joined: Wed Jul 28, 2004 8:38 am

Post by Max.² »

@ Psychophanta

The X10 protocol does not claim to control everything - but X10 compatible appliances.

X10 appliances mainly communicate via the power supply lines so you don't need to use additional wires. To control the appliances, you can use other X10 appliances (plug XY is controlled by switch UV), remote controls or a PC.

BTW, what is your problem? This is a thread about controlling X10 appliances via Purebasic. Nothing less, nothing more. :roll:
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Sorry, a last question.
Aren't there other different protocols to do so? Only x10?
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
griz
Enthusiast
Enthusiast
Posts: 167
Joined: Sun Jun 29, 2003 7:32 pm
Location: Canada

Post by griz »

@Psychophanta
ok, then how i plug it to pc? I can't imagine what x10 is.
A typical X10 interface is a box that plugs into your home AC wall outlet and your computer's serial port. X10 modules are also plugged into your AC. The X10 interface sends commands to the module through the AC power lines. It's that simple.
But that is trivial to do without x10
It's even easier to do with X10. No wiring, soldering, etc. Just plug it in.
mmm... Are you a X10 seller?
Nope. I'm trying to help you understand what X10 is.
Max.²
Enthusiast
Enthusiast
Posts: 175
Joined: Wed Jul 28, 2004 8:38 am

Post by Max.² »

Psychophanta wrote:Sorry, a last question.
Aren't there other different protocols to do so? Only x10?
Another one is EIB (formerly Instabus) by Siemens. Likely there are more; X10 is relatively common in the US and appliances are really cheap over there.
Shadow2002
User
User
Posts: 12
Joined: Mon Feb 20, 2006 7:17 am
Location: Lost in CyberSpace

Post by Shadow2002 »

I had a few questions. Pretty simple I guess. The first would be is this dll still working with your current applications. I cant seem to get it to work. I'm using a x10 Firecracker unit (CM17A). If you are all using a different unit could you please let me know what unit. I've been trying at this for a few days with nothing to show.

Thank you all for your time!
User avatar
dhouston
Enthusiast
Enthusiast
Posts: 430
Joined: Tue Aug 21, 2007 2:44 pm
Location: USA (Cincinnati)
Contact:

Post by dhouston »

It's not clear from the thread which of the X-10 interfaces work with the DLL. The Firecracker uses a totally different protocol from the CMxx serial interfaces or from any of the TTL interfaces. The various protocols are documented on the X-10 website.

http://software.x10.com/pub/manuals/cm17a_protocol.txt
http://software.x10.com/pub/manuals/cm11a_protocol.txt
http://www.x10.com/support/technology1.htm

The first two are fairly easy to handle with serial comms and you can find example VB code on the web.
Fred
Administrator
Administrator
Posts: 18237
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

IIRC, i own a CM11 interface (which is still driven by this DLL, but on linux now :) ). I don't have a CM17 to test, so i fear you will have to do your own investigations on this topic.
User avatar
dhouston
Enthusiast
Enthusiast
Posts: 430
Joined: Tue Aug 21, 2007 2:44 pm
Location: USA (Cincinnati)
Contact:

Post by dhouston »

The CM10a, CM11a, CM11e & CM12u are all serial devices that use the same communication protocol, for which there's a link in my earlier post.

While it connects to a PC serial port, the CM17a is not a normal serial device and it uses an entirely different protocol (again, there's a link in my earlier post). It draws power from the DTR and/or RTS lines and the relationship between those lines determines logic low and logic high. One or the other must be enabled at all times to avoid resetting the device. It requires sub-millisecond timing which is not native to PB but is available in the Windows API. There is a PIC in the CM17a which decodes the toggling of the control lines and, once it has a complete command, retransmits it via the RF transmitter in the CM17a. It was designed to allow pass-through of normal RS232 comms to a standard serial device connected to the downstream side of the CM17a.

There is some sample VB code here... which you can convert to PB.
Post Reply