RXTX Java library with JRE 1.7.0_55

108 views
Skip to first unread message

Simon Platten

unread,
May 17, 2014, 6:51:39 AM5/17/14
to beagl...@googlegroups.com
Hello,

I am using RXTX:

Native lib Version = RXTX-2.2pre2
Java lib Version   = RXTX-2.1-7
WARNING:  RXTX Version mismatch
        Jar version = RXTX-2.1-7
        native lib Version = RXTX-2.2pre2

I have configured several UARTS, ttyO0, ttyO4 and ttyO5.  When I try to open any of the serial devices using the RXTX libary I get:

Online connect to device is not available, device not ready!

I also wrote a libary in C which opens the serial port and communicates to another Beaglebone Black.  This works fine and I have bi-directional communication.

I can't see why the RXTX java library isn't working, any suggestions, here is a snippet of the java code, with additional test lines in.
[code]
    public static CommPortIdentifier validateDevice(String strDev) {
        CommPortIdentifier portId = null;
        System.out.println("Validating: " + strDev);       
       
        try {
            portId = CommPortIdentifier.getPortIdentifier(strDev);
           
            System.out.println("portId: " + ((portId == null)?"null":"ok"));
           
            SerialPort serialPort = (SerialPort)portId.open("Demo application", 5000);

            System.out.println("serialPort: " + ((serialPort == null)?"null":"ok"));
           
            int intPortType = portId.getPortType();
           
            System.out.print("port type: " + intPortType + "...");
           
            if ( intPortType == CommPortIdentifier.PORT_SERIAL ) {               
    // The port is valid on this system
                System.out.println("ok");
                return portId;
            }
        } catch( Exception ex ) {
            portId = null;
            System.out.println(strDev + " ... could not validate");
        }
        return null;
    }
[/code]

I pass the routine "/dev/ttyO5", but it doesn't get as far as the second println statement.

Thank you,
Simon

arsi

unread,
May 17, 2014, 3:21:13 PM5/17/14
to beagl...@googlegroups.com
Hello,

RXTX is not very stable under Linux.
Elegant solution is to use ser2net package. RS232/TCP server.
If you need to use the structure of RXTX, here is my version:

https://sourceforge.net/projects/rxtxser2net/


Has been running for one year in nuclear power plant, in modbus data acquisition without any problems.. ;)

Arsi


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.








 

Simon Platten

unread,
May 17, 2014, 3:44:45 PM5/17/14
to beagl...@googlegroups.com
Thank you, I'll take a look.
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/c00AStshv0g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.




This email is free from viruses and malware because avast! Antivirus protection is active.


Reply all
Reply to author
Forward
0 new messages