Please login or register.

Login with username, password and session length
Advanced search  

News:

The X10Hub (PiX10Hub) is here! Created by the Community, for the Community.:)% #:)

Pages: 1 [2]

Author Topic: Developing my own X10 Controller Software  (Read 31171 times)

Charles Sullivan

  • Hero Member
  • *****
  • Helpful Post Rating: 93
  • Posts: 1565
    • HEYU - X10 Automation for Linux, Unix, and Mac OSX
Re: Developing my own X10 Controller Software
« Reply #15 on: February 21, 2010, 06:41:00 PM »


It's possible that sending the 0x9b to stop the 0xa5 poll isn't sufficient if the CM11A clock isn't already set to a valid (although incorrect) date and time.

Let's try sending a valid time update:
  send  0x9b 0x2e 0x06 0x09 0x3e 0x01 0x00   (7 bytes, representing Sunday, Day 062, 18:06:46 - see protocol section 8)
  read back checksum  (0x7c - the sum of the 6 bytes following the 0x9b)
  send 0x00
  read back 0x55

Then try sending your commands again.

Logged
Yesterday it worked.
Today it doesn't work.
X10 on Windows is like that.

HEYU - X10 Automation for Linux, Unix, and Mac OS X     http://www.heyu.org

halju

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 11
Re: Developing my own X10 Controller Software
« Reply #16 on: February 21, 2010, 07:42:13 PM »

im getting the check sum 0x7c but still not getting the 0x55 after i send 0x00  B:(
Logged

Charles Sullivan

  • Hero Member
  • *****
  • Helpful Post Rating: 93
  • Posts: 1565
    • HEYU - X10 Automation for Linux, Unix, and Mac OSX
Re: Developing my own X10 Controller Software
« Reply #17 on: February 22, 2010, 08:53:26 AM »

im getting the check sum 0x7c but still not getting the 0x55 after i send 0x00  B:(

When you;
   send 0x04,0x66
   receive 0x6a
   send 0x00

The 0x55 won't be returned until after the X10 transmission is completed, which will take about 0.7 seconds.  Your read function may be timing out before then.  If your read function is not a blocking read (i.e., it sits and waits for a byte to be available) with an adjustable timeout, try reading up to 10 times with a 0.1 second delay between tries.
Logged
Yesterday it worked.
Today it doesn't work.
X10 on Windows is like that.

HEYU - X10 Automation for Linux, Unix, and Mac OS X     http://www.heyu.org

halju

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 11
Re: Developing my own X10 Controller Software
« Reply #18 on: February 22, 2010, 01:08:41 PM »

I'll extend the read time. What about sending the 0x00? Is there a time i should wait in between reading the checksum?
Like you said send the 0x9b then wait about 1-2 seconds
then send 0x04 0x66 and i receive the 0x6a about 1-2 milliseconds later
what is the time guidelines i should use when sending the 0x00? I'm using a homemade program similar to hyper-terminal, I almost think I'm not sending the 0x00 fast enough. it usually takes me 2-3 seconds to send the 0x00. is this to long?

also thanks for all your help so far, i really appreciate it
Logged

pconroy

  • Hero Member
  • *****
  • Helpful Post Rating: 9
  • Posts: 294
Re: Developing my own X10 Controller Software
« Reply #19 on: February 22, 2010, 07:23:08 PM »

The other thing you can do - I think - is loop a few times.

Send an 0x00.
Wait for an 0x55.
If you don't get it - sleep a smidge (or delay) and then loop again.

Make sure you code a loop exit...  :)


Also - if you're just trying to get things working - go ahead and put some lengthy delays in your code. Sleep a second or two.
Once you're happy your sending the right bytes, calculating the checksums, etc - then you can start trimming them down.

That's what I'd do.


I don't know if you can do this in your programming language - but I found it easier (for me at least) to dedicate a thread to servicing the port.
Input is thrown into a circular buffer as it comes in.  My other threads can pick it out at their leisure.  I really did this because my Powerlinc serial controller seems fond of sending garbage and I was tired of weeding thru it.  It's made my CM11A stuff easier, for me at least.

Just a thought.
Logged

halju

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 11
Re: Developing my own X10 Controller Software
« Reply #20 on: February 22, 2010, 09:26:59 PM »

Thank you everyone!!!! i was able to get it working!
thanks!!
Logged

Charles Sullivan

  • Hero Member
  • *****
  • Helpful Post Rating: 93
  • Posts: 1565
    • HEYU - X10 Automation for Linux, Unix, and Mac OSX
Re: Developing my own X10 Controller Software
« Reply #21 on: February 22, 2010, 10:37:02 PM »

Thank you everyone!!!! i was able to get it working!
thanks!!

 :)%
Please enlighten us as to what you did differently to get it working.
Logged
Yesterday it worked.
Today it doesn't work.
X10 on Windows is like that.

HEYU - X10 Automation for Linux, Unix, and Mac OS X     http://www.heyu.org
Pages: 1 [2]
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.