]> git.vanrenterghem.biz Git - www.vanrenterghem.biz.git/blob - Linux/imode_on_iPAQ_running_Familiar.shtml
Baseline
[www.vanrenterghem.biz.git] / Linux / imode_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 i-Mode with iPAQ" />
8    <title>vanrenterghem.biz - GNU/Linux - Connecting to i-Mode with iPAQ</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>i-Mode connection for the iPAQ</h1>
16 <h2>Introduction</h2>
17 <p>
18 A while back, my father donated his old iPAQ to me. Being a fan of free software, I immediately decided to put an alternative operating system on the unit. With <a href="http://familiar.handhelds.org/">Familiar</a>, a free alternative was available, and it even provided me with a <em>dpkg</em> lookalike <em>ipkg</em>! 
19 With this system set up, I could do most things one can do with a PDA - maintain a calendar, take notes, play music, ... When cradled, I could connect it to the Internet via my desktop PC.
20 Obviously a PDA isn't meant to be cradled all the time, so I had to find a way to connect it to the net while on the road as well.
21 The hard part turned out to be finding a bluetooth card I could use with this OS, as at the time of writing this document, not a whole lot of Compact Flash cards are supported yet - partly because some manufacturers don't provide specifications required to write the drivers, partly because the ARM kernel used in Familiar isn't fully at par with the one used on i386 systems yet.
22 In this document, I outline the steps necessary to get on the net via i-Mode (~GPRS) using a Bluetooth-capable phone.
23 </p>
25 <h2>Hard- and software</h2>
26 <ul>
27 <li>Compaq iPAQ 3955 (h3900 series)</li>
28 <li>Nokia Bluetooth CF Card DTL-1</li>
29 <li>Motorola V500 camera phone</li>
30 <li><a href="http://familiar.handhelds.org/">Familiar Linux</a></li>
31 </ul>
32 <h2>Provider</h2>
33 <p>
34 Belgian wireless carrier <a href="http://base.be/">Base</a> with <a href="http://www.imode.be/">I-mode</a>
35 </p>
36 <h2>Steps</h2>
37 <h3>Get Bluetooth working</h3>
38 <p>
39 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.2, 
40 you will have to replace <em>/bin/bluepin</em> with a shell script like this one:
41 </p>
42 <code>
43 #!/bin/sh<br />
44 echo -n PIN:<br />
45 cat /etc/bluetooth/pin<br />
46 exit 0<br />
47 </code>
48 <h3>Find the hardware address of the phone</h3>
49 <p>
50 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.
51 </p>
52 <code>
53 ~ # hcitool scan<br />
54 Scanning ...<br />
55 &nbsp;&nbsp;&nbsp;&lt;address&gt;   &lt;friendly name&gt;
56 </code>
57 <h3>Find the channel for dial-up networking</h3>
58 <p>
59 Check on what channel the phone provides dial-up networking (DUN): 
60 </p>
61 <code>
62 sdptool search --bdaddr &lt;bd&gt; DUN
63 </code>
64 <p>
65 where <em>&lt;bd&gt;</em> is the hardware address of your mobile phone as detected by hcitool scan.
66 </p>
67 <h3>Bind rfcomm</h3>
68 <p>
69 I decided to bind <em>/dev/rfcomm0</em> to the DUN channel of my phone.
70 </p>
71 <code>
72 /etc/init.d # cat bind_dun<br />
73 rfcomm bind 0 &lt;bdaddr&gt; &lt;channel&gt;<br />
74 mknod -m 666 /dev/rfcomm0 c 216 0<br />
75 </code>
76 <h3>Configure PPP</h3>
77 <p>
78 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.
79 </p>
80 <p>
81 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 
82 prefer the following:
83 </p>
84 <code>
85 ---------------- cut and paste from here ----------------<br />
86 cat &gt; /etc/ppp/options &lt;&lt; EOF<br />
87 -detach<br />
88 defaultroute<br />
89 nocrtscts<br />
90 lock<br />
91 noauth<br />
92 lcp-echo-interval 5<br />
93 lcp-echo-failure 3<br />
94 usepeerdns<br />
95 115200<br />
96 local<br />
97 asyncmap 0<br />
98 EOF<br />
99 ------------------------ end cut ------------------------<br />
100 </code>
101 <p>
102 Now you'll need a chat script to tell the phone what to do.
103 </p>
104 <code>
105 ---------------- cut and paste from here ----------------<br />
106 cat &gt; /etc/ppp/chat.imode &lt;&lt; EOF<br />
107 ABORT "BUSY"<br />
108 "" "\d"<br />
109 SAY "reseting modem\n"<br />
110 "" "atz"<br />
111 SAY "dialing\n"<br />
112 OK 'AT+cgdcont=1,"IP","portalmmm.nl"'<br />
113 OK "ATD*99#"<br />
114 TIMEOUT 60<br />
115 CONNECT ''<br />
116 SAY "connected\n"<br />
117 EOF<br />
118 ------------------------ end cut ------------------------<br />
120 </code>
121 <p>
122 You'll also need to provide some additional options for <em>pppd</em>:
123 </p>
124 <code>
125 ---------------- cut and paste from here ----------------<br />
126 cat &gt; /etc/ppp/peers/imode  &lt;&lt; EOF<br />
127 debug <br />
128 noauth <br />
129 usepeerdns<br />
130 /dev/rfcomm0 115200<br />
131 115200<br />
132 local<br />
133 nocrtscts<br />
134 defaultroute<br />
135 noipdefault<br />
136 connect '/usr/sbin/chat -f /etc/ppp/chat.imode -r /dev/console'<br />
137 EOF<br />
138 ------------------------ end cut ------------------------<br />
139 </code>
140 <h3>Get connected</h3>
141 <p>
142 Start <em>pppd</em> as follows:
143 </p>
144 <code>
145 ~ # pppd call imode
146 </code>
147 <p>
148 If all goes well (and only if you changed the <em>/etc/ppp/options</em> file), you should see something like this:
149 </p>
150 <code>
151 reseting modem<br />
152 dialing<br />
153 connected<br />
154 Serial connection established.<br />
155 using channel 1<br />
156 Using interface ppp0<br />
157 Connect: ppp0 <--> /dev/rfcomm0<br />
158 </code>
160 <h3>Check routing</h3>
161 <p>
162 As I had a default route already (via the USB connection in the cradle), I had to replace it:
163 </p>
164 <code>
165 route del default<br />
166 route add default ppp0<br />
167 </code>
168 <h3>Set proxy</h3>
169 <p>
170 In order to browse the net, you'll need to set the proxy still. In casu I use <code>http://10.10.100.10:5080</code>.
171 </p>
172 <h2>Photo</h2>
173 <p>
174 ... and obviously no HOWTO document is truly complete without some sort of picture.
175 </p>
176 <p>
177 <img src="http://frederik.gotdns.org:1976/Pictures/varia/ipaq_running_Familiar_Linux_connected_to_internet_via_bluetooth_to_Motorola_V500.jpg" alt="Picture of Compaq iPAQ and Motorola V500 camera phone" title="iPAQ connected via bluetooth phone to internet" />
178 </p>
179 <!--#include virtual='/footer.shtml' -->
180 </body>
181 </html>