1

I run a mqtt server on raspberry pi 3B together with a mqtt client on android handset. A data sequence will be transferred from the server to the client by TCP.

I enabled ip over bluetooth on raspberry pi 3B following the answer of How can I set up a bluetooth PAN connection with a Raspberry Pi and an iPod?

However, the transfer speed is much slower than wifi connection. It took about 5 seconds to transfer a length 8192 integer sequence, while wifi costs about 0.5 seconds.

This is how I implemented mqtt TCP https://stackoverflow.com/questions/56165209/mqtt-transfer-speed-much-slower-when-data-size-increases-on-tcp.

I cut off the wifi power with rfkill block wifi, and move the handset right next to raspberry pi, which improve the transfer speed a little. But it still takes about 3 seconds to transfer a length 8192 integer sequence.

I am wondering whether the setup of ip over bluetooth is not right, or something else I have missed.

Please advise, thanks in advance.

exds75
  • 11
  • 2

1 Answers1

2

I'd be inclined to wonder why my WiFi was slow instead of Bluetooth. Just as a rough figure of merit, WiFi could be 300x faster than Bluetooth (ref).

And with respect to, 3 seconds to transfer a length 8192 integer sequence:

  • The ref indicates Bluetooth data rates can be as much as 2.1 Mbps, but also says there's a 200 msec latency. Could you be incurring multiple latencies due to the way in which you're transferring things?

  • What exactly is a is a length 8192 integer sequence... how many bits is that?

I'm afraid this is not really an answer, but more of a reminder that measurement of transfer rates, and comparison to published specifications is an endeavor that requires a fair amount of specificity. 3 seconds seems a bit long to me also, but your question may be lacking enough detail to allow anyone to offer a reasoned opinion opinion, much less a specific answer.

Seamus
  • 18,728
  • 2
  • 27
  • 57
  • thank you for the suggestion. I gave up this ip over bluetooth idea, and instead setting up a wifi Access Point following the below weblink https://learn.sparkfun.com/tutorials/setting-up-a-raspberry-pi-3-as-an-access-point/all – exds75 May 19 '19 at 02:00
  • @exds75: Apologies! Did not mean to discourage you, but the question couldn't be answered (well) as it's written, and so I was only trying to prod you into thinking through it a bit more. Before you get too far along with the sparkfun video, you should [check out Ingo's Q&A here on this site](https://raspberrypi.stackexchange.com/questions/88214/setting-up-a-raspberry-pi-as-an-access-point-the-easy-way/88234#88234). [He's a good man - and thorough](https://www.youtube.com/watch?v=JHt2szt8pRs) :) – Seamus May 19 '19 at 03:25