Debian Codegraph @

INSTALL

raw
1 /*-------------------------------------------------------------------------
2 | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface.
3 | RXTX is a native interface to serial ports in java.
4 | Copyright 1997-2008 by Trent Jarvi [email protected] and others who
5 | actually wrote it. See individual source files for more information.
6 |
7 | A copy of the LGPL v 2.1 may be found at
8 | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is
9 | here for your convenience.
10 |
11 | This library is free software; you can redistribute it and/or
12 | modify it under the terms of the GNU Lesser General Public
13 | License as published by the Free Software Foundation; either
14 | version 2.1 of the License, or (at your option) any later version.
15 |
16 | This library is distributed in the hope that it will be useful,
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 | Lesser General Public License for more details.
20 |
21 | An executable that contains no derivative of any portion of RXTX, but
22 | is designed to work with RXTX by being dynamically linked with it,
23 | is considered a "work that uses the Library" subject to the terms and
24 | conditions of the GNU Lesser General Public License.
25 |
26 | The following has been added to the RXTX License to remove
27 | any confusion about linking to RXTX. We want to allow in part what
28 | section 5, paragraph 2 of the LGPL does not permit in the special
29 | case of linking over a controlled interface. The intent is to add a
30 | Java Specification Request or standards body defined interface in the
31 | future as another exception but one is not currently available.
32 |
33 | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface
34 |
35 | As a special exception, the copyright holders of RXTX give you
36 | permission to link RXTX with independent modules that communicate with
37 | RXTX solely through the Sun Microsytems CommAPI interface version 2,
38 | regardless of the license terms of these independent modules, and to copy
39 | and distribute the resulting combined work under terms of your choice,
40 | provided that every copy of the combined work is accompanied by a complete
41 | copy of the source code of RXTX (the version of RXTX used to produce the
42 | combined work), being distributed under the terms of the GNU Lesser General
43 | Public License plus this exception. An independent module is a
44 | module which is not derived from or based on RXTX.
45 |
46 | Note that people who make modified versions of RXTX are not obligated
47 | to grant this special exception for their modified versions; it is
48 | their choice whether to do so. The GNU Lesser General Public License
49 | gives permission to release a modified version without this exception; this
50 | exception also makes it possible to release a modified version which
51 | carries forward this exception.
52 |
53 | You should have received a copy of the GNU Lesser General Public
54 | License along with this library; if not, write to the Free
55 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
56 | All trademarks belong to their respective owners.
57 --------------------------------------------------------------------------*/
58 This is the INSTALL file for RXTX. Thu Nov 27 18:32:26 CET 2008
59
60 If, while following the instructions, you find this file unclear or incorrect
61 please make a note and email the details to [email protected].
62
63 A note about rxtx 2.1 and later:
64
65 rxtx 2.1 replaces the entire CommAPI. Every effort is made to conform to
66 CommAPI but out of respect for our friends at Sun the package name of 2.1 has
67 been moved to gnu.io. A script is offered in contrib/ChangePackage.sh that
68 will switch source tree's between javax.comm and gnu.io.
69
70 See Sun's CommAPI license for more details on why this decision was made.
71
72 If you would like to use javax.comm, use rxtx 1.4 with Sun's CommAPI.
73
74 A note on Mac OS X:
75
76 Go to the README.OSX file for install instructions.
77
78 1. INSTALL INSTRUCTIONS IN OTHER LANGUAGES
79
80 A. Japanese
81
82 2. BUILDING COMMAPI SUPPORT
83
84 A. Quick Install
85 B. Uninstalling Sun's comm.jar
86 C. installing javax.comm.properties.
87 D. Add RXTXcomm.jar to your CLASSPATH.
88 E. Build and Install the jar.
89 F. Where did everything end up?
90 G. Compiling for Win32 support
91
92 3. COMMON PROBLEMS
93
94 A. java.lang.UnsatisfiedLinkError: nSetOwner while loading driver
95 gnu.io.RXTXCommDriver
96 B. Exception in thread "main" java.lang.UnsatisfiedLinkError:
97 no rxtxSerial in java.library.path
98 C. I Can Not Open the Port.
99 D. java.lang.NoClassDefFoundError: gnu/io/CommPort
100 E. The Compiler Cannot Find Java Include Files
101 F. Configure says 'unterminated sed command' and stops
102 G. Java Can Not Find libstdc++-libc6.0-1.so.2
103 H. BlackBox Can Not Handle all the ports!
104 I. Illegal use of nonvirtal function call!
105 J. My libc5 Linux system is generating SIGSEGV
106 K. AM_PROG_LIBTOOL not found in library
107 L. Problems with RMISecurityManager()
108 M. Which Wires Should be Connected?
109 N. Which Device Should be Used?
110 O. It Did Not Work!
111 P. Which jdk should be used?
112 Q. How does rxtx detect ports? Can I override it?
113 R. How can I use Lock Files with rxtx?
114 S. How can I tell which version of rxtx is installed?
115 T. What Type of Latency can I expect with RXTX
116 U. I got rxtx working on a new OS but I can't read from the port
117 V. My ThinkPad is Not Working!
118
119 4) APPLETS
120
121 A. Using Applets
122
123 -------------------------------------------------------------------------------
124 1. INSTALL INSTRUCTIONS IN OTHER LANGUAGES
125 A. Japanese
126
127 Instructions are available in Japanese at
128
129 The instructions are fairly old but should help.
130
131 http://www.geocities.co.jp/Technopolis/4789/settei.htm#id1
132 Thanks to Masayuki "Tencho" Yamashita <[email protected]>
133 home page http://www.geocities.co.jp/Technopolis/4789/
134
135 A copy of these install instructions is provided in
136 install-japanese.html
137
138 We will gladly include instructions in any language provided. Tencho
139 was the first to contribute instructions in another language.
140
141 2. BUILDING COMMAPI SUPPORT
142
143 The following is concerned with building and installing commapi
144 support with Sun's CommAPI package. A full stand alone version of
145 rxtx is in the CVS archive for interested developers.
146
147 A. Quick Install
148
149 The following packages are used to build rxtx:
150
151 autoconf-2.59
152 automake-1.9.5
153 libtool-1.5.18
154 gnu make-3.79.1 On some systems like FreeBSD this is
155 called gmake
156 jdk 1.3 or newer
157
158 With the packages installed, proceed to build and install rxtx.
159
160 $ tar -xzvf rxtx-2.1.tar.gz
161 $ cd rxtx-2.1
162 $ ./configure (follow the instructions)
163 $ make install (gmake if your system uses that convention)
164 Read "R. How can I use Lock Files with rxtx?"
165
166 One catch that has showed up... you cannot have spaces in the path.
167 for instance: /home/jarvi/test build/rxtx/... will cause problems.
168 ----^
169 If that does not work or you do not want a script messing with the
170 system, read on..
171
172 B. Uninstalling Sun's comm.jar
173
174 Sun's comm.jar is not required. It is a valid option on
175 some platforms. IT WILL CREATE CHAOS if you have it installed
176 while trying to build rxtx 2.1.
177
178 http://java.sun.com/products/javacomm/index.html
179
180 C. Installing javax.comm.properties.
181
182 javax.comm.properties is not currently required by rxtx-2.1
183
184 D. Add RXTXcomm.jar to your CLASSPATH.
185
186 jdk-1.1:
187
188 make sure /usr/local/java/lib/RXTXcomm.jar is in your
189 CLASSPATH. If you want to use apps that require
190 RXTXcomm.jar.
191
192 in bash:
193
194 $ export CLASSPATH=/usr/local/java/lib/RXTXcomm.jar:.
195
196 jdk-1.2 and newer:
197
198 No changes are needed.
199
200 E. Build and Install the jar.
201
202 configure configure supports build directories.
203 configure requires javac in its path or
204 JAVA_HOME set to grab some java system
205 properties.
206 make to build RXTXcomm.jar and the libraries
207 make install to place the jar and libraries in the correct
208 location
209
210 You may select the JDK you wish to build with using $JAVA_HOME
211 For example:
212 export JAVA_HOME=/usr/local/java
213 Otherwise, configure grabs the JDK from your PATH.
214
215 F. Where did everything end up?
216
217 Lets assume the top java directory is /usr/local/java
218
219 jdk-1.2 the files go in
220
221 /usr/local/java/jre/lib/ext/RXTXcomm.jar
222 /usr/local/java/jre/lib/$(ARCH)/librxtxSerial.so.
223 /usr/local/java/jre/lib/$(ARCH)/librxtxParallel.so.
224 /usr/local/java/jre/lib/$(ARCH)/lib/...
225
226 jdk-1.1.* the files go in
227
228 /usr/local/java/lib/RXTXcomm.jar
229 /usr/lib/librxtxSerial.so.
230 /usr/lib/librxtxParallel.so.
231 /usr/lib/...
232
233 The librxtxSerial.so librxtxParallel.so are placed in
234 /usr/lib so people don't have to change with their
235 LD_LIBRARY_PATH.
236
237 G. Compiling for Win32 support
238
239 Get the Sun CommAPI if you want a plug-in solution. The code
240 is provided for people that may have demanding needs and coding
241 ability.
242
243 There is only serial port code at this time.
244
245 Three ways of compiling win32 libraries are offered:
246
247 mingw32 tools in DOS
248 lcc tools in DOS
249 cross-compiling from Linux
250
251 ----------------- mingw32 tools in DOS -----------------------
252
253 Install a jdk http://java.sun.com/j2se
254 Install mingw32 http://www.mingw.org
255 Make sure the ming32\bin and jdk\bin directories are in your
256 path. Run a DOS command prompt (not MSYS!) in the rxtx top
257 directory to the following:
258
259 mkdir build-mingw
260 copy Makefile.mingw32 build-mingw\Makefile
261 cd build-mingw
262 edit the Makefile and make sure the directories are correct.
263 execute the following:
264 mingw32-make SHELL=cmd
265 mingw32-make SHELL=cmd install
266
267 -------------- MS Visual Studio in Windows -------------------
268
269 Install a jdk http://java.sun.com/j2se
270 Install Visual Studio (Express edition will do)
271 Open a Visual Studio command prompt (with env.vars set)
272 In the rxtx top directory to the following:
273
274 mkdir build-msvc
275 copy Makefile.msvc build-msvc\Makefile
276 cd build-msvc
277 edit the Makefile and make sure the directories are correct.
278 execute the following:
279 nmake
280 nmake install
281
282 ----------------- lcc tools in DOS ---------------------------
283
284 Install a jdk http://java.sun.com/j2se
285 Install lcc http://www.cs.virginia.edu/~lcc-win32/
286
287 A make file (Makefile.lcc) for compiling rxtx with lcc
288 contributed by Valentin Pavlov
289
290 You will need a config.h file in the src directory. Other
291 builds usually generate them automatically. The following
292 should work.
293
294 #define HAVE_FCNTL_H
295 #define HAVE_SIGNAL_H
296 #undef HAVE_SYS_FCNTL_H
297 #undef HAVE_SYS_FILE_H
298 #undef HAVE_SYS_SIGNAL_H
299 #undef HAVE_TERMIOS_H
300 #undef HAVE_SYS_TIME_H
301
302 if you know how to create the above in a dos Makefile send in
303 the changes.
304
305 the following commands should then work fine on the command
306 line.
307
308 cd src
309 make -f ..\Makefile.lcc
310
311 ----------------- cross-compiling from Linux -----------------
312
313 Grab ming32:
314
315 Wayne Roberts contributed the version used by the maintainer.
316 (Wayne is largely responsible for bringing rxtx back to win32.)
317 http://www.linuxgrrls.org/~taj/crossmingw32-2.95-1.i386.rpm
318 A more current version can be obtained:
319 http://www.devolution.com/~slouken/SDL/Xmingw32/crossgcc/index.html
320 prebuilt Binaries:
321 http://www.devolution.com/~slouken/SDL/Xmingw32/mingw32-linux-x86-glibc-2.1.tar.gz
322
323 I built the dll with jdk-1.2.2 for linux using jdk-1.2.2
324 include files from the win32 JDK.
325
326 Make sure that ming32 bin dir is the first in your path (at
327 least before /usr/bin/gcc)
328
329 $ export PATH=" \
330 /usr/local/cross-tools/i386-mingw32/bin/: \
331 $PATH:/usr/X11R6/bin:/usr/local/java/bin: \
332 /usr/local/java/jre/bin/:"
333
334 Place Sun jdk 1.2.2 win32 include files in a known location.
335
336 $ mkdir /home/jarvi/win32java
337 $ cp -r /mnt/win98//java/include /home/jarvi/win32java
338
339 If you are developing win32 support you may want to
340 export the location to make the config script
341 non interactive
342
343 $ export WIN32INCLUDE=/home/jarvi/tools/win32-include
344
345 run configure to generate a Makefile
346
347 $ cd /home/jarvi/rxtx-*
348 $ mkdir build
349 $ cd build
350 $ ../configure --target=i386-mingw32 \
351 --host=i386-redhat-linux
352
353 build the class files and dll.
354
355 $ make
356
357 the files will be located in
358
359 rxtx-*/build/...
360
361 If you're looking at rxtx as an example of cross-compiling you
362 may be interested in looking at the examples provided at:
363
364 ftp.xraylith.wisc.edu
365 /pub/khan/gnu-win32/mingw32/misc/java-jni-examples.zip
366
367 3. COMMON PROBLEMS
368
369 A. I get java.lang.UnsatisfiedLinkError: nSetOwner while loading driver
370 gnu.io.RXTXCommDriver when using rxtx.
371
372 SetOwner appears to be some win32 call.
373 Do not use Sun's win32 CommAPI files. Get the Solaris version.
374 "javacomm20-x86.tar.Z" and rxtx-1.4 if you want Sun's solution.
375
376 See Also: 2-B. Installing Sun's comm.jar (IE its not needed at all)
377
378 B. Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in
379 java.library.path
380
381 librxtxSerial.so is located in the wrong directory. Here is an example
382
383 $ mv /usr/local/java/jre/lib/i386/librxtxSerial* /usr/local/lib
384 $ java BlackBox
385 Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial
386 in java.library.path
387 at java.lang.ClassLoader.loadLibrary(Compiled Code)
388 at java.lang.Runtime.loadLibrary0(Compiled Code)
389 at java.lang.System.loadLibrary(Compiled Code)
390 at gnu.io.NativePort.<clinit>(NativePort.java:32)
391 at gnu.io.RXTXPort.<init>(Compiled Code)
392 at gnu.io.RXTXCommDriver.getCommPort(Compiled Code)
393 at gnu.io.CommPortIdentifier.open(Compiled Code)
394 at SerialPortDisplay.openBBPort(Compiled Code)
395 at SerialPortDisplay.<init>(Compiled Code)
396 at BlackBox.addPort(Compiled Code)
397 at BlackBox.main(Compiled Code)
398
399 ... lets fix it.
400
401 Solution 1: move the file to a place that works
402
403 $ mv /usr/local/lib/librxtxSerial.* /usr/local/java/jre/lib/i386/
404
405 Solution 2: add the location of librxtxSerial to LD_LIBRARY_PATH
406
407 $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/
408
409 Solution 3: pass the location in on the command line
410
411 $ java -Djava.library.path=/usr/local/lib/ ...
412
413 C. I Can Not Open the Port.
414
415 If you're not able to open the port (read the errors carefully) then you
416 may not have permission to use the device. Redhat Linux ships with the
417 following permissions:
418
419 crw-r--r-- /dev/ttyS?
420
421 Users need to be able to read and write with serial communication...
422
423 chmod 666 /dev/ttyS?
424
425 should fix the problem. Be sure to check the file CommAPI for common
426 mistakes.
427
428 Make sure that the user can create lock files see R.
429
430 D. java.lang.NoClassDefFoundError: gnu/io/CommPort
431
432 RXTXcomm.jar is probably not in your classpath or not located in
433 the proper directory.
434
435 for example, lets not include RXTXcomm.jar
436
437 export CLASSPATH=../java/lib/classes.zip
438 $ java BlackBoxException in thread "main"
439 java.lang.NoClassDefFoundError: gnu/io/CommPort
440
441 E. The Compiler Cannot Find Java Include Files
442
443 Check to top of the Makefile to make sure we agree on the location of
444 the include files that came with the jdk. Specifically:
445
446 JAVAINCLUDE = -I /usr/local/java/include/
447 JAVANATINC = -I /usr/local/java/include/genunix
448 also check the classpath
449 CLASSPATH = ...
450
451 F. Configure says 'unterminated sed command' and stops
452
453 Unterminated sed command errors usually result from `find` producing
454 unexpected results. If you are unsure remove all comm.jar and
455 configure to place in in the correct place.
456
457 G. Java Can Not Find libstdc++-libc6.0-1.so.2
458
459 jdk-1.2 on redhat systems may note that Java complains about not being
460 able to find libstdc++-libc6.0-1.so.2. A symbolic link can be used to
461 get around this feature.
462
463 ln -s /usr/lib/libstdc++ /usr/lib/libstdc++-libc6.0-1.so.2
464 ls -l /usr/lib/libstdc++-libc6.0-1.so.2
465 /usr/lib/libstdc++-libc6.0-1.so.2 -> libstdc++.so.2.8.0
466
467 H. BlackBox Can Not Handle all the ports!
468
469 BlackBox has a hard coded limit in BlackBox.java that prevents it from
470 running if you don't specify a port. We are considering alternative
471 ways of handling the large number of port names in Unix. The line in
472 question
473
474 is:
475
476 portDisp = new SerialPortDisplay[50];
477
478 just change 50 to say 256.
479
480 I. Illegal use of nonvirtal function call!
481
482 Exception in thread "main" java.lang.VerifyError: (class:
483 gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V)
484 Illegal use of nonvirtual function call
485 at gnu.io.RXTXCommDriver.getCommPort(Compiled Code)
486 at gnu.io.CommPortIdentifier.open(Compiled Code)
487 at SerialPortDisplay.openBBPort(Compiled Code)
488 at SerialPortDisplay.<init>(Compiled Code)
489 at BlackBox.addPort(Compiled Code)
490 at BlackBox.main(Compiled Code)
491
492 "1.1 compilers sometimes generate code that won't verify under 1.2.
493
494 If you don't have the sources for the offending class to recompile with
495 a 1.2 javac, the only solution I know of is to launch the VM with the
496 -noverify option.
497
498 Louis"
499
500 In other words start with a fresh build directory, rebuild, and
501 reinstall to avoid the problem.
502
503 J. My libc5 Linux system is generating SIGSEGV
504
505 Older Linux Systems (libc5) should upgrade to a glibc system with
506 libpthread-0.7 or newer. We have run into many problems with older
507 libraries. SIGSEGV was the most common symptom. Reported by Peter
508 Bennett <[email protected]>
509
510 K. AM_PROG_LIBTOOL not found in library
511
512 cd. && aclocal
513 aclocal:configure.in: 23: macro 'AM_PROG_LIBTOOL' not found in library
514 make:***[aclocal.m4]Error 1
515
516 If you're positive things are setup right you may try the autogen.sh
517 script to try regenerating the scripts with your tools.
518
519 L. Problems with RMISecurityManager()
520
521 Please see the file RMISecurityManager.html
522
523 M. Which Wires Should be Connected?
524
525 With the DB25 use 2 (TX), 3 (RX) and 7 (GD) to connect to the device.
526 With the DB9 use 2 (RX), 3 (TX) and 5 (GD) to connect to the device.
527
528 You will need to hook up more than that for hardware flow control.
529
530 N. Which Device Should be Used?
531
532 Linux serial ports should use /dev/ttyS?
533 specialx, cyclades and isdn4 linux have been reported to work.
534 as many as 64 ports have worked at one time.
535 FreeBSD uses cuaa?
536 netbsd uses tty0?
537 Irix uses ttyd? ttym? ttyf?
538 HP-UX uses tty0p? tty1p?
539 BeOS uses /dev/ports/serial?
540 Win32 uses COM?
541
542 O. It Did Not Work!
543
544 There are sure to be bugs. The goal is to make the install as painless
545 as possible. Send back comments if something could be easier.
546
547 If you run into a problem building the rxtx package please include the
548 output generated by the following script.
549
550 ---------------clip-----------------
551 #!/bin/sh
552 which java
553 java -version
554 uname -a
555 autoconf --version
556 automake --version
557 libtool --version
558 make --version
559 ---------------clip-----------------
560
561 Here's what's on my system for comparison. Older make is known to cause
562 problems.
563
564 java 1.4
565 autoconf-2.53
566 automake-1.6.3
567 libtool-1.4.2
568 gnu make-3.79.1
569
570 mail any bugs to [email protected].
571
572 P. Which jdk should be used?
573
574 Ideally any jdk would be fine. Here is a list of jdk's tried on
575 RedHat 6.0/kernel 2.2.17pre13 with various versions of glibc.
576
577 Sun IBM Blackdown
578 2.1.2_006 1.3.0 1.1.8v1
579 green native green native green native
580 ------------------------------------------
581 glibc-2.1.1-6 | OK | *1 | *2 | *2 | OK | *3 |
582 -------------------------------------------
583 glibc-2.1.2-11 | OK | *1 | OK | OK | OK | OK |
584 -------------------------------------------
585 glibc-2.1.2-17 | OK | *1 | OK | OK | OK | OK |
586 -------------------------------------------
587 glibc-2.1.3-15 | OK | *1 | OK | OK | OK | OK |
588 -------------------------------------------
589
590 1) BlackBox (a demo application shipped with CommAPI locks after multiple
591 open()/close()
592
593 2) java wont start "Unable to load /usr/local/java/jre/bin/libhpi.so: symbol
594 sem_wait, version GLIBC_2.1 not defined in file libpthread.so.0 with link time
595 reference Could not create the Java virtual machine."
596
597 3) java wont start "error in loading shared libraries:
598 /usr/local/java/bin/../lib/i686/native_threads/libjava.so: symbol sem_init,
599 version GLIBC_2.1 not defined in file libpthread.so.0 with link time reference"
600
601 Conclusion? Avoid Sun's native threads unless you can figure out whats going
602 wrong.
603
604 Q. How does rxtx detect ports? Can I override it?
605
606 rxtx tries to detect ports on by scanning /dev for files matching any
607 of a set of known-good prefixes, such as 'ttyS', 'ttym', and so on.
608 Any ones that exist, are supposed to be good for the current operating
609 system, and that can be read and written are offered back from
610 CommPortIdentifier.getPortIdentifiers(), and only these can be used as
611 ports.
612
613 If you wish, you can set the system properties gnu.io.rxtx.SerialPorts
614 and gnu.io.rxtx.ParallelPorts. If either of these is set, then no
615 scanning will be carried out and only the specified ports will be
616 available. You can use this to make one platform look like another,
617 to restrict Java access to ports, or possibly for other reasons. For
618 example
619
620 java -Dgnu.io.rxtx.SerialPorts=/dev/cua/a:/dev/cua/b com.foo.MyApp
621
622 will look kind of like Solaris, if you have created the appropriate
623 device nodes.
624
625 A note on Linux port enumeration. We have set most ports aside. Once the
626 number of possible devices started getting into the thousands, checking them
627 all made little sense. Look in RXTXCommDriver.java and search for Linux.
628
629 You will see that only /dev/ttyS* is searched but the possible addition ports
630 that can be used are listed under it. Just copy the few you need.
631
632 R. How can I use Lock Files with rxtx?
633
634 Redhat users. Note that Redhat changed group uucp to group lock with Redhat
635 7.2.
636
637 Mandrake users. Note that /var/lock needs to be group uucp for this to work.
638
639 Mac OS X users: Starting at version 2.1.8 rxtx no longer uses lockfiles on OSX.
640
641 RXTX uses lock files by default. configure --disable-lockfiles to generate
642 rxtx libraries without lock files. Its strongly recommended that you do
643 use lock files to prevent rxtx from stomping on other programs using serial
644 ports.
645
646 Lock files are used to prevent more than one program accessing a port at a
647 time. Lock files require a bit of sysadmin to work properly..
648
649 Rxtx has support for lock files on Linux only. It may work on other
650 platforms but read the source before blindly trying it.
651
652 Before you use lock files you need to do one of two things:
653
654 1. Be the root or uucp user on your machine whenever you use rxtx
655 2. add the specific user that needs to use rxtx to the group uucp.
656 (preferred)
657
658 To add a user to the uucp group edit /etc/group as root and change the
659 following:
660 uucp::14:uucp
661 to something like:
662 uucp::14:uucp,jarvi
663 In this case jarvi is the login name for the user that needs to use lock files.
664 Do not change the number (14). Whatever is in your group file is correct.
665
666 User jarvi in this case can now use rxtx with lock files.
667
668 The lock file code does not support kermit style lock files or lock files in
669 /var/spool. Its sure to fail if you're using subdirectories in /dev or do not
670 have /dev.
671
672 Still cant get things to run under a root account?
673
674 Vadim Tkachenko writes:
675
676 "Maybe you remember - couple of months back I've run into inability to
677 run the JDK 1.3+ from under root account.
678
679 Today, absolutely suddenly, something clicked in my head and the cause
680 was found: libsafe. To make JDK work, it is enough to disable libsafe
681 (unset LD_PRELOAD)."
682
683 As another option it is possible to use a Lock File Server. In this case,
684 a server runs in group uucp or lock and rxtx then connects to localhost
685 to lock and unlock the port. The server and install instructions can be
686 found in src/lfd. RXTX will need to be configured to use the server:
687
688 configure --enable-lockfile_server
689
690 Any user can then lock the ports if they are not already locked.
691
692 S. How can I tell which version of rxtx is installed?
693
694 Version information is not documented in Sun's CommAPI so this is probably
695 unique to RXTX.
696
697 As of rxtx-1.5-4 and rxtx-1.4-6 a class has been added to allow developers to
698 check which version of rxtx is installed. The class is RXTXVersion.
699
700 The static method: System.out.println(RXTXVersion.getVersion());
701
702 will print the rxtx version as a String in the following format:
703
704 "RXTX-MAJOR.MINOR-PATCH".
705
706 an example would be:
707
708 "RXTX-1.5-4"
709
710 A change in the MAJOR version would suggest you're in trouble.
711
712 Odd MINOR version are reserved for development. Even MINOR versions are
713 reserved for 'stable' releases.
714
715 PATCH is used to differentiate incremental releases of the MINOR releases.
716
717 CommPortIdentifier is expected to support getVersion() in the RXTX-1.5 series.
718
719 T. What Type of Latency can I expect with RXTX
720
721 frantz <[email protected]> put RXTX under a scope and found
722 the following:
723
724 RXTX currently has a latency of 150-200ms on a PII at 450mhz.
725 The latency can be reduced to 70-80ms by reducing the usleep()
726 value in SerialImp.c:eventLoop() to usleep(5000)).
727
728 Much lower latencies should be possible but the maintainer does not
729 have equipment to test changes.
730
731 He is going to look at this further. He needs 20 ms or less latency.
732
733 U. I got rxtx working on a new OS but I can't read from the port
734
735 > Now my java program starts up nicely without complaining. However, it does
736 > never read any data from the serial port. It looks like it can write data,
737 > because if I start a terminal program after I tried to run my program, I get
738 > all the return stuff from the modem that my program wrote.
739 >
740 > I hacked around abit and found out that it hangs in the select() call which
741 > simply never returns.
742 >
743 On Sun, 28 Jan 2001, Baldur Norddahl wrote:
744 > HPUX 11:
745 >
746 > As I wrote to the mailinglist I had some wierd problems where it apparently
747 > could write data to the modem, but not read anything back. My terminal
748 > programs had no problem using the port. A few days after I reported the
749 > problem to the mailinglist, I had given up for now, but then I noticed that
750 > it suddenly worked! So it remains a mystery what was wrong as I did not
751 > change anything at all, neither in my program nor on the host.
752 >
753 > Baldur
754 >
755
756 I suspect two java applications had the port open. Its easy to do while
757 developing. Perhaps <ctl> z instead of <ctl> c was entered.
758
759 This is the reason for adding lockfile support to rxtx. If another application
760 has opened the port, a second application will appear to not be able to
761 read or get only part of the data. ..because the first one is reading. Only
762 one of the select()s are waken.
763
764 Its possible to put lockfile support in for HPUX if it is known where other
765 applications place their lockfiles. The easiest way to find out where is
766 to fire up minicom, kermit, ... and see where its lockfile is placed.
767
768 Here are the known suspects:
769
770 const char *lockdirs[]={ "/etc/locks", "/usr/spool/kermit",
771 "/usr/spool/locks", "/usr/spool/uucp", "/usr/spool/uucp/",
772 "/usr/spool/uucp/LCK", "/var/lock", "/var/lock/modem",
773 "/var/spool/lock", "/var/spool/locks", "/var/spool/uucp",NULL
774 };
775
776 freebsd uses /var/spool/uucp/, linux uses /var/lock those are the only two
777 I've done so far. Adding the support is trivial once a directory is
778 decided upon.
779
780 Lockfiles are rather simple. when an application opens a port it first checks
781 if there is a file with the ports name. If there is it grabs the PID from the
782 file. If that PID is still active the application does not open the port.
783
784 If the PID is not active or there is no lockfile, the application creates one
785 with its own PID in it.
786
787 The confusion starts when you have to decide where (see above) to put the
788 lockfile, what the name format is for the file and how to store the PID.
789
790 rxtx follows The File System Hierarchy Standard http://www.pathname.com/fhs/
791 on linux. I'm not positive what is normal on other OS's.
792
793 more reading:
794
795 The File System Hierarchy Standard
796 http://www.pathname.com/fhs/
797
798 FSSTND
799 ftp://tsx-11.mit.edu/pub/linux/docs/linux-standards/fsstnd/
800
801 Proposed Changes to the File System Hierarchy Standard
802 ftp://scicom.alphacdc.com/pub/linux/devlock-0.X.tgz
803
804 "UNIX Network Programming", W. Richard Stevens,
805 Prentice-Hall, 1990, pages 96-101.
806 more reading:
807
808 V. My ThinkPad is Not Working!
809
810 Scott Burleigh <[email protected]> writes:
811
812 For your files, and in case anybody asks in the
813 future, IBM Thinkpads ship with the external serial port
814 *disabled* by default. The Thinkpad configuration utility
815 supplied with the machine (under Windows) says it's enabled,
816 and the device manager in the System dialog of the Control
817 panel says it's enabled, but they lie. In order to enable the
818 port you have to use the old DOS ps2.exe bios configuration
819 utility which, under Windows 2000, is in
820 c:\Program Files\Thinkpad\utilities:
821
822 ps2 sera enable
823
824 Until you do, "setserial -ga /dev/ttyS0" will always tell you
825 the UART is unknown.
826
827
828
829 4. APPLETS
830
831 More info is needed on signing applets. This is an exchange from the rxtx mail-
832 list.
833
834 A. Using Applets
835
836 [email protected] asked:
837
838 Hi All !
839
840 I am trying to use applet on thin terminal which has
841 Linux base Kernel.For testing I am using Linux
842 machine.I have install all the required components.
843 e.g. JDK, RXTX. Everthing is fine. BlackBox runs ,even
844 my application runs. When It comes to applet,
845 everything is halts. It does not even show the listing
846 of ports. Is it because applet can't run under root
847 account or what might be the reasons. Can anybody tell
848 me solution.
849
850 Son To <[email protected]> replied:
851
852 Java applets run withing the sandbox of the security manager.
853 Applets must be signed to access the com port, but for development
854 purposes you can put
855
856 user_pref("signed.applets.codebase_principal_support", true);
857
858 in your prefs.js located in ~/.mozilla/default/XYYrandomDirName
859
860 I didn't use Java applet for my application. I used XUL and CSS for
861 the GUI development and used mozilla Javascript SOAP library to
862 communicate with apache Axis webservice backend which uses RXTX to
863 access the com port.
864
865 --
866 Trent Jarvi
867 [email protected]
868 -------------------------------------------------------------------------------
869 You made it this far.. what is one more line.
870
871 Sun, Solaris and Java are registered trademarks of Sun Microsystems, Inc.
872
873
874 reminder:
875
876 redhat 7.1 needs:
877 export LD_ASSUME_KERNEL=2.2.5