aspose file tools*
The moose likes Java in General and the fly likes serial communication using applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "serial communication using applet" Watch "serial communication using applet" New topic
Author

serial communication using applet

JigaR Parekh
Ranch Hand

Joined: May 23, 2005
Posts: 112
Hi,

I have one strange problem, I have to do some serial port communication on remote machine.

so i am planning to develop some webstart application but i have one question that can i do this using applet (signed)???

any help is appreciated.

Jigar
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Jigar if I am not wrong then to read from serial port you require

(1)Java Comm jar
(2)Platform Proprietary supporting file (.dll for windows)

Hence it is not possible to achieve same using applet.

I don’t have idea about webstart, but if you are developing a web based application and client can come from heterogeneous platforms, I don’t see any solution.


My blood is tested +ve for Java.
JigaR Parekh
Ranch Hand

Joined: May 23, 2005
Posts: 112
thx for reply,

you are saying correct that if i implement using comm api then i will loose platform portability.

but atleast i can start with.

and i have gone through comm api faqs on sun they have mention that we can communicate with serial port using signed applet.

Jigar
JigaR Parekh
Ranch Hand

Joined: May 23, 2005
Posts: 112
i am also searching for any other option if there is ???
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Does your application has to be web based only?

Are you open for client server model using Java?
JigaR Parekh
Ranch Hand

Joined: May 23, 2005
Posts: 112
Yes my application is web-based and server is located at remote place.
Now i am suppose to give some solution for following.

There might be some equiment attached to some machine and they will post some data in computer which i have to read and push in to my application.
JigaR Parekh
Ranch Hand

Joined: May 23, 2005
Posts: 112
My application is based on servlet,xsl,ejb and web services and i am using linux as deployment server.
Client will be limited most of the cases they will be windows machine
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Originally posted by jigar parekh:
Yes my application is web-based and server is located at remote place.
Now i am suppose to give some solution for following.

There might be some equiment attached to some machine and they will post some data in computer which i have to read and push in to my application.


What do you mean by "some equiment" ?

Is it digital certificate that you wanna read?
JigaR Parekh
Ranch Hand

Joined: May 23, 2005
Posts: 112
sorry it was typo error
there might be some equipment attached computer and will post data through serial port.
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
no no i am asking which instrument is that?

do you need to read digital certificate from the port?
JigaR Parekh
Ranch Hand

Joined: May 23, 2005
Posts: 112
i dont know what do you mean by digital certificate.
but the equipment will post some raw binary data to machine which i will need to push in to application
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Originally posted by jigar parekh:
i dont know what do you mean by digital certificate.
but the equipment will post some raw binary data to machine which i will need to push in to application


What is Digital Certificate

You application can by accessed by “anybody” using internet or only by those who have specific kind of device attached with their PC?

[ September 30, 2005: Message edited by: Chetan Parekh ]
[ September 30, 2005: Message edited by: Chetan Parekh ]
JigaR Parekh
Ranch Hand

Joined: May 23, 2005
Posts: 112
application is going to use by specific client but they are going to much more than this (ie posting data through serial port).

Thx
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
First develop an application that read data from serial port, put it in jar, sign it and give it to the client. Tell him to put it JAVA_HOME\jre\lib\ext folder.

Include an applet in you web application that instantiate a class from the local jar and call a specific method that read binary data from port.

This should work for you!!
JigaR Parekh
Ranch Hand

Joined: May 23, 2005
Posts: 112
thx for solution let me try this.

just one question why i will need to create jar and place it into ext folder of java.

can i transfer it with my applet jar ??

Jigar
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Well using applet use can check that whether the needed jar/dll/sh files are there at specific location or not, if not then download it from server and copy at specific location.

Even you can register dll file in window registry using applet, hence you can transfer required dll file from server to client firs time when client accessing site and install all needed files there.
JigaR Parekh
Ranch Hand

Joined: May 23, 2005
Posts: 112
Originally posted by Chetan Parekh:
Well using applet use can check that whether the needed jar/dll/sh files are there at specific location or not, if not then download it from server and copy at specific location.

Even you can register dll file in window registry using applet, hence you can transfer required dll file from server to client firs time when client accessing site and install all needed files there.


Relly can we do these with applet !!
can u tell me how we can achive this ? if u know..
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
See you need all required jar files in JAVA_HOME\jre\lib\ext folder. Using applet get JAVA_HOME value and using IO check whether required jars file are there or not in JAVA_HOME\jre\lib\ext. If no then using IO copy file from server to client.
JigaR Parekh
Ranch Hand

Joined: May 23, 2005
Posts: 112
Thx chetan,
Let me do it and let u know if i have any problem.

JigaR Parekh
 
Consider Paul's rocket mass heater.
 
subject: serial communication using applet