# ed\_DialupConnectionStart problem

**URL:** <https://forum.sierrawireless.com/t/ed-dialupconnectionstart-problem/218>\
**Category:** Open AT\
**Created:** [January 12, 2006, 2:01pm UTC](https://forum.sierrawireless.com/t/ed-dialupconnectionstart-problem/218 "2006-01-12T14:01:55Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![malek77](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@malek77](https://forum.sierrawireless.com/u/malek77)\
**Post date:** [January 12, 2006, 2:01pm UTC](https://forum.sierrawireless.com/t/ed-dialupconnectionstart-problem/218/1 "2006-01-12T14:01:55Z")

</div>

Hi all  
I begin to developp an FTP Appli and i have seen on other question that the basic steps are :

1. register on the GPRS network (AT+CGATT=1)
2. ed\_DialupSetConfig
3. ed\_DialupConnectionStart  
4- set parameters of FTP and FTP get Filename  
5- Get fileme

But my pb is in “ed\_DialupConnectionStart” that returns ED\_ERR\_NETWORK\_KO although AT+CGATT=1 return OK

And with AT# Commands : AT#ConnectionStart return good result and The IP delivered by service provider

So have u idea about this, thanks

---

<div class="post-metadata">

**Author:** ![jan](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jan](https://forum.sierrawireless.com/u/jan)\
**Post date:** [January 12, 2006, 2:45pm UTC](https://forum.sierrawireless.com/t/ed-dialupconnectionstart-problem/218/2 "2006-01-12T14:45:08Z")

</div>

Hi Malek,

the OK after AT+CGATT=1 doesn’t mean too much…

Did you also wait for +CGREG: 1 or +CGREG: 5? These are similar to the +CREG indications but used for GPRS. That means that you are registered on the network… When you do the ed\_DialupConnectionStart() then, it should work without a problem…

Also, I don’t think ed\_DialupSetConfig() is the right setup function for GPRS - you should use ed\_GPRSSetConfig() instead.

Best Regards,  
Jan

---

<div class="post-metadata">

**Author:** ![malek77](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@malek77](https://forum.sierrawireless.com/u/malek77)\
**Post date:** [January 12, 2006, 2:52pm UTC](https://forum.sierrawireless.com/t/ed-dialupconnectionstart-problem/218/3 "2006-01-12T14:52:22Z")

</div>

Hi jan thanks  
The best is to wait +CGREG as you said because i’ve tried to wait few seconds before "ed\_DialupConnectionStart " and it work

---

<div class="post-metadata">

**Author:** ![sergiofernando](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@sergiofernando](https://forum.sierrawireless.com/u/sergiofernando)\
**Post date:** [January 12, 2006, 5:20pm UTC](https://forum.sierrawireless.com/t/ed-dialupconnectionstart-problem/218/4 "2006-01-12T17:20:34Z")

</div>

Hi, the steps you described work for me every time. You should wait for “OK” response from at+cgatt=1 before calling ed\_DialupSetConfig(). Besides that, it should work…

> [@malek77](#):
>
> Hi all  
> I begin to developp an FTP Appli and i have seen on other question that the basic steps are :
> 
> 1. register on the GPRS network (AT+CGATT=1)
> 2. ed\_DialupSetConfig
> 3. ed\_DialupConnectionStart  
> 4- set parameters of FTP and FTP get Filename  
> 5- Get fileme
> 
> But my pb is in “ed\_DialupConnectionStart” that returns ED\_ERR\_NETWORK\_KO although AT+CGATT=1 return OK
> 
> And with AT# Commands : AT#ConnectionStart return good result and The IP delivered by service provider
> 
> So have u idea about this, thanks

---

<div class="post-metadata">

**Author:** ![jan](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jan](https://forum.sierrawireless.com/u/jan)\
**Post date:** [January 12, 2006, 6:15pm UTC](https://forum.sierrawireless.com/t/ed-dialupconnectionstart-problem/218/5 "2006-01-12T18:15:07Z")

</div>

Hi sergiofernando,

interesting… Are you using GPRS or dialup?

If you are using GPRS I am curious: you don’t actually wait for the modem to be registered on the GPRS network (+CGREG…) and it does work to setup a connection? (It still could be that your network is so good that it registers very quickly…)

I think setting up the GPRS session should fail when you are not registered - just as setting up a call will fail when the modem is not (yet) registered in the GSM network (+CREG: 1 or 5).

Best Regards,  
Jan

---

<div class="post-metadata">

**Author:** ![charlesoram](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@charlesoram](https://forum.sierrawireless.com/u/charlesoram)\
**Post date:** [January 13, 2006, 12:07am UTC](https://forum.sierrawireless.com/t/ed-dialupconnectionstart-problem/218/6 "2006-01-13T00:07:46Z")

</div>

Hi Malek,  
I have had the same problem. I call “at+cgatt=1” using adl\_atCmdCreate()  
and then wait for the command to complete by waiting for the ADL\_GPRS\_EVENT\_ME\_ATTACH event (in a handler subscribed from adl\_gprsSubscribe()). I then call ip\_Connect() and get a -14 error.  
Of course this works fine if I manually enter the “at+cgatt=1” command and then manually enter the “at+ipconnect=1,1” command.  
I have found that if I have a 10s delay after receiving the ADL\_GPRS\_EVENT\_ME\_ATTACH event then the ip\_Connect() works fine.

Jan, how do you wait for +CGREG: 1 or +CGREG: 5?

regards,  
Charles

---

<div class="post-metadata">

**Author:** ![jan](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jan](https://forum.sierrawireless.com/u/jan)\
**Post date:** [January 13, 2006, 7:57am UTC](https://forum.sierrawireless.com/t/ed-dialupconnectionstart-problem/218/7 "2006-01-13T07:57:19Z")

</div>

Hi Charles,

you could do a

```auto
adl_atUnSoSubscribe( "+CGREG:", UnSo_CGREG_Handler );
```

at the beginning of the program, then you do other initialization including AT+CGATT=1 and your handler will be called with all +CGREG unsolicited messages.

In the handler function

```auto
bool UnSo_CGREG_Handler( adl_atUnsolicited_t *paras ) {
  ascii *rsp;

  rsp = (ascii *)adl_memGet( paras->StrLength );
  wm_strRemoveCRLF( rsp, paras->StrData, paras->StrLength );

  ...

  switch ( rsp[8] ) {
     case '1':
     case '5':
        ...
  }
}
```

you can start the gprs connection. You might also want to handle the cases ‘0’ and/or ‘2’…

Also, you should consider that your handler will also be called when the currently used cell changes. So you should make sure that if you already have an active connection, that you do not start the session again…

An other command that I found very helpful is AT+WGPRS=0,0. If you use this and reset the modem, it will automatically attach to the GPRS network after each reset, so you do not need to use the AT+CGATT=1 command at all. Very nice if you don’t mind to be attached at all times (if network coverage is there).

Best Regards,  
Jan

---

<div class="post-metadata">

**Author:** ![charlesoram](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@charlesoram](https://forum.sierrawireless.com/u/charlesoram)\
**Post date:** [January 13, 2006, 8:58am UTC](https://forum.sierrawireless.com/t/ed-dialupconnectionstart-problem/218/8 "2006-01-13T08:58:08Z")

</div>

Thanks, Jan, I’ll give that a try.  
regards,  
Charles

---

<div class="post-metadata">

**Author:** ![sergiofernando](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@sergiofernando](https://forum.sierrawireless.com/u/sergiofernando)\
**Post date:** [January 13, 2006, 4:11pm UTC](https://forum.sierrawireless.com/t/ed-dialupconnectionstart-problem/218/9 "2006-01-13T16:11:39Z")

</div>

hi jan,

IÂ´m opening a GPRS connection. Sice waiting for “OK” from at+cgatt=1 command worked for me every time i never worried about it. My guess was that registring on the network was encapsulated in the ed\_GprsSetConfig() or ed\_DialupConnectionStart() funtions. Here are the steps I follow to activate a GPRS connection:

1. AT+CGATT  
2)wait for OK  
3)ed\_GprsSetConfig()  
4)ed\_DialupConnectionStart()

of course, since there is a delay between each of theese steps, there may be enough time for the modem to register on the net.

Best Regards,  
SÃ©rgio Chevtchenko

---

<div class="post-metadata">

**Author:** ![ybdragon](https://avatars.discourse-cdn.com/v4/letter/y/e95f7d/32.png) [@ybdragon](https://forum.sierrawireless.com/u/ybdragon)\
**Post date:** [July 19, 2006, 2:26pm UTC](https://forum.sierrawireless.com/t/ed-dialupconnectionstart-problem/218/10 "2006-07-19T14:26:44Z")

</div>

> [@sergiofernando](#):
>
> hi jan,
> 
> IÂ´m opening a GPRS connection. Sice waiting for “OK” from at+cgatt=1 command worked for me every time i never worried about it. My guess was that registring on the network was encapsulated in the ed\_GprsSetConfig() or ed\_DialupConnectionStart() funtions. Here are the steps I follow to activate a GPRS connection:
> 
> 1. AT+CGATT  
> 2)wait for OK

How you can wait for the OK?

---

<div class="post-metadata">

**Author:** ![jan](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jan](https://forum.sierrawireless.com/u/jan)\
**Post date:** [July 20, 2006, 11:57am UTC](https://forum.sierrawireless.com/t/ed-dialupconnectionstart-problem/218/11 "2006-07-20T11:57:59Z")

</div>

Hi ybdragon,

I think you may have figured it out already… Anyway, here is the answer: Your handler function is called with “OK” - so you would put code that should be executed after the OK into the handler function…

Best Regards,  
Jan
