unnivm / android-obd-reader

Automatically exported from code.google.com/p/android-obd-reader
0 stars 0 forks source link

How to set UUID of bluetooth device? #13

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I bought a OBD2 adapter that same to the one(the last row in the Working 
adapters table) in the web site(http://torque-bhp.com/wiki/Bluetooth_Adapters), 
and this adapter works well with my Ford Tdci (2010) with your Torque app. It 
is very amazing work for me.
I wanna try to develop a customized app with obd2 information, but encounter a 
code problem. Would you give me some hints to solve the code problem shown 
below briefly:

protected BluetoothDevice dev = null;
protected static final UUID MY_UUID = 
UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
protected void startDevice() throws IOException, InterruptedException {
        sock = this.dev.createRfcommSocketToServiceRecord(MY_UUID);
        sock.connect();

.....
}

But I always get the error messages on this line
sock.connect();
:~~~, 

please help me escape this hell, please!! thank you very much.

Original issue reported on code.google.com by superhot...@gmail.com on 11 Oct 2011 at 9:36

GoogleCodeExporter commented 8 years ago
I saw the note described below at the web page 
------------------------------------------------------------------------------
If you are having problems getting data, try choosing Menu->Run Command->Reset 
Protocol atsp0. This will set the protocol to automatic on the Elm327. If you 
are still having problems please email me the output from running a few 
commands.
------------------------------------------------------------------------------
But I only saw "Reset Protocol astp0" instead of "Reset Protocol atsp0"

mm....

Original comment by superhot...@gmail.com on 11 Oct 2011 at 9:43

GoogleCodeExporter commented 8 years ago
Whilst this is outside of the scope of this application, I can try to help you 
by e-mail. Please, mail me your issues and I'll gladly help.

Original comment by pjpi...@gmail.com on 22 Oct 2011 at 5:00

GoogleCodeExporter commented 8 years ago
Hi, pjpi, 
Few days age, I downloaded your apk on code.google, but it didn't work well 
when establishing a bluetooth connect. Thus I rewrote the bluetooth connection 
instead finally, and then referred your code to get some results of the certain 
PIDs (i.e., 010C, 010D...etc) on OBD2 successfully. Until now, I still don't 
know why your code don't work well, but I am very glad to see your 
contributions on this OBD2 project.

Original comment by superhot...@gmail.com on 24 Oct 2011 at 8:07

GoogleCodeExporter commented 8 years ago
Are you testing branch dev-1_3? 
http://code.google.com/p/android-obd-reader/source/list?name=dev-1_3

Original comment by pjpi...@gmail.com on 24 Oct 2011 at 1:21

GoogleCodeExporter commented 8 years ago
First of all: thanks for this project!

I'm facing the same problem... no result from the device.

"Java.io.Exception: socket failed to connect" in ObdConnectThread:68

I assume this is related to the UUID. Are the last 12 digits of the UUID the 
hardware address of the Bluetooth Adapter or where does this number come from?

Thanks in advance!

Original comment by jakob.moellers on 9 Apr 2012 at 5:42

GoogleCodeExporter commented 8 years ago
Once again, are you testing branch dev-1_3? 
http://code.google.com/p/android-obd-reader/source/list?name=dev-1_3

Original comment by pjpi...@gmail.com on 10 Apr 2012 at 9:57

GoogleCodeExporter commented 8 years ago
thanks, that did it!

Original comment by jakob.moellers on 12 Apr 2012 at 3:45

GoogleCodeExporter commented 8 years ago
hi,
when running the app the following exception was thrown.

java.io.IOException: service discovery failed at android.bluetooth

Please help.

Thanks in advance!

Original comment by bandula....@gmail.com on 26 May 2013 at 9:55