Windows 8.1 Bluetooth Low Energy Behavior - windows

I'm looking into programming Bluetooh Low Energy on Windows 8.1 and have a few questions about its behavior on auto-reconnecting to BLE devices after the connection is termiated:
How long will this auto-reconnect feature timed out? Or is it as long as you subscribe to BLE notifications and attempt to read/write data to it?
Will it reconnect if I restart Windows and my application?
How many devices can Windows remember to reconnect? Is it as many as the number of devices my app can connect to?

Where did you read about auto-connecting algorithm for Bluetooth devices in Windows 8.1. As far as I know, it is not possible to perform any kind of auto-connection, so all connection establishment has to be done manually in Windows 8.1 Bluetooth settings.
If your device is in connected state and you restart your PC for some reason, it will still show your device in the list but as "Not Connected" state. So you manually have to remove the device, and then pair it again.
I made a test, where I connected to two devices and read notifications from them both at the same time. What do you mean by app ?. A Smartphone application or ?.
All in all there is a lack of efficiency using Windows 8.1 for BLE applications, since all scanning and connection establishment functionalities have to be done in Windows 8.1 settings rather than in your Windows application, which restricts some important algorithms like auto-connection based on RSSI values and so on.

Related

Serial Communication on Windows 7 via Bluetooth has intermittent data loss

Currently I'm working on a portal device, which communicates with Windows via bluetooth serial communication.
It works fine on windows 10.
But on windows 7, things get strange, the communication is not stable, sometimes it runs well for a whole day, sometimes it lose data frequently. The bluetooth driver version on two platforms is the same. I have no idea how to solve it.
Are there any reasons?

Maintaining a Windows Bluetooth Connection

I'm manufacturing a device that connects to my computer using Bluetooth and then a desktop Java app uses the Bluetooth connection to send serial data to the device which is then displayed.
When I try to connect my device to windows 7 it successfully finds and pairs with it creating a Bluetooth link on a COM port. This link can then be used by a serial prompt (used for testing) or my Java application. It works initially however soon after windows drops the connection and the only way to reconnect is to delete the device within devices and printers and then reconnect.
This seems to be a known problem with windows bluetooth so I decieded to use a third party Bluetooth application. I downloaded and tried Toshiba's Bluetooth Stack and it was able to add a Bluetooth device and keep a stable connection which works great however this only works for Toshiba computers without getting a cracked version.
This device is commercial and can't be sold with cracked versions of software. Has anybody experienced the same problems or not in other operating systems and has any solutions of advice as that would be a tremendous help.
This is not a good idea/method to use the COM ports generated by Windows, it's not working fine and not reliable in any scenario ; you should use Bluetooth Sockets instead.
Using Toshiba or Widcomm or BleuSoleil won't help: under Win7, all dongles are now trying to use the Microsoft Stack, not their own implementation.

How do I connect a Windows Phone device with an Arduino?

I want to capture distances from sensors, using an Arduino and a Windows Phone device. How can I do that?
The Windows Phone 7 SDK does not give access to the USB port or Bluetooth on the phone, so you can't use that. So I think the best way (and probably only way on Windows Phone 7) would be to communcate over Internet or local network with the Arduino acting as a server which the Windows Phone 7 app connects too.
Here are some examples of an Arduino web server and TCP server.
For the Windows Phone client I would check out either WebClient or sockets.
Windows Phone 8 SDK:
Consider establishing an App to Device communication through Bluetooth API which became available for developers in the release. Bluetooth App to Device application sample, available on MSDN, is the way to go.
There is another option in Windows Phone 8, using Proximity (a set of classes which works with NFC), which is more applicable for a short range communication.
As for Arduino, there is certainly a Bluetooth module.
Windows Phone 7 SDK:
No way to establish a peer-to-peer communication with a third party device. A workaround would be to connect them through a network, as was proposed by Johan.
I have actually made a Windows Phone 8 App that connects to an Arduino using the Sparkfun Bluetooth Silver Modem. Issues is, even after I get them connected, I can't get either the Arduino to receive the input OR I can't get the WP8 App to successfully send to the Arduino...
My GitHub for the project is: https://github.com/lanceseidman/Arduino-Bluetooth-WinPhone8
Hoping everyone can try and help on the project.
My Breadboard photos will be up soon and my Arduino Code.

Force cellular data when connected to the PC over USB

I am debugging my Windows Phone app for some crashes that I can only reproduce when I am using cellular data connection. But when I connect my phone to the PC to debug the crash in Visual Studio, my phone is using my computers (fast) Internet connection and I can't reproduce the crashes then. This is probably somehow related to the slowness of the cellular data connectivity or something...
So is there a way to force the app to use cellular data connectivity even if the phone is connected to the PC over USB?
Or alternatively, can I somehow get some stack traces off the phone when I test it while it's disconnected from the PC?
Usually I just turn off the wifi on my PC and on the phone. Pretty simple solution. :)

Windows Phone - Application crashes when disconnected from PC

Whenever I disconnect my Windows Phone from PC (connected through USB) and if my application is running, my application hangs for sometime and then application crashes.
Does anyone experienced same behavior? I guess switching for PC connection to Wi-Fi/GPRS is causing the issue.
the windows Phone Requires that you Safely Remove hardware first, after a few times when i started Development on the windows phone i did the same and Ended up getting a new Phone. So plainly put, try to Safely Remove and Make sure it is installing the app to the Device.
Meaning if you Remove the phone, the App is still able to be ran just like a normal downloaded App form the Market place.
if you want more in depth information, i would suggest Reading the WP7 Everything Programming ebook lol
its filled with good information, and Definitely Helped me along my road to Love DEV for WP7.
As gamernb says, if you disconnect the USB from a properly tethered Windows Phone (i.e. connected to Zune, or using the WPConnect utility), the phone's network connection will be reset and your app's connections will be terminated. The phone will then start trying to connect using WiFi or cellular data (if they are on), but this can take quite a while.
You will have to handle this network disconnection in your app - I've found that pulling the USB cable in this way is a good ad-hoc test for WP7 apps: do an action which you know will use the network connection. Then watch if the app crashes, or handles this gracefully.
Actually you aren't guaranteed to always use the PC data connection: if you make sure that the computer has no data connection (i.e. pull the Ethernet cable, turn off WiFi etc ), the WP7 app can then use cellular data or WiFi on the phone instead.
Alas-
you could set perimeters in your application to Check what the connection type is, then Make changes accordingly.
You May have a slight freeze, but that's better then a crash....mainly when the phone switches from PC to WWAN, their would be a slight Pause.
use the Reachability Class and NSLog to Figure out whats going on exactly.
I really hope that helps!

Resources