| Home |Contact| e3value.com| cs.vu.nl|
e3value
Jaap Gordijn's website
18-07-2008 | The latest available version of the CM11XPL gateway is version 0.4

Welcome back!

  
home
personal
homeautomation
CM11ASimulator
CM11AXPL
WS2300XPL
about

New article

Technical Challenges in Market-Driven Automated Service Provisioning

>> more info | 5735 views

New article

Aligning Information System Design and Business strategy - A Starting Internet Company

>> more info | 6331 views

New article

Designing Value-based Inter-organizational Controls Using Patterns

>> more info | 6416 views

New article

A Model-based Approach to Aid the Development of e-Government Projects in Real-life Setting Focusing on Stakeholder Value

>> more info | 6536 views

New article

Business strategy-IT alignment in a multi-actor setting: A mobile e-service case

>> more info | 13083 views

New article

Consistency Checking Between Value Models and Process Models: A Best-of-Breed Approach

>> more info | 12994 views

New article

Value-driven coordination process design using physical delivery models

>> more info | 13162 views

New article

Value-Driven Service Matching

>> more info | 13132 views


Next >>>

Gordijn.org >> Personal >> Homeautomation >> CM11ASimulator >> Index

Print page    E-mail page    
 A CM11A simulator.

Rationale

I do most of my programming during traintrips and flights. So, I have then no CM11A at my disposal. That's why I needed a simulator. The development of the CM11AXPL gateway was almost entirely done using this emulator.

Funtionality

The simulator has the following functionality:

  • The simulator does simulation for:
  1. The CM11A itself
  2. One or more simulated X10 devices (on/off devices, dimmers)
  3. A remote control
  • For the CM11A, it simulates:
  1. CM11A X10 command (if you ask to change a device's state this happens) (not: X10 extended commands)
  2. CM11A Event report (if a X10 device changes state, the simulator reports this).
  3. CM11A Status report (if you ask for the status of the CM11A, this is reported back) .
  • X10 devices are simulated:
  1. On/Off devices and dimmers
  2. Two way devices (not X10 extended codes)
  • Remote control: using a command line interface, you can change the state of X10 devices, and the CM11A emulator reports this accordingly.

Installation

The distribution below are the sources, which you have to build yourself. To do so, you need:

  • log4j (I used version 1.2.13).
  • RXTX (serial API for Java). Please take note that not only you have to compile the simulator with RXTX, but that you have also to install the runtime files of RXTX (in short putting rxtxParallel.dll and rxtxSerial.dll in the bin directory of your Java distribution, see the RXTX documentation for more information).
  • com0com (this creates two virtual serial ports on your PC, which are connected as a null model. You connect the simulator to one port, and the program - communicating with the simulated CM11A) that should communicate with the simulator to the other port).

In CM11AEmulator.java, you can build your simulated X10 network:

  • Go to the constructor (CM11AEmulator())
  • Find here the statement "x10Network.add(new X10Device("Test", 'A', 1, true, true, cm11aExternalEventsSender));"
  • This is the way to create a new X10 device. The arguments are:
  1. A user-friendly name for the device
  2. Houscode
  3. DeviceCode
  4. Boolean: indicates if the device reports on X10 state requests
  5. Boolean: indicates if the device reports events
  6. always "cm11aExternalEventsSender"

Usage

You can start the code, as you are used to in your development environment. The following command line argument is taken:

  • -port COM6

This indicates the COM port used by the simulator (here, we use COM6, because this is a COM port we have configured with com0com).

After starting, every state change is logged.

You can also send commands yourself using a remote-control emulator. The following commands are available (thanks to Jesse Peterson, see below):

commands   = helpcmd | quitcmd | +( "(" command ")" )
helpcmd    = "help"
quitcmd    = "quit"
command    = house-code key-code [extra data]
house-code = "A"
           | "B"
           | "C"
           | "D"
           | "E"
           | "F"
           | "G"
           | "H"
           | "I"
           | "J"
           | "K"
           | "L"
           | "M"
           | "N"
           | "O"
           | "P"
key-code   = "01"  ; Unit 1
           | "02"  ; Unit 2
           | "03"  ; Unit 3
           | "04"  ; Unit 4
           | "05"  ; Unit 5
           | "06"  ; Unit 6
           | "07"  ; Unit 7
           | "08"  ; Unit 8
           | "09"  ; Unit 9
           | "10"  ; Unit 10
           | "11"  ; Unit 11
           | "12"  ; Unit 12
           | "13"  ; Unit 13
           | "14"  ; Unit 14
           | "15"  ; Unit 15
           | "16"  ; Unit 16
           | "A0"  ; All Units Off
           | "L1"  ; All Lights On
           | "ON"  ; On
           | "OF"  ; Off
           | "DI"  ; Dim
           | "BR"  ; Bright
           | "L0"  ; All Lights Off
           | "S1"  ; Status On
           | "S0"  ; Status Off
           | "SR"  ; Status Request

Example:
Turn on device A3(A03)(AON)
Turn off all lights for house code A AL0
Dim B13 by 11 dims(B13)(BDI11)

Limitations

  • As told earlier, not all CM11A functionality is covered, and also not all X10 functionality (e.g. no extended codes, and no macros)

  • The simulator does not simulate any timing issues of the CM11A (a real CM11A needs e.g. some time to respond on a command, this is not simulated).

Acknowledgements

The CM11A uses some of Jesse Peterson's Java classes (borrowed from his Java API for the CM11A), and some of his example code (e.g. for the remote control simulator

 Files and links
A Java-based simulator for the CM11A X10 device 12/05/06
55 KB
Sort by name,date,type
Quick links
Publication list
Publications of Jaap Gordijn can be found here
Publications
CM11A XPL gateway
A Java-based gateway between XPL (Lighting scheme) and the X10 CM11A
>> more info
CM11A simulator
A Java-based simulator for the X10 CM11A device
>> more info
MSc. assignments
Interested in a MSc assignment?
>> more info
HBO graduates in Information Sciences
HBO (HEAO-BI, HIO, HTS-TC, IandI, IE) graduates who want to start a master Information Sciences at Vrije Universiteit (VU) Amsterdam, please read on.
>> more info