Next Previous Contents

8. How to connect to an isp using a modem (or a mobile phone)

It isn't that easy, it will depend on:

8.1 First stage: serial connection

This is in fact the crucial point: if this works, the rest should work. But until it works, you won't be able to do anything...

Don't run away! I managed to do it with my own Robotics Modem, so there's some hope :)

Plug (or align IrDA leds of) the modem or mobile phone to your hp (there are plenty of plans on http://www.hpcalc.org). Configure serial connection in IOPAR to maximum speed (unless you have good reasons not to do so). For IrDA, your device needs to support the COMM protocol.

Try some OPENIO "AT" 13 CHR + 10 CHR + XMIT DROP and then look what BUFLEN DROP SRECV says: if it says "OK", you've done it!

If it doesn't, you may have to ask the modem to ignore DTR and RTSCTS by either switching a dip on the modem (US Robotics modem may have it, for instance), or by sending a configuration string thanks to a computer before connecting it to the hp. This is really modem-dependant, so I can't help much here. See http://www.hpcalc.org/details.php?id=3021 for more information.

8.2 Second stage: modem / mobile phone configuration

This is in fact related to First stage, since the parameters you give here may hold those you had to give to your modem thanks to a computer before connecting it to your hp.

Look in your modem manual, to know the initialisation string to set XONXOFF on your modem and disable RTSCTS, it should be something like AT&F&H2&I1&R1

If you don't have any manual (most general case nowadays... *snif*), ask Windows to do some logging in your modem's configuration panel, then connect to your favorite isp with xonxoff but no rtscts, at 9600 bps. Your initialisation string(s) is(are) in c;\windows\modemlog.txt.

now,

\<<
   32 SF
   ""   13 CHR 10 CHR + @ avoid garbage
   ""   "ATZ" 13 CHR + 10 CHR + @ resets modem
   "OK" "AT&FYourinitialisationString" 13 CHR + 10 CHR + @ setups modem
   "OK" "ATDTPhoneNumber" 13 CHR + 10 CHR + @ dial number
   "sillything"
   9 \-> LIST
   CHAT
\>>
should work, and you should see at least CONNECT 9600 (or something similar) (if you have several initialisation strings, add lines like
"OK" "ATYourNextInitialisationString" 13 CHR + 10 CHR +
between the line containing the first initialisation string and the "ATDT" line, and increase 9 by twice as much as the number of lines you added (in fact, by the number of strings you added)). The "avoid garbage" line is there to ensure that the AT letters of ATZ will be the first on its line (just in case someone did some "garbage" XMIT before launching the script).

For mobile phone connection (gprs for instance), you may use something like E0V1 as initialization string, and *99# as phone number. Just have a look at documentations on the net for gprs & linux, you'll probably find what you need.

8.3 Third stage: network connection

According to your isp's policy, you may have to login via scripts, or via PAP.

Indeed, while testing the program of the Second Stage, you should have got something appearing just after CONNECT, either

If you need a script, you may just adapt this one to your parameters:

<<
   32 SF
   ""   13 CHR 10 CHR + @ avoid garbage
   ""   "ATZ" 13 CHR + 10 CHR + @ resets modem
   "OK" "AT&FYourInitialisationString" 13 CHR + 10 CHR + @ setups modem
   "OK" "ATDTPhoneNumber" 13 CHR + 10 CHR + @ dial number
   "ogin:" "login" 13 CHR + 10 CHR + @ logs in
   "asswd:" "passwd" 13 CHR + 10 CHR +
   "~"
   13 \-> LIST
   CHAT
   PPPON
>>

If you need PAP, you may just adapt that one to your parameters:

<<
   32 SF
   ""   13 CHR + 10 CHR + @ avoid garbage
   ""   "ATZ" 13 CHR + 10 CHR + @ resets modem
   "OK" "AT&FYourInitialisationString" 13 CHR + 10 CHR + @ setups modem
   "OK" "ATDTPhoneNumber" 13 CHR + 10 CHR + @ dial number
   "CONNECT"
   9 \-> LIST
   CHAT
   "login" "passwd"
   PPPON
   DROP2
>>

YourInitialisationString was found in your manual (or in Windows, or in last resort, mine), and PhoneNumber, login and passwd were given to you by your isp.

If it works once, it should always work. You may then remove "32 SF" for a more quiet connection.

Good luck!


Next Previous Contents