Serial Comms w/ modem making me crazy

I

Ian Williamson

Greetings,

I have been trying to perform modem communications for a
few weeks now without any success.

Using Dick Grier's wrapper, I have been able to connect
to Hyperterminal on my desktop and push keystrokes.

However, when I plug into my modem, it seems that the
modem refuses to process my AT commands. I have tried
the same modem using a full framework serial app and have
had no problems.

One thing I do notice is that the Terminal Ready light on
my modem is not on when I open the serial port using CF.

My connection settings are as follows:

CFSerialClass.SerialIO.SerialPort serial = new
CFSerialClass.SerialIO.SerialPort();
serial.EnableOnComm = true;
serial.CommPort = 1;
serial.BitRate = 57600;
serial.Parity = "N";
serial.DataBits = 8;
serial.StopBits = 1;
serial.PortOpen = true;
serial.Output("ATDT#######" + (char)13);
MessageBox.Show("wait");
serial.PortOpen = false;

Any ideas what might be going wrong?

Cheers, Ian Williamson
 
J

James Riddell

code looks fine, although maybe try & vbcrlf instead of (chr)13?

"One thing I do notice is that the Terminal Ready light on
my modem is not on when I open the serial port using CF."

suggests that the modem is waiting for DTR (Data Terminal ready) to be
raised by the device. Perhaps your device only has a 3 wire serial port?
(such as an iPaq) This would explain why your full framework app works
(your PC probably has a full function 9 wire serial port )

Also - if it still doesn't work - your modem might be set to hardware flow
control (3 wire rs232 doesn't have CTS or RTS, only TXD,RXD and GND). You
can probably get around this by setting the modem to use software or no flow
control using an AT command from hyperterminal on your PC. (AT&K4 from
memory - might be different for your modem though)

If this doesn't work - maybe you are just crazy?
 
D

Dick Grier

Hi,

Did you set DTREnable = True?

I don't see this in your code. Also... RTSEnable = True will be required by
most modems.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.
 
I

Ian Williamson

And there it was staring me in the face. A simple flip
of the DTR override jumper on the modem and I am in
business. Forest for the trees, yadda, yadda.

Thanks for waking me up James, although I still think I
might be crazy.

Cheers.
 
D

Dick Grier

Hi Ian,

Don't change the DIP switch. You may want to use DTR to force a modem
disconnect. Use the software properties, DTREnable and RTSEnable to control
the state of these control lines.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top