[Solved] Can I use BLE on iOS?

interested in this as well, haven’t got BLE to work either.

OK - I found out what’s wrong.
It is Thunkable Live app for iOS, it cannot connect to BLE.
Android Live app works great, it connects immediately, sends messages etc.
iOS app luckily works when you compile it, send via mail and install, but no live preview…
So that’s it, you have to fix BLE in iOS Live app…

Otherwise, these blocks work surprisingly good, really straightforward and simple. You just connect to device and send messages, nothing more… really cool. Disconnect is maybe missing and some more detailed stuff maybe, but for my purpose this can easily be enough.

23%20AM

And here’s a final update:
Live preview warns you that it’s not working on iOS, so it’s ok.
I have coded using Android live prew, but compiled version stopped working on iOS after the app got more complicated, now it doesn’t work on Android too…
SO… I think I have wasted my time, I will go back to Classic and make it only for Android… Classic has much more detailed and reliable BLE protocol, this one is much simpler, easy to use, but completely unreliable. I hope it might get improved soon.

Thanks for the feedback @neuheisser - sorry to hear that this isn’t quite ready for you yet.

We are planning updates and improvements so hopefully your input can help with this.

We recently had another user with a similar problem and their solution was to add the READ property to the TX characteristic in the UART service on their ESP32. Here’s their full message:

I programmed my ESP-32 as a server with one Service (UART service) and two characteristics RX and TX. On my RX was allowed only the property of WRITE and on my TX was allowed only the property of NOTIFY (this is done on one of the defaults examples on the ESP-32’s libraries). For some reason, this configuration works well with the iOS App but my ANDROID App couldn’t receive data from the SERVER. So, to make it work on ANDROID and iOS I added the following properties on my characteristics RX and TX: READ, WRITE, NOTIFY, INDICATE

Actually, just adding the READ property on the TX characteristics of the the UART service is enough to solve this and make it work well.

Hope this helps.

-Mark

2 Likes

BLE preview doesn’t view with iOS and it is clearly stated if you press “Live Test” button.
Everything is OK with BLE module, works great, but you have to compile the app for iOS!

2 Likes

Hello. I have no problem sending data. I’m having trouble receiving data, the timer updates every 50 ms, but I don’t see any reception. in addition it is possible to disconnect the external device connected to the ble without closing the app?thun

Hey

I’ve been trying to get the BLE receive to work for weeks now. I’ using a HM10 module and an Arduino to receive transmit the data.

I have come to conclude that the receive block is not functioning. Hopefully, that would be reviewed soon

2 Likes

I used Thinkable X BLE with Arduino Nano 33BLE. Both Sending and Receiving work ok. I verified just now. What I experienced:

  1. Scan takes a very long time, it finally scans something after I waited like forever. So now I choose to Connect to Device Name directly.
  2. Fro both Sending and Receiving, I use “String”. It is very difficult for me to figure out using specific data types, so in Arduino I used generic BLE characteristic.
  3. I have to use timer to Receive from Arduino periodically. To avoid congestion I use 100ms loop. In Thunkable side better if we can have a WHEN Received block.
  4. So far the apk works fine in Android, but not in iOS. In iOS it does not connect (like my BLE peripheral does not exist). I am still thinking what’s wrong with it. Perhaps build another simpler one to verify?

(Correction: BLE app works in iOS just now, but I am not sure of the thing that I changed. So for No 4 I will keep watching.)

2 Likes

can you share your project here?

1 Like

In Android I think it is possible to “Disconnect” without closing the App.

I simply “Connect to Device Name”, and if check if the returned “Device ID” is empty or not.
It works ok with single button to turn it On and Off.
However, it doesn’t look very good in iOS, I will check it more.

kufirre I show you a portion of simple example: polling the XYZ data from Nano 33 BLE accelerator.
A button is set to turn the polling on and off. When it is on, a timer is activated with a duration of 100ms. Each time the timer is fired, X, Y, Z data are read from the BLE device in respective characteristics:
0000FFC1-0000-1000-8000-00805F9B34FB (X)
0000FFC2-0000-1000-8000-00805F9B34FB (Y)
0000FFC3-0000-1000-8000-00805F9B34FB (Z)

Like I said, I currently convert the float data into char array string in Arduino side so that those data can be read correctly. To give you part of the codes:

void ReadAccelerationSensorData() {
float x, y, z;
char buffer_x[6], buffer_y[6], buffer_z[6];

if(IMU.accelerationAvailable()) {
IMU.readAcceleration(x, y, z);

dtostrf(x, ACCE_XYZ_LEN, FLOAT_PREC_LEN, buffer_x);
dtostrf(y, ACCE_XYZ_LEN, FLOAT_PREC_LEN, buffer_y);
dtostrf(z, ACCE_XYZ_LEN, FLOAT_PREC_LEN, buffer_z);

characteristicAcceX.writeValue(buffer_x);
characteristicAcceY.writeValue(buffer_y);
characteristicAcceZ.writeValue(buffer_z);

}
}

I did not try on HM-10 with Thinkable so I cannot identity the actual difference. Hope it helps.

2 Likes

to connect and disconnect the Android BLE system, with the same “connect” command, connect and disconnect the device, with IOS connect it and just do not disconnect even if you call the command.

To receive the HM-10 it appears to me that it uses the same “characteristic” for both receiving and sending

Yes, I use the same “characteristic, but receive doesn’t work for iOS. There might be an issue with this block. I wish the Thunkable X team can look at this for iOS”

1 Like

In my case it’s not working: I receive “No device is connected” when I try to connect using Device Name.

Martin, are you sure you are using compiled app, not the preview?

1 Like

Sure! I enabled my app in Device Management, so it’s definately not the preview. BTW I can connect via Device UUID.
When I use Device name I receive “There is no device with name “MyDeviceName”. Please, try it again.”

Sometimes things got somehow “stuck”, and my app cannot communicate with the device. Check the connection to your device with eBeacon, find it on the AppStore. Connect with “Not JAALEE Beacon” option and see if you can see it. Also you have to have location enabled, did you do that?

1 Like

Yes, I can communicate to my BLE device via eBeacon - it works flawlessly

Fixed it. Extremely weird bug:

When Location is Disabled for iOS app I can’t connect to my BLE Device.

When Location is Enabled for iOS app I can connect to my BLE Device only when I close eBeacon or similar software.

But I can connect to BLE Device via UUID when Location is Disabled for iOS app or I have eBeacon or similar software running in background. :crazy_face:

1 Like

i am so terribly waiting for this , i am stuck with BLE receive as well