1
votes

I need to transmit multiple 8-byte-packets over bluetooth-serial link. I am using JY MCU bluetooth-serial module. On the PC side, I have a C# application running that communicates with the COM port.

Considering 115200 baud, each 8 byte packet should take 8*8/115200 = 0.555 milliseconds.

The problem is that one in every 4 packets takes up to 39 milliseconds which completely destroys all the timing.

For measuring times, I am using stopwatch component of .net framework. output from C # application:


Sample # 583 : 39.126841990471 ms

Sample # 584 : 0.7883273789593 ms

Sample # 585 : 0.93885067781563 ms

Sample # 586 : 0.884708368788226 ms

Sample # 587 : 8.65278575619526 ms

Sample # 588 : 1.05558303203074 ms

Sample # 589 : 0.870116824511337 ms

Sample # 590 : 0.888932236868378 ms

Sample # 591 : 39.0876752137277 ms

Sample # 592 : 1.02639994347697 ms

Sample # 593 : 0.820198383564084 ms

Sample # 594 : 0.960737994230964 ms

Sample # 595 : 15.2051571125331 ms


Note that each sample contains 8 bytes of data

1
Does consistency go up if you lower your baud rate? On a similar note when I switched to using bt 4.0 I noticed better connection times. Are you using the same bt versions on both host and client?Robert Snyder
Baud rate of this module can't be changed with software. i will visit lab tomorrow and see if consistency changes. Not too sure about bt versions right now :(Faisal

1 Answers

0
votes

Dogma #1: There is no such thing as a guaranteed timing in the bluetooth world.

Just consider a device dropping a frame (e.g. because your microwave oven just switched on) - the time to understand the frame as lost is substantial. Additionally the connect/disconnect as shown in your first sample is lengthy. If one of the devices uses e.g. a bluetooth mouse or is discoverable, all bets are off.

Long story short: Bluetooth messages have no consistent timing - if you want to keep timing information, include a timestamp in your payload.