Javax comm api tutorial
Hi!
I've gone through sun's examples on how to use comm api.
Are there any detailed tutorials anywhere which one can use to learn the intricacies of the comm api? This is because one can go through the code or even the javadoc and get already written code to run, but a good detailed tutorial somewhere always helps a great deal to really plunge into the essence of the technology in use.
I'm an undergrad student and my aim is to send AT commands to a cell phone using a JAVA applet as well as receive responses from it through the JAVA applet.
Thanks alot for all your help.
This is a very well commented piece of code and is a good tutorial for the javx.comm api!
http://discussion.forum.nokia.com/forum/showthread.php?s=ffbe2f2bf1e0d951ec1a0867c9470bd0&threadid=27929&highlight=%2Ajavax.comm%2A
Similar Messages
-
Trying to use javax comm api in Windows Environment
I am working on developing a module to dial a phone number in a Windows environment. This is to test a voicemail connection so it isn't, necessarily, calling a modem.
A couple of questions:
1) I found the javax comm api but it appears Sun has only provided a Solaris and Linux version - where would I find a Windows version?
2) I was planning on dialing a modem with the voicemail phone number (programmatically, of course). I, then, want to recognize response and react to it - possibly stopping only with seeing that the phone number answered (since I don't want to write voice recognition software). Am I on the right track?
EdI don't know of any devices named "/dev/term/a" - and that's both Linux and Solaris.
-
Hi,
I am using javax comm API on linux. I am using RXTX comm API release 1.4 that uses gnu.io.RXTXCommDriver on J2ME Personal Profile Runtime Environment for x86 Linux Version 1.0.
When I try to open a serial port, I get javax.comm.NoSuchPortException. What could be the problem? Does the cvm not support comm API. Is there any alternate way?I am looking for one too.. i figured better would be to use JNI classes... but i havent yet implemented it.. mebbe that will cause even more problemos..
please post here if you find smthing -
hi all,
I tend to install the javax comm api on my windows98 se but it seem that I cant find the win32com.dll in the unzipped file.
I downloaded the javax.comm 3.0, update 1 for Linux plateform, since there is no version for the windows.
I have tried to enable the view every folder in my view tool but cant seem to work, I still cant see the win32com.dll file.
Regards,
Rejina Choihi , I having problem downloading this file ""Comm3.0_u1_linux.zip""" and I need it urgently could someone give me a link where I can download it. Sun say that "Product Not Found The product you requested is not available at this time".
-
Hello everyone.
Do anyone of you know why the new version of comm api (version 3.0) does not support Windows? It is only available for Solaris SPARC, Solaris x86, and Linux x86.
Therefore, I can only use comm 2.0. But my problem is that although I have managed to connect a GPS device with my desktop, I can not do that with my laptop or a different desktop pc that I have tried.
The problem is that the application that I have developed can not find the COM port that I describe.
Any thoughts?
Thanks a lot
Pavloshttp://www.rxtx.org/
RXTX is an open source javax.comm 2.x compatible package with multi platform support. I use it on all of WinXP/CE, Linux, FreeBSD, OSX and it works like a charm for parallel, serial and serial to USB devices (for GPRS modems and GPS devices specifically). RXTX is nicely abstracted also so you don't specifically need to use anything but the javax.comm interface unless you want to use one of the API extensions (for example clearCommInput() which is a very obvious omission in the javax.comm api - skip() just does not cut it).
The code itself is not well documented - for the most part you can use the javax.comm documentation or just read the source - but it works, and works very well. Even if the heuristics in the RXTXCommDriver don't automatically find the device (you can check the sources as to why) you can add devices at runtime with CommPortIdentifier.addPortName() if needed. -
Comm API problems (getPortIdentifier)
Hi! I wrote an applet that uses the javax.comm API to manage a serial port in the host machine. When first develop it with JDK 1.1.8 the applet (and an application) runs perfectly. I now have Java 2 (jdk1.3.1._02) and I'm trying to run this applet and when it arrives to a CommPortIdentifier.getPortIdentifier(String) call, I got this message:
"java.io.lang: name can't be null"
First I thought that was my applet, that my application was wrong, so I try to use de SerialDemo example that comes with the javax.comm and It doesn't work either! If I run it with the latest beta version of JDK (1.4 I think) it runs again... any idea???
Thanks a lot! =)in jdk1.3...
u have to copy the win32com.dll and comm.properties file in the jre\1.3\bin folder of the machine
and comm.jar in the jre\1.3\lib folder....
remember, in windows, u will get the
...\program files\javasoft\jre\1.3\lib or ..\bin
ther u have to store not in ur c:\jdk1.3\bin
Regards,
Ritesh -
Can the Javax Comm Api support SCSI??? There is any API that works with SCSI?
No, the comm API is for use with the serial ports etc. I don't think there is an API to work specifically with SCSI, unless you use JNI to call platform specific OS libraries.
-
Hi,
I am trying to communicate with the communication ports using javax comm API through an applet.
I am using Java 1.3.1.
It gives me the exception:
java.lang.ClassNotFoundException:javax.comm.commPortIdentifier
I run the same program not using the applet , it runs fine.(i.e.recognises the ports etc)
i tried to using a signed applet for the communication and still the exception is raised.
All the files like comm.jar and properties file and also windriver are located in the reqd locations.else my program would not have run without using the applet.
Can someone suggest what could be causing this problem
Thanks
SaiI am having the same problems with this javax.comm package. I am using Java 1.3.1_01 under WIN2K. I checked the hardware profile, and it listed my serial ports. I also have a palmpilot which communicates with this serial port, and it works fine as well.
I tryed installing it two different ways:
1.)
installed it as if I was using jdk1.1.x
putting the comm.jar package in the <jdkroot>/lib dir
putting the properties file in the <jdkroot>/lib dir
putting the dll in the <jdkroot>/bin dir
adding <jdkroot>/lib/comm.jar to the classpath.
While this did not give me a runtime error, it would not recognize any of my serial ports.
2.)
installed it according to the jdk1.2 documentation
comm.jar -> <jdkroot>/jre/lib/ext/ dir
properties -> <jdkroot>/jre/lib
dll -> <jdkroot>/jre/bin
not altering the path
This gave me the following runtime error:
java.lang.NoClassDefFoundError: javax/comm/CommPortIdentifier
at VirtualGPSConsoleApp.main(VirtualGPSConsoleApp.java:27)
Exception in thread "main"
Process VirtualGPSConsoleApp exited abnormally with code 1
Please let me know if you make any headway.
Thank you,
[email protected] -
How to use the COMM API in a JAR file
I have developed an application, using the NetBeans IDE, to communicate with a modem over the COM1 serial port using the Java Comm API. The application works fine within the IDE, but when a JAR file is created and "double-clicked", the application launches correctly, but when the code is executed to "talk" over the COM1 serial port - nothing happens. No exceptions and no warnings are thrown. My environment is XP, SP1.
The manifest file is as follows:
Manifest-Version: 1.0
Class-Path: ../j2sdk1.4.2/jre/lib/ext/TimerBean.jar ../j2sdk1.4.2/jre/
lib/ext/AbsoluteLayout.jar ../j2sdk1.4.2/jre/lib/ext/comm.jar
Created-By: NetBeans IDE
Specified-By: Projects/TheApp/Files/TheApp.jarContent
Main-Class: Main
According to the Comm API installation instructions, the following files are copied:
copy comm.jar \j2sdk1.4.2\jre\lib\ext
copy wind32com.dll \j2sdk1.4.2\bin
copy javax.comm.properties \j2sdk1.4.2\jre\lib
I suspect it has something to do with the paths.
Any help would be greatly appreciated. Thanks.Thanks for your input, but after trying what you suggested the problem still exists. I think your right to be suspicous of the javax.comm.properties file. The application, that worked in the IDE, exhibits the same behavoir as the JAR file if the javax.comm.properties file is removed from the ../jre/lib directory. In other words it compiles correctly in the IDE, but when executed, nothing happens when the code that "talks" to the serial port is run.
I've tried moving the javax.comm.properties file into the working directory. Also, the CLASSPATH and PATH system variables were modified to include the path to javax.comm.properties.
If you have anymore ideas, please let me know.
Thanks. -
My last chance...for comm api with applet
Hi to u great valued developers,
Did anybody on earth the same as I do:
Create and deploy a signed applet including the java comm api lib.
The applet is deployed on an Apache Server and should run under IE6
Easy? sure but something is certainly missing in the cab 'cause altough no error is return in console, I either do not receive any info from the ports.
Same app compiled as application is ok.
Thanks very much for any help.
Cedric ([email protected])Hello Enrique,
tx for ur answer.
As said, the application (reading serial ports) works fine.
The problem come possibly from javax.comm.property.
Should I package it with the cab? -
Error in the latest Java comm api for Linux
installed latest Java comm api for Linux, tried test application for the Sun package:
$ java SimpleRead
Exception in thread "main" java.lang.ExceptionInInitializerError
at SimpleRead.main(SimpleRead.java:67)
Caused by: java.lang.NullPointerException
at javax.comm.CommPortIdentifier.findConfFile(CommPortIdentifier.java:199)
at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:117)
... 1 more
What deis this message mean? How to make you serial port support work?and what does this error message mean??
The package was installed accordingly to "Java(tm) Communications API Linux Installation Instructions":
$ls /usr/lib/libLinuxSerialParallel.so
/usr/lib/libLinuxSerialParallel.so
$env|grep CLASS
CLASSPATH=<..skipped..>:/opt/commapi/jar/comm.jar:/opt/commapi/jar/commtest.jar
$ ls /opt/jdk1.5.0_04/jre/lib/javax.comm.properties
/opt/jdk1.5.0_04/jre/lib/javax.comm.properties
What else does it need? -
Configure comm.api in tomcat
hello friends,
i want to configure comm.api in tomcat5.5. please help me
Thanks in advance.
javax.comm: Error loading javax.comm.properties!
null
java.io.IOException: javax.comm: platform driver class name = null
(Check 'driver' property in javax.comm.properties)
at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:244)
at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:109)
at welcome.list(welcome.java:47)
at welcome.doGet(welcome.java:21)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)If your operating system works it as a comm port you can readily run the BlackBox example that comes with the comm 2.0 API and see if it picks it up.
-
Problem in Accessing serial port using java comm Api
I have installed java comm Api in my pc.
i have gone through the instalation instruction which comes on this package.
I have done the instalation like this
Copy win32com.dll to my <JDK>\bin directory.
Copy comm.jar to my <JDK>\lib directory.
Copy javax.comm.properties to my <JDK>\lib directory.
and restart the system.
But when i run the BlackBox , it is giving me message
"serial port not found".
Can any one tell me , what is the exact problem ?I'm not sure what you mean by BlackBox, but I have used the COMM api extensively.
The majority of problems is that the api cannot see the serial port (which is what you are describing) and this is caused by incorrect placing of the javax.comm.properties file.
As well as <JDK>\lib, try putting it into <JRE>\lib as well. That has often solved problems on my setup. -
I am trying to use Sun's Comm API with Web Start so I can access COM1 from my application.
When the application starts, I receive an exception for the CommPortIdentifier. When I run this
application as a standalone, it works fine. I have to assume that there is a problem with the
deployment of the Comm API.
I have include the win32com.dll in a jar file and defined it in the nativelib tag in the jnlp file.
The comm.jar and the javax.comm.properties files are include in another jar. I am not sure
what is the proper way to deploy these files and cannot find any documentation on this.
Does anyone know the correct way to handle this?I have include the win32com.dll in a jar file and
defined it in the nativelib tag in the jnlp file.
The comm.jar and the javax.comm.properties files are
include in another jar. I am not sure
what is the proper way to deploy these files and
cannot find any documentation on this.
should like like this
<resources>
<j2se version="..." href="..."/>
<jar href="application.jar"/>
<jar href="comm.jar" />
</resources>
<resources os="Windows">
<nativelib href="win32com.dll"/>
</resources>
Then in the code in application.jar, call
System.loadLibrary("win32com");
/Dietz -
Comm API and Exception in SerialDemo
I was able to compile the SerialDemo source into the application. However, when I run it, it throws an exception at line 560 of SerialDemo$ConfigurationPanel.listPortChoices
This line deals with enumerating the available ports on a system. The exception is a NoClassDefFound (no such class) error. It is looking for javax.comm.CommPortIdentifier
I have installed Comm API 2.0 according to the Win32 directions. I once had a prior installation working - at least listing what ports I actually had on the system - but even then the apps were unable to work with them at all.
Anyone got ideas?i have this error when run SerialDemo:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPortIdentifier
at SerialDemo$ConfigurationPanel.listPortChoices(SerialDemo.java:560)
at SerialDemo$ConfigurationPanel.<init>(SerialDemo.java:448)
at SerialDemo.<init>(SerialDemo.java:142)
at SerialDemo.main(SerialDemo.java:89)
My CLASSPATH :
C:\j2me\midp2.0fcs\classes;C:\Benhui_Bluecove;
C:\Benhui_Bluecove\classes;
C:\WTK23\apps\BTGalleryExample\src;
C:\Programmi\UCB\jdk1.4.1_02\j2sdk1.4.1_02\jre\lib\comm.jar;
and i have followed the instructions that are at http://www.benhui.net
These are the instructions :
To get mine to work, I copied the 'comm.jar' and 'javax.comm.properties' files into the following locations:
* <J2SE SDK installation directory>\lib
* <J2SE SDK installation directory>\jre\lib
* <J2SE SDK installation directory>\jre\lib\ext
And copied the 'win32com.dll' into the following locations:
* <J2SE SDK installation directory>\bin
* <J2SE SDK installation directory>\jre\bin
Can someone help me?
Thanks
Dani
Maybe you are looking for
-
Sending email with attachments not working on Lumi...
It is not possible to attach a file to an email, either via WiFi or my 4G connection. I have two different Office365 email accounts (work and private) that work perfectly when sending/receiving emails with/without attachments. However when I try an
-
How to get Mail 8.1 to forward an email based on Subject line?
I am using Mail 8.1 under MacOSX 10.10 (Yosemite). I would like to create a rule that takes all mail received into a specific Mailbox and send or forward it to an email address which forms the Subject line of that email, changing the Subject line of
-
Can I install and run Photoshop CS2 on a Windows 7 64Bit OS?
I just purchased a computer It is a Windows 7 Ultimate 64 bit OS. Can I install and run Photoshop CS2? What issues would I have?
-
Flash CS4 crash when scrolling
Hi, Today one of our artists started experiencing a crash in Flash CS4 Professional when scrolling the workspace around in one of his .fla files. All he has to do is hold down the spacebar and scroll around with the mouse; or use the scrollbars to s
-
Hi, Regarding video with Cocomo, I writing to confirm that the current version does not provide the following two capabilities: Recording. Acrobat Connect Pro includes record capability. Am I correct that at this time Cocomo does not (yet) include re