I am trying to get a simple python script running on my Andorid phone (using SL4A) to connect to the BlueSMiRF Bluetooth modem (based on RN41 device), however no matter what I try, I keep getting the following error when trying to connect.
java.io.IOException: Unable to start Service Discovery
Python script shown below
import android droid = android.Android() droid.toggleBluetoothState(True) result = droid.bluetoothConnect()
I tried all three bluetoothConnect () options, as shown in the code above. If I try the first two connection methods, I can see blueSMiRF in the list of devices to connect.
My arduino sketch (powered by Arduino Mega) is shown below. It simply redirects characters from one port to another. Serial is connected to my 9600 laptop, Serial1 is connected to BlueSMiRF on 115200.
void setup () { // initialise serial Serial.begin(9600); Serial1.begin(115200); } void loop () { if (Serial1.available()) { char c = Serial1.read(); Serial.print(c); } if (Serial.available()) { char c = Serial.read(); Serial1.print(c); } }
I can use Putty to access blueSMiRF command mode by typing $$$. Everything seems to be in order. I have only a little concern about the settings for the class of service and device class. They are set to factory defaults of 0x0000 and 0x1f00 respectivley, and I wonder if the service class 0x1101 (UUID for SSP) can be set.
Additional information: Android 2.3.3 SL4A r4
source share