aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Serial Port Ethernet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Serial Port Ethernet" Watch "Serial Port Ethernet" New topic
Author

Serial Port Ethernet

nipun batra
Greenhorn

Joined: Feb 28, 2009
Posts: 2
i need some help regarding serial port/ethernet access in linux using java.I am new to JAVA and Linux and have not been able to make Sun's Comm api or rxtx work.Sir i am supposed to create a Java GUI to handle data serially coming via instruments such as magenetometer,GPS transmitters etc.Done with the GUI part but serial port access seems to be a problem.I tried out Giovynet serial port libraries which worked in windows but not in Linux.Even in windows i was not able to save the information properly(using Giovynet serial port) in a text file which is again a requirement.Found your programs really interesting and helpful but still not able to run properly even after following instructions fot the API's.
Here is the error list i get:

Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z
at com.sun.comm.SunrayInfo.isSessionActive(Native Method)
at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155)
at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100)
at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:138)
at PortChooser.populate(CommPortOpen.java:304)
at PortChooser.<init>(CommPortOpen.java:254)
at PortChooser.main(CommPortOpen.java:241)


.Looking forward to your support and guidance both regarding serial port as well as ethernet,tcp/ip
Regards,
Nipun Batra
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34


You're showing a stack trace that's complaining that a Solaris library is missing. "Solaris" is Sun Microsystem's proprietary UNIX variant; it is completely different from Linux. I wonder if you're reporting that the libraries don't work for you on Linux, but you're actually not even running on Linux, but rather on Solaris. You need to find out which. What happens when you type "uname -a" at the command prompt?

I've never heard of "Giovynet" serial comm libraries, but you can still get the old version of RXTX, which does also have solaris support.

You mentioned Ethernet a couple times; I'm not sure why. Ethernet is a hardware-level protocol, and application software normally has no access to it. It's handled by network cards, or possibly by their drivers for really cheap cards. IN any case, it has precisely zero overlap with serial port communications. You can run TCP over IP using a protocol called SLIP. SLIP has largely been supplanted by PPP, although it's not quite the same thing..

[Jess in Action][AskingGoodQuestions]
nipun batra
Greenhorn

Joined: Feb 28, 2009
Posts: 2

You're showing a stack trace that's complaining that a Solaris library is missing. "Solaris" is Sun Microsystem's proprietary UNIX variant; it is completely different from Linux. I wonder if you're reporting that the libraries don't work for you on Linux, but you're actually not even running on Linux, but rather on Solaris. You need to find out which. What happens when you type "uname -a" at the command prompt?

I've never heard of "Giovynet" serial comm libraries, but you can still get the old version of RXTX, which does also have solaris support.

You mentioned Ethernet a couple times; I'm not sure why. Ethernet is a hardware-level protocol, and application software normally has no access to it. It's handled by network cards, or possibly by their drivers for really cheap cards. IN any case, it has precisely zero overlap with serial port communications. You can run TCP over IP using a protocol called SLIP. SLIP has largely been supplanted by PPP, although it's not quite the same thing..
Sir i am using java on linux via NetBeans ide..thanks for the response but it still does not solve my problem.I tried comm api and rxtx on windows without success.Then i found a link on Giovynet libraries www.giovynet.com/serialport.html
The program worked fine on windows but i was not able to write information into text files properly.
Further when i tried the same libraries in Linux(FEDORA 10).i was not able to make it work.
Further i followed instructions which are provided along with the api's i.e. comm and rxtx.
then i got the errors reported above.
please help.
Further can we receive data similarly via TCP/IP.
Please may you provide some insight.I am presently able to copy a file from one location on my computer to another.
Regards
Nipun Batra
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Serial Port Ethernet