RCX to RCX comm, is disabling an option?

This is where you talk about the RCX software itself, installation issues, and programming talk.

Moderator: roger

RCX to RCX comm, is disabling an option?

Postby stevendh » Mon Feb 12, 2007 5:05 pm

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?

~Steven~
stevendh
New User
 
Posts: 16
Joined: Fri Feb 09, 2007 5:08 pm

Postby stevendh » Wed Feb 14, 2007 4:20 pm

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.
stevendh
New User
 
Posts: 16
Joined: Fri Feb 09, 2007 5:08 pm

Postby bbagnall » Wed Feb 14, 2007 5:51 pm

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.
User avatar
bbagnall
Site Admin
 
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Postby stevendh » Wed Feb 14, 2007 9:11 pm

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.

Thanks,

Steven
University of Washington
stevendh
New User
 
Posts: 16
Joined: Fri Feb 09, 2007 5:08 pm

Postby bbagnall » Thu Feb 15, 2007 4:19 pm

In the API docs take a look at:

josx.rcxcomm.remotecontrol

Specifically RemoteControlSensor, which has the list of opcodes. The code OPCODE_POWER_OFF is the one you want to send.
User avatar
bbagnall
Site Admin
 
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Postby stevendh » Sat Feb 17, 2007 7:01 am

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)?
stevendh
New User
 
Posts: 16
Joined: Fri Feb 09, 2007 5:08 pm

Postby stevendh » Sat Feb 17, 2007 7:36 am

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.

Steven
University of Washington
stevendh
New User
 
Posts: 16
Joined: Fri Feb 09, 2007 5:08 pm

Postby stevendh » Mon Feb 19, 2007 12:30 am

Ok, here is my code so far...

import josx.rcxcomm.*;
import java.io.*;

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();

os.write(123);
os.flush();
}
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>(LLCHandler.java:18)
at josx.rcxcomm.RCXPort.<init>(RCXPort.java:18)
at prog1.main(prog1.java:12)

What is going on?

Steven Hansen
University of Washington
stevendh
New User
 
Posts: 16
Joined: Fri Feb 09, 2007 5:08 pm

Postby umeshnk » Mon Feb 19, 2007 3:31 am

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.
umeshnk
New User
 
Posts: 12
Joined: Mon Jan 22, 2007 3:29 am
Location: Sri Lanka

Postby stevendh » Tue Feb 20, 2007 12:57 am

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
stevendh
New User
 
Posts: 16
Joined: Fri Feb 09, 2007 5:08 pm

Postby bbagnall » Sun Feb 25, 2007 8:58 am

In the thread "IR communication" it sounds like someone is doing the same thing you are working on.
User avatar
bbagnall
Site Admin
 
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm


Return to RCX Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff