Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-12

Network connections

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

SteveG

Evening All (from where I'm sitting anyway)

I have the following code which connects me to the Internet using a 'Wireless Broadband USB Key'.

Very simply, it uses wvdial to create the connection, and this works fine from a cmd line (linux obviously) or from a small Laz/Fpc test program. I can browse / email and my main program can access the internet successfully.

If I place the same code (as below) in my main program though, browser and email still work, but the program containing this code can no longer 'see' the connection.

The problem appears to be related to my usage of TProcess ?

begin
    AsyncProcess1.CommandLine := 'wvdial';
    AsyncProcess1.Execute;
end;

As a side issue, if anybody knows how to connect to a USB B'Band key directly from Laz/fpc (no wvdial etc) any pointers would be much appreciated.

Thanks - SteveG

Reply by email

Terry A. Haimann

If it is a script, it may not run from the Lazarus start procedure. Secondly, you may need to explicitly define the path. Your command prompt has a number of predifined paths,which your lazarus app doesn't.

SteveG wrote 30 lines
Evening All (from where I'm sitting anyway) I have the following code which connects me to the Internet using a 'Wireless Broadband USB Key'. Very simply, it uses wvdial to create the connection, and this works fine from a cmd line (linux obviously) or from a small Laz/Fpc test program. I can browse / email and my main program can access the internet successfully. If I place the same code (as below) in my main program though, browser and email still work, but the program containing this code can no longer 'see' the connection. The problem appears to be related to my usage of TProcess ? begin AsyncProcess1.CommandLine := 'wvdial'; AsyncProcess1.Execute; end; As a side issue, if anybody knows how to connect to a USB B'Band key directly from Laz/fpc (no wvdial etc) any pointers would be much appreciated. Thanks - SteveG -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

SteveG
to Terry A. Haimann
Terry A. Haimann wrote 30 lines
If it is a script, it may not run from the Lazarus start procedure. Secondly, you may need to explicitly define the path. Your command prompt has a number of predifined paths,which your lazarus app doesn't. SteveG wrote: >Evening All (from where I'm sitting anyway) > >I have the following code which connects me to the Internet using a > 'Wireless Broadband USB Key'. > >Very simply, it uses wvdial to create the connection, and this works fine > from a cmd line (linux obviously) or from a small Laz/Fpc test program. I > can browse / email and my main program can access the internet > successfully. > >If I place the same code (as below) in my main program though, browser and >email still work, but the program containing this code can no longer 'see' > the connection. > >The problem appears to be related to my usage of TProcess ? > >begin > AsyncProcess1.CommandLine := 'wvdial'; > AsyncProcess1.Execute; >end; > >As a side issue, if anybody knows how to connect to a USB B'Band key > directly from Laz/fpc (no wvdial etc) any pointers would be much > appreciated. >

Thanks Terry - I believe the script runs ok (initiates the connection) as all programs (browser etc) can access the Internet - the only program that cant is the Laz/Fpc program that called the script.
If I call the wvdial script from another fpc program first, my 'main' program then works ok, but placing the script call in my 'main' program (no other changes) prevents my 'main' program accessing the Internet.

SteveG

Reply by email

Michael Joyner ᏩᏯ
to SteveG
SteveG wrote 45 lines
On Thursday 31 December 2009 03:13:55 Terry A. Haimann wrote: > If it is a script, it may not run from the Lazarus start procedure. > Secondly, you may need to explicitly define the path. Your command prompt > has a number of predifined paths,which your lazarus app doesn't. > > SteveG wrote: > >> Evening All (from where I'm sitting anyway) >> >> I have the following code which connects me to the Internet using a >> 'Wireless Broadband USB Key'. >> >> Very simply, it uses wvdial to create the connection, and this works fine >> from a cmd line (linux obviously) or from a small Laz/Fpc test program. I >> can browse / email and my main program can access the internet >> successfully. >> >> If I place the same code (as below) in my main program though, browser and >> email still work, but the program containing this code can no longer 'see' >> the connection. >> >> The problem appears to be related to my usage of TProcess ? >> >> begin >> AsyncProcess1.CommandLine := 'wvdial'; >> AsyncProcess1.Execute; >> end; >> >> As a side issue, if anybody knows how to connect to a USB B'Band key >> directly from Laz/fpc (no wvdial etc) any pointers would be much >> appreciated. >> >> Thanks Terry - I believe the script runs ok (initiates the connection) as all programs (browser etc) can access the Internet - the only program that cant is the Laz/Fpc program that called the script. If I call the wvdial script from another fpc program first, my 'main' program then works ok, but placing the script call in my 'main' program (no other changes) prevents my 'main' program accessing the Internet. SteveG

Have you tried 're-initilizing' the internet connection after wvdial connects?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20091230/a99f4d47/attachment.html>

Reply by email

Vincent Snijders
to SteveG: Evening All (from where I'm sitting anyway) I have the following code which connects me…
SteveG wrote 16 lines
Evening All (from where I'm sitting anyway) Very simply, it uses wvdial to create the connection, and this works fine from a cmd line (linux obviously) or from a small Laz/Fpc test program. I can browse / email and my main program can access the internet successfully. If I place the same code (as below) in my main program though, browser and email still work, but the program containing this code can no longer 'see' the connection. The problem appears to be related to my usage of TProcess ? begin AsyncProcess1.CommandLine := 'wvdial'; AsyncProcess1.Execute; end;

Do you use TAsyncProcess in the command line application too? Or do you use TProcess in you GUI/LCL application too?

Vincent

Reply by email

SteveG
to Michael Joyner ᏩᏯ: Have you tried 're-initilizing' the internet connection after wvdial connects?…
Michael Joyner ?? wrote 43 lines
SteveG wrote: > On Thursday 31 December 2009 03:13:55 Terry A. Haimann wrote: >> If it is a script, it may not run from the Lazarus start procedure. >> Secondly, you may need to explicitly define the path. Your command >> prompt has a number of predifined paths,which your lazarus app doesn't. >> >> SteveG wrote: >>> Evening All (from where I'm sitting anyway) >>> >>> I have the following code which connects me to the Internet using a >>> 'Wireless Broadband USB Key'. >>> >>> Very simply, it uses wvdial to create the connection, and this works >>> fine from a cmd line (linux obviously) or from a small Laz/Fpc test >>> program. I can browse / email and my main program can access the >>> internet successfully. >>> >>> If I place the same code (as below) in my main program though, browser >>> and email still work, but the program containing this code can no >>> longer 'see' the connection. >>> >>> The problem appears to be related to my usage of TProcess ? >>> >>> begin >>> AsyncProcess1.CommandLine := 'wvdial'; >>> AsyncProcess1.Execute; >>> end; >>> >>> As a side issue, if anybody knows how to connect to a USB B'Band key >>> directly from Laz/fpc (no wvdial etc) any pointers would be much >>> appreciated. > > Thanks Terry - I believe the script runs ok (initiates the connection) as > all programs (browser etc) can access the Internet - the only program > that cant is the Laz/Fpc program that called the script. > If I call the wvdial script from another fpc program first, my 'main' > program then works ok, but placing the script call in my 'main' program > (no other changes) prevents my 'main' program accessing the Internet. > > SteveG Have you tried 're-initilizing' the internet connection after wvdial connects?

Sorry for the late reply Michael -
In what way do you mean to 're-init' ? - to run the wvdial script again perhaps ?

Thanks

Reply by email

SteveG
to Vincent Snijders: Do you use TAsyncProcess in the command line application too? Or do you use TProcess in…
Vincent Snijders wrote 22 lines
SteveG schreef: > Evening All (from where I'm sitting anyway) > > Very simply, it uses wvdial to create the connection, and this works fine > from a cmd line (linux obviously) or from a small Laz/Fpc test program. I > can browse / email and my main program can access the internet > successfully. > > If I place the same code (as below) in my main program though, browser > and email still work, but the program containing this code can no longer > 'see' the connection. > > The problem appears to be related to my usage of TProcess ? > > begin > AsyncProcess1.CommandLine := 'wvdial'; > AsyncProcess1.Execute; > end; Do you use TAsyncProcess in the command line application too? Or do you use TProcess in you GUI/LCL application too?

Sorry for late reply here as well Vincent -

I use the TAsyncProc in both applications (each is actually a full GUI app, not cmd line). It would seem that any app I create that calls the wvdial script using TAsync (or TProcess) can not 'see' the internet connection, but all 'external' apps (browsers etc) including my own Laz apps can.

Thanks

Reply by email