How to connect to Bluetooth OBD II with visual C++ and for PC - bluetooth

I'm trying to use a Bluetooth OBDII (on-board diagnosis) to connect with a Bluetooth dongle connected to my computer (My OS is windows 7). The dongle connects to the device and assigns it 2 virtual com ports (COM4 for incoming and COM5 for outgoing), But unfortunately I couldn't communicate with this device over the virtual com port. I also attempted to work with winsock library but I didn't find any example for working with Bluetooth OBD and send and receive the instruments. I just found one Bluetooth API for android but it's not useful for me because I want to implement it inside the visual C++ and for PC. and right now I have 2 questions about that :
1. which method is better, Virtual com port or winsock and how ?
2. Do you have any sample code for working with Bluetooth OBD ?

1: Has your device a ELM327 chip? If so, you can setup a serial port over bluetooth, and communicate with that port. I don't know winsock very much, but I think a serial port is better suited for this job.
To set it up, have a look here: http://windows.microsoft.com/en-us/windows7/choose-a-com-port-for-a-bluetooth-enabled-device
Maybe if you can pair with the device, windows 7 will automagically set it up?
2:
You might want to have a look at: http://icculus.org/obdgpslogger/
It's open-source, so you can have a peek how it works. There's also a simulator in the package, which could help you developing/testing. Mostly is Linux based, but it should give you hints where to go. There are also windows installers available for the simulator.

Related

How to use TI Sensortag on Windows Desktop with USB 4.0 BLE Dongle

I have an Asus USB-BT400 Bluetooth Dongle, it works with BLE devices. I also have an TI Sensortag, i installed the drivers and software and I can connect my PC to the sensortag (using windows 7 or windows 8.1 in VM, both works).
Windows doesn't find drivers for the sensors (I think 8 in total) so I would like to know how I can communicate to them. I already exposed a COM port for the bluetooth device (that's possible via Bluetooth settings). I tried the BLE device monitor, where the COM port shows up, but it gives an error (no response from BLE host at port COM3). I also tried the windows Desktop app (win8), which doesn't work either.
I would be glad for any solutions, resources and hints which do not require me to buy the Dongle from TI website for ~50$.
Thank you!
I don't believe it works under anything less than Win 8.1 as the OS must have the BLE Profile drivers.
Running VM is not going to help, as you need those drivers at the base OS level.

Does the Universal Windows Application infrastructure support any Serial Port communications?

I have a WPF desktop application that would make a good candidate as a Universal Windows App. The application has a must-have dependence on USB or Bluetooth devices that act as a Serial Port.
In all my reading I've yet to discover whether there is any access to a SerialPort API in a UWA.
I suspect the answer is 'No support'. If so, does anyone know of a USB or Bluetooth GPS that supports whatever APIs the UWA has for that sort of thing. I have to be able to read things like ground speed, elevation, rate of climb, etc.
If the answer is 'Supported', could you point me to some documentation.
For the "Bluetooth devices that act as a Serial Port", I assume you mean the RFCOMM. They are both supported on Windows Runtime since Windows 8.1 and you can also use them in the Universal Windows Application.
namespace: Windows.Devices.Usb and Windows.Devices.Bluetooth.Rfcomm.
About the Bluetooth GPS, I'm not sure if it uses RFCOMM or not (it depends on the devices), and it is also possible to use the GATT.
Code Sample: Custom USB device access sample

Bluetooth paired but no COM port

So I've built an Arduino module with a Bluetooth chip (HM-10) and it pairs succesfully with my Windows laptop. They both use Bluetooth BLE.
The problem is that the pairing doesn't seem to open a COM port, so I have no way to actually communicate across the connection.
There are no COM port connections when I go into Bluetooth settings->COM Ports, even though Windows is definitely telling me that the pairing was successfull.
Does anyone know why this could be?
Thanks for reading
Lukas
I had the same problem on a Mac. Turns out it's not a problem. BLE doesn't quite work like regular ol' Bluetooth and you won't have a COM port. You need to write your own middleware to take care of the communication between the Arduino and your computer.
There are different projects working on that in Python or Node.js. A simple google search should provide with a proficiency of solutions.

Trouble connecting FTDI device

I am trying to use the second example code for Visual C++ (http://www.ftdichip.com/Support/Soft...SSE/FTCSPI.htm) To connect to the FT2232H Mini Module. My code works and indicates no device is connected when none is. However, when i connect the board and then run the code i recieve the attached message (the device is used by another application). I am not sure why i am getting this message. Any input greatly appreciated.
The FT2232 has two different drivers. One that presents the device as a serial port and one that allows the developer to use a custom interface. Odds are that you have the Virtual Com Port (VCP) driver installed instead of the D2XX driver.
See: http://www.ftdichip.com/Products/ICs/FT2232H.htm

Bluetooth LE - PAN1720 BlueRadios Serial Port Profile with Windows

I am using a Single-Mode Bluetooth Low Energy PAN1720BR BLE dongle which is loaded with the firmware "BlueRadios nBlue 1.2.1.3.1.0-PAN1720" (latest). When plugged to a computer, I can control and configure this PAN1720BR module with AT Commands through a terminal application on the computer.
With a second computer equipped with a standard BLE dongle, I can pair and connect to the PAN1720BR. See configuration below:
PC1 + PAN1720BR <---- BT 4.0 ----> PC2 + Standard BLE dongle + App running on PC2
The problem is that BLE does not have an SPP profile, so to establish a communication between the two PCs, I need to write an application on PC2. The PAN1720BR has a proprietary profile called BlueRadios Serial Port (BRPS) which is not a standard.
BlueRadios provides libraries for iOS and Android so that we can connect a cellphone to a PAN1720BR and communicate wih it. But they are silent about how to connect a PC (Windows) to a PAN1720BR. When establishing the connection, the Battery service (standard) installs properly on PC2, but the service corresponding to BRSP does not install, driver is missing. What is going on here is not very clear to me.
My goal is to write an application to be run on PC2 to enable communication between the two PCs. My question is, how can I access the Bluetooth with my application? Please correct me if I'm wrong, but I believe my app needs to access the ATT/GATT layer in order to read/write data.
Do you have any sample code that would help, in Java (prefered), C/C++, C# or anything else that would help on Windows?
Thank you
For an App with BLE Module from BlueRadios you must use the ATT/GATT Profile or you use the library from BlueRadios with there BRSP Profile.

Resources