# Tethering Cm7 Alpha2.1 Tp To Iphone Via Bluetooth



## hume_rootzwiki (Nov 3, 2011)

Like many others, I was looking for a means of tethering my TP to my smartphone so that I could use the device out and about, on the bus and whatnot. Unlike many others, I'm stuck with my old iPhone 3GS, which can't act as an ad-hoc wifi hotspot like an iPhone 4 or some of the Droid phones out there.

So what I've done is compiled the BNEP module out of the CM7 team's Tenderloin source and wrapped a shell script around it and pand, which is already present on the device. With some tweaking, it's able to connect to the iPhone and tether quite well. This is just a very hacked together item... I'm *not* an Android developer, although I'm decent in Unix. I'm interested in learning, so I'll probably use this as an excuse to learn how to write a proper Android tool around it. For now, though, I'm providing it here for anyone to use if they have the will and know-how.

Please note that this is *not* an item endorsed by anyone on the CM7-Touchpad team! They very deliberately did NOT compile BNEP support into their kernel, and we don't know their reasons... it could be because they wanted a simple kernel for alpha purposes, or it could be because they know something about bnep.ko that I don't... like it could cause the Touchpad to melt down, spreading toxic chemicals and ending sentient life on Earth. Either way, please don't bug them about what this module can or can't do. Please don't file issues with them about bugs with your CM7-TP install with this software on your device. Remove it, then reproduce.

Similarly, please have some knowledge of how to use adb and copy files to and from your device before using this. If you don't already have adb installed, or if you don't know the difference between Unix and DOS end-of-line characters, then you should skip this. Even if nothing bad happens, you'll frustrate yourself. I wish I could help walk people through the process, but I honestly don't have the time.

For the intrepid, here's the how:
1) Download bttether_0.01.zip (md5sum: 2967979d5a4f42d7e989e499c63d21a4) to the platform of your choice.

2) Unzip the zipfile. It'll contain a directory "bttether" with bnep.ko, bttether.sh, and nap.conf.

3) Edit nap.conf - I'd recommend an editor that respect Unix text conventions, although it may not matter - and change "PUT YOUR IPHONE BLUETOOTH MAC HERE" to the BT address of your phone. On the iPhone, that can be found under Settings, General -> About. An example would be "04:1EE:AD:BE:EF". Save the file.

4) Using adb, push the bttether directory to /data/bttether. (ie: adb push ./bttether /data/bttether).

5) Make sure your TP and phone are *already* paired. Make sure your smartphone has bluetooth *and* tethering enabled (as well as your data plan! Depending on your wireless provider, this may require personal lubricant...)

6) To start tethering, open up a Terminal window and gain superuser. From the root shell:
cd /data/bttether​./bttether.sh start​
You don't need to keep the terminal open once tethering has started.​
7) To stop tethering, re-open the shell as above, and use "./bttether.sh stop". I do advise properly shutting down tethering when you're done. I've seen pand get stuck if I simply shut off the phone, or went out of range, or otherwise left the Touchpad orphaned.

Obviously, I've *only* tested this with my iPhone. Reports of successes/failures with other devices would be welcome, although I don't know what I could do about bugs.

If someone keen wants to write a "proper" app around this, feel free. All I'd ever ask is the opportunity to see the source code so I could further my own education in 'Droid dev.


----------



## player500 (Oct 13, 2011)

Thanks for posting this. Works nicely with my old WinMo phone.


----------



## ddy (Oct 21, 2011)

This is great news! Can't wait to get a moment to try! You just made the world a better place (for me anyway).

I'm an old bsd guy myself and this my first Android device. At last I'm bumping into adb so I'll be digging for a decent primer.

THANKS!!!

Update: got it working with no hitches on stock 3GS with IOS5.0 on ATT with tethering plan. Call me stoked!!!


----------



## robreefer (Oct 19, 2011)

I use the wifi off of my Iphone all the time. You just need to jailbreak it and download MiWi...


----------



## Formula84 (Oct 5, 2011)

Any chance this works with CM9?


----------

