Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Modem/Serial Comm. Problem

 
G. Ainscow
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try ATDT xxxxxxxxxx
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
G. Ainscow
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ernest,

Thanks, good to be here.

Sorry about the name and incorrect forum. :roll:

Glen.
 
G. Ainscow
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forgot to add one thing...

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

Glen.
 
G. Ainscow
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic