* [ECOS] PPP disconnect script @ 2004-07-03 14:18 Felix Nielsen 2004-07-05 9:27 ` Nick Garnett 0 siblings, 1 reply; 5+ messages in thread From: Felix Nielsen @ 2004-07-03 14:18 UTC (permalink / raw) To: ecos-discuss Hi I am trying to get a persistent connection up and running using a GRPS modem. After successful connection, at some point the connection is dropped from the ISP provider, and I need to re-connect automatically. Have enabled (=1) : "extern int persist; /* Reopen link after it goes down */" But before I can launch the connection again, I need to fire "+++" to the modem, so the modem is ready again. I have been looking in the source, and found : "extern char *disconnector; /* Script to disestablish physical link */" But how do I initialize that script? Any hints or examples would be appreciated. Thanks Felix -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] PPP disconnect script 2004-07-03 14:18 [ECOS] PPP disconnect script Felix Nielsen @ 2004-07-05 9:27 ` Nick Garnett 2004-07-05 13:42 ` Felix Nielsen 0 siblings, 1 reply; 5+ messages in thread From: Nick Garnett @ 2004-07-05 9:27 UTC (permalink / raw) To: Felix Nielsen; +Cc: ecos-discuss Felix Nielsen <felix@dezign.dk> writes: > Hi > > I am trying to get a persistent connection up and running using a GRPS > modem. After successful connection, at some point the connection is > dropped from the ISP provider, and I need to re-connect automatically. > > Have enabled (=1) : > > "extern int persist; /* Reopen link after it goes down */" > > But before I can launch the connection again, I need to fire "+++" to > the modem, so the modem is ready again. I have been looking in the > source, and found : > > "extern char *disconnector; /* Script to disestablish physical > link */" > > But how do I initialize that script? > > Any hints or examples would be appreciated. I don't believe persistence has been extensively tested. Looking at the code it should work, however I cannot guarantee that some part of it was stripped out when porting to eCos. All scripting support was also removed. eCos has no scripting language. If all you want to do is send the modem some simple commands, then use a chat script. Alternatively, both of these things can be handled outside the current stack. Just set up a thread to monitor the PPP connection and have it run something like this: void ppp_monitor( CYG_ADDRWORD arg ) { cyg_ppp_options_t options; cyg_ppp_handle_t ppp_handle; cyg_ppp_options_init( &options ); /* Adjust the options here */ while( ppp_persist ) { /* Do any connection establishment processing here */ ppp_handle = cyg_ppp_up( ppp_device, &options ); cyg_ppp_wait_up( ppp_handle ); cyg_ppp_wait_down( ppp_handle ); /* Do any connection dis-establishment processing here */ } } -- Nick Garnett eCos Kernel Architect http://www.ecoscentric.com/ The eCos and RedBoot experts -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] PPP disconnect script 2004-07-05 9:27 ` Nick Garnett @ 2004-07-05 13:42 ` Felix Nielsen 2004-07-05 14:12 ` Nick Garnett 2004-07-05 20:11 ` silpol 0 siblings, 2 replies; 5+ messages in thread From: Felix Nielsen @ 2004-07-05 13:42 UTC (permalink / raw) To: ecos-discuss Hi Nick, Thanks I will try that :) The "persist" seems to work just fine, the stack is trying to re-connect, when the ISP fails or no activity. But the connect fails if the modem is not ready to receive the initializing commands. I thought that maybe it was possible to specify a chat disconnect script. But I will debug some more :) Felix Nick Garnett wrote: >Felix Nielsen <felix@dezign.dk> writes: > > > >>Hi >> >>I am trying to get a persistent connection up and running using a GRPS >>modem. After successful connection, at some point the connection is >>dropped from the ISP provider, and I need to re-connect automatically. >> >>Have enabled (=1) : >> >>"extern int persist; /* Reopen link after it goes down */" >> >>But before I can launch the connection again, I need to fire "+++" to >>the modem, so the modem is ready again. I have been looking in the >>source, and found : >> >>"extern char *disconnector; /* Script to disestablish physical >>link */" >> >>But how do I initialize that script? >> >>Any hints or examples would be appreciated. >> >> > > >I don't believe persistence has been extensively tested. Looking at >the code it should work, however I cannot guarantee that some part of >it was stripped out when porting to eCos. > >All scripting support was also removed. eCos has no scripting >language. If all you want to do is send the modem some simple >commands, then use a chat script. > >Alternatively, both of these things can be handled outside the current >stack. Just set up a thread to monitor the PPP connection and have it >run something like this: > >void ppp_monitor( CYG_ADDRWORD arg ) >{ > cyg_ppp_options_t options; > cyg_ppp_handle_t ppp_handle; > > cyg_ppp_options_init( &options ); > > /* Adjust the options here */ > > while( ppp_persist ) > { > /* Do any connection establishment processing here */ > > ppp_handle = cyg_ppp_up( ppp_device, &options ); > > cyg_ppp_wait_up( ppp_handle ); > > cyg_ppp_wait_down( ppp_handle ); > > /* Do any connection dis-establishment processing here */ > > } >} > > > -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] PPP disconnect script 2004-07-05 13:42 ` Felix Nielsen @ 2004-07-05 14:12 ` Nick Garnett 2004-07-05 20:11 ` silpol 1 sibling, 0 replies; 5+ messages in thread From: Nick Garnett @ 2004-07-05 14:12 UTC (permalink / raw) To: Felix Nielsen; +Cc: ecos-discuss Felix Nielsen <felix@dezign.dk> writes: > Hi Nick, > > Thanks I will try that :) > > The "persist" seems to work just fine, the stack is trying to > re-connect, when the ISP fails or no activity. But the connect fails > if the modem is not ready to receive the initializing commands. > > I thought that maybe it was possible to specify a chat disconnect script. Since the call to chat() is inside the main loop, it will be invoked each time around the reconnect loop. So a chat script that just sends the "+++" each time should work. Actually, maybe not, since there are timing constraints on the speed at which the "+++" is received by the modem. You have the sources, so you could just modify the loop to call out to a routine of your own after the disconnection. -- Nick Garnett eCos Kernel Architect http://www.ecoscentric.com/ The eCos and RedBoot experts -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] PPP disconnect script 2004-07-05 13:42 ` Felix Nielsen 2004-07-05 14:12 ` Nick Garnett @ 2004-07-05 20:11 ` silpol 1 sibling, 0 replies; 5+ messages in thread From: silpol @ 2004-07-05 20:11 UTC (permalink / raw) To: ecos-discuss Hi Felix & Nick, It looks like ISP (heh, you can't make ISP out of telecom ;) is _not_ failing... Typical GPRS connection has yet another status "idle", but common PPP driver (BSD one) doesn't have such thing if I don't miss anything. Any GPRS-capable terminal MUST be able to go in idle after either timeout on inactivity or on message from SGSN (I could be wrong - last time I touched GPRS network side code more than 2 years ago) - this is done to save bandwidth, terminal's battery, etc. To make long things short - common BSD PPP driver should be modified in order to handle things properly with GPRS. More details you can find at 3gpp.org . BR, Andrej On Mon, 05 Jul 2004 15:42:46 +0200, Felix Nielsen <felix@dezign.dk> wrote: > Hi Nick, > > Thanks I will try that :) > > The "persist" seems to work just fine, the stack is trying to > re-connect, when the ISP fails or no activity. But the connect fails if > the modem is not ready to receive the initializing commands. > > I thought that maybe it was possible to specify a chat disconnect script. > > But I will debug some more :) > > Felix > > > > Nick Garnett wrote: > > >Felix Nielsen <felix@dezign.dk> writes: > > > > > > > >>Hi > >> > >>I am trying to get a persistent connection up and running using a GRPS > >>modem. After successful connection, at some point the connection is > >>dropped from the ISP provider, and I need to re-connect automatically. > >> > >>Have enabled (=1) : > >> > >>"extern int persist; /* Reopen link after it goes down */" > >> > >>But before I can launch the connection again, I need to fire "+++" to > >>the modem, so the modem is ready again. I have been looking in the > >>source, and found : > >> > >>"extern char *disconnector; /* Script to disestablish physical > >>link */" > >> > >>But how do I initialize that script? > >> > >>Any hints or examples would be appreciated. > >> > >> > > > > > >I don't believe persistence has been extensively tested. Looking at > >the code it should work, however I cannot guarantee that some part of > >it was stripped out when porting to eCos. > > > >All scripting support was also removed. eCos has no scripting > >language. If all you want to do is send the modem some simple > >commands, then use a chat script. > > > >Alternatively, both of these things can be handled outside the current > >stack. Just set up a thread to monitor the PPP connection and have it > >run something like this: > > > >void ppp_monitor( CYG_ADDRWORD arg ) > >{ > > cyg_ppp_options_t options; > > cyg_ppp_handle_t ppp_handle; > > > > cyg_ppp_options_init( &options ); > > > > /* Adjust the options here */ > > > > while( ppp_persist ) > > { > > /* Do any connection establishment processing here */ > > > > ppp_handle = cyg_ppp_up( ppp_device, &options ); > > > > cyg_ppp_wait_up( ppp_handle ); > > > > cyg_ppp_wait_down( ppp_handle ); > > > > /* Do any connection dis-establishment processing here */ > > > > } > >} > > > > > > > > -- > Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos > and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss > > -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-07-05 20:11 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2004-07-03 14:18 [ECOS] PPP disconnect script Felix Nielsen 2004-07-05 9:27 ` Nick Garnett 2004-07-05 13:42 ` Felix Nielsen 2004-07-05 14:12 ` Nick Garnett 2004-07-05 20:11 ` silpol
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).