CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Sending +++ to modem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
micknfld



Joined: 31 Jan 2006
Posts: 6

View user's profile Send private message

Sending +++ to modem
PostPosted: Mon Mar 06, 2006 6:43 pm     Reply with quote

I have a PIC connected to a modem. I use the modem to call another computer to transfer data to it. I am able to connect to the other computer and successfully send data to it. However, I am unable to use the +++ command to return to command mode to hang up the line. The following is part of my code:

fprintf(modem,"atdt,8959%c",13);
fprintf(modem,"data");
fprintf(modem,"+");
fprintf(modem,"+");
fprintf(modem,"+");
fprintf(modem,"ath0%c",13);

I saw a posting on this forum that said that you need to put a delay between the +'s. I tried putting a 150ms delay between the +'s and then a 500ms delay before sending the ath0 command. This didn't work. A also just tried fprintf(modem,"+++") but this didn't work either.

The problem is that the modem just takes the +++ and ath0 and sends it to the other computer as data and the modem remains off-hook.

Any suggestions?
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Mon Mar 06, 2006 7:34 pm     Reply with quote

Try sending

fprintf(modem,"+++");

After you send the "+++" you will need to wait for a response from the modem. If you send data then the modem will think that you are trying to send "+++ath0\n" as though it was data. For starters try this:

fprintf(modem,"+++");
delay_ms(1000);
fprintf(modem,"ath0%c",13);


Once you see that it works, take out the delay and look for a response.
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

Re: Sending +++ to modem
PostPosted: Mon Mar 06, 2006 10:53 pm     Reply with quote

You need 1 second of "silence" before sending the +++ sequence.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
King Virus



Joined: 02 Mar 2006
Posts: 14
Location: Italy

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Mar 08, 2006 2:59 pm     Reply with quote

...or you pull down the CTS Line. In standart configuration the modem should interpret this as ATH !
_________________
*** A good forum is a forum where people respect eatch other ! ***
StuartH



Joined: 19 Aug 2005
Posts: 14
Location: W. Midlands, UK

View user's profile Send private message

PostPosted: Wed Mar 08, 2006 6:44 pm     Reply with quote

Quote:
...or you pull down the CTS Line. In standart configuration the modem should interpret this as ATH !


DTR actually, for every modem I've come across.
micknfld



Joined: 31 Jan 2006
Posts: 6

View user's profile Send private message

PostPosted: Wed Mar 08, 2006 7:15 pm     Reply with quote

I put a delay of 1 second before sending the +++ sequence. That worked. Thanks.
King Virus



Joined: 02 Mar 2006
Posts: 14
Location: Italy

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Mar 09, 2006 7:18 am     Reply with quote

Quote:


DTR actually, for every modem I've come across.


Right ! Sorry !
_________________
*** A good forum is a forum where people respect eatch other ! ***
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group