Android Question AdaFruit BLE UART Friend - Service missing?

SteveTerrell

Active Member
Licensed User
Longtime User
Hi,

Using a modified version of the BLE2 example I am able to get the Services and characteristics of the above device.

B4X:
(ArrayList) [00001800-0000-1000-8000-00805f9b34fb, 00001801-0000-1000-8000-00805f9b34fb, 00001530-1212-efde-1523-785feabcd123, 0000180a-0000-1000-8000-00805f9b34fb, 6e400001-b5a3-f393-e0a9-e50e24dcca9e]
ReadData for Service 00001800-0000-1000-8000-00805f9b34fb
ReadData for Service 00001801-0000-1000-8000-00805f9b34fb
ReadData for Service 00001530-1212-efde-1523-785feabcd123
ReadData for Service 0000180a-0000-1000-8000-00805f9b34fb
ReadData for Service 6e400001-b5a3-f393-e0a9-e50e24dcca9e
--
Data available for service:00001800-0000-1000-8000-00805f9b34fb
chararacteristics:00002a00-0000-1000-8000-00805f9b34fb
chararacteristics:00002a01-0000-1000-8000-00805f9b34fb
chararacteristics:00002a04-0000-1000-8000-00805f9b34fb
-
Data available for service:00001530-1212-efde-1523-785feabcd123
chararacteristics:00001534-1212-efde-1523-785feabcd123
-
Data available for service:0000180a-0000-1000-8000-00805f9b34fb
chararacteristics:00002a29-0000-1000-8000-00805f9b34fb
chararacteristics:00002a24-0000-1000-8000-00805f9b34fb
chararacteristics:00002a25-0000-1000-8000-00805f9b34fb
chararacteristics:00002a28-0000-1000-8000-00805f9b34fb
chararacteristics:00002a26-0000-1000-8000-00805f9b34fb
chararacteristics:00002a27-0000-1000-8000-00805f9b34fb
-

The ConnectedServices has a service 6e400001.... which should have the Tx and Rx characteristics but the ReadData for that characteristic does not seem to return anything (or occasionally "No matching characteristic found").

Does anyone know if this is a problem with the Adafruit module or am i doing something silly?
 

SteveTerrell

Active Member
Licensed User
Longtime User
Please try it again with v1.12: https://www.b4x.com/android/forum/threads/ble-2-bluetooth-low-energy.59937/#post-377705

Unreadable characteristics were not included. This issue is fixed in v1.12.

Thanks for the quick reply. Slightly strange results now!

B4X:
    For Each s As String In ConnectedServices
    '    Log("ReadData for Service "&ConnectedServices.Get(4))
    '    manager.ReadData(ConnectedServices.Get(4))
        Log("ReadData for Service "&s)
        manager.ReadData(s)           
    Next

i.e. code in original form.

Returns

B4X:
(ArrayList) [00001800-0000-1000-8000-00805f9b34fb, 00001801-0000-1000-8000-00805f9b34fb, 00001530-1212-efde-1523-785feabcd123, 0000180a-0000-1000-8000-00805f9b34fb, 6e400001-b5a3-f393-e0a9-e50e24dcca9e]
ReadData for Service 00001800-0000-1000-8000-00805f9b34fb
ReadData for Service 00001801-0000-1000-8000-00805f9b34fb
ReadData for Service 00001530-1212-efde-1523-785feabcd123
ReadData for Service 0000180a-0000-1000-8000-00805f9b34fb
ReadData for Service 6e400001-b5a3-f393-e0a9-e50e24dcca9e
Data available for service:00001800-0000-1000-8000-00805f9b34fb
chararacteristics:00002a00-0000-1000-8000-00805f9b34fb
chararacteristics:00002a01-0000-1000-8000-00805f9b34fb
chararacteristics:00002a04-0000-1000-8000-00805f9b34fb
-
Data available for service:00001530-1212-efde-1523-785feabcd123
chararacteristics:00001534-1212-efde-1523-785feabcd123
chararacteristics:00001532-1212-efde-1523-785feabcd123
chararacteristics:00001531-1212-efde-1523-785feabcd123
-
Data available for service:0000180a-0000-1000-8000-00805f9b34fb
chararacteristics:00002a29-0000-1000-8000-00805f9b34fb
chararacteristics:00002a24-0000-1000-8000-00805f9b34fb
chararacteristics:00002a25-0000-1000-8000-00805f9b34fb
chararacteristics:00002a28-0000-1000-8000-00805f9b34fb
chararacteristics:00002a26-0000-1000-8000-00805f9b34fb
chararacteristics:00002a27-0000-1000-8000-00805f9b34fb
-

While

B4X:
    For Each s As String In ConnectedServices
        Log("ReadData for Service "&ConnectedServices.Get(4))
        manager.ReadData(ConnectedServices.Get(4))
    '    Log("ReadData for Service "&s)
    '    manager.ReadData(s)           
    Next

I happen to know Tx/Rx is entry 4

Returns

B4X:
(ArrayList) [00001800-0000-1000-8000-00805f9b34fb, 00001801-0000-1000-8000-00805f9b34fb, 00001530-1212-efde-1523-785feabcd123, 0000180a-0000-1000-8000-00805f9b34fb, 6e400001-b5a3-f393-e0a9-e50e24dcca9e]
ReadData for Service 6e400001-b5a3-f393-e0a9-e50e24dcca9e
ReadData for Service 6e400001-b5a3-f393-e0a9-e50e24dcca9e
ReadData for Service 6e400001-b5a3-f393-e0a9-e50e24dcca9e
ReadData for Service 6e400001-b5a3-f393-e0a9-e50e24dcca9e
ReadData for Service 6e400001-b5a3-f393-e0a9-e50e24dcca9e
Data available for service:6e400001-b5a3-f393-e0a9-e50e24dcca9e
chararacteristics:6e400003-b5a3-f393-e0a9-e50e24dcca9e
chararacteristics:6e400002-b5a3-f393-e0a9-e50e24dcca9e
-
Data available for service:6e400001-b5a3-f393-e0a9-e50e24dcca9e
chararacteristics:6e400003-b5a3-f393-e0a9-e50e24dcca9e
chararacteristics:6e400002-b5a3-f393-e0a9-e50e24dcca9e
-
Data available for service:6e400001-b5a3-f393-e0a9-e50e24dcca9e
chararacteristics:6e400003-b5a3-f393-e0a9-e50e24dcca9e
chararacteristics:6e400002-b5a3-f393-e0a9-e50e24dcca9e
-
Data available for service:6e400001-b5a3-f393-e0a9-e50e24dcca9e
chararacteristics:6e400003-b5a3-f393-e0a9-e50e24dcca9e
chararacteristics:6e400002-b5a3-f393-e0a9-e50e24dcca9e
-
Data available for service:6e400001-b5a3-f393-e0a9-e50e24dcca9e
chararacteristics:6e400003-b5a3-f393-e0a9-e50e24dcca9e
chararacteristics:6e400002-b5a3-f393-e0a9-e50e24dcca9e
-

So running through the full services list seems to loose the characteristics for last one?

Steve
 
Upvote 0

SteveTerrell

Active Member
Licensed User
Longtime User
The second For Each block is incorrect. You are reading the the data from the same service 4 times. Remove the For Each block if you are only interested in this service.
Hi,

You are of course right, the second code was just a trivial modification to show that the "missing" service is correctly reported when asked for "directly".


The real question is why did the "00001801" and "6e400001" service characteristics not get reported (an answer to the ReadData call) in the first example?
The second loop asks for the same service 5 times and gets 5 correct answers. The first loop asks for each of 5 services in turn but only gets 3 answers.
Occasionally there is a "no characteristics for this service" log entry - but not every time as you can see from the example.
Occasionally the "00001801" is reported.

The pointless second loop just keeps the timing similar because it looked a little like a timing issue to start with.

Steve
 
Upvote 0

SteveTerrell

Active Member
Licensed User
Longtime User
Hi,

You are of course right, the second code was just a trivial modification to show that the "missing" service is correctly reported when asked for "directly".


The real question is why did the "00001801" and "6e400001" service characteristics not get reported (an answer to the ReadData call) in the first example?
The second loop asks for the same service 5 times and gets 5 correct answers. The first loop asks for each of 5 services in turn but only gets 3 answers.
Occasionally there is a "no characteristics for this service" log entry - but not every time as you can see from the example.
Occasionally the "00001801" is reported.

The pointless second loop just keeps the timing similar because it looked a little like a timing issue to start with.

Steve

Update

I put a simple 2.5 sec delay between the ReadData calls (timer and loop index) and all services now report their characteristics. It looks as if some of the replies to the "loop" version of ReadData are getting lost before "Manager_DataAvailable (ServiceId As String, Characteristics As Map)" is called.

Steve
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

SteveTerrell

Active Member
Licensed User
Longtime User
I think that I know the cause of this issue. Please try it again without the delay, with v1.13: https://www.b4x.com/android/forum/threads/ble-2-bluetooth-low-energy.59937/#post-377705

Make sure not to read the data of the same service multiple times (before the DataAvailable event was raised). You can call ReadData multiple times with different services.

Hi, getting there..

The loop code is:-

B4X:
Public Sub ReadData
    Log( ConnectedServices )
    For Each s As String In ConnectedServices
        Log("ReadData for Service "&s)
        manager.ReadData(s)       
    Next
    Log("")
End Sub

The DataAvailable code is

B4X:
Sub DataAvailable (Service As String, Characteristics As Map)
    pbReadData.Visible = False
    Log("Data available for service:"&Service)
    clv.Add(CreateServiceItem(Service), 30dip, "")
    For Each id As String In Characteristics.Keys
        Log("chararacteristics:"&id)
        clv.Add(CreateCharacteristicItem(id, Characteristics.Get(id)), 40dip, "")
    Next
    Log("-")
End Sub

And the log

B4X:
(ArrayList) [00001800-0000-1000-8000-00805f9b34fb, 00001801-0000-1000-8000-00805f9b34fb, 00001530-1212-efde-1523-785feabcd123, 0000180a-0000-1000-8000-00805f9b34fb, 6e400001-b5a3-f393-e0a9-e50e24dcca9e]
ReadData for Service 00001800-0000-1000-8000-00805f9b34fb
ReadData for Service 00001801-0000-1000-8000-00805f9b34fb
ReadData for Service 00001530-1212-efde-1523-785feabcd123
ReadData for Service 0000180a-0000-1000-8000-00805f9b34fb
ReadData for Service 6e400001-b5a3-f393-e0a9-e50e24dcca9e
Data available for service:00001801-0000-1000-8000-00805f9b34fb
chararacteristics:00002a05-0000-1000-8000-00805f9b34fb
-
Data available for service:00001530-1212-efde-1523-785feabcd123
chararacteristics:00001532-1212-efde-1523-785feabcd123
chararacteristics:00001531-1212-efde-1523-785feabcd123
chararacteristics:00001534-1212-efde-1523-785feabcd123
-
Data available for service:0000180a-0000-1000-8000-00805f9b34fb
chararacteristics:00002a29-0000-1000-8000-00805f9b34fb
chararacteristics:00002a24-0000-1000-8000-00805f9b34fb
chararacteristics:00002a25-0000-1000-8000-00805f9b34fb
chararacteristics:00002a28-0000-1000-8000-00805f9b34fb
chararacteristics:00002a26-0000-1000-8000-00805f9b34fb
chararacteristics:00002a27-0000-1000-8000-00805f9b34fb
-
Data available for service:6e400001-b5a3-f393-e0a9-e50e24dcca9e
chararacteristics:6e400003-b5a3-f393-e0a9-e50e24dcca9e
chararacteristics:6e400002-b5a3-f393-e0a9-e50e24dcca9e
-
Data available for service:00001800-0000-1000-8000-00805f9b34fb
chararacteristics:00002a00-0000-1000-8000-00805f9b34fb
chararacteristics:00002a01-0000-1000-8000-00805f9b34fb
chararacteristics:00002a04-0000-1000-8000-00805f9b34fb
-
Data available for service:00001530-1212-efde-1523-785feabcd123
chararacteristics:00001534-1212-efde-1523-785feabcd123
chararacteristics:00001532-1212-efde-1523-785feabcd123
chararacteristics:00001531-1212-efde-1523-785feabcd123
-
Data available for service:0000180a-0000-1000-8000-00805f9b34fb
chararacteristics:00002a29-0000-1000-8000-00805f9b34fb
chararacteristics:00002a24-0000-1000-8000-00805f9b34fb
chararacteristics:00002a25-0000-1000-8000-00805f9b34fb
chararacteristics:00002a28-0000-1000-8000-00805f9b34fb
chararacteristics:00002a26-0000-1000-8000-00805f9b34fb
chararacteristics:00002a27-0000-1000-8000-00805f9b34fb
-

All services and their characteristics are now listed but the order is a bit wrong (1801 appears before 1800 which was requested first, etc.) and the last three (1800, 1530 and 180a) are in the wrong place and 1530 and 180a are duplicates.

Also the tablet screen listing of the characteristics used to show the values associated with that characteristic (like the device name etc.) but now it shows nothing.
The Data part of Characteristics.Get(id) always seems to be empty.

Steve
 
Upvote 0

SteveTerrell

Active Member
Licensed User
Longtime User
The order is not important. You shouldn't rely on the reading order.

Can you post the output of:
B4X:
Dim bc as ByteConverter
Log($"char: ${id}, value = ${bc.HexFromBytes(Characteristics.Get(id))}"$)

As requested:-


B4X:
Installing file.
** Activity (main) Pause, UserClosed = false **
PackageAdded: package:b4a.example
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Found: Adafruit Bluefruit LE 6C08, D4:37:D2:14:6C:08, RSSI = -44, (MyMap) {1=[B@adf2885, 10=[B@b3af6da, 7=[B@5edb70b, 9=[B@17e79e8}
Discovering services.
Connected
(ArrayList) [00001800-0000-1000-8000-00805f9b34fb, 00001801-0000-1000-8000-00805f9b34fb, 00001530-1212-efde-1523-785feabcd123, 0000180a-0000-1000-8000-00805f9b34fb, 6e400001-b5a3-f393-e0a9-e50e24dcca9e]
ReadData for Service 00001800-0000-1000-8000-00805f9b34fb
ReadData for Service 00001801-0000-1000-8000-00805f9b34fb
ReadData for Service 00001530-1212-efde-1523-785feabcd123
ReadData for Service 0000180a-0000-1000-8000-00805f9b34fb
ReadData for Service 6e400001-b5a3-f393-e0a9-e50e24dcca9e
Data available for service:00001801-0000-1000-8000-00805f9b34fb
chararacteristics:00002a05-0000-1000-8000-00805f9b34fb
char: 00002a05-0000-1000-8000-00805f9b34fb, value =
-
Data available for service:00001530-1212-efde-1523-785feabcd123
chararacteristics:00001532-1212-efde-1523-785feabcd123
char: 00001532-1212-efde-1523-785feabcd123, value =
chararacteristics:00001531-1212-efde-1523-785feabcd123
char: 00001531-1212-efde-1523-785feabcd123, value =
chararacteristics:00001534-1212-efde-1523-785feabcd123
char: 00001534-1212-efde-1523-785feabcd123, value =
-
Data available for service:0000180a-0000-1000-8000-00805f9b34fb
chararacteristics:00002a29-0000-1000-8000-00805f9b34fb
char: 00002a29-0000-1000-8000-00805f9b34fb, value =
chararacteristics:00002a24-0000-1000-8000-00805f9b34fb
char: 00002a24-0000-1000-8000-00805f9b34fb, value =
chararacteristics:00002a25-0000-1000-8000-00805f9b34fb
char: 00002a25-0000-1000-8000-00805f9b34fb, value =
chararacteristics:00002a28-0000-1000-8000-00805f9b34fb
char: 00002a28-0000-1000-8000-00805f9b34fb, value =
chararacteristics:00002a26-0000-1000-8000-00805f9b34fb
char: 00002a26-0000-1000-8000-00805f9b34fb, value =
chararacteristics:00002a27-0000-1000-8000-00805f9b34fb
char: 00002a27-0000-1000-8000-00805f9b34fb, value =
-
Data available for service:6e400001-b5a3-f393-e0a9-e50e24dcca9e
chararacteristics:6e400003-b5a3-f393-e0a9-e50e24dcca9e
char: 6e400003-b5a3-f393-e0a9-e50e24dcca9e, value =
chararacteristics:6e400002-b5a3-f393-e0a9-e50e24dcca9e
char: 6e400002-b5a3-f393-e0a9-e50e24dcca9e, value =
-
Data available for service:00001800-0000-1000-8000-00805f9b34fb
chararacteristics:00002a00-0000-1000-8000-00805f9b34fb
char: 00002a00-0000-1000-8000-00805f9b34fb, value = 416461667275697420426C75656672756974204C452036433038
chararacteristics:00002a01-0000-1000-8000-00805f9b34fb
char: 00002a01-0000-1000-8000-00805f9b34fb, value = 0000
chararacteristics:00002a04-0000-1000-8000-00805f9b34fb
char: 00002a04-0000-1000-8000-00805f9b34fb, value = 1000500000009001
-
Data available for service:00001530-1212-efde-1523-785feabcd123
chararacteristics:00001534-1212-efde-1523-785feabcd123
char: 00001534-1212-efde-1523-785feabcd123, value = 0100
chararacteristics:00001532-1212-efde-1523-785feabcd123
char: 00001532-1212-efde-1523-785feabcd123, value =
chararacteristics:00001531-1212-efde-1523-785feabcd123
char: 00001531-1212-efde-1523-785feabcd123, value =
-
Data available for service:0000180a-0000-1000-8000-00805f9b34fb
chararacteristics:00002a29-0000-1000-8000-00805f9b34fb
char: 00002a29-0000-1000-8000-00805f9b34fb, value = 416461667275697420496E6475737472696573
chararacteristics:00002a24-0000-1000-8000-00805f9b34fb
char: 00002a24-0000-1000-8000-00805f9b34fb, value = 424C45465249454E443332
chararacteristics:00002a25-0000-1000-8000-00805f9b34fb
char: 00002a25-0000-1000-8000-00805f9b34fb, value = 30353931443537333843374237444446
chararacteristics:00002a28-0000-1000-8000-00805f9b34fb
char: 00002a28-0000-1000-8000-00805f9b34fb, value = 302E362E32202D204170722033302032303135
chararacteristics:00002a26-0000-1000-8000-00805f9b34fb
char: 00002a26-0000-1000-8000-00805f9b34fb, value = 5331313020382E302E302C20302E32
chararacteristics:00002a27-0000-1000-8000-00805f9b34fb
char: 00002a27-0000-1000-8000-00805f9b34fb, value = 51464143413130
-

While the reading order (calls to DataAvailable) may differ from the requesting order (calls of ReadData) presumably there should be the same number of each?
In this case 7 DataAvailable replies in response to 5 ReadData calls.

Steve
 
Upvote 0

SteveTerrell

Active Member
Licensed User
Longtime User
As you can probably see the first reply to service 180a has no data with the characteristics.

The second reply to 180a (near the bottom) does have the correct data as does the reply to 1800.

As you can see there was only one ReadData to 180a.

Steve
 
Upvote 0

SteveTerrell

Active Member
Licensed User
Longtime User
Hi,

Looks good..

5 requests, 5 replies, data shown for characteristics where it should be.

Thanks

Steve

I have just upgraded to 1.16 and seem to be back to only getting 3 services reported again

B4X:
** Activity (main) Pause, UserClosed = false **
** Service (starter) Create **
log file is:Mk2ResistanceMeterBLE1.txt
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*16:54:22:998::I:TRS Mk 2 Resistance Meter V4.00 13JAN16::Mk 2 V4.00
*16:54:23:189::I:BLEManager::::0->1::initialised
*16:54:23:239::I:ScreenManager::::0->1::initialised
*16:54:23:262::I:MeterManager::S:0::initialised
*16:54:23:305::I:MeterManager::::0->1
*16:54:23:331::I:MeterManager::::1->2
*16:54:23:364::I:Manager_StateChange::State change
*16:54:24:993::I:MeterManager::::2->3::Starting scan
*16:54:25:063::I:BLEManager::::1->2::Scan started
*16:54:27:352::I:BLEManager::S:2::Found: Adafruit Bluefruit LE, D4:37:D2:14:6C:08, RSSI = -60, (MyMap) {1=[B@4b9ddc9, 10=[B@72cdcce, 7=[B@eb4f7ef, 9=[B@87292fc}
*16:54:27:372::I:BLEManager::::2->3::Found a UART, connecting
*16:54:27:452::I:MeterManager::S:3::device found:Adafruit Bluefruit LE
*16:54:27:498::I:MeterManager::S:3::Connecting:Adafruit Bluefruit LE
*16:54:27:501::I:MeterManager::::3->4
Discovering services.
*16:54:28:608::I:BLEManager::::3->4::Connected
*16:54:28:624::I:MeterManager::::4->5
*16:54:28:641::I:BLEManager::S:4::ReadData for Service 00001800-0000-1000-8000-00805f9b34fb
*16:54:28:644::I:BLEManager::S:4::ReadData for Service 00001801-0000-1000-8000-00805f9b34fb
*16:54:28:647::I:BLEManager::S:4::ReadData for Service 00001530-1212-efde-1523-785feabcd123

Has 1.16 broken the earlier fix?

Steve
 
Upvote 0

SteveTerrell

Active Member
Licensed User
Longtime User
Sub Manager_DataAvailable (ServiceId As String, Characteristics As Map)

Only seems to be receiving services with no characteristics

Steve
 
Upvote 0

SteveTerrell

Active Member
Licensed User
Longtime User
The changes from v1.15 shouldn't affect this.

What is the output of Log(Services) in the connected event?

This is the same device as my earlier posts.

This was working in 1.15 but something has changed since the original release of that version.
Log from your current example (with some log lines added).

B4X:
Connected:(ArrayList) [00001800-0000-1000-8000-00805f9b34fb, 00001801-0000-1000-8000-00805f9b34fb, 00001530-1212-efde-1523-785feabcd123]

The following was copied from above posts

B4X:
(ArrayList) [00001800-0000-1000-8000-00805f9b34fb, 00001801-0000-1000-8000-00805f9b34fb, 00001530-1212-efde-1523-785feabcd123, 0000180a-0000-1000-8000-00805f9b34fb, 6e400001-b5a3-f393-e0a9-e50e24dcca9e]

As you can see the 0000180a and 6e400001 are not now listed.

Also

B4X:
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Found: Adafruit Bluefruit LE, D4:37:D2:14:6C:08, RSSI = -65, (MyMap) {1=[B@87292fc, 10=[B@c798d85, 7=[B@2bdf7da, 9=[B@903240b}
Discovering services.
Connected:(ArrayList) [00001800-0000-1000-8000-00805f9b34fb, 00001801-0000-1000-8000-00805f9b34fb, 00001530-1212-efde-1523-785feabcd123]
ReadData for Service 00001800-0000-1000-8000-00805f9b34fb
ReadData for Service 00001801-0000-1000-8000-00805f9b34fb
ReadData for Service 00001530-1212-efde-1523-785feabcd123
Data available for service:00001800-0000-1000-8000-00805f9b34fb
Data available for service:00001801-0000-1000-8000-00805f9b34fb
Data available for service:00001530-1212-efde-1523-785feabcd123

No characteristics are listed (screen or log) because "Characteristics" is an empty map (checked with debugger).

B4X:
Sub DataAvailable (Service As String, Characteristics As Map)
    pbReadData.Visible = False
    Log("Data available for service:"&Service)
    clv.Add(CreateServiceItem(Service), 30dip, "")
    For Each id As String In Characteristics.Keys
        Log("characteristics:"&id)
        clv.Add(CreateCharacteristicItem(id, Characteristics.Get(id)), 40dip, "")
        Dim bc As ByteConverter
        Log($"char: ${id}, value = ${bc.HexFromBytes(Characteristics.Get(id))}"$)
    Next
End Sub



Where as previously (example for 00001530)

B4X:
Data available for service:00001530-1212-efde-1523-785feabcd123
chararacteristics:00001532-1212-efde-1523-785feabcd123
char: 00001532-1212-efde-1523-785feabcd123, value =
chararacteristics:00001531-1212-efde-1523-785feabcd123
char: 00001531-1212-efde-1523-785feabcd123, value =
chararacteristics:00001534-1212-efde-1523-785feabcd123
char: 00001534-1212-efde-1523-785feabcd123, value =

Hope this helps - if you need any extra tests just ask.

Steve
 
Upvote 0

SteveTerrell

Active Member
Licensed User
Longtime User
Hold the investigation...

I ran the Adafruit app to see if the device is working (as a UART), which it was.
Now i get all services reported.

B4X:
Installing file.
PackageAdded: package:b4a.example
Copying updated assets files (1)
** Service (starter) Create **
log file is:Mk2ResistanceMeterBLE2.txt
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*09:48:09:722::I:TRS Mk 2 Resistance Meter V4.00 13JAN16::Mk 2 V4.00
*09:48:09:907::I:BLEManager::::0->1::initialised
*09:48:09:963::I:ScreenManager::::0->1::initialised
*09:48:09:978::I:MeterManager::S:0::initialised
*09:48:09:996::I:MeterManager::::0->1
*09:48:10:021::I:MeterManager::::1->2
*09:48:10:055::I:Manager_StateChange::State change
*09:48:12:381::I:MeterManager::::2->3::Starting scan
*09:48:12:402::I:BLEManager::::1->2::Scan started
Found: Adafruit Bluefruit LE, D4:37:D2:14:6C:08, RSSI = -65, (MyMap) {1=[B@72cdcce, 10=[B@eb4f7ef, 7=[B@87292fc, 9=[B@c798d85}
*09:48:13:358::I:BLEManager::S:2::Found: Adafruit Bluefruit LE, D4:37:D2:14:6C:08, RSSI = -65, (MyMap) {1=[B@72cdcce, 10=[B@eb4f7ef, 7=[B@87292fc, 9=[B@c798d85}
*09:48:13:362::I:BLEManager::::2->3::Found a UART, connecting
*09:48:13:400::I:MeterManager::S:3::device found:Adafruit Bluefruit LE
*09:48:13:415::I:MeterManager::S:3::Connecting:Adafruit Bluefruit LE
*09:48:13:418::I:MeterManager::::3->4
Discovering services.
*09:48:15:117::I:BLEManager::::3->4::Connected
*09:48:15:127::I:MeterManager::::4->5
*09:48:15:138::I:BLEManager::S:4::ReadData for Service 00001800-0000-1000-8000-00805f9b34fb
*09:48:15:138::I:BLEManager::S:4::ReadData for Service 00001801-0000-1000-8000-00805f9b34fb
*09:48:15:139::I:BLEManager::S:4::ReadData for Service 00001530-1212-efde-1523-785feabcd123
*09:48:15:139::I:BLEManager::S:4::ReadData for Service 0000180a-0000-1000-8000-00805f9b34fb
*09:48:15:139::I:BLEManager::S:4::ReadData for Service 6e400001-b5a3-f393-e0a9-e50e24dcca9e



Not sure what is going on at the moment?????.

Steve
 
Upvote 0

SteveTerrell

Active Member
Licensed User
Longtime User
PS sorry to waste your time - It was almost like the BLE device was stuck in some way.

The good news is Connect2 is proving fast (<2s) and reliable

Steve
 
Upvote 0
Top