The important part is to ensure you've closed the connection before your 
program exits.  If you do this you shouldn't run into the lock file problem.

Ensure NXTComm.close() is called before your program exists.  Even under 
error conditions, and hopefully this problem will go away.

Deleting the lock files is how to get out of the lock file problem, once 
you get into it.

Derek



Brian Bagnall wrote:
> Hi Jonny,
> 
> The lock file is something I don't experience in Windows with RXTX but I've 
> heard others talk about it. Apparently if you manually delete it first 
> before running it will work. From your message it looks like it's at 
> /var/lock/LCK..ttyUSB0
> 
> (Why two dots in the filename?)
> 
> Our next version will have the option to work with Bluez for Linux, which is 
> much better than RXTX. We also added an option for Java Comm API support.
> 
> - Brian
> 
> ----- Original Message ----- 
> From: "jonny Linux" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Wednesday, December 13, 2006 10:25 AM
> Subject: Re: [Lejos-discussion] NXT ticks when using motors with icommand
> 
> 
>> On 12/12/06, Brian Bagnall <[EMAIL PROTECTED]> wrote:
>>> 30 degrees is a pretty small number. The clicking is probably because the
>>> motor barely moved. Try forward(360) or just forward().
>>>
>>> - Brian
>>
>>
>> Thanks Brian - that worked!
>>
>> I now get gnu.io.PortInUseException every time I try to run a program. 
>> Even
>> after turning the NXT off and on again. I tried reseting the NXT (by
>> pressing the reset button for 5 seconds), then I had a ticking problem so 
>> I
>> had to upload the firmware again. I ran the icommand program again, and it
>> worked. But any subsequent attempts have resulted in:
>>
>> [EMAIL PROTECTED] icommand-0.5]# java Wheel
>> Looking for 'icommand.properties' in working dir: /usr/src/icommand-0.5
>> NXTCOMM = /dev/ttyUSB0
>> Experimental:  JNI_OnLoad called.
>> Stable Library
>> =========================================
>> Native lib Version = RXTX-2.1-7
>> Java lib Version   = RXTX-2.1-7
>> RXTX Warning:  Removing stale lock file. /var/lock/LCK..ttyUSB0
>> Error while connecting NXTCommand() constructor
>> gnu.io.PortInUseException:  root PID =  29201 Program = java
>>
>> I'm using Linux (Fedora Core 5). Any ideas how to fix this?
>>
>> Thanks,
>>
>> Jonny
>>
> 
> 
> --------------------------------------------------------------------------------
> 
> 
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share 
>> your
>> opinions on IT & business topics through brief surveys - and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> 
> 
> --------------------------------------------------------------------------------
> 
> 
>> _______________________________________________
>> Lejos-discussion mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/lejos-discussion
>>
> 
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Lejos-discussion mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/lejos-discussion
> 
> 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Lejos-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lejos-discussion

Reply via email to