Hi,
I am trying to get setup to write a realtime program for serial port communication. Problem im having is that sun say that java.comm is no longer available and that rxtx site just baffles me. I tried downloading several of the files but the zip folders where empty. Is there an alternative that anyone can recomment or even a sample script that someone has developed?
6 1897 JosAH 11,448
Recognized Expert MVP
Hi,
I am trying to get setup to write a realtime program for serial port communication. Problem im having is that sun say that java.comm is no longer available and that rxtx site just baffles me. I tried downloading several of the files but the zip folders where empty. Is there an alternative that anyone can recomment or even a sample script that someone has developed?
So I noticed: they've made a bit of a mess out of it; all you need are three files:
1) RXTXcomm.jar: the Java api identical to Sun's API
2) rxtxParalel.dll : parallel port support library
3) rxtxSerial.dll: serial port support library.
The two dlls belong in the bin directory of your JRE and the jar can be convenienty
stored in the lib\ext directory of that same JRE. I still have those files from the
2.1.7 distribution but I have no idea how to get them across; I don't have any
web space anymore ... maybe you can open up your email address and close
it again after you've received those three files (total: 182KB)
kind regards,
Jos
Thanks, that should be my email open now.
yeah I got those ok. Thanks Jo
JosAH 11,448
Recognized Expert MVP
yeah I got those ok. Thanks Jo
Good; remember: stick those dlls in your jre bin directory and that jar in your
jre lib\ext directory (or anywhere on your classpath). The packages are in the
gnu namespace as in: -
import gnu.io.CommPortIdentifier;
-
import gnu.io.PortInUseException;
-
import gnu.io.SerialPort;
-
import gnu.io.UnsupportedCommOperationException;
-
All the rest of the code is identical to Sun's implementation and you can use
Sun's API documentation for it.
kind regards,
Jos
I dont suppose you have any code that I could use to check my installation is correct?
JosAH 11,448
Recognized Expert MVP
I dont suppose you have any code that I could use to check my installation is correct?
you can try something like this for starters: -
Enumeration locPortList = CommPortIdentifier.getPortIdentifiers();
-
-
while (locPortList.hasMoreElements()) {
-
-
CommPortIdentifier locPortId= (CommPortIdentifier) locPortList.nextElement();
-
System.out.println(locPortId.getName()+" serial: "+(locPortId.getPortType() == CommPortIdentifier.PORT_SERIAL));
-
}
-
It should give you a list of installed serial ports.
kind regards,
Jos
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Dominik Kaspar |
last post by:
hello
i am writing a java program for locating a wireless device within an
office environment. i want to use the signal strengths of the
surrounding base stations (access points) to estimate the current
location of the device.
does anybody have an idea how to get the strength of a signal sent by
a base station in java?
thank you,
|
by: Mike C. |
last post by:
I am trying to get Java v1.4.2 to use my PCI add-on serial port.
So far, everything I try gives me
javax.comm.NoSuchPortException
at
javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:105)
at
org.sf.javaemu.Serial.SerialCommunications.openConnection(UnknownSource)
at javaemu.main.init(Unknown Source)
|
by: Greg Pedder |
last post by:
Hello. I have an application that uses the Java Communications API to use a
modem. At startup,
the application checks to see what serial devices are connected. For each
serial device, the app
tries to write some "AT" commands to make sure it gets back "OK" from the
modem. At this point
all the ports are closed and the application goes into a serversocket accept
blocking call and waits
for any connections.
|
by: Dan |
last post by:
I wnat to see in browser an status from an device connected on rs232
port
The java class for read from serial port is:
//Serial.java
import java.io.*;
import java.util.*;
import java.lang.*;
import javax.comm.*;
|
by: Michael Chong |
last post by:
I wrote a program that communicate with SerialComm. In every 300
milliseconds, my program continuously send & receive data via the serial
port once the program starts.
My program is once in a while, the serial port seems corrupted because when
my data is sent, it doesn't go through the serial port, so as same to
receive process. In order to fix this, I have to close the port and reopen
the port again.
Why?!! Is there any way to fix...
| |
by: luthriaajay |
last post by:
I have a tricky situation,
So please any help will be appreciated.
I have 2 XML docs :
Document 1
----------
<Interest>
|
by: suryawati |
last post by:
Dear All,
I am running a java serial program ( Black Box on commapi package ) on a Linux. But when Main Menu can displayed, automatically program stop for running and I can't do anything with what's displayed, for examples: the button can't be pressed, the combo box can't be schrolled, etc. One thing that make me confused is threre's no error message at all, with all of happened.
I had done somethings like :
- put jar.com file on dir:...
|
by: flarosa |
last post by:
Hi,
I'm wondering if I can get a reasonably civil (without starting any
huge wars) opinion on how server-side PHP compares to server-side
Java.
I've been strictly a Java developer for almost 10 years now, and I'm
pretty happy with it. However, I can't help but notice that there are
a significant amount of PHP-based development projects where I live,
and I've also noticed when searching around the internet for ready-
|
by: Jollywg |
last post by:
I'm running a small program that should list all of the comm ports that are available on the computer. The only problem is that nothing is recognized. I've stepped through the program and it jumps over the while .....hasMoreItems. When I set the hasMoreItems to false it executes it. There are no syntax errors and it runs completely, it just doesn't give me the info I need.
Thanks in advance!
package gps;
import javax.comm.*;...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |