Re: Serial communication on Linux using Java

From: iksrazal (iksrazal_at_terra.com.br)
Date: 07/12/04


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



Relevant Pages

  • Re: Serial communication on Linux using Java
    ... Typically there are other handshaking control pins, besides rx/tx, ... Handshaking ... between a DCE and a DTE to prevent data loss during transmission. ... The DCE and DTE terms can get confusing due "null modem" cables. ...
    (comp.os.linux.development.apps)
  • Re: Does modem really supports FULL DUPLEX?
    ... > I have yet to come across a voice modem capable of that. ... > Listed there should be all the drivers for the waveform audio (e.g. ... Error Control Forced \N2 ... Speaker Mode Dial M1 ...
    (microsoft.public.win32.programmer.tapi)
  • Re: Serial Port Problems
    ... >>I am having the following problem with my serial port, ... >> I think Windows is controlling the DTR and RTS signals from ... control lines; Data Terminal Ready and Data Set Ready, ... The other approach is to talk to the modem via ...
    (microsoft.public.windowsxp.hardware)
  • Re: Serial port: open vs fcntl
    ... >CLOCAL Ignore modem control lines. ... For example most RS-232 terminals simply do not ... >signals, and also that the serial interface driver will read incoming ...
    (comp.unix.programmer)
  • Re: USR Control Center wont detect USR5686E under XP Pro
    ... I received this response from USR ... Currently there is an issue with Control Center not detecting our ... Even though Control Center is software for the modem, ... all updates can be downloaded from the support ...
    (microsoft.public.windowsxp.hardware)

Loading