Bluetooth “DUN” for Blackberries and Macs?
I was planning on working on a solution for tethering Blackberries and Macs for Alex’s little bounty. There are some vagaries, so I’m not quite sure if the solution I’m going to propose would even qualify. The reason I’m not pursuing the bounty, is that (being honest with myself here) I barely have enough time for work, let along personal projects. And this doesn’t quite fall under personal project, maybe as a second tier personal project. And I had even picked up a use 7100t for testing too. Anyone want to buy it off me?
The Solution (?)
The proposed solution is to tunnel PPP over TCP/UDP.
The Mac would expose a serial port over Bluetooth. The Blackberry would run a proxy that opens that serial port, and also connects (via its data connection) to a remote server running pppd. The proxy would pass the data between the serial port and the connection to the server. On the Mac, the user would then run pppd on the serial port.
Pros:
- No third party software on the Mac (pppd is already there).
Cons:
- Requires a pppd server on the other end.
- There is additional overhead to tunnel TCP.
Ingredients
- Bluetooth capable Mac
- Bluetooth capable Blackberry
- Proxy software for Blackberry
- Server running pppd
The Proxy
This is the only component that needs to be written. And, in fact, it should be pretty straightforward. Open the serial port, open a connection to the server, spin up a couple threads and wait for data. When you see data, send it to the other connection.
To write the program, you will need to spend the $100+ for keys because the app needs to be signed to take advantage of the Bluetooth serial APIs. Others have successfully used it to connect to bardcode readers, etc.
To clarify: The Blackberry does not provide the serial port. The Mac provides the serial port. The Blackberry connects to the Mac’s serial port.
The Server
In order to have something to have something to “dial into” you will need to run pppd over either TCP or UDP. For a single user, you can probably use netcat. For multiple users, you’re on your own. Your server will need to be configured to do NAT. I haven’t worked out the pppd commandlines yet, but there are plenty of pppd guides out there ;).
Conclusion
There you have it. Seems pretty sound to me. There really isn’t any sort of wierd hacky stuff going on. There is a possible issue in that the Blackberry may not be able to forward data between the connections fast enough. But then Bluetooth caps your speeds at 115kbps (or so) anyways. Hey, maybe you can even start a Blackberry DUN ISP.
Someone may also want to wrap up the pppd commandline into something more user friendly too.
This is probably the solution that requires the least development work. And it is a cross platform solution.










August 31st, 2006 at 10:26 pm
Interesting idea. I figured that since the BlackBerry already shows up as a modem in Mac OS X and already works as a modem under Windows, writing a modem script/driver would be the easiest solution.
You note that this would be a cross-platform solution, you are planning to target Linux users as well?
September 3rd, 2006 at 8:05 am
[...] tienshiao.org - Bluetooth DUN for Blackberries and Macs? [...]
September 6th, 2006 at 11:20 pm
Sorry. I should have made it more clear. I do not intend on pursuing the bounty as I simply do not have the time.
The only software that needs to be developed is the proxy that runs on the Blackberry.
Once you’ve got that running and you’re paired with your Mac (or Linux), you can run the native pppd on that serial port.