Bluetooth debugging tools - bluetooth

Linux has hcidump which is a very handy tool for debugging bluetooth problems.
Can anyone recommend similar tools for Windows? I'd also be interested in other tools for Linux if anyone knows anything good.
I'm trying to investigate why my BT device disconnects after a couple of seconds. I expect its a crappy mini-dongle, but would like to find out more about where the disconnection originated from.

You can capture the USB interface with a Windows USB sniffer, e.g. Usbtrace or Usblyzer and convert the captured output to btsnoop file format which can then be loaded and analyzed in Wireshark or FTS4BT viewer (free tool from ww.fte.com).

I don't think that you have something similar for Windows desktop, but for Windows CE there is a tool called BTDC Tool. If you read Wireshark wiki they say that there isn't something for Windows: http://wiki.wireshark.org/CaptureSetup/Bluetooth and http://wiki.wireshark.org/Bluetooth
You could capture the traffic, by going deep into the driver, but for this you should study the Windows DDK. It allows you to add extensions of your own.

Related

How to view all the raw data that comes from a bluetooth device to your computer?

I have a gamepad with giroscope that works with Nintendo Switch, but there is no such feature for windows, but I think that the gamepad anyway send the information from giroscope but windows don't respond to it.
You could use Wireshark. has a Windows and Linux version.
Capturing Bluetooth isn't that complex. see the Wireshark site for the tutorial.
You can do so using the WebHID API. For your concrete question, maybe you can just directly use my WebHID Nintendo Joy-Con driver that makes gyroscope data available to the browser.

Device for testing BLE that works with Windows

I'm looking for a recommendation for a device for testing BLE devices with Windows. The Windows API itself seems really flaky, and doesn't give much debug information, so I'm thinking a standalone device, probably that plugs in over USB and skips the Windows BLE stack altogether is the way to go. What I'm looking for would:
Be able to connect to a GattServer and do all the typical operations ( read, notify, etc )
Nice to haves:
Give debug information about the connection state
Trace packets
Have some kind of automation hook, that is, COM, CLI, etc so that the data read from a characteristic could be dumped into Python etc
Anyone have any products they would recommend?

USB Controller on Chromebook

Pretty new to ChromeOS as have tried googling but can't find anything of how to write something to control my USB Nes Controller to use it pretty much as a keyboard to play emulators online, much less system demanding than running it all through linux.
that product page doesn't say how the device presents itself to the OS. is it a keyboard ? if so, it should "just work" ...
you can find out by plugging it in and then going to chrome://system and look at the lsusb and dmesg output. or look at this page for getting a system debug log.
if it is an arbitrary device, there is the Chrome USB API, but that only works for dedicated apps. i don't think you can write an interface as an extension which would allow working with any website.

Tools for bluetooth monitoring

For my project I have an Android phone and an Arduino device that communicate via Bluetooth. I was wondering if anyone knows any software tools I could use to monitor a bluetooth communications between two devices. Something like a packet eavesdropping. Preferably for Linux.
Take a look at ubertooth one. In the linked webpage there are instructions on how to build the dongle, as well as links to shops selling assembled dongles may be bought. Ubertooth one should work well with Kismet, and thus in Linux, by using a BT plugin (disclaimer: I have no personal experience on this).
Sounds like you are after a Bluetooth sniffer.
Bad news: They are almost exclusively Windows OS based and cost mega-$.
http://www.fte.com/products/bluetooth.aspx
If you were using BlueZ for one side of the communication you could use the BlueZ HCIDUMP app and Wireshark.
I don't think anyone has made a Linuz/Bluez Sniffer - could be wrong.

Is it possible to make a computer behave as a bluetooth HID device?

Is it possible to make a computer behave as a bluetooth HID device? That is, given a local machine with a standard USB keyboard plugged into it, other devices could discover this machine and use it as a bluetooth keyboard.
I'd like to create a linux or OS X application (or use an existing one, though I've found none) which can behave as described above, but I'm not sure where to start, or if it's even possible.
So:
Is what I'm describing possible?
Are there any existing applications that do what I describe?
If no application already exists (I'm assuming not), are there bluetooth libraries or bindings that will help? (I'm pretty comfortable using most of today's popular languages, so I'd prefer a library most directly suited to the task, so long as it's available in linux or OS X.)
Failing any of the above, the bluetooth spec looks pretty dense. Are there specific guides or other starting points applicable to the problem at hand that I can read?
I realize that such an application would most likely need to steal the normal keyboard input, possibly providing some KVM-like hotkey for switching between providing input to the host operating system and sending the input over bluetooth to the connected device, but I'm considering that problem to be outside the scope of this question.
It is definitely possible on Linux. Some time ago I found this project:
http://nohands.sourceforge.net/index.html
They emulate a full-blown headset with audio and keyboard controls on the Linux bluetooth stack. If they can emulate something like that, you would probably be able to emulate something simpler like a keyboard.
It is possible, however I don't think I'll be able explain it very well and I don't know the entire answer. A BT HID device works as a server and waits for connections to come to it. In linux, using the bluez stack, first you would have to advertise the HID service for other devices to see. I think you do that using the sdp.h and sdp-lib.h header files(the second header maybe called something else, I'm on a windows computer and can't check). So you would have to add the HID service record to you computer for other devices to see it. You would have to create a program that first adds this service to the record, then waits for other devices to connect, then handle the pairing process, Bluez might handle this for you, or you might have to do some things to it, I'm not quite sure. You should also read the Bluetooth HID Spec found at the http://www.bluetooth.com/English/Technology/Building/Pages/Specification.aspx site. This document contains the details of the SDP record relevant to HID. Also the book Bluetooth essentials for programmers is pretty good to introduce you into bluetooth programming
I would like to have given a more concise answer, with more detail, but that's all I know ATM. I am also trying do something similar, but spare time is so hard to find ;) I'm also not on my Linux box and can't check all the details. If your are still interested, let me know and i'll try to expand my answer.
I don't know if this is helpful, nor if it is still alive and working, but perhaps you could try this link.
Another one that might or might not be helpful in some way is remuco, but I don't know if they are using a Bluetooth HID profile.
It is indeed entirely possible with Linux and Bluez. See: https://github.com/lkundrak/virtkbd/blob/master/btkbdd.pod
Try Across, unfortuantly for me my phone was lacking support.

Resources