Tethering a Blackberry Pearl in Linux
26-Sep-07
Tonight I decided to try and get on the internet using my Pearl as a GPRS modem. It took a couple hours of poking and prodding, but I managed to get it to work.
Software used:
- barry (for the bcharge utility) (0.7)
- opensync (0.22)
- openmotif (2.3.0)
- Xlt (CVS)
- XmBlackberry (CVS)
- pppd
- chat
All of those components except for pppd and chat had to be compiled and installed on my laptop, which runs Slackware 12. The order listed for the applications I had to compile is the order in which I built them, as XmBlackberry depends on OpenMotif , Xlt, and opensync. Additionally, I had to edit a large portion of the opensync directory in XmBlackberry to get it to build against that particular version of opensync, as one of the header files contained an underscore where it was referenced with a dash in XmBlackberry.
Aside from that single build snafu (or series of snafus), I largely followed this blog post, which as excellent directions that don’t directly correspond to working with AT&T’s network. Once everything is built, about all that is left relates to the differences betweeing using T-Mobile and AT&T.
Rather than producing a detailed guide like that, I’ll just note my config files, as they differ somewhat.
Here’s my chat script, which works with AT&T. I placed it in /etc/chatscripts/blackberry
ECHO ON
ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED ABORT ERROR
'' ATZ 'OK' 'AT+CGDCONT=1,"IP","WAP.CINGULAR"'
OK 'ATD*99***1#'
Next up is /etc/ppp/peers/blackberry
debug
nodetach
/dev/pts/6
115200
noauth
connect "/usr/sbin/chat -f /etc/chatscripts/blackberry"
modem
defaultroute
noipdefault
user "username"
password "password"
remotename provider
ipparam provider
persist
usepeerdns
Most of the difference here is that I specify something for username and password. These don’t seem to matter for PAP authentication with AT&T, but pppd doesn’t want to do authentication without those two options being specified with *something* in them. Additionally I specify persist so pppd will reconnect when I get disconnected.
Anyway, once you’ve plugged in your Pearl, ran bcharge -o to put it in single device mode, fired up XmBlackberry and clicked on the option menu to create the /dev/pts/* device, pointed your pppd config at that device node, and run pppd with that configuration, likely you’ll end up with magical cell phone internets!
For those lucky peope who work through all of this, your reward is a nice network device reported by ifconfig.
ppp0 Link encap:Point-to-Point Protocol
inet addr:10.121.157.122 P-t-P:10.0.0.2 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:68 (68.0 b) TX bytes:123 (123.0 b)
The only downside I’ve found is that I get kicked off consistently every two minutes. I think this might be because I don’t pay for ‘tethering’ my phone. If I intended to drop a card into my laptop to use their network frequently, I’d consider paying for it. As is, I already pay for unlimited data and I don’t plan to use my phone as a modem often. It will be handy when I’m out of town, but otherwise this is pretty cumbersome and not all that speedy.
[EDIT]
After a bit of searching, it turns out that adding
lcp-echo-failure 0
lcp-echo-interval 0
to my peer file fixes the two minute disconnect issue. Looks like pppd was defaulting to expecting an lcp echo, which didn’t happen, so it would disconnect.
This edit was made over my GPRS connection.
