ARM not responding to java code

I’m doing bluetooth control of the lynxmotion AL5A robot arm. I havent started with the BT yet i’m trying to get the arm to move via the serial cable first. I got the source code for motion from scot preston’s site and compiled it. However its the SSC 32 controller is not responding to the commands. All i actually did was to connect the arm setup via serial cable to my pc and test it with the RIOS software , to which is responds fine I might add. I then got the source code off the net and it compiles fine in my netbeans but the arm fails to respond.
Could the problem be because i’m running the code straight from the IDE?

Could the IDE (Netbeans 6.1) be the problem?

Could the fact that i’m using the JDK 6.0 instead of the JSDK the book recommended be a problem. Pls help urgently needed!!

Have you asked for help from Scott? I don’t know anything about the program. :frowning:

I’m not familiar with Scott Preston’s code or his book. (I’m assuming you’re using the book “Building Java Robots”.) I downloaded the code just now though and looked through it briefly. Some thoughts:

]His code relies on Sun’s javax.comm package. That is no longer supported by Sun on Windows, though I think it still works. Scott makes it available for download on his site. (You can’t download it from Sun these days.) You’ve installed that in to your JDK per the install instructions, correct?
[list]
](There are other ways to use it without installing per the instructions, but doing so is more complex.)/:m]
] Some people recommend installing the files in both the JDK and JRE directories. See here. /:m]/
:m]
]If it compiles without any errors in Netbeans, then it’s unlikely an incompatiblity problem with your JDK. Netbeans will not cause any explicit problems with what you’re trying to do.
/
:m]
]What program are you trying to run? Are you getting any errors or messages? You can try adding “System.out.println(“I am here”)” calls to your main method just to verify things are starting the way you think they should. Netbeans will show console output.
/
:m]
*]Have you tried running the org.javarobots.test.SerialSSC program? If so:

] You have the set the correct COM port (same as you use in RIOS) and nothing else is connected to the COM port when you run the program, right?/:m]
] Are you sure you’re specifying a valid servo PIN? Looks like this program defaults to PIN 0./:m]
] It looks like the code uses the Mini SSC-II Emulation capabilities of the SSC32. I’m not familiar with that, but would assume the code is correct regarding COM port setup, etc./:m]/*:m][/list:u]
I would think this should work without too much problem. If you are new to Java development, then you should probably stick with trying to get this to work. It’s most likely just a minor configuration or code problem.


If you are more familiar with Java development though, then there are some other alternatives to consider:

] RXTX - This is an open source and generally better replacement for Sun’s javax.comm implementation.
/
:m]
] Once you move to Bluetooth, you have some other options. You can continue to program as if using the serial port paradigms, and the underlying native Bluetooth library will handle the wireless Bluetooth specifics. In this case you’ll still be using javax.comm or rxtx from Java. Alternatively, you can use Bluetooth directly without an intermediate virtual COM port. JSR-82 is the standard API for interfacing Java and Bluetooth. I’ve recently used BlueCove to connect and control an SSC32 via a BlueSMIRF. I was using RXTX previously. I haven’t done a lot of testing yet, but the connect and disconnect using Bluecove is much faster than it was when using RXTX./:m]

thanx alot. I managed to get the robot working now via the serial cable. I just downloaded the eclipse and compiled the code in there and viola! I dont know why but i’m glad its working.
However i’m experiencing problems making the arm respond to the code via bluetooth. It works with the RIOS accompanying software but does not respond to scott’s code. I read his book and he said something about changing the port id to match the particular port the bluetooth is connected to. I’m at a loss as to which class to effect this change in. Pls help.

Are you constructing a new StandardSerialPort? If so, the first parameter (comID) is the COM port #.

I think the method for determining what COM port your bluetooth device is using differs per bluetooth stack and windows version, but in general you want to find where your bluetooth device is listed in Windows and check the properties to see what COM port # it’s assigned to.

I finally got the code to work via bluetooth on a desktop but when i tried running the exact same code using the same jdk and ide on some laptops, it didn’t work.
But the RIOS program works fine on the laptops via bluetooth. I’m thinking the code is not working because the laptops have no serial ports.
I need help trying to get it to work on my laptop. Could someone help me out with this?

Start here…

Serial / usb to serial port troubleshooting.
lynxmotion.net/viewtopic.php?t=4702

The List Open Ports code too does not list any open ports on any of the other machines now(i’ve now even tried it on another desktop with serial port-with no luck)
It only outputs “done!”
Don’t know what’s wrong. Need help

My only guess is that you have not installed the javax.comm package correctly on the other desktops. See:
] circuitnegma.wordpress.com/2007/ … vironment//:m]
] forums.sun.com/thread.jspa?threadID=501695/:m]

It’s working with RIOS, but not the java code. I’ve no experience with java, so sorry, I’m out of ideas.