Closed giorgioinfo13 closed 5 months ago
Solution found! The "problem" was here
pRXCharacteristic->writeValue(data, 18, true);
I changed with
pRXCharacteristic->writeValue(data, 18, false);
And all is working
Glad you found it, yes you need to check if the write mode you are using is supported.
Hi everyone, I have a problem using the Bluetooth library NimBLEDevice.h for Espressif ESP32-WROVER-E I describe the problem: I have to initialize a NimBLEClient (master) on ESP32, this must connect to one of my server devices (slave).
I use a communication protocol called Transparent UART, I attach a link to help you understand what it is
https://microchipdeveloper.com/xwiki/bin/view/applications/ble/android-development-for-bm70rn4870/transparent-uart-service-for-bm70rn4870/
Long story short, when I write a value on the server's RX characteristic (which has WRITE properties), I receive a response callback (as I rightly expect because I have previously registered the TX callback which has NOTIFY properties). If I then sequentially write a second value on the RX characteristic, I do not receive a second callback from the server.
Why?
I wrote the bluetooth firmware of the server device and I am sure that it is sending the second callback correctly. When I connect to this server via a smartphone app everything works correctly, whereas if I use the NimBLEClient library from ESP32 I do not receive this callback. I attach a test code that shows the problem (maybe it helps to make you understand better) and also the output I receive. I expect that after sending the second command "Data sent." will be printed on the screen. exactly as happens with the first, but this doesn't happen. Is it possible that after calling the ->writeValue() function a second time, the memory is full?
Thank you in advance!
Output:
Starting BLE Client... Connected! writing first command on RX Server
Writing command: [8 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0] Data sent. Callback from TX server: [5 5 0 4C 2B E6 45 56 F7 FD 11 89 95 6C 3F 3D 53 AA] writing second command on RX Server
Writing command: [8 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0]
Code: