2

Hoping to get a nudge in the right direction :-).

I am writing a Java application that will run on a Raspberry Pi 4, embedded in a vehicle (headless, no keyboard). The client or central will be android or iOS.

I'd like the following:

  • ABSOLUTELY painless pairing - this is the most important point! You walk into range and you're automatically connected. NEVER a PIN verification prompt or "connection verification" prompt.
  • cannot interfere with connecting to the same BT profiles used by the car entertainment system (i.e.cant interfere with hands-free or audio profiles)
  • relatively small file transfers (about 500K) in a reasonable amount of time
  • when not transferring files I need to be able to send a few random bits that the server/peripheral will act upon.
  • battery life isn't really a concern
  • security is not really an issue

I've written some classic BT code using jSerial, but the raspberry pi has a few connection issues that make Classic BT seem unwieldy. The connection process requires acceptance of PIN codes, which the headless raspberry, buried under the hood of the car, is unable to validate. Disconnects/reconnects cause issues with the rfcomm/serial port. I can transfer files relatively quickly over SPP, but the connection/reconnection issues are a show stopper.

I've tried Classic BT with SSP ("just works" security ) and I still got a PIN prompt. :-(

BLE would seem to be an option with respect to the "no pairing required", but file transfer would be painfully slow (I'd have to create the file xfer process myself). Upside is that iOS does support BLE, though.

I've looked into wifi direct briefly, but even it requires connection validation from the server side (the appliance under the hood), so this is probably a no go.

Is BLE the best way to go and I just need to get used to the poor file transfer speeds? Any suggestions or libraries that handle xmodem or other guaranteed file xfer over BLE?

Thanks for any advice!

Regards,

Bret

Bret
  • 29
  • 1
  • 2
    BLE sounds like the way to go for me. Have a look at https://www.novelbits.io/bluetooth-5-speed-maximum-throughput/ to get an idea about the speed. It might not be as bad as you think! – Michael Kotzjan Apr 15 '21 at 05:53
  • 1
    Thanks very much! :-) Looks like I'll have to develop some file transfer protocol and go with BLE. Thanks for the advice. :-) – Bret Apr 15 '21 at 12:15

1 Answers1

2

If you want your device to work seamlessly with both iOS and Android, then your best bet is BLE indeed. This is because unlike classic Bluetooth and WiFi Direct, BLE is a lot more mature and suitable on the iOS platform, and you'll end up finding a lot more resources (prior to iOS 13, CoreBluetooth only supported BLE connections). Have a look at the links below for more details:-

You've done your research and you're right about the limitations of the different technologies above, although the speed has greatly improved for BLE since Bluetooth v4.2 which most devices now support. Have a look at the links below:-

The only remaining challenge is to implement an SPP-like mechanism for BLE, which I agree is not trivial, but there are many people who have attempted this in the past, and although there isn't a single recommended solution, you would also not be starting from scratch.

Youssif Saeed
  • 11,789
  • 4
  • 44
  • 72