How do I read Bluetooth Low Energy transmitted data programmatically on Mac OS X 10.9.5? - macos

I'm trying to read Bluetooth Low Energy transmitted data programtically using Ruby. Bluetooth Low Energy technology provides no support for the Serial Port Profile (SPP) in the standard Specification v4.0.
With older Bluetooth communication methods, one can just read the serial port for Bluetooth incoming data (/dev/tty.Bluetooth-Incoming-Port). Clearly, this won’t work for Bluetooth Low Energy, given it works almost completely differently.
I came across a few tools like LightBlue and XCode Hardware IO tools to read the data transmitted by the said Bluetooth Low Energy device but I’m not sure how they work. Can somebody help?

Reading up on fundamentals really helped me a lot. Here's a link to great post explaining BLE basics. Having understood this, on OSX I ended us using noble to establish connection and read BLE transmitted UART data using another library using noble called blendmicro.
We didn't use blendmicro BLE chip but still were able to use blendmicro-node library. If you read through blendmicro.js, it's easily modifiable to suit any BLE chip that uses UART for data transmission.

Related

Android Things and NFC

I'm running Android Things on a Raspberry Pi 3 Model B. I want to read NFC Tags, is it possible to do this? I've got like zero hardware knowledge about this stuff. All I know is how to write the necessary code.
A Raspberry Pi (or the other Dev kit) does not have NFC hardware. If you want to read NFC tags you need to get some hardware.
In addition to that, there is not user space driver for NFC, so you'd need to read it using a driver.
I only know of 2 chips that are sort of supported, both drivers are very limited. In fact, the simplest way to get them to work is to plug then into an Arduino and then communicate with the Arduino either using UART or I2C.
The best supported chip is RC-522. It reads mifare, but not sure how many other formats. You have a driver ported from arduino here: http://github.com/Galarzaa90/android-things-rc522
One of the important limitations is that it does not support card emulation.
I've had success with the ACR122U running over USB. It supports Mifare.

Installing Eddybeacon

As far as I understand eddybeacon (just released by Google) is effectively a new 'operating system' for Bluetooth 4.0 Low energy devices (iBeacons). I have been experimenting with iBeacons for sometime now and want to try out a few things with eddybeacon. Has anyone had a go with it yet? I've read a few sites and they say it can be installed to some devices... Can anyone share how to do this?
If you want to start out by playing with Eddystone, you have a couple of options:
You can use a software transmitter. Just download my free Locate App in the Google Play store which will both act as an Eddystone transmitter and decode other Eddystone-compatible beacons in the vicinity. Google also has posted an Android app that can transmit the Eddystone-UID frame here, but you have to compile it yourself.
You can get a few hardware beacons for testing with a Developer Kit from Radius Networks (my company) here.
Once you have a transmitter, you can try writing some software to work with it. Here's a tutorial I wrote on how to build a basic Eddystone-capable Android app.
One other thing that might be useful is an Eddystone detector tool. You can use the free Android Locate app to detect and decode all of the frames transmitted by Eddystone.
So:
Eddystone is a specification for Bluetooth Smart (usually just called BLE) devices to behave like beacons — it defines the Bluetooth frames and content they need to broadcast to be seen as beacons.
iBeacon is not a generic term. iBeacon is actually Apple's specification for Bluetooth beacons. Eddystone and iBeacon are both examples of beacon specifications for BLE devices.
There are a few ways to get started with Eddystone beacons.
a. A number of hardware manufacturers sell developer kits that will let you get started with Eddystone beacons right away, and there is plenty of example software out, either from those vendors, or from the google pages on GitHub — github.com/google/eddystone and github.com/google/beacon-platform.
b. Some people have had good luck with Arduinos and Raspberry Pis. You can see an Arduino example here (Note: I have no idea how well that project works, I've just seen it used a few times.)

Is Serial Port Profile (SPP) supported on iOS 7 over Bluetooth Low Energy (v4.0)?

Can I use Serial Port Profile (SPP) to communicate with iOS devices over Bluetooth Low Energy (v4.0) without the need for MFi Chip?
If you're designing something from scratch (rather than trying to interface to an existing SPP-enabled device), there is a possible solution.
Laird Technologies make a Bluetooth Low Energy Module (BL600), which can be loaded with a virtual serial port application. This creates a service which is similar to the SPP; at the remote end it can just be treated as a plain serial port (albeit rather low speed). You could roll your own service to do something similar on other devices.
It's not the most elegant solution, but seems to work okay, and far easier than trying to get MFi certification.
If you cannot control the peripheral's protocol choice:
The Serial Port Profile (SPP) is still supported by Bluetooth 4.0. However, Bluetooth 4.0 Low Energy uses different pysical and link layer protocols that are not backwards compatible with older Bluetooth standards. Current iOS and Android devices use "dual mode" interfaces that support the backward compatible part of BT 4.0 and the Low Energy standard.
Bluetooth 4.0 Low Energy does not support SPP whereas regular Bluetooth 4.0 does!
I found a Cordova/Phonegap Plugin on GitHub that might serve as a source of inspiration for you. They advertise to support SPP on iOS and Android alike.
If you are in control of the peripheral, i.e. you implement the peripheral's software:
Bluetooth 4.0 Low Energy communication makes use of the Generic ATTribute Protocol. Based on GATT there exist a number of profiles but no serial port profile.
The good news is that implementing your own proprietary serial port profile on iOS, Android and your device is fairly simple. The API instructions for your BTLE module/SoC should provide some examples for existing profiles.
As soon as you see how simple implementing your own profile is, you will probably choose to go for a more use case specific profile which will save you lots of power on your (battery powered?) peripheral.
Just to clear up John Parsons comment from Feb 16th - the BL600 is definitely not discontinued whatsoever.
vSP works well for a low level, low throughput data connectivity using BLE for iOS devices, as well as Android. Video showing the solution working to an iPad are at this link and full source code is available for the iOS application as well http://www.lairdtech.com/Support-Center/Technical-Library/Videos/VSP-Bridge-Command/#.UwYvzGJ_s1w
There are no MFi requirements for BLE connectivity on iOS.
MFi is only relevant to Classic Bluetooth data connections to / from iOS devices, where you need to use Apple's iAP protocol, be a MFi licensee, use an external Apple Authentication IC and pay a royalty to Apple.
NO,you can't. BLE not support SPP.
No, you can't. In general, it's important to remember that any Bluetooth Classic profile isn't necessarily applicable for Bluetooth Low Energy. With BLE however, you can easily create your own custom service/profile, specially tailored towards your particular application. As far as I know, all BLE communication with iOS is currently allowed without participating in the MFi. You can also take a look at this page for further information on SPP and BLE.
I'm searching for SPP for iOS myself and found a German supplier, lintech.de, that has products for "Bluetooth meets Apple" claiming to support/emulate SSP, apparently using their own embedded software layer combined with iAP. "BlueMFI software communicate with APPLE devices using the iAP (iPod Accessory Protocol) and manage the data communication with the Apple authentication chip...BlueMFI software is designed to run on a variety of hardware platforms (Bluetooth modules), and interested users can obtain the relevant evaluation kits. LinTech’s Bluetooth modules with BlueMFI software not only support the APPLE iAP protocol via Bluetooth, but they are also able to communicate with standard Bluetooth devices." Haven't tried this yet, just exploring and sharing.
I won't say SPP is directly supported under iOS 7, Apple says no. Won't argue :)
But...
I use connectblue modules OBS421 and OBS425 on a data collection project.
BLE modules have SPP profile enabled and I transmit data from my sensors to the iOS devices using BTLE module in SPP mode.
Works pretty fine under iOS 6 and 7
That said, I was having trouble with MFi bluetooth devices under iPhone 5S, that's why I moved to BTLE.
Drawback with BTLE, it's limited to 20 bytes at a time.
I had to adjust hardware and software, but was easy.
You have programmable chips such as Bluegiga BL112 that are doing the job. It is the cable replacement code.
I'm integrating it actually for both iOS and Android 4.3. It works at least on the demo board.

Bluetooth Low Energy does it require additional hardware controller?

Sorry if the question is very basic.
What I know?
Bluetooth Low Energy is supported in the blutooth version 4.0. and it is a client server model. That is server is kind of advertiser, and client is a receiver.
My Question.
1) Does both the device [ client/ server] needs external hardware bluetooth chip support for BLE?
Or,
It is just enough only server to have external hardware bluetooth controller for the BLE?
2) Why i am asking this question is that Bluetooth 4.0 is just a different implementation algorithm comparing with classic bluetooth, in all layers of the bluetooth stack, to avoid energy consumption. In that case, what is the contribution of external BLE controller?.
Yes, both the devices needs bluetooth 4.0 chip to communicate for BLE.None of the BLE communication can happen over classic bluetooth, check wiki link and differnce, BLE has low data transfer rate as compared to classic bluetooth

Accessing an Ethernet or USB port

Good Afternoon,
This post is to ask for ideas on which programming language for Windows Vista you would suggest for accessing raw data from an Ethernet port or a USB port. My strength is in micro-controllers. I have a project underway where the 32-bit micro-controller is the last processing device in a software defined radio. The micro has the capability to output digitized signals over a USB port or an Ethernet port. I would like to use the PC as a plotting tool to display the raw digitized sound as a waveform on the screen and possibly play the sound on the sound card output. Also, I will be creating FFT spectrum data, either in the 32-bit micro or in the PC, if the software is fast enough, for spectrum display on my laptop.
I have past experience with older VB. In my last project, I used a simple basic program (JustBasic) to send control data via a USB/RS232 device to a micro-controller. This interface is certainly not fast enough for this project. Additional future features would be to use the Ethernet or USB to control real time features i.e. filter frequencies, FFT size and sample rates in the micro-controller. Any help is appreciated.
Microsoft provides the Raw Input API to get data straight from a USB device. You could use C# to access the port (see here), or any other .NET language. You could also use C or C++ (see here).

Resources