Results 1 to 6 of 6

Thread: Serial Port

  1. #1
    radhika is offline Member
    Join Date
    Apr 2007
    Posts
    2
    Rep Power
    0

    Default serial port

    i am a new in serial port topic ,i know the concept read & write port on my pc
    now i want to implement in my project,i need help how can i access the serial port in remote system

    please any one help for me

    advance thanks

    regards
    R.Radhika

  2. #2
    radhika is offline Member
    Join Date
    Apr 2007
    Posts
    2
    Rep Power
    0

    Default

    how can i access the serial port in remote system

  3. #3
    levent Guest

    Default

    Hi Radhika,

    First of all i moved your thread to "New To Java" forum since it was not appropriate for "Java Announcements" forum.

    Your problem has two parts:

    1. Controlling serial port on a machine

    For this part, you will need Java Communications API. Its installation can be a little bit problematic. It is important to find a working tutorial for it. I dont remember which one i used so you need to find your way yourself. But you can start with installation instructions there.

    2. Accessing a serial port on a remote machine

    After you set up Java Communications API on the remote machine, you will need to develop a server application because you need to control a remote machine and to do this, you should have both client and server.

    For client-server programming you can use socket programming or RMI (Remote Method Invocation). If you want to use a web based interface, then you can use Servlets to develop your server application and use your browser as the client application.

    Let us know if you have further problems..

  4. #4
    dnsunil is offline Member
    Join Date
    Nov 2007
    Posts
    1
    Rep Power
    0

    Default

    Does anybody implemented accesing serial port on a remote machine? Please share the information that would be really beneficial to me.

  5. #5
    hobbyist is offline Member
    Join Date
    Nov 2007
    Posts
    5
    Rep Power
    0

    Default

    I also have an issue with serial comm API.
    I am trying to write a JavaSE application using Swing to access the virtual COM port created when connecting a Modem aware device to the USB.
    I can see data coming across via Hyperterminal and I want to write a hyperterminal type application to react to and filter messaging.
    I have tried using the Comm API and followed in the API instructions to the letter.
    I am using the following code in my JavaSE app:

    {
    ...
    private void initCommPorts() {
    CommPortIdentifier portId;
    Enumeration portList = CommPortIdentifier.getPortIdentifiers();
    if (portList == null) {
    System.out.println("portList is null");
    }
    else {
    System.out.println(portList.toString());
    }

    String comPort = "";
    while (portList.hasMoreElements()) {
    portId = (CommPortIdentifier) portList.nextElement();
    System.out.print("Port found");
    comPort = portId.getName();
    System.out.println("Found port: " + comPort);
    // Add COM port to visual object selection list
    comChoice.addItem(comPort);
    }

    }
    ...
    }

    The issue is that this code never finds the COM port. The Enumeration is always empty.

    Am I using the right API here. Can the Comm API be used to create a connection to the virtual COM ports in Windows XP?

    Thanks guys - and sorry for my ignorance on this matter!

  6. #6
    pawanpugliya is offline Member
    Join Date
    Nov 2009
    Posts
    1
    Rep Power
    0

    Default

    I downloaded java comm api and copied files into jdk folder correctly. But

    portList.hasMoreElements()

    is returning false.
    Plz suggest any measures to solve the problem.

Similar Threads

  1. Reading from Serial port!
    By Dogge in forum New To Java
    Replies: 2
    Last Post: 12-01-2010, 03:21 AM
  2. Accessing Serial port using JDK 1.6
    By hasani6leap in forum Advanced Java
    Replies: 5
    Last Post: 01-24-2009, 03:23 AM
  3. Access Serial port
    By hasani6leap in forum Advanced Java
    Replies: 0
    Last Post: 02-12-2008, 09:45 AM
  4. Writing to serial port (com1)
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-05-2008, 09:02 AM
  5. serial port
    By musiigedeo in forum Advanced Java
    Replies: 0
    Last Post: 07-23-2007, 04:52 PM

Posting Permissions

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