Re: Serial communication on Linux using Java
From: iksrazal (iksrazal_at_terra.com.br)
Date: 07/12/04
- Next message: Isaac Gerg: "Displaying a buffered image with a predifined colormap"
- Previous message: Rogan Dawes: "Re: NetBeans HTTP Monitor question"
- In reply to: Pashmina: "Serial communication on Linux using Java"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 12 Jul 2004 07:04:04 -0700
pashmina14@hotmail.com (Pashmina) wrote in message news:<2d8a920f.0407110910.4ce109b1@posting.google.com>...
> Hi,
> Our application on Linux needs to communicate with some devices. We
> are using RxTx package for that, and have been successful in
> establishing a connection to the modem and retrieving the data. But
> the data is recieved in blocks/chunks and not the entire data. The
> code seems to be fine. So wanted to know if this could be a problem
> with the serial port hardware buffer, which is filling up and then the
> data is being read. If yes, what can i do to solve the problem.
> Also, previously we were using wvdial to establish the connection and
> the data was received properly.
> Has anyone encountered such a problem before, or does anyone know what
> the problem could be?
>
> Thanks & Regards,
> Pashmina
Some quick thoughts, assumming rs232 and not rs485 or rs422. Use this
link for a good reference:
http://www.mathworks.com/access/helpdesk/help/toolbox/instrument/ch_ser22.html
1) Typically there are other handshaking control pins, besides rx/tx,
like cts/rts, that can help indicate when to read/send data. A
voltmeter on the pins or the docs may help there.
Quick def:
Controlling the Flow of Data: Handshaking
Data flow control or handshaking is a method used for communicating
between a DCE and a DTE to prevent data loss during transmission. For
example, suppose your computer can receive only a limited amount of
data before it must be processed. As this limit is reached, a
handshaking signal is transmitted to the DCE to stop sending data.
When the computer can accept more data, another handshaking signal is
transmitted to the DCE to resume sending data.
The DCE and DTE terms can get confusing due "null modem" cables. But
you might know all this - if not read up on it.
2) What type of flox control are you using, hardware or Xon/Xoff?
First, there are theoretical limits on software control - sorry can't
find a link or remember exactly the limit - so it may be an issue.
More likely, your device and host computer have to be using the same
type of control:
http://www.fokus.gmd.de/linux/FAQ/PPP-FAQ-10.html
It is important that the modem, not just the computer, have the proper
setting for flow control. If the modem does not do flow control and
the computer is expecting that the modem will tell it when the buffer
overruns, then the buffer will overrun because the modem is not
configured to tell the computer that it is full.
Likewise if the modem is configured to use RTS/CTS and your computer
is configured to use XON/XOFF then you will not be able to recognize
the modem\s request to suspend transmission.
HTH
Outsource to an American programmer living in brazil!
http://www.braziloutsource.com/
iksrazal
- Next message: Isaac Gerg: "Displaying a buffered image with a predifined colormap"
- Previous message: Rogan Dawes: "Re: NetBeans HTTP Monitor question"
- In reply to: Pashmina: "Serial communication on Linux using Java"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|