jQuery in Action, 2nd edition*
The moose likes Other JSE/JEE APIs and the fly likes Modem/Serial Comm. Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Modem/Serial Comm. Problem" Watch "Modem/Serial Comm. Problem" New topic
Author

Modem/Serial Comm. Problem

G. Ainscow
Greenhorn

Joined: Oct 31, 2004
Posts: 9
Hi,

I've spent two full days trying to find an answer to this question, without
any luck.

When I send an AT command to my modem it just echo's it right back at me,
instead of sending some form of acknowledgement, such as an OK response
code.

Of course, this means it doesn't respond correctly to dialling commands
either (AT Dnnnnnnn).

The problem is this: BlackBox works, as well as another sample application I
have -- just not <my> code (typical).

Any ideas as to why this is happening? Could it be that my sending and
receiving is not done in separate threads?

Some info:
OS: Windows 2000
JDK: 1.5.0
Modem: 3Com U.S. Robotics 56K Faxmodem

My code follows: (Test & _SerialPort)

Note: I'm using RXTX for communication, same/similar API to the sun implementation.





If you have any other working sample code for serial/modem i/o, please send
it my way.

Thanks,

D.
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
Try ATDT xxxxxxxxxx


Mike Gershman
SCJP 1.4, SCWCD in process
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

Hi Glen,

Welcome to JavaRanch!

First, a bit of business: you may not have read our naming policy on the way in. It reqiures that you use a full, real (sounding) first and last name for your display name. Initials aren't enough. You can change your display name here. Thanks.


Now, as to your question: this really belongs in our Other Java APIs forum. I'm going to move it there for you.


[Jess in Action][AskingGoodQuestions]
G. Ainscow
Greenhorn

Joined: Oct 31, 2004
Posts: 9
Hi Ernest,

Thanks, good to be here.

Sorry about the name and incorrect forum. :roll:

Glen.
G. Ainscow
Greenhorn

Joined: Oct 31, 2004
Posts: 9
Forgot to add one thing...

The code (usually?) works on first execution, but not again until the system is restarted.

Glen.
G. Ainscow
Greenhorn

Joined: Oct 31, 2004
Posts: 9
Originally posted by Mike Gershman:
Try ATDT xxxxxxxxxx


Hi Mike,

The same thing happens. (with both tone and pulse dialling)

Thanks.

Glen.
G. Ainscow
Greenhorn

Joined: Oct 31, 2004
Posts: 9
Found the problem...

I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only.

It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.)

Pretty silly, but you live and learn!

Glen.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Modem/Serial Comm. Problem
 
Similar Threads
Converting data file to text file
Modem/Serial Comm. Problem
sending sms through gsm modem
Send SMS by using Serial Port
serial port problems