[Solved] BLE error "Operation was rejected" with BT-20

I use bluetooth module DX-BT20 + Arduino Uno and I try to get data from arduino by use BLE receive block but only get error “Operation was rejected”.

*Transmit block is not problem I can send data to arduino and it going well.

What are you running on the Arduino @dada.prasertsakitz3? SoftwareSerial.print () or Software Serial.write()?

1 Like

I want to get some int from Arduino’s ROM then I use SoftwareSerial.print ().

I solved this ploblem by use another Bluetooth module. I change from BT-20 to HM-10 and that work.

2 Likes

I’m using HM-10 too. And when i send data from my arduino. The app keeps giving the same error: “Can’t read the characteristic provided”. Can you help me with the problem.
Here 's my arduino code:
#include <SoftwareSerial.h>
SoftwareSerial HM10(2, 3); // RX = 2, TX = 3
String data;

void setup() {
HM10.begin(9600);
}

void loop() {
HM10.print(“b”);
delay(100);
}

Hello, i solved the problem.
My english isn’t so good, sorry, i am from Argentina.
The thing is that you are using a Characteristic on de BLE that isn’t READ. Most of the BLE modules have a Characteristic that NOTIFY when the register change.
I use a ESP32 with Arduino
Fist, i was having the error “operation was rejected” because I created a Characteristic as NOTIFY
I make it work when i defined the Characteristic as READ.
i hope it helps you because i lost several hours with this.

3 Likes

Thank you Gaston, you saved some time :).
So basically if you have this error, go and chack your MCU code and maybe you find something like this:
BLECharacteristic::PROPERTY_NOTIFY and change into PROPERTY_READ. It’s worked for me.

For error like this: Can’t read the characteristic provided, please consider to check your UUID. RX and TX and also device UUID are different.

I can confirm this works. Using an esp32, partially following the example at https://www.instructables.com/id/ESP32-BLE-Android-App-Arduino-IDE-AWESOME/

// Create a BLE Characteristic
pCharacteristic = pService->createCharacteristic(
CHARACTERISTIC_UUID_TX,
BLECharacteristic::PROPERTY_READ
);

My little thunkable app is now reading data sent by the esp32 over BLE.

I am using a ESP32 variant of ESP32 DOIT. I am able to connect but unable to read from the device. I attempted all the suggestion made here. Also, I got a ESP32 Thunkable tutorial and tried “as it is”, and it is able to send data but does not read anything back from ESP32.

I changed the BLE from “Receive String” to “Receive Byte Array” and I got this error “n is not a function. (In ‘n(void 0,l.t0.message)’, ‘n’ is undefined)”

I don’t know whatelse can I do to make it work.

Some news, I download an App called “LightBlue” used to test the Bluetooth LE connection. So far, my ESP32 is working fine as server and properly notifying the client. I was able to read my string from that app while I am unable to read it from Thunkable.

It looks like this is a bug in the Thunkable where I am not able to subscribe the notifier within Thunkable Bluetooth LE component as it works as expected with LighBlue app.

Where do I open a bug ticket against Thunkable Bluetooth component? Or to put a new request to add the notify functionality in the Thunkable Bluetooth LE component as it had in the Classic one?

Just to report my findings and my solution: ESP32 can be used as notification and reading (send data from ESP32 to App).

I had found two issues:

  1. x Thunkable is unable to attach to the notification system over bluetooth. It requires reading operation. Solution: send a message to ESP32 to be ready to be read in the following upcoming seconds by means of a regular read operation.
  2. I had hardtimes to understand ESP32 sometimes was not being configured in the “BLE read mode”. I found it out by using the LightBlue app. Solution: I cleared completelly the ESP32 memory by using its tool to erase the whole flash and reconfigured its partition to have more room for code.

Everything is working now. :slight_smile: