Testing out the PPD42 Air Quality Sensor, with an MSP430 Launchpad and graphing the data with GNUplot.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

822 lines
28 KiB

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