More challenging that I expect with Serial

Scantech

Well-Known Member
Licensed User
Longtime User
I am tinkering around with my Bluetooth Device ELM327 and came across with a problem. I have no problem connecting to this device with vb.net, however it is more challenging with B4A. With the Device Paired up but not connected, I ran the Serial Example by Erel and noticed with Serial1.connect or Serial1.Listen causes an
Java.Lang.securityException Need BLUETOOTH_ADMIN Permission: Neither User 10071 nor current process has android.permission.Bluetooth_Admin.

I am not giving up and hopefully do not end up bald after figuring this out! Any suggestions would be appreciated. Thanks
 

Scantech

Well-Known Member
Licensed User
Longtime User
I am getting somewhere. Got it to connect Successfully. I have to use Unsecured Connection. Seems to connect successfully at Port 2

Dim bt as BluetoothAdmin

Serial1.ConnectInsecure(bt, pairedDevices.Get(l.Get(res)), 2)

The Success Event was raised. This is a start. I hope it works.
 
Upvote 0

Scantech

Well-Known Member
Licensed User
Longtime User
Spoke too soon. It connected successfully once only. Now, i can't get it going anymore. I need a break. Lol
 
Upvote 0

Scantech

Well-Known Member
Licensed User
Longtime User
Try to unpair and pair the devices again.

Still no success by unpairing/pairing. Maybe Rick or Brad can share some of their tips. After reading their threads, It appears they have it connected to the device with success.
 
Upvote 0

Scantech

Well-Known Member
Licensed User
Longtime User
Good News! Finally got something going. Erel Serial Tutorial needs a slight modification to make it work with this OBD II ELM 327 device.

For some strange reason, if you do not use Serial1.StopListening in the Activity Pause or Disconnect Button then you will come across with Discovery Error when you try to reconnect to the IVT corp. Bluetooth Chipset. StopListening is very important or you may have to unpair/pair up the device to get it going. Most of the time I had to reboot my phone.

I use SerialConnect3 @ port 1 to connect.

This is a Must!! Add this to your Globals "Dim bt as BluetoothAdmin" this will add Bluetooth Permission in the Manifest or you will get Discovery Error (I forget the whole description). I send a simple command to reset the device and it works! I am having trouble parsing the incoming data. The length of incoming data is correct however I need to convert the Char.
 
Last edited:
Upvote 0
Top