Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Communicate between iOS app and Raspberry Pi via Bluetooth

I'm trying to communicate between an iOS app and Raspberry Pi using Bluetooth. The Raspberry Pi is using a Python script for this purpose.

I was originally using the PyBluez library, however this does not support Bluetooth LE and thus can't be used with CoreBluetooth on iOS.
My next solution was to use the private BluetoothManager framework to communicate with the Pi, but this doesn't work on iOS 7.

I've researched a bit more and have seen suggestions for manually sending/receiving LE packets with PyBluez, but this seems incredibly complex and I really have no idea where to start.

So at the moment, I'm stuck. I need either:

  • A solution to communicate with a non-LE Bluetooth device via iOS, or
  • A solution for advertising and communicating as a LE device on the Raspberry Pi via Python
like image 680
ttarik Avatar asked Nov 09 '13 00:11

ttarik


People also ask

How do I connect my iPhone to my Raspberry Pi via Bluetooth?

Go to Settings->Bluetooth, and set Bluetooth to “on”. At the bottom of your screen, you'll see the text “Now Discoverable”. If the device you're pairing with isn't discoverable, the Pi isn't going to see it. In the case of the iPhone, it's only discoverable while this screen is active.

How do I transfer data to my Raspberry Pi via Bluetooth?

Just press the Bluetooth icon, and select your phone Bluetooth. 4. After pairing the Bluetooth, add the python script directly into the Raspbian by typing the nano command and copy/paste the source code, or you can directly copy the run.py file. 6.

Can you control Raspberry Pi with iPhone?

You will be able to control the LED on/off on Raspberry Pi board from iPhone/iPad. You will learn how to: Set up the network connection between Raspberry Pi hardware and iPhone/iPad. Configure and run a Simulink model for Raspberry Pi hardware to receive UDP packets from iPhone/iPad.


1 Answers

One option is to buy a USB dongle with a BLE stack in it already.

We have used the Laird BL620-USB, flashed with BL600 firmware to operate as a BLE peripheral.

Having BLE stack in the dongle means it can be communicated with from the Raspberry Pi like a simple USB serial port, without using any linux Bluetooth stack.

BL600 includes the Nordic / Laird proprietary Virtual Serial Port Profile already, so you can achieve the simplicity similar to the classic Bluetooth SPP, even when communicating to an iOS device.

Laird will provide iOS and Android code to use the VSP on the mobile side.

Other BLE module makers probably do the same.

like image 167
Mark Ch Avatar answered Sep 19 '22 04:09

Mark Ch