• bluetooth reference
  • android app - begin with bluetooth connectivity and control over a BBB & BT Slave & Continuous Servos

Parts

  • ball casters - form with polymorph & marble
  • 2 X battery packs - develop interchange re-charge rail
  • simple servo claw
  • location for sensors
  • larger wheels
  • pass through network - remote control

References

Log

Initially I have had some great success !   I have tried the bluetoothchat example from android and that "failed to connect".  However, I also tried the Amarino apk application and "IT CONNECTED" to the little cheap blue tooth device!  But wait there's more ! 

I connected the bt slave module to a FDTI cable and opened a gtkterm so I could see if anything was being sent.  The module and gtkterm was configured for 9600-8-N-1, but I was doubtful there sould be info sent back and forth.  All the documentation I have seen so far says connect at 57600 or 115K.  Regrettably the very cheap BT module will not change its baud rate.  I have tried with AT command, but no success so far so I was doubtful.

However after connecting with the Amarino app I SENT INFO !  Yep, I typed stuff in and it flew to the little slave BT device and printed itself right there on the gtkterminal.  Whoa !

How does the BT module decode what was sent?  The BT part doesn't know or care about the 9600 but something somewhere is changing it into a modulated 9600-8-N-1 stream from the android.  How does that happen?  WTF?

I tried typing in the gtkterm but alas no indication was given the Amarino recieved it.  Looking into the problem..

Some (more) Stuff I've learned :

There is a "special" UUID for serial blue tooth - some part of this identifier means its SPP (Serial Port Protocol) -
SSP_UUID = 00001101-0000-1000-8000-00805F9B34FB, but it fails with my little BT module, and the Amarino app "connects directly"

try {
        mSocket = mDevice.openSocket(SPP_UUID);
    } catch (Exception e) {
        Logger.d(TAG, "Connection via SDP unsuccessful, try to connect via port directly");
        // 1.x Android devices only work this way since SDP was not part of their firmware then
        mSocket = mDevice.openSocket(1);
    }

The Amarino application does not use the Bluetooth libraries from Android.  They use something which was constructed before the Android API had a bluetooth library.  Androids API is a bit different.  And now I am searching to determine if the new API supports this "connect via port directly" concept.

This forum post gets into some of the details of the Android API and SSP identifier.  Unfortunately, the resolution in that post fails in my case :P

Here is a step by step tutorial to connect with Android -> Amarino -> BlueSmirf BT -> Arduino and graph stuff.  Of course, that is if you have a "BlueSmirf Gold" ($64)  vs a dumb cheap slave BT ($10) :)  He installs the library apk on the phone, which I have not done.  Maybe it will allow data from my gtkterm to be monitored on the phone app.

TODO

  • install aramino library apk and extras
  • hack the BlueToothChatService program from Android and set MY_UUID_INSECURE = 00001101-0000-1000-8000-00805F9B34FB  (even though this failed in Amarino) 
  • find out how to connect to "channel" 1 as Amarino does
  • try this code from stack overflow, which connects a zeemote to android, which looks very promising.  It works but there is questiosn as to Why? ... I'm betting their is a nice albiet protected function in the bluetooth device.. no longer directly accessable through the API.  And with the invoking trick you can quickly get around this :)
            Method m = blueToothDevice.getClass().getMethod(
                   
"createRfcommSocket", new Class[] { int.class });
            socket
= (BluetoothSocket) m.invoke(blueToothDevice, port);
            Method m = blueToothDevice.getClass().getMethod(                     "createRfcommSocket", new Class[] { int.class });             socket = (BluetoothSocket) m.invoke(blueToothDevice, port);