gransee gravatar image

Posted 2018-01-04 17:56:57 +0100

blogs->all

Bluetooth on a desktop computer (Windows, Mac, Linux)

Posting this here in an effort to save the time of anyone else who is wanting to control a device from a desktop computer.

Our application is a motor control device that is wirelessly controlled from a desktop computer. This is not really what BLE was designed for. BLE is all about low power and is easy to connect to a smartphone. Connecting to a desktop computer however, is much more difficult.

The real trouble is on the PC end. Coming up with software that communicates to a BLE chip. Here's some things I tried...

You can use a HID profile. But the latency and data rate may not be what you expect. It is good for a mouse or keyboard. I couldn't get even 20kbits/second with decent latency using the HID examples. Kind of complicated on the PC end I found as well. Maybe you will have better luck. Maybe it will just take a lot of your time.

You may have seen Bluetooth dongles communicating at high speed in windows. Those are probably using SPP which sets up a serial port in windows. The nRF5x does not support this and never will because SPP is not part of the BLE feature set.

A custom GATT profile is theoretically possible but I tried for a month to get some sort of PC software that could communicate with it. Setup on the nRF was easy but every single library I tried on the PC side had some sort of problem. It is like development just stopped about a decade ago. I think everyone went somewhere else. I tried 32feet, lightblue, bluecove, bluetooth SIG and the MS examples. Errors. Out of data documentation. What a mess. Really. I would not wish this on an enemy.

BLE is great for battery powered gadgets that connect to a smart phone. You can get that working within an hour or so.

For our application, volume is high so price is a factor. We didn't want the customer to have to use a special dongle. We also needed it work on a wide variety of desktop operating systems. Bandwidth requirements were modest (20kbit/s) and local processing was doable on the nRF but the development on the PC side was just absolutely horrible. What did I end up doing? Went to a Wi-Fi SOC. Longer range. Faster. More CPU. Got it doing more than in less than a day. Easy. It is even cheaper. How is that? Because more people are using this part and that lowers the cost. It does use more power so be aware of that. It is also very easy to develop because people are actually using it an there are zillions of examples. So refreshing to see examples and tools on the desktop that are up to date. No expensive compiler required.

Hopefully this saves some time and sanity for you.

2 comments

hnhoan gravatar image

Posted Jan. 5, 2018, 3:59 p.m.

Yeah, BLE on PC is a mess. We work with all 3 platforms at the office. Best is the MAC flawless with builtin BLE support with Corebluetooth. Corebluetooth can also works with older MAC with a dongle. Here is my example code for scanning and read manufacture specific in the advertisement packet. On Linux and Windows, Qt was used with dongle. Other solution for Linux is Bluez. Windows 10 have also builtin driver with Windows 10 only, that works in C#. Examples are available on Microsoft website.

mr_jj gravatar image

Posted Jan. 8, 2018, 1:19 p.m.

I am using the BLED112 USB dongle with pygatt to solve the BLE windows nightmare.

Sign in to comment.

User menu

    or sign up

Recent questions

Related posts by tag

No results