Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: rxtxSerial help needed

  1. #1
    Join Date
    Oct 2009
    Location
    A place with no mountains
    Posts
    280

    Default rxtxSerial help needed

    I'm trying to set rxtxSerial to work so a Java app has access to a serial port (via SiLabs CP210x driver, port /dev/ttyUSB0).

    When I use update-alternatives --config java, there are 3 alternatives which provide `java'. I have tried openJDK and Sun. Both fail but with completely different messages.

    Any help is appreciated.

    /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java
    -----------------------------------------------
    Code:
    check_group_uucp(): error testing lock file creation Error details:Permission denied
    check_lock_status: No permission to create lock file.
    please see: How can I use Lock Files with rxtx? in INSTALL
    There is no "INSTALL" file. However, I know the solution is supposed to be adding my user to group uucp. I have done that.


    /usr/lib64/jvm/jre-1.6.0-sun/bin/java
    -----------------------------------------------
    Code:
    ERROR: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver
    I have a link pointing to the gnu.io.RXTXCommDriver. It looks correct to me:
    ls -la /usr/lib64/jvm/jre/lib/ext/
    total 1244
    drwxr-xr-x 2 root root 4096 2010-05-10 12:02 .
    drwxr-xr-x 19 root root 4096 2009-12-06 11:49 ..
    -rw-r--r-- 1 root root 8239 2009-10-11 04:37 dnsns.jar
    -rw-r--r-- 1 root root 841667 2009-11-13 04:42 localedata.jar
    -rw-r--r-- 1 root root 429 2009-10-11 05:09 meta-index
    lrwxrwxrwx 1 root root 12 2010-05-10 12:02 RXTXcomm.jar -> RXTXcomm.jar
    -rw-r--r-- 1 root root 170239 2009-10-11 04:12 sunjce_provider.jar
    -rw-r--r-- 1 root root 231542 2009-10-11 04:36 sunpkcs11.jar

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: rxtxSerial help needed

    3 lines from the bottom is a circular symbolic link. You must have the real RXTXcomm.jar somewhere.

  3. #3
    Join Date
    Oct 2009
    Location
    A place with no mountains
    Posts
    280

    Default Re: rxtxSerial help needed

    Quote Originally Posted by ken_yap View Post
    3 lines from the bottom is a circular symbolic link. You must have the real RXTXcomm.jar somewhere.
    According to the rxtx mailing list, "There is a problem with openSUSE 11.2 that causes rxtx to fail."

    I worked around that by allowing var/lock to be world read/writable (just for now, at least).

    I guess I also screwed up the ln -s command, as you pointed out. To be sure it's right this time I copied the real file and the result is shown below.

    Code:
    /usr/lib64/jvm/jre/lib/ext # ls -la
    total 3068
    drwxr-xr-x  2 root root    4096 2010-05-10 14:05 .
    drwxr-xr-x 11 root root    4096 2009-12-06 11:49 ..
    -rw-r--r--  1 root root    9230 2009-11-26 19:02 dnsns.jar
    -rw-r--r--  1 root root  448948 2009-11-26 19:19 gnome-java-bridge.jar
    -rw-r--r--  1 root root  496631 2009-11-26 19:05 localedata.jar
    -rw-r--r--  1 root root     347 2009-11-26 19:13 meta-index
    -rw-r--r--  1 root root 1648612 2009-11-26 18:46 pulse-java.jar
    -rw-r--r--  1 root root   59464 2010-05-10 14:05 RXTXcomm.jar
    -rw-r--r--  1 root root  211402 2009-11-26 19:06 sunjce_provider.jar
    -rw-r--r--  1 root root  239876 2009-11-26 19:01 sunpkcs11.jar
    Now I have fixed the permission issue and I have the real RXTXcomm.jar in /usr/lib64/jvm/jre/lib/ext. However, I still cannot get my java app to find any serial ports on openSUSE. The app works on Ubuntu and Windows.

    Any more suggestions?

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: rxtxSerial help needed

    Look in the kernel messages at boot to see if the serial ports were detected. You may have to load the driver since it's a USB serial port. If needed add the module name to /etc/sysconfig/kernel, variable MODULES_LOADED_ON_BOOT.

  5. #5
    Join Date
    Oct 2009
    Location
    A place with no mountains
    Posts
    280

    Default Re: rxtxSerial help needed

    Thanks again. I got one step further. As a temporary step, I did this:
    chmod 666 /dev/ttyUSB0

    That allowed the serial port to be visible to my java app and my app now starts, run, and lists the serial ports. All this is with /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java.

    However, as soon as serial data comes in, the app crashes. Here's the message.

    Experimental: JNI_OnLoad called.
    Stable Library
    =========================================
    Native lib Version = RXTX-2.1-7
    Java lib Version = RXTX-2.1-7
    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    # SIGSEGV (0xb) at pc=0x00007f3a01a96462, pid=6434, tid=139887112681744
    #
    # JRE version: 6.0-b16
    # Java VM: OpenJDK 64-Bit Server VM (14.0-b16 mixed mode linux-amd64 )
    # Distribution: Custom build (Thu Nov 26 23:44:19 UTC 2009)
    # Problematic frame:
    # C [librxtxSerial.so+0x6462] read_byte_array+0x52
    #
    # An error report file with more information is saved as:
    # hs_err_pid6434.log
    #
    # If you would like to submit a bug report, please include
    # instructions how to reproduce the bug and visit:
    # Bugzilla Main Page
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #
    Aborted

    That makes me want to try the Sun JRE, but when I try it I am back to square one and I cannot even get the rxtxSerial modules/jars on the java path. The error is the same as in my original post. The only progress I was able to make was with OpenJDK.

  6. #6
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: rxtxSerial help needed

    Persevere with Sun Java, this looks like an OpenJDK bug.

  7. #7
    Join Date
    Oct 2009
    Location
    A place with no mountains
    Posts
    280

    Default Re: rxtxSerial help needed

    Quote Originally Posted by ken_yap View Post
    Persevere with Sun Java, this looks like an OpenJDK bug.
    I tested on another computer. The error is identical with the Sun java.

    JRE version: 6.0_16-b01
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 )
    # Problematic frame:
    # C [librxtxSerial.so+0x6462] read_byte_array+0x52

    Compare that to the OpenJDK error. Same message.

    JRE version: 6.0-b16
    # Java VM: OpenJDK 64-Bit Server VM (14.0-b16 mixed mode linux-amd64 )
    # Distribution: Custom build (Thu Nov 26 23:44:19 UTC 2009)
    # Problematic frame:
    # C [librxtxSerial.so+0x6462] read_byte_array+0x52

    Ah, looks like a known bug:
    https://bugs.launchpad.net/ubuntu/+s...tx/+bug/361635

  8. #8
    Join Date
    Oct 2009
    Location
    A place with no mountains
    Posts
    280

    Default Re: rxtxSerial help needed

    status. No success. Everything works on Windows but not on Ubuntu or openSUSE. Giving up for the moment...

  9. #9
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: rxtxSerial help needed

    Did you try the patched rxtx package mentioned in that thread?

  10. #10
    Join Date
    Oct 2009
    Location
    A place with no mountains
    Posts
    280

    Default Re: rxtxSerial help needed

    Yes, I tried rxtx-2.2pre2-bins. It solved the crash, but it didn't work. No crash, but no communication either. No serial data was received. (The data does come if I connect to the serial port with minicom.)

    I'm wondering if that updated rxtxSerial will work without updating the Java app? I don't have the java source code and the java app was built with the prior version of rxtxSerial.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •