For a my project I've implemented in Micropython on two ESP32-C3 a BLE server with two buttons that based on which button is pressed send two different commands to a BLE client that then drive two different strips of ws2812 led.
Both codes seems work quite well but the problem is that sometime also if the buttons are pressed
and the relative isr is activated , for some reason the client dosen't receive any command.
Due that I must be sure the the command is received I would like implement on the client a sort
of aknoledge message to be sent back to the server as confirmation of received command , and in case the server
dosen't receive an aknoledge within a certain time send the same command again.
To do that I've implemented in both side (client and server ) two additional characteristics to be used only
to communicate/recive the ack message . On the Client code I simply write a value in the characteristic ,
as is
Code: Select all
left_characteristic_ACK.write(b'ok_l', send_update=True)
I've also tried to encode the ack message in UTF-8 without any change
Now my doubt is if the client after have estabilished the connection with the server can send back some data to the server or the data flow must always go from server side to client.
If usefull I can post the omplete codes.
Tks.