[Solved] Can I use BLE on iOS?

I support, as an embedded systems developer who can’t code mobile apps at this time. IoT is a BIG thing

1 Like

Just to update this thread with something that I haven’t found announced:
BLE now works on iOS even in Thunkable Live app!
Somehow it just started, even if it still has a warning in Live Test.
So, @domhnallohanlon, you can remove the warning - it works now :slight_smile:

Even more good news - BLE component was silently updated - no announcement on that too! I have just noticed new options, but you have to click on the block itself, they are still not available in the blocks pane:
Screenshot 2020-09-09 at 11.54.47

By now, I have tested only the Disconnect function, AND IT WORKS!!! :smiley: :smiley: :slight_smile:

I’ll test the others and report, but this is really good news for us working with BLE!
Thanks @domhnallohanlon and please announce these updates!

2 Likes

A couple of you have asked me about the ESP32 talking (RX/TX) to Thunkable X. Below is the crux of my Arduino handshake code. It uses nkolban BLE libraries…
I am concatenating packets of 20b directly into a SPIFF file.

class MyCallbacks: public BLECharacteristicCallbacks {
char lastpacket[41] = {’\0’};
char check[41] = {’\0’};
File packets = SPIFFS.open("/uploadstring.txt", FILE_APPEND);
std::string pw = SPIFF_string_delim_eol("/credentials.txt", “|pw|”);//custom function called

void onWrite(BLECharacteristic *pCharacteristic) {
  std::string rxValue = pCharacteristic->getValue();
  if (rxValue.length() > 0) {
    packets.print(rxValue.c_str());//append packet to file.
    strcat(lastpacket, rxValue.c_str());// ***constantly tagging two consecutive packets to check unbroken password or other keywords.***
    strcpy(check, lastpacket);
    strcpy(lastpacket, rxValue.c_str());
    pTxCharacteristic->setValue(rxValue);//***send Thunkable back the packet for checksum.***
    if (strstr(check, pw.c_str()) != NULL && check[strlen(check) - 2] == '~' ) { //***check for flag sent by Thunkable. security password variable confirms credentials, integrity and end of packet.***
      packets.close();
      Serial.println("success");//Serial monitor 
      pTxCharacteristic->setValue("success"); // ***this is sent to Thunkable on completion***
      // btStop(); //***Now using Thunkable to disconnect***
    }
  }
}

};

I will eventually get around to documenting my project which I will be happy to share excerpts of including Arduino / Firebase / Thunkable three way communication. Sorry for the brevity guys but I never was much good at documentation and explanation of my modules. We all have our weaknesses :slight_smile:

2 Likes

This is exactly what I have been searching for and others too… Adding the bellow ** ** portion to the existing code worked perfectly. So many people were blaming thunkable (The, requiring the BLE receive to be an EVENT block aside)

pCharacteristic = pService->createCharacteristic(
CHARACTERISTIC_UUID_TX,
BLECharacteristic::PROPERTY_NOTIFY**|BLECharacteristic::PROPERTY_READ**
);

Top man Mark @ Thunkable and the original person

1 Like

OK - I can finally confirm that BLE transfer works both ways with ESP32 :slight_smile:
The key is really in setting right properties, and the easiest way for setting things up is

  1. flashing the example BLE_notify from ESP32 BLE Arduino folder in Examples
  2. Connecting to the device name ESP32 (BLE block)
  3. Using CHARACTERISTIC_UUID from the example for Receive block.
    And basically you got it. Good luck and thanks for help Richard and the others!
1 Like

Could you show an example of the receive UUID?
I’m using either a romeo mini 2.0 or a HM-10, or a Nano BLE for modules and can transmit to the device from phone app, but can’t receive anything but “undefined” error message.

Have you tried with BLE_notify example?

Thank for your sharing,
I’m using HM10 connect with PC via USB to UART module. HM10 connect with my Android phone via Bluetooth.
I can send string from phone to PC no problem, but could not receive string from PC.
I’m using this UUID: 0000FFE1-0000-1000-8000-00805F9B34FB.
Please advise any other UUID should be use? Thank you!

I believe this has something to do with the notification/indication characteristic and not the UUID listed for the HM-10 BLE. Wasn’t able to find a solution for this problem

Hi,
can you please tell me which block i can use to get notify about device notifications such as call or messages.