RCX serial commands

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: RCX serial commands

Post by mattallen37 »

Instead of a USB tower, I can just use a COM port. Right now, I am using a virtual COM port (FTDI HW). I can communicate with BCC using COM 2 (in this case). BrickOS should be able to do the same... no real need for USB IR Tower.

Can you give me advice for setting up BrickOS on a Win 7 64-bit machine?

The protocol changing would be for extra speed talking with additional HW (other RCX's, NXT though the IR Link, PICAXE, Arduino...), not the IR tower (computer communication). The computer to RCX speed is okay. I am not a fan of the slow speeds, but with the computer, it is just for debugging and setup, not for real-time robots (like additional HW would be for). Once I get into computer programming, that will be a different story though...

Basically, I want byte by byte accessibility in my programs. Normally, the header, inverse, and checksum are all processed by the FW, and if it doesn't totally match up, it discards the whole string. I want it to still be looking for Opcodes, but for all the other strings (wrong header...) I want program access to every byte.

Like I say, computer communication speed is not my biggest issue here.

Yes, I have read some about RCX DCC, but have never tried any of it. I mostly use the NXT for my robot brains, but an RCX running a DCC generator would be a nice addition. The idea of using DCC decoders for lego motors is not what I am looking for (I can make, and have, motor multiplexers). And yes, I do have DCC HO trains (that's what I want the DCC generator for).

Wow, I didn't know there were that many FW projects for the RCX... That's quite a few.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
mesheets
Posts: 11
Joined: 21 Apr 2011, 19:28

Re: RCX serial commands

Post by mesheets »

mattallen37 wrote: Instead of a USB tower, I can just use a COM port. Right now, I am using a virtual COM port (FTDI HW). I can communicate with BCC using COM 2 (in this case). BrickOS should be able to do the same... no real need for USB IR Tower.
BrickOS supports communication via serial COM and USB IR Tower, plus a TCP connection that can be used to facilitate communication over a network or to the BrickEmu emulator.

mattallen37 wrote: Can you give me advice for setting up BrickOS on a Win 7 64-bit machine?
There are at least three possible routes, so pick your poison. ;-)
  • Setup Cygwin and build your own H8300 toolchain
  • Install a SliTaz virtual machine, setting up the serial and/or USB connections to pass through to the VM. I already have most of the H8300 toolchain built and packaged for SliTaz.
  • Install a Linux-in-Windows distribution such as andLinux or coLinux and build your own H8300 toolchain
mattallen37 wrote: The protocol changing would be for extra speed talking with additional HW (other RCX's, NXT though the IR Link, PICAXE, Arduino...), not the IR tower (computer communication).
Baud rate and protocol changes are available to both RCX-PC connections and RCX-RCX connections. Really, the RCX doesn't know the source of the IR signals--it could be a PC, another RCX, a remote, a Palm device running pBrick Remote, etc. All incoming IR signals appear the same to the RCX. With the right IR TCP server setup, you could even have an emulated RCX communicating with a "real," physical RCX. Theoretically, one RCX should even be able to download firmware to another RCX (though I've never attempted that).

mattallen37 wrote: Basically, I want byte by byte accessibility in my programs. Normally, the header, inverse, and checksum are all processed by the FW, and if it doesn't totally match up, it discards the whole string. I want it to still be looking for Opcodes, but for all the other strings (wrong header...) I want program access to every byte.
It sounds like the lower layers of LNP might be pretty close to what you're seeking....

mattallen37 wrote: Yes, I have read some about RCX DCC, but have never tried any of it. I mostly use the NXT for my robot brains, but an RCX running a DCC generator would be a nice addition. The idea of using DCC decoders for lego motors is not what I am looking for (I can make, and have, motor multiplexers)....

Wow, I didn't know there were that many FW projects for the RCX... That's quite a few.
There's one version of firmware (LDCC) that even enables the RCX to act as a mini DCC command station. I'm currently investigating some booster and DCC integration capabilities.

mattallen37 wrote: And yes, I do have DCC HO trains (that's what I want the DCC generator for).
Have you picked any particular railroad or era to model, or do you pretty much like them all? ;-) I've largely settled on Chessie System, with a focus on the B&O and WM territories. :-)
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: RCX serial commands

Post by mattallen37 »

I previously installed Cygwin, but have never used it... I am not a computer programmer (yet). How would you recommend I get started with BrickOS? Perhaps slightly OT, but I noticed that BCC supposedly supports it to some extent. I am very comfortable using the BCC IDE, and would like to know if it really would support BrickOS, and what it would take to get it working.

I have read some about LDCC, but it seems too limited for what I want... I want total control through either the program, or IR directly (such as from the NXT).

No I haven't, I like all the American freight trains (sorry to you Europeans, but the European trains look absolutely awful). I haven't added much to my collection for a year or so, and only have a partially finished (track and roadbed laid, but no turf or trees in place yet, and only a little ballast) 4'x6' layout. It has two main lines, turnouts to connect them, a TT, and a few spurs. It is wired into about 8-10 blocks, but I run DCC, so they are almost always all on (unless reprogramming). The controller is just a Bachmann E-Z Command DCC system (big reason to upgrade to something that can program CVs... like a lego RCX). I mostly run smaller diesels (GP-38, GP-40, 70 ton switch engine...), a couple small steam (0-4-0 and 0-6-0), as well as a couple mid sized diesel engines (SD-40, SD-45). I have a few 4-8-4s, but my layout is to small to have the minimum radius required to run them. I don't have any specific era or road name that I steer towards.

Please note, that my main wish at this time is to get the IR control I want (and I really like what I have read about BrickOS). After I get that all settled, then perhaps I will try getting DCC to work. When it is time to actually work on getting DCC to work, I think I should be able to build a booster fairly easily (basically just an H-Bridge) so that the trains will actually run (I don't think they would do very well on 9v at only around 300ma ;)).
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
mesheets
Posts: 11
Joined: 21 Apr 2011, 19:28

Re: RCX serial commands

Post by mesheets »

LDCC itself isn't so much for programming as it is for running as a DCC command station; however, the DCC packet generation capabilities have been ported to the pbForth and patched BrickOS firmwares to facilitate programmatic control of the packet generation. LDCC is able to accept commands via IR, though, so another RCX or other IR source could send commands to an RCX running LDCC. One area where LDCC might be of help to you, though, is with the DCC CV programming. Check the "Decoder Programming" section on this LDCC page. There is a newer version of LDCC on the beta page, as well as a separate LACC firmware that enables an RCX to serve as a DCC booster or a DCC stationary decoder.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: RCX serial commands

Post by mattallen37 »

Yea, I know LDCC is not to be programmed with... that's why I've never tried it.
...however, the DCC packet generation capabilities have been ported to the pbForth and patched BrickOS firmwares to facilitate programmatic control of the packet generation.
That sounds like exactly what I want.
LDCC is able to accept commands via IR, though, so another RCX or other IR source could send commands to an RCX running LDCC
Yea, but there isn't the full control that I want (AFAIK).
One area where LDCC might be of help to you, though, is with the DCC CV programming
That would definitely be a bonus, but the main idea is to just control them.
...as well as a separate LACC firmware that enables an RCX to serve as a DCC booster
The RCX H-Bridges are really small, I think it would be better to use a separate booster (not to mention that trains require a higher voltage than the RCX can handle).
...or a DCC stationary decoder
Being a stationary decoder might be cool, but for things like turnouts (and any future lights), I should be able to program a PICAXE to control. I would have the NXT be the user-interface and data distribution center. It would send commands to the RCX to run the DCC signals, and to the PICAXE to control the turnouts (and TT, if I motorize it).

I guess for both my wishes (good IR control, and DCC), I need BrickOS... Any idea where I can get help with it?
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
mesheets
Posts: 11
Joined: 21 Apr 2011, 19:28

Re: RCX serial commands

Post by mesheets »

mattallen37 wrote: I guess for both my wishes (good IR control, and DCC), I need BrickOS... Any idea where I can get help with it?
The best source is likely still lugnet.com's lugnet.robotics.rcx.legos newsgroup. You can view via a web browser or subscribe using a newsgroup reader. Though the newsgroup is very low traffic, several of very knowledgeable people still check new postings. To increase the likelihood of a response, try to clearly articulate what you have attempted and where you think you might be having a problem. If someone throws out a vague, "I need help, can you get this working for me" post, that might not generate a response. Based on your postings here, I doubt you'll have much difficulty in that regard.

Particularly if desiring to run under Windows 7, It is important to keep in mind that BrickOS was designed for a *nix environment. That's why even if you use BrickOS from within Windows, to get it working you have to deal with *nix-like things such as Cygwin.

I put together the "unofficial" release described in the lugnet post linked to earlier and try to assist as time permits. Unfortunately, other responsibilities and activities in life sometimes push the RCX to the back burner....
mesheets
Posts: 11
Joined: 21 Apr 2011, 19:28

Re: RCX serial commands

Post by mesheets »

mattallen37 wrote: for things like turnouts (and any future lights), I should be able to program a PICAXE to control. I would have the NXT be the user-interface and data distribution center. It would send commands to the RCX to run the DCC signals, and to the PICAXE to control the turnouts (and TT, if I motorize it).
Though not directly related to any of the MindStorms sets, I thought I would also pass along a few links that you might find of interest on the DCC side of things.

While the open source JMRI software has been popular as a computer-based DCC interface, another open source project project worth mentioning is Rocrail. (Rocrail was started by some developers in Germany, so you may have to get used to some of the European lingo.) In addition to software, though, Rocrail is interesting in that it also has open-sourced the designs for various DCC hardware components. While there is a list of quite a few designs here, a few that might be of interest to you are the ORD-1 driver (command station) and booster and the ORTT-1 Turntable Controller. There are other designers for detectors, decoders, etc. The ORF-1 is a feedback sensor that is based on the S88. The S88 has proven itself to be a popular DIY choice for getting feedback, and on the aforementioned Rocrail hardware page, there is also a link to more detailed information on using the S88 in a model railroad setup.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: RCX serial commands

Post by mattallen37 »

Okay, wow. Thanks for all that info. I'll be sure to check it out :D
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
h-g-t
Posts: 552
Joined: 07 Jan 2011, 08:59
Location: Albania

Re: RCX serial commands

Post by h-g-t »

There is some info on the IR setup here - http://legolab.daimi.au.dk/CSaEA/RCX/Ma ... al.html#IR
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 19 guests