# Something wrong in my communication through BLE

**URL:** <https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439>\
**Category:** Questions about Thunkable X\
**Created:** [April 23, 2021, 1:43pm UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439 "2021-04-23T13:43:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![felipe.moriondo](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@felipe.moriondo](https://community.thunkable.com/u/felipe.moriondo)\
**Post date:** [April 23, 2021, 1:43pm UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/1 "2021-04-23T13:43:28Z")

</div>

Thunkable’s friends,  
I am programming with thunkable and I need to connect via bluetooth AT-09 BLE I can communicate from the IDE’s serial monitor of the arduino with the BlExAR App and with the DSDTECH Bluetooth App perfectly in both directions, but when I try to do this through the thunkable, I can only do it transmitting a word, a few letters come out at the reception, only the first letter of the word I sent is returned to me and if I send it from the IDE monitor, nothing arrives in the thunkable. I am operating with the thunkable for IOS on the Iphone.  
the link of my thunkable [Thunkable](https://x.thunkable.com/copy/c247d60cdf0f10bd7dff3b67d09510cc)  
If anyone can take a look and see what could be wrong I am grateful for the help!

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 23, 2021, 2:13pm UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/2 "2021-04-23T14:13:51Z")

</div>

Most of the BLE devices will use different characteristic UUID for send than that one for receive. Check to have one of them start with FFE0 instead of FFE1.

[Edit]  
I read more about BLE and iOS and read a comment that not all iOS version accept the full UUID but only FFE1

Also read that FFE0 is used as a service not as a characteristic.

---

<div class="post-metadata">

**Author:** ![felipe.moriondo](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@felipe.moriondo](https://community.thunkable.com/u/felipe.moriondo)\
**Post date:** [April 24, 2021, 2:01am UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/3 "2021-04-24T02:01:07Z")

</div>

I want to thank your attention I mean that both the reception and the transmission use the same UUID characteristic and always start with 0xFFE1 and the service 0xFFE0 the thunkable only asks for the UUID of the ID and UUID Characteristic  
It would be nice if they could be different from each other maybe it was already resolved.  
I saw in some examples that the UUID are declared in the arduino’s sketch and I didn’t understand and I don’t know if it is necessary because the transmission works the reception that I can’t send from the serial monitor  
what i don’t understand is that when i send a sequence of letters FGHJKH and call the reception it returns the letter F as if he was bringing back what i sent.  
I can’t evolve anymore !! the interesting thing is that when I use a ready-made application as I said above, the communication is perfect for both sides.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 24, 2021, 9:52am UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/4 "2021-04-24T09:52:25Z")

</div>

Can you try putting the receive block in a loop to see if it will bring you all letters?

When you send, do you see the full letters you send in the device display?

---

<div class="post-metadata">

**Author:** ![felipe.moriondo](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@felipe.moriondo](https://community.thunkable.com/u/felipe.moriondo)\
**Post date:** [April 25, 2021, 2:46pm UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/5 "2021-04-25T14:46:31Z")

</div>

I did the loop, but I was not successful, I did a simple Sketch only with Bluetooth.write (“felipe”);  
and only the “f” continues to appear.  
I did the experiment with numbers and continues with the letter “f”  
another word and “f” again  
on the second question, yes I send it to both the Serial monitor and an OLED display and it appears complete.  
[https://x.thunkable.com/copy/7c05441c3ab8ca0dcc2d4dc5c4e779de](https://x.thunkable.com/copy/7c05441c3ab8ca0dcc2d4dc5c4e779de)

#include \<SoftwareSerial.h\>  
SoftwareSerial Bluetooth(3 , 2);  
void setup() {  
Serial.begin(9600);  
Bluetooth.begin(9600);  
}  
void loop() {  
Bluetooth.write(“FELIPE”);  
}

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 25, 2021, 3:23pm UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/6 "2021-04-25T15:23:35Z")

</div>

Your C code says that you are dealing with a serial port and in bauds this means you need to change the text in Thunkable to a list of single characters not simple text.

So make a list of the word “FELIPE” by creating a list and having each letter in a position in the list and then assign the list as the **string** to send.

---

<div class="post-metadata">

**Author:** ![felipe.moriondo](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@felipe.moriondo](https://community.thunkable.com/u/felipe.moriondo)\
**Post date:** [April 25, 2021, 5:11pm UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/7 "2021-04-25T17:11:53Z")

</div>

I will try to do what it says.  
I come back to tell you what happened.  
thanks

---

<div class="post-metadata">

**Author:** ![felipe.moriondo](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@felipe.moriondo](https://community.thunkable.com/u/felipe.moriondo)\
**Post date:** [April 25, 2021, 7:50pm UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/8 "2021-04-25T19:50:55Z")

</div>

Would the list be for reception? because I’m already managing to get the word out on both the monitor and the display.  
This sketch I posted before was an idea to make a very simple one to see if I could solve the reception on the thunkable App.  
I saw an example in which to send a signal from a sensor to a label in the app would be something simple \>\>\>\> bluetooth.write (“the signal”); \<\<\<\<\<\< and it would arrive in the App but nothing arrives.  
the code I’m using from sketch is more complex. I’ll send it to you to take a look.  
thanks

#include \<SPI.h\>  
#include \<Wire.h\>  
#include \<Adafruit\_GFX.h\>  
#include \<Adafruit\_SSD1306.h\>  
#include \<SoftwareSerial.h\>  
SoftwareSerial bluetooth(3 , 2);

const byte SCREEN\_WIDTH = 128; // OLED display width, in pixels  
const byte SCREEN\_HEIGHT = 64; // OLED display height, in pixels

// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)

const int OLED\_RESET = -1; // Reset pin # (or -1 if sharing Arduino reset pin)  
Adafruit\_SSD1306 display(SCREEN\_WIDTH, SCREEN\_HEIGHT, &Wire, OLED\_RESET);

#include “HX711.h”

HX711 scale;

uint8\_t dataPin = 6;  
uint8\_t clockPin = 5;

uint32\_t start, stop;  
volatile float f;

unsigned long prevMillis;  
const int READ\_TIME = 500; //ms

void setup() {

bluetooth.begin(9600);  
Serial.begin(9600);  
display.begin(SSD1306\_SWITCHCAPVCC, 0x3C);  
display.clearDisplay();  
display.setTextSize(2);  
display.setTextColor(WHITE);  
scale.begin(dataPin, clockPin);  
scale.set\_scale(420.0983);

// reset the scale to zero = 0  
scale.tare();  
delay(1);  
}  
int filtered;

int val1,  
val2,  
val3,  
val4;

void loop() {

f = scale.get\_units(5);  
int value = f;  
val4 = val3;  
val3 = val2;  
val2 = val1;  
val1 = value;

filtered = (((val1 + val2 + val3 + val4)\*-1) / 4)\*3.44;

Serial.println(filtered);  
display.setCursor(10, 28);  
display.println(filtered);  
display.setCursor(60, 28);  
display.println(“grams”);  
display.display();  
bluetooth.println(filtered);

```
if (Serial.available()) {       

String str = "";
Serial.print("Input: ");

prevMillis = millis();
while (millis() - prevMillis < READ_TIME) {
  if (Serial.available()) {                                                    
    char c = Serial.read();
    if (c != 10 && c != 13) { 
      str += c;
      bluetooth.write(c);
    }
  }
}

bluetooth.println(str);
Serial.println(str);

```

}  
if (bluetooth.available()) {  
String str = “”;  
Serial.print("Item: ");

```
prevMillis = millis();
while (millis() - prevMillis < READ_TIME) {
  if (bluetooth.available()) {
    str += (char) bluetooth.read();
   
  }
}
Serial.println(str);
display.clearDisplay();
display.setCursor(28, 10);
display.print(str);
display.display();

```

}  
}

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 26, 2021, 10:13am UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/9 "2021-04-26T10:13:05Z")

</div>

Very good,  
The C language code you presented actually reads the output **one character at a time** and then display it. This is typical for bauds devices.

It only shows that you need to create a similar loop in the receiving side.

---

<div class="post-metadata">

**Author:** ![felipe.moriondo](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@felipe.moriondo](https://community.thunkable.com/u/felipe.moriondo)\
**Post date:** [April 27, 2021, 2:39am UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/10 "2021-04-27T02:39:19Z")

</div>

Mr Muneer,  
Thanks for your direction, now I am studying how to do it, I am learning a little bit day by day, but it is still not easy for my level of knowledge and I can’t find an example that I can compare the differences. When you talk about doing the LOOP are you talking about the block “recive string” from BLE in thunkable?  
if it is possible to send me any example, it would facilitate my execution.  
But if there is no way, soon I will give you some news !!

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 27, 2021, 8:42am UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/11 "2021-04-27T08:42:17Z")

</div>

Ok, I will make an example in Thunkable and send to you later today.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 27, 2021, 11:59am UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/12 "2021-04-27T11:59:55Z")

</div>

Please see the screenshot below. I made use of a “Timer” component in the project to use it to establish a functional loop. This way, the receive block will be executed every 100ms to see if any information is coming to the port.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/e/0ea84560f778ac366a9f60f835dbd6b1215ca124.png)

If the BLE device is sending one character at a time then the blocks will be rearranged a bit differently like this.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f560f1ac54543780ef8949ab49df8c14a452423.png)

Notice in this block you need to reset the contents of the label every time you start receiving.

---

<div class="post-metadata">

**Author:** ![felipe.moriondo](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@felipe.moriondo](https://community.thunkable.com/u/felipe.moriondo)\
**Post date:** [April 27, 2021, 2:18pm UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/13 "2021-04-27T14:18:22Z")

</div>

Mr.Muneer,  
First modification continued in the same way, but the second modification with the join block, see what happened ![https://drive.google.com/file/d/1PeIJI_zWLUTFxXxRGaiYJYVRW1c-KkaY/view?usp=sharing](https://drive.google.com/file/d/1PeIJI_zWLUTFxXxRGaiYJYVRW1c-KkaY/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![felipe.moriondo](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@felipe.moriondo](https://community.thunkable.com/u/felipe.moriondo)\
**Post date:** [April 27, 2021, 3:00pm UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/14 "2021-04-27T15:00:47Z")

</div>

the communication works from thunkable to the IDE monitor and I can return the first letter of any word or number in the thunkable lable.  
In the opposite direction, I write in the IDE’s upload bar and what I sent appears on the IDE’s monitor.  
What I find interesting is that there isn’t even a character in the thunkable, so I don’t think it’s a matter of list, we needed to do something that at least the thankable gets one character, but nothing is difficult to understand.

---

<div class="post-metadata">

**Author:** ![felipe.moriondo](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@felipe.moriondo](https://community.thunkable.com/u/felipe.moriondo)\
**Post date:** [April 27, 2021, 4:02pm UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/15 "2021-04-27T16:02:21Z")

</div>

What do you think about writing a code as simple as possible to send a character from arduino to thunkable only with receiver blocks and one lable.  
this would have to work, what do you think?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 28, 2021, 2:20am UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/16 "2021-04-28T02:20:38Z")

</div>

The question is why the first letter is echoed back?

Is that meant to be? In normal circumstances it should not.

---

<div class="post-metadata">

**Author:** ![felipe.moriondo](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@felipe.moriondo](https://community.thunkable.com/u/felipe.moriondo)\
**Post date:** [April 28, 2021, 2:23am UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/17 "2021-04-28T02:23:16Z")

</div>

maybe because the UUID characteristic is the same

---

<div class="post-metadata">

**Author:** ![felipe.moriondo](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@felipe.moriondo](https://community.thunkable.com/u/felipe.moriondo)\
**Post date:** [April 28, 2021, 2:27am UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/18 "2021-04-28T02:27:17Z")

</div>

I at first thought it was a question of string or hex or DEC  
I think that if we had UUID Characteristic one for TX and one for RX it would be resolved but it is my thought I don’t know if I am right.  
unfortunately the AT-09 BLE only has service UUID and UUID characteristic

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 28, 2021, 3:06am UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/19 "2021-04-28T03:06:05Z")

</div>

- Can you send anything from your BLE device and receive it in Thunkable?

- Can you try to send the text as a list not as a normal string?

- Can you send AT commands to you BLE device? More particularly **ATZ** or **ATT0** note: the last character is ZERO not “O”.

---

<div class="post-metadata">

**Author:** ![felipe.moriondo](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@felipe.moriondo](https://community.thunkable.com/u/felipe.moriondo)\
**Post date:** [April 28, 2021, 3:17am UTC](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439/20 "2021-04-28T03:17:30Z")

</div>

- Can you send anything from your BLE device and receive it in Thunkable?  
No I never got it.  
only with BLExAR App and DSDTech from apple store

- Can you send AT commands to you BLE device? More particularly **ATZ** or **ATT0** note: the last character is ZERO not “O”.  
yes, but i never tried to send these two commands

[Next page](https://community.thunkable.com/t/something-wrong-in-my-communication-through-ble/1241439.md?page=2)
