PortInUseException on Mac

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

Moderators: 99jonathan, roger, imaqine

PortInUseException on Mac

Postby eagereyes » Sun Mar 18, 2007 1:31 pm

I have started playing with iCommand on the Mac, but can't get it to work. I have installed everything, paired the NXT (it works in the Lego software), and renamed the tty. I keep getting the following error:
Code: Select all
Error while connecting NXTCommand() constructor
gnu.io.PortInUseException: Unknown Application
        at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354)
        at icommand.nxtcomm.NXTComm.open(Unknown Source)
        at icommand.nxtcomm.NXTCommand.<clinit>(Unknown Source)
        at icommand.platform.nxt.Motor.stop(Unknown Source)
        at RadioControl.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:613)
Exception in thread "Thread-2" java.lang.NullPointerException
        at icommand.nxtcomm.NXTComm.sendData(Unknown Source)
        at icommand.nxtcomm.NXTCommand.sendRequest(Unknown Source)
        at icommand.nxtcomm.NXTCommand.setOutputState(Unknown Source)
        at icommand.platform.nxt.Motor.stop(Unknown Source)
        at RadioControl.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:613)

From googling, it seems that lots of people have this problem, but I haven't seen any solutions. It looks like the problem is the initiation of the Bluetooth connection, since the CommPortIdentifier.open() method throws this particular exception when the port is not available. Perhaps RXTX needs to do something special when dealing with Bluetooth serial ports? The port is certainly not in use, I even checked that with lsof.

Does anybody have any ideas what might be wrong? Also, I have seen several mentions of a new release - any idea when that will come out?
eagereyes
New User
 
Posts: 2
Joined: Sun Mar 18, 2007 1:17 pm

Postby eagereyes » Sun Mar 18, 2007 1:52 pm

This is odd, I just played around a bit more and found this: I can manually open the connection by doing a cat:
Code: Select all
cat > /dev/tty.NXT

The Bluetooth icon in the taskbar then shows the connected dots, and the NXT also shows the <> next to the BT icon. iCommand/RXTX still can't connect, even though the BT preferences show the NXT as being connected (this is of course after the cat is no longer using the device).
eagereyes
New User
 
Posts: 2
Joined: Sun Mar 18, 2007 1:17 pm

Postby Romain » Thu May 10, 2007 3:46 pm

Hi,

I am currently testing iCommand on a Windows XP SP2 environment and I encounter the same error than eagereyes.

Actually, I read and follow the readme file but encounter a problem during the section "2.3 - NEW Setting up the COM port" : I find the COM port created by the Lego software, but after a reboot, it desapears.
So I try another solution : create the bluetooth connection with the Windows tool. In that case, the iCommand program tells me that the port was already in use (the exactly same error than eagereyes).
To resolve it, I find a solution : after the creation (with Windows tool) I reboot the computer and the COM port stay alive AND free. So iCommand program succeeds.

But, this solution is not stable : after a few time, the connection is busy by another application than iCommand et iCommand crash with the "gnu.io.PortInUseException".

Can anyone have the same problem and have a better solution please ?
Thanks and sorry for my english ;)
Romain
New User
 
Posts: 4
Joined: Thu May 10, 2007 3:28 pm


Return to NXJ Software

Who is online

Users browsing this forum: Google [Bot] and 2 guests

more stuff