BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Linux Users Corner (http://www.blackberryforums.com/linux-users-corner/)
-   -   How To: Tether (use as modem) your BB in Linux (http://www.blackberryforums.com/linux-users-corner/92085-how-tether-use-modem-your-bb-linux.html)

tcolar 08-24-2007 07:40 PM

How To: Tether (use as modem) your BB in Linux
 
Update: i added my doc directly in this page, just scroll 2 post down !

Here is my full documentation on how i did it:
Tethering With Blackberry Pearl On Linux [Thibaut Colar's Home.]

Hope this helps !

rivviepop 08-24-2007 11:17 PM

If you could rewrite that into vB format and post it here (bottom left of this page is a link "vB Code" that has the html-like codes you use for bold, color, etc. for you to reference) I'm sure we could get the mods to sticky it for everyone to learn from. LunkHead will probably stop by and scrape the post you make and put it in the FAQ, too - you'll be famous! :)

Making a post that links to a blog/wiki without posting the actual steps doesn't work out, the content needs to be present here (what if the remote blog disappears? we lose all the info) in a normal post.

tcolar 08-25-2007 02:09 AM

I was kinda lazy to do that to be honest, quite a bit of text :-)
I'm not to worried about the blog, it's my own site, has been up for many years.

But i'll try to give it a shot and try to rewrite it here with Vb within a day or two.

I'm already famous 8-)

tcolar 08-25-2007 02:41 AM

Tethering With Blackberry Pearl On Linux

YOU CAN FIND THE ORIGINAL HTML VERSION HERE:
Tethering With Blackberry Pearl On Linux [Thibaut Colar's Home.]

NOTE: If you are going to use this, you should save this page now, yo your laptop, cause when you are gonna need it, you probably won't have a connection :-)


WARNING: This whole setup is sort of screwy, but hey it works !


WARNING: Tethering will cost you a lot of money unless you have an unlimited data plan. Some phone companies, forbid it unless you have a special plan, some other allow it but won't support it, some just plain disallow it.


I believe tethering should be allowed, but you should use that only as needed when on the road, users who use GB of data on a tether connection annoy me because 1) sooner or later the carrier will be blocked anyway, 2) if too many people do that, phone companies might block tethering unless you buy an Expensive plan !
You are not helping anybody if you do this, be reasonable and enjoy tethering when you really need it, ex: in a crunch on the road.

Introduction
Ok, i spent a LOT of time getting this dammed thing to work, but i did it !
Fisrt let me talk about the few options i tried:
- Barry: this project on source forge provides a synchronization and they started modem support but modem support does not work yet.

- XmBlackberry: This is the project that DOES work, however the site is very 'bare bone' and almost no documentation exists. On top of that the latest time they made a release was over a year ago and that release does not work with my BB. I was able to make it work with the live CVS version, though it was a pain to compile and get going.

NOTE: I only managed to get tethering to work using BOTH Barry(to recognize the device properly) and XmBlackberry(modem support), so we will install both


I used Ubuntu Feisty Fawn (x86)for this doc, though same idea should work on other linux distros.
My device is a Blackberry Pearl (8100)
My Carrier is TMobile.

This works with the USB cable and not Bluetooth, i prefer the USB cable anyhow, it's faster and less chance to loose/forget my phone if tied to the laptop :-)

Installing XmBlackberry from sources
The main issues i had here are:
- XmBlackberry only works with the pearl with the CVS version.
- The CVS version of XMBlackBerry will only compile with openmotif2.3. 2.2 won't work !
- Debian does not have a packaged version of openmotif2.3 (the libmotif3 package is openmotif2.2)

If you use motif2.2 you will get errors like this:
Quote:

undefined reference to `XmVaCreatePushButton'
So as a result of all that the first step is to install openmotif2.3 from sources.

Prerequities

WARNING: If you have never compiled form source on your machine before, you will want to install those packages first:

Quote:

sudo apt-get install libc6-dev g++ gcc make build-essential
To compile/install all those things i had to install the following packages first. (The whole command is ONE LINE !)

Quote:

sudo apt-get install libtool autoconf automake cvs libglib2.0-dev libxml2-dev libssl-dev libopensync0-dev libxt-dev x11proto-print-dev libxmu-dev libxft-dev libfreetype6-dev libXp-dev flex byacc
Openmotif would not compile because libfreetype-dev installed files not where openmotif expected them (freetype & freetype2 dir), to compile i add to do this:

WARNING: not sure if that is a safe thing to do(probably OK), so you might want to revert this after (move back) after compiling openmotif.

Quote:

cd /usr/include/
sudo mv freetype freetype-back
sudo mv freetype2/freetype/ .
I also had to do this, to get XmBlackberry to run later:
Quote:

sudo ln -s /usr/X11R6/lib/libXm.so.4 /usr/X11R6/lib/libXm.so.3
Installing OpenMotif 2.3

NOTE: if you have motif3 you might need to remove it first. Honestly i'm not sure if it's a good idea, so don't do this unless you have to.

sudo apt-get remove libmotif3 libmotif-dev motif-clients


Installing motif2.3:
Quote:

cd ~
wget ftp://ftp.ics.com/openmotif/2.3/2.3....f-2.3.0.tar.gz
tar xzvf openmotif-2.3.0.tar.gz
cd openmotif-2.3.0/
./configure
make
sudo make install

Installing XmBlackberry


XmBlackberry needs Xlt installed (from source)

Installing libXlt

Quote:

cd ~
cvs -d :pserver:anonymous@xlt.cvs.sourceforge.net:/cvsroot/xlt co Xlt
cd Xlt
./CVSMake
./configure --prefix=/usr
make
sudo make install
XmBlackBerry
Get XmBlackberry source code

ALL ONE ONE LINE !!
Quote:

cd ~
cvs -d :pserver:anonymous@xmblackberry.cvs.sourceforge.ne t:/cvsroot/xmblackberry co XmBlackBerry
Inside xmBlackberry folder get libusb source code.

Quote:

cd XmBlackBerry/
cvs -d :pserver:anonymous@libusb.cvs.sourceforge.net:/cvsroot/libusb co libusb
Compile/Install XMBlackberry

Quote:

./CVSMake
./configure --enable-maintainer-mode --disable-shared
make
sudo make install
Install libusb as it will be needed by Barry

Quote:

cd libusb
sudo make install
OpenSync
Install openSync (part of XmBlackberry)

Quote:

cd ..
cd opensync
make
sudo make install
Installing Barry

Quote:

cd ~
cvs -d:pserver:anonymous@barry.cvs.sourceforge.net:/cvsroot/barry login
cvs -z3 -d:pserver:anonymous@barry.cvs.sourceforge.net:/cvsroot/barry co -P barry
cd barry
sh buildgen.sh
./configure --prefix=/usr
make
sudo make install
Running XmBlackberry

WARNING: you will notice i run most of the following command with sudo, that is because otherwise it would fail, due i think to USB device permissions on debian, ideally it would probably be best to fix those permissions rather than tun those thing under sudo.


NOTE: PLUG YOUR BLACKBERRY NOW WITH THE USB CABLE.


There is an issue whereas the module usb_storage takes over the Blacberry device as soon as it is plugged in and thus XmBB can't use/see it.

We are gonna run Barry's bcharge, this has two uses here:
1) It will regrab the device from usb_storage
2) It will set the BB charging current to 500ma instead of 100ma, this will make the BB happy (no more warning) and allow it to dialog correctly with XmBB.

Because of a driver issue on the pearl we have to run bcharge twice, sounds odd, but is needed, as you will see on the second call the device will be found.

Quote:

sudo bcharge
sudo bcharge -o
Now, the device should be found. Example: ''sudo btool -l''

Blackberry devices found:
Device ID: 0x80xxxx. PIN: 241xxxx, Description: RIM 8100 Series Colour GPRS Handheld


NOTE: you can had Barry to udev, so it automatically runs when the BB is connected.
cp /home/thibautc/barry/udev/*b* /etc/udev/rules.d/
I haven't tried this yet.

Now we are ready to run XmBlackberry.
Quote:

sudo XmBlackberry
Once XmBlackBerry opens, click the ''Options'' Menu, this should dump something like this on the console:

XmBlackBerry.c:OptionPopupCallback(995) - GPRS modem device /dev/pts/0

If you see that, you are in business ! it found your GRPS modem !

Note "/dev/pts/0", this is going to be your modem device.
If you have other device it might be another number rather than 0, note this.


Tethering & connecting to GPRS / EDGE
You will want to have XmBlackberry up to be able to use the BB modem, so if not already running, restart it now.

PPP scripts

I found multiple pp scripts online, but none of them worked as-is, by combining some i found something working for me:

You will need to create those two files:

WARNING: if you don't use tmobile, you will have to adjust the 'AT+CGDCONT=1,"IP","wap.voicestream.com"' line.


see here for other carriers strings:
Using BlackBerry As Modem - BlackBerryFAQ

Note: "ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED ABORT ERROR" is all one line.


/etc/chatscripts/blackberry:
Quote:

ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED ABORT ERROR
SAY "Initializing\n"
'' ATZ
SAY "ATE\n"
OK 'AT+CGDCONT=1,"IP","wap.voicestream.com"'
OK 'AT'
OK 'ATDT*99***1#'
SAY "Dialing\n"
WARNING: If XmBlackberry found your device somewhere else that /dev/pts/0 then adjust the file. TMobile use blank user and password, other carriers might want something else, adjust as needed.


/etc/ppp/peers/blackberry :
Quote:

debug debug debug
nodetach
/dev/pts/0
115200
connect "/usr/sbin/chat -f /etc/chatscripts/blackberry"
nomultilink
defaultroute
noipdefault
ipcp-restart 7
ipcp-accept-local
ipcp-accept-remote
# added this, so that it doesn't disconnect after few mn of innactivity
lcp-echo-interval 0
lcp-echo-failure 999
modem
noauth
nocrtscts
noipdefault
novj # refused anyway, no point in trying every time
usepeerdns
user ""
password ""
Once this is setup, you are ready to get connected ... Finally !
Quote:

sudo pppd call blackberry
If all goes well you should get something like this:
Initializing
Dialing
Serial connection established.
using channel 15
Using interface ppp0
Connect: ppp0 <--> /dev/pts/0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x682edbe8> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x10 <asyncmap 0x0> <auth chap MD5>]
.....
sent [PAP AuthReq id=0x1 user="thibautc-laptop" password=<hidden>]
.....
PAP authentication succeeded
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
......
local IP address 10.169.13.231
remote IP address 169.254.1.1
primary DNS address 66.94.9.120
secondary DNS address 66.94.25.120
Script /etc/ppp/ip-up started (pid 20529)
Script /etc/ppp/ip-up finished (pid 20529), status = 0x0
........


Make sure all your other interfaces (wireless/ethernet) are down, and enjoy browsing the web using your BB modem !

TIP: I actually posted this page using my Tethered connection !!


Links
I used a compilation of other docs to get to this results, among others:

SourceForge.net: Barry
SourceForge.net: XmBlackBerry
Net Direct :: Open Solutions
http://www.blackberryforums.com/linu...x-success.html
http://www.blackberryforums.com/linu...der-linux.html
http://www.fibble.org/BlackBerry%208800
forums.fibble.org :: View topic - HOWTO: Use your 8800 as a Bluetooth Modem with your Mac
http://www.blackberryforums.com/mac-...sconnects.html
http://www.blackberryforums.com/gene...nux-works.html

rivviepop 08-25-2007 12:28 PM

Sweet, thanks - a lot of people will love you. :) I've PM'd JC asking him to sticky the thread...

John Clark 08-25-2007 12:31 PM

Stuck!

tcolar 08-25-2007 02:13 PM

BTW, if anybody has some suggestion on improving this, let me know so i can update it.
Some of it is still a little too "hacky" in my opinion :-)

woodi68 08-30-2007 05:18 PM

I can't get past the libXlt part.... = (

tcolar 09-01-2007 01:09 AM

What kind of error did you get ?
Make sure you have installed all the packages i listed (apt-get), all those -dev packages are needed.

woodi68 09-01-2007 01:38 AM

Well hi there tcolar in Kent!! I made it past the "./configure" part, but "./make" gives me an error that the directory doesn't exist. i'm in the Openmotif folder... I didn't miss any steps, but if I then skip to sudo make install it does a bunch of stuff but it looks like most of that stuff is errors too. The volume of the errors similar to "makestrs.c:547: warning incompatible (or "implicit" sometimes") declaration of blah blah blah... all kinds of stuff. i've about had it with trying to get back tethered on my blackberry. It's so frustrating.

tcolar 09-04-2007 11:08 AM

If you have error.problems with compiling here are some tips.

To compile anything (if it's your first time compiling from sources you will need the compiler minimums:

Quote:

sudo apt-get install libc6-dev g++ gcc make build-essential
Woodi68: you will want to make sure you just run
Quote:

make
NOT ./make !

AbuAnsar 09-06-2007 08:22 PM

I been trying to install the followin script for a while and unsuccessfully. I just noticed that there was a syntax error which resulted in Error. Here it is:

sudo apt-get install libtool autoconf automake cvs libglib2.0-dev libxml2-dev libssl-dev libopensync0-dev libxt-dev x11proto-print-dev libxmu-dev libxft.dev libfreetype6-dev libXp-dev flex byacc


libxft.dev should be changed to libxft-dev

AbuAnsar 09-06-2007 11:24 PM

Quote:

Originally Posted by woodi68 (Post 651202)
I can't get past the libXlt part.... = (

I believe there's another typing error in the following command that prevents you from properly performing the 'make' and thus 'sudo make install' parts. I can't check it right now coz I have no internet access on Ubuntu.

sudo apt-get install libtool autoconf automake cvs libglib2.0-dev libxml2-dev libssl-dev libopensync0-dev libxt-dev x11proto-print-dev libxmu-dev libxft.dev libfreetype6-dev libXp-dev flex byacc

try changinglibxt-dev to libXlt-dev

simply run: sudo apt-get install libXlt-dev

then follow "Installing Xlt" steps over again.

tcolar 09-07-2007 02:36 AM

Nice catch !
i fixed it in the howto now.

I thought i copy/pasted all the commands to be safe but i guess i mussed have (mis)typed that one manually.

tcolar 09-07-2007 02:42 AM

No, for this one i did mean libxt-dev (different than libXlt)
In my doc i installed libXlt from sources(CVS) so that it matches the version of openMotif2.3. Not sure what version the libXlt-dev debian package is, it might be ok. In which case you would apt-get BOTH libXlt-dev and libxt-dev and nit have to install libXlt from sources.

Quote:

Originally Posted by AbuAnsar (Post 658427)
I believe there's another typing error in the following command that prevents you from properly performing the 'make' and thus 'sudo make install' parts. I can't check it right now coz I have no internet access on Ubuntu.

sudo apt-get install libtool autoconf automake cvs libglib2.0-dev libxml2-dev libssl-dev libopensync0-dev libxt-dev x11proto-print-dev libxmu-dev libxft.dev libfreetype6-dev libXp-dev flex byacc

try changinglibxt-dev to libXlt-dev

simply run: sudo apt-get install libXlt-dev

then follow "Installing Xlt" steps over again.


tcolar 09-07-2007 02:47 AM

I had a few other typos in my post, sorry.
I hope i fixed them all now (./make instead of make and a line that had nothing to do there for libXlt compilation)

LunkHead 09-07-2007 02:27 PM

Awesome step by step!!!!

Can I post this in the FAQ area?? With proper credit given?

AbuAnsar 09-07-2007 03:27 PM

amid@amid-laptop:~/openmotif-2.3.0$

i tried and it doesnt work:

amid@amid-laptop:~$ cd /usr/include/
amid@amid-laptop:/usr/include$ sudo mv freetype freetype-back
amid@amid-laptop:/usr/include$ sudo mv freetype2/freetype/ .
mv: cannot stat `freetype2/freetype/': No such file or directory

so i tried the following. it doesnt return any error msgs but not sure if it works:

amid@amid-laptop:~$ cd /usr/include/ sudo mv freetype freetype-back sudo mv freetype2/freetype/ .
amid@amid-laptop:/usr/include$

also tried this:

amid@amid-laptop:~$ sudo ln -s /usr/include/freetype2/freetype /usr/include/freetype
ln: creating symbolic link `/usr/include/freetype' to `/usr/include/freetype2/freetype': File exists

I cant have openmotif-2.3.0 compiled, nor can i compile XmBlackBerry -->

INSTALLING libXlt

./configure --prefix=/usr
config.status: config.h is unchanged
config.status: executing depfiles commands

Xlt 18.3.18 from NOCTURNAL
==================================

prefix: /usr
compiler: gcc
Motif: -Inone $(link_motif)
Database support: no


amid@amid-laptop:~/Xlt$

tcolar 09-07-2007 04:58 PM

Lunkhead, sure you can post it as you wish.

tcolar 09-07-2007 05:00 PM

AbuAnsar:
For freetype, maybe you don't have 2 versions like i did, and might be able to kip it.

You say you can't compile, can you be more specific, ie post or email the actual error(s) (tc ola r AT co la r DOT net)


All times are GMT -5. The time now is 07:23 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.