Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Help with serial port

From: parki:whatevernot at: 30-Aug-2003 14:53

With some playing around, I have been able to get some data sent to the serial port, and a response from the X.10 controller. I am stumped now on being able to send a single 0 byte (?). Basically, I need to send down 0x06 0x61 to the X.10 controller, and it responds with a checksum (0x67) in response. I then send down one 0x00 byte instructing it to actually execute the command (turn on all lights), to which it responds with 0x55. The script (so far): ; I know that USA19QI14P1.1 controls the X.10 device system/ports/serial: [ cu.USA19QI13P1.1 cu.USA19QI14P1.1 ] ; Open the connection to the serial port serial-port: open/binary/direct/no-wait serial://port2/4800/8/none/1 serial-port/rts-cts: false update serial-port insert serial-port #{0661} At this point, I can read the response from the X.10 controller:
>> probe copy serial-port
#{67} Which is what we expect. So communications with the X.10 device certainly work. The next step is to send down one byte (0x00) and receive the response (0x55).
>> insert serial-port #{00} >> probe copy serial-port
#{} == #{} Not the 0x55 as expected. I am wonderfully stumped. The only conjecture that I have right now is that Rebol sends everything down the serial as two-byte words, and that "insert serial-port #{00}" really sends down 0x0000 (16 bits) which somehow upsets the X.10 device. Any idas? Progress certainly being made... Thanks, parki... On Saturday, August 30, 2003, at 10:40 AM, Brett Handley wrote: