]> git.vanrenterghem.biz Git - www.vanrenterghem.biz.git/blob - Linux/GPRS_on_iPAQ_running_Familiar.shtml
Update header - remove Tech section and add Projects.
[www.vanrenterghem.biz.git] / Linux / GPRS_on_iPAQ_running_Familiar.shtml
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15" />
6    <meta name="author" content="Frederik Vanrenterghem" />
7    <meta name="Description" content="Personal homepage - GNU/Linux stuff - Connecting to GPRS network with iPAQ running Familiar Linux" />
8    <title>vanrenterghem.biz - GNU/Linux - Connecting to GPRS network with iPAQ PDA running Familiar Linux</title>
9 <link rel="stylesheet" href="/styles/header.css" type="text/css" />
10 <link rel="stylesheet" href="/styles/main.css" type="text/css" />
11 </head>
12 <body>
13 <!--#include virtual='/header.shtml' -->
15 <h1>GPRS network connection for the iPAQ</h1>
16 <h2>Introduction</h2>
17 <p>
18 In this document, I outline the steps necessary to get an iPAQ running Familiar Linux on the net via GPRS using a Bluetooth-capable phone.
19 </p>
21 <h2>Hard- and software</h2>
22 <ul>
23 <li>Compaq iPAQ 3955 (h3900 series)</li>
24 <li>Nokia Bluetooth CF Card DTL-1</li>
25 <li>Nokia 6131 camera phone</li>
26 <li><a href="http://familiar.handhelds.org/">Familiar Linux</a></li>
27 </ul>
28 <h2>Provider</h2>
29 <p>
30 Belgian wireless carrier <a href="http://base.be/">Base</a>.
31 </p>
32 <h2>Steps</h2>
33 <h3>Get Bluetooth working</h3>
34 <p>
35 There's various HOWTO's available on getting Bluetooth functioning on (Familiar) Linux. Tip: use <a href="http://www.bluez.org/">Bluez</a>. If you are using the Opie image of Familiar 0.8.4, 
36 you will have to replace <em>/bin/bluepin</em> with a shell script like this one:
37 </p>
38 <code>
39 #!/bin/sh<br />
40 echo -n PIN:<br />
41 cat /etc/bluetooth/pin<br />
42 exit 0<br />
43 </code>
44 <h3>Find the hardware address of the phone</h3>
45 <p>
46 Use hcitool to find the various bluetooth devices in your neighbourhood. Provided you've made the phone broadcast its presence, it should show up in the scan.
47 </p>
48 <code>
49 ~ # hcitool scan<br />
50 Scanning ...<br />
51 &nbsp;&nbsp;&nbsp;&lt;address&gt;   &lt;friendly name&gt;
52 </code>
53 <h3>Find the channel for dial-up networking</h3>
54 <p>
55 Check on what channel the phone provides dial-up networking (DUN): 
56 </p>
57 <code>
58 sdptool search --bdaddr &lt;bd&gt; DUN
59 </code>
60 <p>
61 where <em>&lt;bd&gt;</em> is the hardware address of your mobile phone as detected by hcitool scan.
62 </p>
63 <h3>Bind rfcomm</h3>
64 <p>
65 I decided to bind <em>/dev/rfcomm0</em> to the DUN channel of my phone.
66 </p>
67 <code>
68 /etc/init.d # cat bind_dun<br />
69 rfcomm bind 0 &lt;bdaddr&gt; &lt;channel&gt;<br />
70 mknod -m 666 /dev/rfcomm0 c 216 0<br />
71 </code>
72 <h3>Configure PPP</h3>
73 <p>
74 I assume you have the point-to-point protocol set up on your device already. If not, <code>ipkg search *ppp*</code> is your friend.
75 </p>
76 <p>
77 On Familiar 0.8.x, the pppd options were changed versus 0.7.x. The file now only contains a minimal <code>lock</code> as option. I 
78 prefer the following:
79 </p>
80 <code>
81 ---------------- cut and paste from here ----------------<br />
82 cat &gt; /etc/ppp/options &lt;&lt; EOF<br />
83 -detach<br />
84 defaultroute<br />
85 nocrtscts<br />
86 lock<br />
87 noauth<br />
88 lcp-echo-interval 5<br />
89 lcp-echo-failure 3<br />
90 usepeerdns<br />
91 460800<br />
92 local<br />
93 asyncmap 0<br />
94 EOF<br />
95 ------------------------ end cut ------------------------<br />
96 </code>
97 <p>
98 Now you'll need a chat script to tell the phone what to do.
99 </p>
100 <code>
101 ---------------- cut and paste from here ----------------<br />
102 cat &gt; /etc/ppp/chat.gprs.base &lt;&lt; EOF<br />
103 ABORT "BUSY"<br />
104 "" "\d"<br />
105 SAY "Resetting modem\n"<br />
106 "" "atz"<br />
107 SAY "Dialing\n"<br />
108 OK 'AT+cgdcont=1,"IP","gprs.base.be"'<br />
109 OK "ATD*99#"<br />
110 TIMEOUT 60<br />
111 CONNECT ''<br />
112 SAY "Connected\n"<br />
113 EOF<br />
114 ------------------------ end cut ------------------------<br />
116 </code>
117 <p>
118 You'll also need to provide some additional options for <em>pppd</em>:
119 </p>
120 <code>
121 ---------------- cut and paste from here ----------------<br />
122 cat &gt; /etc/ppp/peers/base_gprs  &lt;&lt; EOF<br />
123 debug <br />
124 noauth <br />
125 usepeerdns<br />
126 /dev/rfcomm0 460800<br />
127 460800<br />
128 user base<br />
129 password base<br />
130 local<br />
131 nocrtscts<br />
132 defaultroute<br />
133 noipdefault<br />
134 connect '/usr/sbin/chat -f /etc/ppp/chat.gprs.base -r /dev/console'<br />
135 EOF<br />
136 ------------------------ end cut ------------------------<br />
137 </code>
138 <h3>Get connected</h3>
139 <p>
140 Start <em>pppd</em> as follows:
141 </p>
142 <code>
143 ~ # pppd call base_gprs
144 </code>
145 <p>
146 If all goes well (and only if you changed the <em>/etc/ppp/options</em> file), you should see something like this:
147 </p>
148 <code>
149 Reseting modem<br />
150 Dialing...<br />
151 Connected<br />
152 Serial connection established.<br />
153 using channel 13<br />
154 Using interface ppp0<br />
155 Connect: ppp0 <--> /dev/rfcomm0<br />
156 </code>
158 <h3>Check routing</h3>
159 <p>
160 As I had a default route already (via the USB connection in the cradle), I had to replace it:
161 </p>
162 <code>
163 route del default<br />
164 route add default ppp0<br />
165 </code>
166 </p>
167 <!--#include virtual='/footer.shtml' -->
168 </body>
169 </html>