Page 1 of 1

RCX to RCX comm, is disabling an option?

Posted: Mon Feb 12, 2007 5:05 pm
by stevendh
Hello all. I have just started using Lejos on my RCX brick, so let me give you a little background. I am doing a project over at the University of Washington, and our group is assigned the task of disabling other RCX bricks. My question is the following:

Can I set up my RCX brick to disable other RCX bricks over IR? I know that multiple RCX bricks can transmit messages back and forth, but is it possible to send some sort of global "shutdown" message?


Posted: Wed Feb 14, 2007 4:20 pm
by stevendh
Hmmm. I've been trying to see if there is any command to talk to another RCX brick. It looks like you can do it, but can you talk to another brick if it is not set up to receive your messages?

The end result needs to be something like:

-Send Message (Erase Program 1)
-Send Message (Run Program 1)

Or anything else that might crash or turn off the brick.

Posted: Wed Feb 14, 2007 5:51 pm
by bbagnall
Do you have one of those LEGO IR remote controls? I've never owned one, but I think we added a program that will interact with that in the examples. One of the commands in LEGO's remote control protocol is a power off command.

Posted: Wed Feb 14, 2007 9:11 pm
by stevendh
No, I don't have a remote control. These controls are actually prohibited in the final competition. So, can my RCX brick send out a command making it "look" like the remote control? This sounds great, but I don't know the command. I know it is more complicated than a simple command, but if someone knows how the remote control actually sends its commands, let me know.


University of Washington

Posted: Thu Feb 15, 2007 4:19 pm
by bbagnall
In the API docs take a look at:


Specifically RemoteControlSensor, which has the list of opcodes. The code OPCODE_POWER_OFF is the one you want to send.

Posted: Sat Feb 17, 2007 7:01 am
by stevendh
Hey thanks! This looks perfect for what I am doing.

Ok, here's the deal, i'm using the Lejos plugin for eclipse right now. I need to use josx.rcxcomm.remotecontrol.RemoteControlMessenger.

Unfortunately, RemoteControlMessenger is not there! I have searched and found the source code for this on the internet, but I now need to know why was it not included with the other files? I have tried to add it in to my project, but Eclipse doesn't like it (it cannot find the packages josx.rcxcomm.remotecontrol even though it is there...etc).

Is there any reason that RemoteControlMessenger is not included with Lejos? Or is there another way of sending messages with the existing three classes (RemoteControlListener, RemoteControlAdapter, and RemoteControlSensor)?

Posted: Sat Feb 17, 2007 7:36 am
by stevendh
Ok, now I am really confused.

If someone could post some code showing exactly how to send an opcode message via the IR port, I would be eternally grateful. I am doing my best to learn the comm api, but if someone could post sample code I know I would learn much faster.

Again, THANK YOU if you decide to post some code. All you guys on this forum have been very helpful, and I am very much impressed with your professionalism.

University of Washington

Posted: Mon Feb 19, 2007 12:30 am
by stevendh
Ok, here is my code so far...

import josx.rcxcomm.*;

public class prog1

public static final byte OPCODE_DELETE_FIRMWARE = (byte)0x65;

public static void main(String [] args) {

try {
RCXPort port = new RCXPort();

OutputStream os = port.getOutputStream();

catch (IOException ioe) {


This should just send the message to delete firmware (at least that is the goal). When I compile, I get the following problems:

Exception in thread "main" java.lang.UnsatisfiedLinkError: init
at josx.rcxcomm.LLC.init(Native Method)
at josx.rcxcomm.LLCHandler.<init>(
at josx.rcxcomm.RCXPort.<init>(
at prog1.main(

What is going on?

Steven Hansen
University of Washington

Posted: Mon Feb 19, 2007 3:31 am
by umeshnk
If you are using eclipse, download the plugins for lejos for eclipse web site. Then you can start a RCX client project. All the needed packages will be available then.

Posted: Tue Feb 20, 2007 12:57 am
by stevendh
I am currently using the Lejos plugin for Eclipse. I also have the RCXport jar and have migrated it into my project. The problem is that there is an error with linking the LLC class.

"Exception in thread "main" java.lang.UnsatisfiedLinkError: init
at josx.rcxcomm.LLC.init(Native Method)"

Why would it not be able to link the init method? Any ideas?

Steven Hansen
University of Washington

Posted: Sun Feb 25, 2007 8:58 am
by bbagnall
In the thread "IR communication" it sounds like someone is doing the same thing you are working on.