[Rxtx] Linux problem
Trent Jarvi
tjarvi at qbang.org
Sat Feb 28 10:24:30 MST 2009
On Fri, 27 Feb 2009, François-Xavier GENDRIN wrote:
>
> Hi,
>
>
>
> I use latest bin from wiki download and I run jar attached program.
>
>
>
> I use a debian Linux 2.6.26-1-686 #1 SMP Wed Sep 10 16:46:13 UTC 2008 i686
> GNU/Linux
>
> I run the program in three shells different at the same time
>
> java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS0 2> S0
>
> java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS4 2> S1
>
> java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS5 2> S5
>
>
>
> ttyS4 and ttyS5 are moxa port.
>
>
>
> I have following errors in one of my shell (not all the time …)
>
> RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists
>
> RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists
>
> RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists
>
> RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists
>
> RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists
>
> RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists
>
> java.io.IOException: Resource temporarily unavailable in writeArray
>
> at gnu.io.LPRPort.writeArray(Native Method)
>
> at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:325)
>
> at serial.Main2$Main2Runnable.run(Main2.java:63)
>
> at java.lang.Thread.run(Thread.java:619)
>
> RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists
>
> RXTX Warning: Removing stale lock file. /var/lock/LCK..lp0
>
> RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists
>
> RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists
>
> RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists
>
> RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists
>
> RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists
>
> RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists
>
>
>
>
>
> Anyone have idea about this, or did I have to wait the next pre-release?
>
I think these are valid resource contentions. In order to avoid this, you
will want to specify serial ports rather than enumerate them.
http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F
Otherwise rxtx tries to open and close all of the usual serial ports to
determine what is available for use.
2.2 will not alter the behavior.
--
Trent Jarvi
tjarvi at qbang.org
More information about the Rxtx
mailing list