473,387 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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.
Jul 17 '05 #1
4 9049
still waiting...
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.

Jul 17 '05 #2

"^CeFoS^" <se****@terra.es> wrote in message
news:74**************************@posting.google.c om...
still waiting...
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.

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.

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?

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]

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?


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.
Jul 17 '05 #3
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.class), where can I
look for information about communication between a server application
and the user applet.

Thanks in advance.
Jul 17 '05 #4
still waiting ...

se****@terra.es (^CeFoS^) wrote in message news:<74**************************@posting.google. com>...
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.class), where can I
look for information about communication between a server application
and the user applet.

Thanks in advance.

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: per.bergstrom | last post by:
To whom it may concern, The serial port server 'cnhd38' has been terminated (on who's initiative, I don't know). It affects the users of the (at least) following nodes: cnhd36, cnhd44, cnhd45,...
3
by: Gayathri Subramaniam | last post by:
hai, im a student. i am assigned a task to instruct a robot. for this i want to write and read from com1. i do not know how to configure the port using DCB structure. i have a data rate of...
8
by: Vivek Menon | last post by:
Hi, I am using a C program to write/read from a serial port. The writing part is working perfectly fine. However, I am not able to read the values correctly and display them. To debug this issue I...
4
by: Petr Jakes | last post by:
I am trying to save data it is comming from the serial port continually for some period. (expect reading from serial port is 100% not a problem) Following is an example of the code I am trying to...
8
by: glaskan | last post by:
This code is meant to take an input from the serial port and then save the input from the serial port as the name and as the data to a text file but all i am getting is an empty text file or a text...
8
by: Ringo | last post by:
I have a micro controller that sends a stream of 102 bytes to the pc. The values range from 0 to 255. I set up my serialport like this sp.BaudRate = 115200; sp.PortName = "COM53"; sp.DataBits =...
6
by: John Wright | last post by:
I am trying to read the data from a device on a serial port. I connect just fine and can receive data fine in text mode but not in binary mode. In text mode the data from the device comes in...
2
by: Nasif | last post by:
Currently I am writing a program which sends and receives messages through serial port to a device. I am using C# and Microsoft Visual studio 2005 for windows program. But my problem is when i try...
6
by: anu29dolly | last post by:
Hello everyone... I have written a program to write and read data from serial port.... I am able to write 80(in binary)..and is expecting 1B but i am uable to read it... My code goes as...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.