M Mike1970 Well-Known Member Licensed User Longtime User Apr 22, 2023 #1 hi everyone, I've an ESP32 and I connect to it using BLE. I want to send data in a fast way to control a ws2812 RGB led strip... but seems to be not possible.. there is a sort of delay. Just for testing I modified the original BLE Example by Erel to add a slider. Take a look at the video, when I stop sliding the data are still arriving... is there something I can do to improve the speed? I tried using "WriteData" instead of "WriteDataWithResponse" but in this way nothing is sent... BTW what is the point of "WriteData"? P.S. on ESP side there is only the simplest sample code with just the callback for incoming data... nothing else, what It get it prints thanks in advance Last edited: Apr 22, 2023
hi everyone, I've an ESP32 and I connect to it using BLE. I want to send data in a fast way to control a ws2812 RGB led strip... but seems to be not possible.. there is a sort of delay. Just for testing I modified the original BLE Example by Erel to add a slider. Take a look at the video, when I stop sliding the data are still arriving... is there something I can do to improve the speed? I tried using "WriteData" instead of "WriteDataWithResponse" but in this way nothing is sent... BTW what is the point of "WriteData"? P.S. on ESP side there is only the simplest sample code with just the callback for incoming data... nothing else, what It get it prints thanks in advance
Erel B4X founder Staff member Licensed User Longtime User Apr 23, 2023 #2 1. Are you testing in release mode? 2. Can you test it with B4A and an Android device? The code should be very similar. Mike1970 said: BTW what is the point of "WriteData"? Click to expand... I don't remember the exact details but not all writable characteristics support the "write with response" method and the same is true for "write without response". Upvote 0
1. Are you testing in release mode? 2. Can you test it with B4A and an Android device? The code should be very similar. Mike1970 said: BTW what is the point of "WriteData"? Click to expand... I don't remember the exact details but not all writable characteristics support the "write with response" method and the same is true for "write without response".
M Mike1970 Well-Known Member Licensed User Longtime User Apr 23, 2023 #3 Erel said: 1. Are you testing in release mode? Click to expand... Yes, it is the same, but read till the end Erel said: 2. Can you test it with B4A and an Android device? The code should be very similar. Click to expand... No because I think I just found the answer, in case I will update the thread Erel said: I don't remember the exact details but not all writable characteristics support the "write with response" method and the same is true for "write without response". Click to expand... Yes, I asked chatGPT for the difference and it answered back that with PROPERTY_WRITE the esp32 sends back an ACK, with PROPERTY_WRITE_NR (no response) it does not send the ACK... faster but not 100% reliable, its like TCP vs UDP So the effect on B4X side is the activation or not of the manager_WriteComplete sub. So, I changed the code of my esp32 to have the PROPERTY_WRITE_NR instead, and in this way the data transfer is MUCH faster, but as I said the WriteComplete sub is now useless Upvote 0
Erel said: 1. Are you testing in release mode? Click to expand... Yes, it is the same, but read till the end Erel said: 2. Can you test it with B4A and an Android device? The code should be very similar. Click to expand... No because I think I just found the answer, in case I will update the thread Erel said: I don't remember the exact details but not all writable characteristics support the "write with response" method and the same is true for "write without response". Click to expand... Yes, I asked chatGPT for the difference and it answered back that with PROPERTY_WRITE the esp32 sends back an ACK, with PROPERTY_WRITE_NR (no response) it does not send the ACK... faster but not 100% reliable, its like TCP vs UDP So the effect on B4X side is the activation or not of the manager_WriteComplete sub. So, I changed the code of my esp32 to have the PROPERTY_WRITE_NR instead, and in this way the data transfer is MUCH faster, but as I said the WriteComplete sub is now useless