I am building an app for an Android tablet that will control an Arduino microcontroller board (paired via bluetooth). However, the tablet will also be paired via Bluetooth with my Android phone to share the phone's internet connection. Can I pair the devices this way simultaneously?
-
Which profile is being used to control the Arduino? RFCOMM?– Ignacio Vazquez-AbramsCommented May 30, 2012 at 17:41
-
I'm not sure - this is in the beginning stages of my development. Here is the module I was thinking of using - it supports BCSP, DUN, LAN, GAP SDP, RFCOMM, and L2CAP. sparkfun.com/products/158– SSumnerCommented May 30, 2012 at 17:59
2 Answers
AFAIK, bluetooth connections can occur simultaneously as long as their operational bounds do not overlap. In other words, you cannot connect two bluetooth headsets at the same time, but you can connect a bluetooth keyboard and bluetooth mouse to the same device at the same time (I personally have tested this last scenario, and it works!)
So in your case, I assume the steps you would take would include making sure that the two communication streams don't require any of the same functionality, which sounds as if it would be possible, since one is strictly for internet availability. If you connect both and they won't pair with the device simultaneously, you probably won't be able to. But if they register as different types of devices (under different bluetooth "profiles", for example) you may be in luck!
Sorry there's nothing definitive. The bottom line here may be trial and error. If they don't work initially, you may be able to set up the Arduino to register under a different "profile" when it connects to the tablet, so as not to interfere with the internet connection coming from the phone.
-
Or you could eliminate your problems by using wi-fi tether to share your phone's internet connection and then using the bluetooth exclusively for your Arduino. Commented Jun 7, 2012 at 14:05
-
The only problem is wi-fi tether requires (a) a tethering plan, which I am not going to pay for or (b) a rooted phone, which I am not going to do right after I get a new phone (I have a rooted phone now, but I am going to be upgrading to a 4G phone soon), so bluetooth tethering is my only option. Thanks for the answer.– SSumnerCommented Jun 7, 2012 at 14:38
-
of course! I root my phone primarily for wi-fi tethering, but I completely understand not wanting to go at a new phone right away :P hope the dual-BT works for you! Commented Jun 7, 2012 at 14:49
-
1Actually the wi-fi tether option might work. I used the FoxFi app, and its wi-fi hotspot mode works great. So I might only need to connect through Bluetooth for Arduino. Thanks!– SSumnerCommented Feb 11, 2013 at 18:28
-
Well, in Android 4.1, the wi-fi hotspot ability was removed so I'm back to needing bluetooth– SSumnerCommented Apr 9, 2013 at 19:46
Some devices have a concurrent connection limit due to power/resource constraints (usually cheap feature phones like my old SEMC W880i only allowed up to 5 connections at a time). Also some apps like bluetooth file transfer can be set up to limit max simultaneous connections. Generally, Android's bluetooth implementation does not force such a limit though. I've been able to use bluetooth keyboard, mouse, game controller and a headset the same time. Bluetooth internet sharing capability depends on your device though, not every handset/tablet maker implements this (most aftermarket roms support this however).