Hi all,
I am working on an application that visualises sensor data in real time. An ESP32 collects the sensor data and sends 18-byte packets over bluetooth serial to the PC, using python and the Qt framework for the GUI. The ESP32 bluetooth latency is fairly inconsistent so I want to limit the packet overhead to achieve the required throughput. I am currently transmitting the data at 500Hz but hoping to increase that towards 1kHz. Using 2-bytes as start-of-frame and another 2 for end-of-frame, I have a crude way of synchronising and delimiting my packets but I still get framing errors. I am fairly certain ASCII-encoding is too much overhead for the ESP32.
I have looked into COBS encoding but the 255 byte-lookahead is not ideal and I am not overly confident in implementing the buffer for that (C++). SLIP encoding also looks interesting but I am wondering if the non-constant packet sizes from byte stuffing will cause more troubles for the bluetooth serial communication than a constant-overhead communication protocol. I can live without a checksum/ CRC for what I am trying to do.
What framing algorithm/ communication protocol would you recommend for transmitting fixed-length 18-byte packets at the desired 1000Hz?