Linux Tethered Internet Access Via Blackberry
This guide seeks to aggregate and improve upon information I gathered from various sources in order to get PC internet access thru a Blackberry working on Linux. They were tested on a Blackberry 8703e, but should apply if generalized slightly for other devices – the important part for non-blackberry users would be how to use the configuration scripts described. Please refer to the bottom of the guide where I cite references which were huge in making this possible.
Tethering on the blackberry in Linux is not supported by any vendor, but there are open source packages which have developed to the point where support is pretty solid. The process one must go thru is unneccesarily complicated currently because documentation on the internet is fragmented and poorly organized. This guide details my experience on a Gentoo Linux system, but should apply equally to other distros.
The steps detailed here include all requirements for getting blackberry tethering working – including kernel and software configuration that is directly required. These steps presume you have a properly configured kernel and your system is running stable – you should already have wired ethernet working to establish a base level of networking functionality. The process of setting up tethered internet access in this guide will be broken down into 7 sections. The headings below detail Kernel Configuration, Required Packages, Installing Packages From Source, Testing Functionality, Running XmBlackBerry, Configuration Scripts, and Connecting To The Internet.
If your running Ubuntu, you can disregard this section as Ubuntu has the kernel components needed already built in – this may be true for other distros also. As a starting point for the rest of us, let’s make sure our kernel has the necessary PPP support included. Navigate to /usr/src/linux in a terminal and run “sudo make menuconfig”. The options we need are under “Device Drivers—>Network Device Support—>”. Here we want to ensure “PPP support” and “PPP support for async serial ports” are build as modules – ensure they have an “M” next to them. If they were not already listed as Modules, you can exit menuconfig saving your changes then issue “sudo make menuconfig && sudo make modules_install” to recompile your kernel. When complete, copy your kernel from /usr/src/linux/arch/i386/boot/bzImage to /boot and name it whatever you want. Update grub.conf or menu.lst so that you have the option to boot into your new kernel after you restart. Now reboot into your newly compiled kernel.
These are the packages you need to install to get tethering working:
Installing Packages From Source
Depending on your distribution, installing these packages from source may be required. If your package manager has an up to date version of the items listed above, install thru the package manager as it will likely be quicker/easier. If you already have a package installed, or you install thru your package manager, you are all set and do not need to compile from source.
If you have never installed a package from source and you need to, be aware that it requires that you have the appropriate compilers and development packages already installed. Look here at the “what you need” section and here for a basic overview of how to configure, compile, and install any source package.
If you encounter errors during manual installation, search google on the topmost error you received for assistance on getting the package installed correctly, or contact me for advice.
At this point, you should have all “Required Packages” above installed successfully. Before we move on we should blacklist the berry_charge module to ensure it isn’t loaded. If loaded, it would block our access to the device. To do this open /etc/modprobe.d/blacklist in your preferred text editor, and add the line “blacklist berry_charge” anywhere in the file.
At this point, we can go ahead and plug the Blackberry in with the USB cable. Once its connected, we can issue in the terminal “sudo btool -l” and it should find the device. Output should look something like this:
Once the device is recognized, we are ready to run XmBlackBerry.
To run XmBlackBerry you want to go to your terminal and issue the command “sudo /usr/local/bin/XmBlackBerry”. This will open the XmBlackBerry GUI and output messages to the terminal window – we need some information from the terminal window. The output will look like this:
Take a look at the first highlighted line above – it shows the device as not recognized because I clicked on the Options menu in XmBlackBerry before it was fully loaded and the device isn’t being picked up yet. That is what you will see if your device is not being recognized. Then, the second item highlighted appeared after I entered the device password and shows the device is recognized. Remember the device name listed here (/dev/pts/2) as yours could be different and we’ll need this for our config scripts later. If your ready to roll, you should see this device name.
Now that our device is recognized by the computer, we need to configure our scripts for using the Blackberry as a modem. We installed Barry earlier, and with that package comes several example configuration scripts. We will make a couple customizations to these scripts and place them in /etc/ppp/peers/ and /etc/chatscripts/. To start, go to the directory where you extracted Barry and look at the files in the ppp directory. We will use the barry-verizon example – the barry-verizon file should be placed into /etc/ppp/peers/ and the barry-verizon.chat should be placed in /etc/chatscripts/. The chatscript does not need to be modified, but the barry-verizon peer file needs to have our device name and username/password input. Open the file in your preferred text editor and we will change 3 lines. First in the user line, input your phone number and domain name as shown – for Verizon phones, this is “firstname.lastname@example.org”. Refer to my linked sources below if you are with a different provider to find out the proper domain to use in your username. Second, in the password field enter your phone number. Finally, comment out the line “pty /usr/sbin/pppob” so that it looks like this “#pty /usr/sbin/pppob” – then right below that line input your device name. For example: /dev/pts/2
Your configuration files are now ready for you to connect. In the box below is an example of my /etc/ppp/peers configuration file, with comments explaining what each value means. These explanations come from the manpage for pppd. The lines that needed personalized are highlighted:
Connecting To The Internet Using The Blackberry As A Modem:
Thru the steps above, we are now fully configured and ready to connect. To connect, we first run XmBlackBerry to establish a connection with the device. Issue “sudo /usr/local/bin/XmBlackBerry” at a terminal and provide your device password if prompted by the GUI. Now, we go to a terminal window and type “sudo pppd call barry-verizon” to initialize the Blackberry as a modem and connect. This runs pppd to initiate the connection and tells it to call the script named barry-verizon from /etc/ppp/peers/. If you named your script something other than barry-verizon, be sure to specify the correct name.
Once the script runs, run ifconfig from the terminal and you should see an entry for ppp0 with an IP address. Congratulations – Your Connected!
The setup process is somewhat involved, but once complete everything works great. Linux has come a long way in many regards, but this is one of those ugly processes whose development hasn’t come far enough to make things less painful yet. If you encountered problems at any part of the process, you may find further troubleshooting details at the sources linked below. Also, feel free to contact me with questions or for clarification.