View previous topic :: View next topic |
Author |
Message |
micknfld
Joined: 31 Jan 2006 Posts: 6
|
Sending +++ to modem |
Posted: Mon Mar 06, 2006 6:43 pm |
|
|
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
|
|
Posted: Mon Mar 06, 2006 7:34 pm |
|
|
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: 1635 Location: Perth, Australia
|
Re: Sending +++ to modem |
Posted: Mon Mar 06, 2006 10:53 pm |
|
|
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
|
|
Posted: Wed Mar 08, 2006 2:59 pm |
|
|
...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
|
|
Posted: Wed Mar 08, 2006 6:44 pm |
|
|
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
|
|
Posted: Wed Mar 08, 2006 7:15 pm |
|
|
I put a delay of 1 second before sending the +++ sequence. That worked. Thanks. |
|
|
King Virus
Joined: 02 Mar 2006 Posts: 14 Location: Italy
|
|
Posted: Thu Mar 09, 2006 7:18 am |
|
|
Quote: |
DTR actually, for every modem I've come across. |
Right ! Sorry ! _________________ *** A good forum is a forum where people respect eatch other ! *** |
|
|
|