Bluetooth Dongle and iOS Simulator - bluetooth

I have bought an IOGEAR GBU521 bluetooth dongle as per the instruction on Apple's technote:
http://developer.apple.com/library/ios/#technotes/tn2295/_index.html
I have also configured it as instructed and I'm trying to get the temperaturesensor demo to work but the Bluetooth under settings never seems to turn on (keeps spinning). Looking at the console, here is what I see:
2012-11-02 4:17:08.114 PM Preferences[862]: BTM: setting discoverable status enabled
2012-11-02 4:17:08.114 PM Preferences[862]: BTM: setting connectable enabled
2012-11-02 4:17:08.115 PM Preferences[862]: BTM: enabling device scanning
2012-11-02 4:17:08.115 PM Preferences[862]: BTM: failed to start scanning with error 111
Any thoughts? I've seen people ask about this but has anyone got this approach to work?
Best,

Throw away the IOGEAR and pick up a Cirago BTA8000.
I bought the IOGEAR you mention, in addition to the Cirago BTA8000, and the MediaLink 4.0 adapter. Turns out that anything based on the Broadcom chip won't work despite my MacBook having the exact same one built in, which means the MediaLink and IOGEAR don't work. My Cirago shipment just arrived this morning, and the Bluetooth slider in the iOS Simulator flicks to "ON" in less than a second.
If you want to experiment, I'd love to hear if other non-Broadcom chips work too.

I just bought a GBU521 from amazon to upgrade the BT in my MacBook8,3
I had the same problem of it not showing up. Reading the same article you referenced (TN2295) I did a sudo nvram bluetoothHostControllerSwitchBehavior="always" which tells the system to ALWAYS switch to a bluetooth controller if one is plugged in.
The default option:
when a new HCI is connected, the built-in driver only disconnects from the built in HCI and attaches to the external HCI if the new module is not an Apple module.
I presume that because the vendor IDs matched (0xa5c) that it was not switching over to the new dongle. Setting it to always causes OSX to always switch to a new BT adapter. This is confirmed by the following statement in TN2295:
Open the System Information application to verify that the system Bluetooth driver is matched to the built-in Bluetooth host controller interface (HCI). For the Hardware->Bluetooth setting, verify that the Vendor ID is "0x5AC".
Rebooting after the nvram update and I was able to re-pair all of my devices without incident.
HOWEVER this will not work for iOS BT LE development due to the following statement in TN2295:
If the system Bluetooth controller is matched to the Bluetooth LE USB adapter, then the iOS simulator will not be able to use the external Bluetooth controller for Bluetooth LE services.

Actually, you can mod the Info.plist inside the BroadcomBluetoothHostControllerUSBTransport.kext found here:
/System/Library/Extensions/IOBluetoothFamily.kext/Contents/PlugIns/BroadcomBluetoothHostControllerUSBTransport.kext/Contents/Info.plist...
Just copy another Broadcom dictionary and modify it or use the following additon to the Info.plist. You'll need to do this as an admin (i.e. sudo nano or vi this file after making a copy of the original).
<key>Add an appropriate name here</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string>
<key>IOClass</key>
<string>BroadcomBluetoothHostControllerUSBTransport</string>
<key>IOProviderClass</key>
<string>IOUSBDevice</string>
<key>idProduct</key>
<integer>8680</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
May need to reboot after the edit. Did this on 2012 MacBook Pro, ran XCode, and it allowed access to the Bluetooth dongle in iOS Simulator!
I hope this helps!

Related

Bluetooth Firmware Update

I have a BLE module that i'm trying to update the firmware in, but having a lot of problems connecting the recommended update software (ISupdater). All I get is 'connect failed' message. There seems to be no troubleshooting information available, so I hope that someone has run into the same issues and solved it.
For the hardware setup, I'm connecting to a PC via a USB-USART serial adapter board. I have the 3.3V, GND, reset switch, mode switch, USART connection from the RN4870 BLE module connected as per the microchip connection diagrams (https://microchipdeveloper.com/ble:rn4870-app-example-fw-upgrade). I have verified many many many times that my connections are correct.
Connection Diagram
To test the BLE connection and data transfer I have mobile devices (iOS and Android) with the recommended apps (SmartData, mBIoT). I can see the BLE broadcast in the bluetooth lists, and I can connect to it to use the apps.
For the RN4870 module, I'm able to connect to CoolTerm software to test that I'm getting communication between the terminal and a mobile device. I'm able to send and receive data on the CoolTerm terminal, and on the mobile device apps, so that suggests to me that the USART adaptor is working correctly, and so is the BLE module.
In CoolTerm, I'm able to enter the CMD mode for the RN4870 module to set and read settings of the module, so I can check and set the baudrate to the default 115200.
If I use a BM70 module (which is the same hardware as RN4870 but different firmware), i can't enter any CMD mode, or do any sort of reset. The data is still able to be sent and received, so that confirms the baud rate is correct.
When I attempt to connect to either BLE module using the ISUpdate software that is recommended in the update steps to use as the firmware updater, I'm not able to connect to the module to update the firmware. I've tried many times to get the software to connect, many different ways, without success, and it's frustrating to no end.
I've updated the MCP2200 drivers to the latest ones from the microchip website, as well as using the latest versions of the CoolTerm and ISupdater. I've also tried previous versions, but still they all have 'connect failed'
ISupdater Image
has anyone got any solutions to the issue?
PC: Windows 10, 64-bit
BLE Modules: RN4870, BM70
CoolTerm Version: v1.8.0 (build 861)
ISUpdater Version: v4.0.0.207
IS187x_102_BLEDK3v1.11_UIv1.01 for Windows 10
Mobile Apps: SmartData, LightBlue for iOS, LightBlue for Android, mBIoT
Hmm, well it turns out that the USB-USART serial adaptor (although confirmed to be working correctly) seemed to be the problem.
At first, I only had the 1 adaptor, and I had to borrow a different adaptor. After swapping this FTDI232 USB-USART Serial adaptor, the connection was made first try, and I was able to update the firmware. I have now purchased a new adaptor.
So, if you are having the same trouble, try using a different adaptor.

Establish a connection between smartphone and PC via Bluetooth automatically

I'm trying to establish a connection between my PC running Ubuntu and my iPhone via Bluetooth automatically when it becomes available, after being manually paired beforehand. I've seen this to be possible with certain peripherals, mainly audio. For example, my phone will automatically connect to a Bluetooth speaker when it is turned on and Bluetooth is active on my phone; another example is my phone automatically connects to my car's radio system via Bluetooth when I turn the car on.
I'm not able to connect my phone to my PC without first initiating the connection from the smartphone's Bluetooth menu. I'm thinking that I could possibly write an application for the PC to attempt to connect to the device every few minutes or something, but it seems that the phone needs to be the device to initiate the connection.
The only information that I need for what I'm trying to do ultimately is that the devices can pair successfully. Essentially I'm trying to build a sort of proximity trigger between my phone and my PC without using Wi-Fi and GPS - I can't use these for some specific reasons.
Is there any way to make this happen?
Yes this should be doable as long as you use the Background Processing feature for iOS apps. In the example I'll give below, we'll have the PC be the peripheral and the phone be the central, but you can really have it working either way. You will need to do the following:-
First initial connection needs to be performed in the foreground (this is due to iOS's background limitations).
On the iOS side, you need an application that acts as a central that scans and connects to the remove device (check this example as a starting point).
Upon connection, you need to bond with the PC. Bonding is important as it will prevent you from having to do the pairing again in the future. However, pairing/bonding is managed by the iPhone's OS so you cannot write it in your application, so the workaround is to have an encrypted characteristic on the PC side that will force the iPhone to bond (this is covered later).
On the PC side, you need to have a BlueZ script that acts as a peripheral that is always advertising. You can do this using bluetoothctl (check the examples here and here).
Before you start advertising, you need to have a GATT server on the PC side (to do this, check this example).
When registering characteristics, ensure that one of them has the encrypt-read property (you can find a full list of the properties here).
Now when you attempt to read this characteristic from the iOS side, the two devices should bond (make sure that your PC is bondable which you can do this via these commands).
Once the devices are paired, your iOS app needs to be working in the background constantly scanning and attempting to connect to the same peripheral (have a look at this and this example).
You can find more useful information at the links below:-
Getting started with Bluetooth Low Energy
The Ultimate Guide to CoreBluetooth Development
How to manage Bluetooth devices on Linux using bluetoothctl

How to get into and add features into a cheap Bluetooth smartwatch that I bought?

I bought a cheap bluetooth smartwatch that costed like $20.
When I plug it into my computer, I cannot see the device listed. I cannot think of any other way to access the source code.
The reason I am trying to get at the source code is to add a few of my own watch faces and try to create my own features.
Any help?
I guess under "plug in" you meant you've plugged it in the USB charging port. Most probably communications are disabled there by a default and the port is in charging only mode.
Try to pair it with your laptop via Bluetooth first, then try to access your watches as a bluetooth device (there is an option for the file transfer, for example, for windows see here: https://support.microsoft.com/en-us/help/4026874/windows-10-share-files-over-bluetooth).

Windows 8.1 Bluetooth searching issue

I have a windows 8.1 based lap top which supports Bluetooth.
I wrote a java based bluetooth server which gets connections from Android.
The issue is, the device sometimes get invisible(or to say not shown) on android devices.
I've tried with other laptops or Android phones, but sometimes it just doesn't get searched.
I think it's not about my java server program. Even if there's a problem with my program, it should at least be shown on the bluetooth search list of other devices.
I found a very crude solution about this issue.
Always running the 'change pc settings(not the exact name)' app of windows 8.1, and going to 'PC, devices' -> Bluetooth makes it always searchable. If I turn this off(I mean the 'change pc settings' app, not turning off bluetooth), the bluetooth cannot be found by other devices.
Why is this happening? My purpose is, bluetooth server must be turned on automatically after boot, but the reliability of the bluetooth device is failing my intention. However, since my crude solution above is temporarily solving my issue, I do not think it's a hardware issue.
So, my question is :
1) Why is this happening? And how can I mend this?
2) How can I run windows metro app through windows shell? If I can't find any other solution about this, I will have to write a batch script to always run the solution thing above.
Going to Change PC Settings>PC and devices>Bluetooth is initiating a Bluetooth device search. As a side effect, the Bluetooth is also made Discoverable (pairing mode). However, this Discoverable setting is temporary, only while the PC is searching for remote Bluetooth devices.
If you wish to keep Bluetooth Discoverable at all times, you need to check the "Allow Bluetooth devices to find this PC" button box, found in Bluetooth Settings. I found Bluetooth settings by right clicking the Bluetooth system icon. Can also be found in Devices and Printers, by right clicking the Bluetooth adapter icon.

Bluetooth support on Android Emulator

I want to know if the developer team which made the emulator have some information to make bluetooth work in the Android emulator, indicate some links about it, if they have some date for release or if they'll make it works in the future.
as far as I know there is no support in the emulator for bluetooth. And I will have to teach android and bluetooth in some classes. And the students will need to code stuff and test (guess it) in the android emulator.
So I came up with a bare-bone reimplementation of the android bluetooth API on top of tcp. You can find it on here on github.
Basically, you run a tcp-server on your machine, and the emulators will connect through it.
Instead of using the classes in the package android.bluetooth, you just need to use the classes in the package dk.itu.android.bluetooth (and other 2 little modifies).
As for now it supports:
switch on/off the "radio"
discovery devices (only other android emulators)
creating bluetooth services
connecting to bluetooth services
It's not much, but until we got some more from the android guys, I guess there is nothing else around.
Hope it'll be useful, cheers!
The documented bluetooth limitation appears inconsistent with the qemu -bt option. So, how is bluetooth enabled in the emulator so the -bt options can be used, or at least to know that bluetooth is supported?
The target/board/.../BoardConfig.mk having "BOARD_HAVE_BLUETOOTH := true" doesn't provide a bluetooth icon or enable bluetooth. So, how do we turn on bluetooth on the android qemu emulator?
What does it mean that bluetooth is not supported given the -bt option for emulating USB devices that were provided in 2008? The post and limitations are outdated.
The functional limitations of the emulator include:
No support for placing or receiving actual phone calls. You can simulate phone calls (placed and received) through the emulator console, however.
No support for USB connections
No support for device-attached headphones
No support for determining network connected state
No support for determining battery charge level and AC charging state
No support for determining SD card insert/eject
No support for Bluetooth
http://developer.android.com/tools/devices/emulator.html#limitations

Resources