reading & writing in serial port from server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ^CeFoS^

    reading & writing in serial port from server

    Hello to everybody,

    I've done an application that draws in a frame the trajectory of a
    robot. The robot position is readed through the serial port, and
    several commands are wrote through the same port to change the
    direction of the robot.
    The trajectory frame is managed by an applet, and the project works
    good when the applet is called by a html document allocated in the
    same local machine under W98 where the classes and the serial port
    are.

    But my intention is now that the serial port is going to be in a
    server machine under Linux, and the users will connect with the frame
    through internet. And these are the questions:
    1.- If the same application that works in a local machine is called by
    these users, will it operate with the serial port of the server or the
    serial port of the user PC?
    2.- With the traditional applets can the users see the trajectory in
    the frame with the readed data from the server serial port and operate
    through the hmtl document in order to write in the server serial port?

    Thanks in advance, and I hope anybody could help me in this trouble.

    Bye.
  • ^CeFoS^

    #2
    reading & writing in serial port from server

    still waiting...
    [color=blue]
    > Hello to everybody,
    >
    > I've done an application that draws in a frame the trajectory of a
    > robot. The robot position is readed through the serial port, and
    > several commands are wrote through the same port to change the
    > direction of the robot.
    > The trajectory frame is managed by an applet, and the project works
    > good when the applet is called by a html document allocated in the
    > same local machine under W98 where the classes and the serial port
    > are.
    >
    > But my intention is now that the serial port is going to be in a
    > server machine under Linux, and the users will connect with the frame
    > through internet. And these are the questions:
    > 1.- If the same application that works in a local machine is called by
    > these users, will it operate with the serial port of the server or the
    > serial port of the user PC?
    > 2.- With the traditional applets can the users see the trajectory in
    > the frame with the readed data from the server serial port and operate
    > through the hmtl document in order to write in the server serial port?
    >
    > Thanks in advance, and I hope anybody could help me in this trouble.
    >
    > Bye.[/color]

    Comment

    • Anthony Borla

      #3
      Re: reading & writing in serial port from server


      "^CeFoS^" <[email protected] s> wrote in message
      news:7403957a.0 311100042.60410 [email protected] gle.com...[color=blue]
      > still waiting...
      >[color=green]
      > > Hello to everybody,
      > >
      > > I've done an application that draws in a frame the trajectory
      > > of a robot. The robot position is read through the serial port,
      > > and several commands are written through the same port to
      > > change the direction of the robot.
      > >
      > > The trajectory frame is managed by an applet, and the
      > > project works good when the applet is called by a html
      > > document allocated in the same local machine under W98
      > > where the classes and the serial port are.
      > >[/color][/color]

      Am I to understand that all the pertinent application logic:

      * Robot Interface / Control [i.e. serial port access, generate
      robot commands (?) etc]

      * Trajectory Engine [i.e. trajectory data generation etc]

      * User Interface [i.e. frame management, trajectory data
      display, user command interpretation etc]

      is located within the applet ? If so, I suggest a design change - see
      response below.
      [color=blue][color=green]
      > >
      > > But my intention is now that the serial port is going to
      > > be in a server machine under Linux, and the users will
      > > connect with the frame through internet. And these are the
      > > questions:
      > >
      > > 1.- If the same application that works in a local machine is
      > > called by these users, will it operate with the serial port of the
      > > server or the serial port of the user PC?
      > >[/color][/color]

      If you are executing code on machine X which accesses the serial port [or
      any other resource / device] it will be machine X's serial port / device it
      will be accessing. Thus, in this case, the user PC's port. To put it quite
      simply, it is not possible to *directly* access another machine's resource /
      devices. Such functionality [i.e. access to remote resources] needs the aid
      of an intermediary [i.e. URL, socket, RMI, etc], and code needs to be
      altered to allow this.

      Note:

      * Applets [unsigned] loaded via URL cannot access local
      resources - forget accessing local PC serial port [it's not
      what you want anyway]
      [color=blue][color=green]
      > >
      > > 2.- With the traditional applets can the users see the trajectory
      > > in the frame with the readed data from the server serial port and
      > > operate through the hmtl document in order to write in the server
      > > serial port?
      > >[/color][/color]

      If you redesign your project you will certainly have the functionality you
      require via an URL-launched unsigned applet. One [of several possible]
      redesign suggestion:

      * Implement a server application, which will execute on
      your Linux box, to perform the:

      - Robot Interface / Control
      - Trajectory Engine

      duties. I recommend use of the 'javax.comm' package for
      serial port access tasks

      * Your applet could be redesigned to do what applets do
      best - act as a user interface to a server application. The
      applet would communicate with the server application:

      - Sending user commands

      - Receiving robot trajectory data and drawing it on
      screen, etc

      I hope this explanation sheds some light on your problem, and please note
      that the suggested approach is only one of several. My aim is to offer
      ideas, not a complete solution.

      Cheers,

      Anthony Borla

      P.S.

      You might care to post to:

      comp.lang.java. help
      comp.lang.java. programmer

      in future. The current newsgroup was officially retired in 1996, which
      partly explains why responses come very slowly, if at all.

      I've also taken the liberty of forwarding this response to
      'comp.lang.java .help' - you may well get additional feedback.


      Comment

      • ^CeFoS^

        #4
        Re: reading &amp; writing in serial port from server

        First of all thank you for your accurate advices. According to your
        answer I have the application running in the server machine and using
        the serial port. The other application that will be called in the html
        document that it'll allocate the frame with the user interfaz and
        it'll manage the events, I suppose it would be a simple applet like I
        had in the local machine test.

        But I have any questions. I suppose the server application will be
        running using the java command (java MyServerApp.cla ss), where can I
        look for information about communication between a server application
        and the user applet.

        Thanks in advance.

        Comment

        • ^CeFoS^

          #5
          Re: reading &amp; writing in serial port from server

          still waiting ...

          [email protected] (^CeFoS^) wrote in message news:<7403957a. 0311170327.74b6 [email protected] ogle.com>...[color=blue]
          > First of all thank you for your accurate advices. According to your
          > answer I have the application running in the server machine and using
          > the serial port. The other application that will be called in the html
          > document that it'll allocate the frame with the user interfaz and
          > it'll manage the events, I suppose it would be a simple applet like I
          > had in the local machine test.
          >
          > But I have any questions. I suppose the server application will be
          > running using the java command (java MyServerApp.cla ss), where can I
          > look for information about communication between a server application
          > and the user applet.
          >
          > Thanks in advance.[/color]

          Comment

          Working...