I'm trying bring up Bluetooth over USB support on a new ARM-based Android device. I think I'm missing some magic piece of configuration in order to successfully open a BT socket connection.
BT is provided through a USB dongle (vs. UART in most Android devices)
I can successfully run "hcitool scan" to discover devices.
I can open a socket via libbluetooth in C
When I try to establish an RFCOMM connection the connection, the connection
is refused because an L2CAP connection cannot be established.
Also,
for some OS's, I'm required to approve a pairing. (Older Ubuntu, some flavors of Windows' BT stack.)
the peripheral device doesn't require a PIN, but in some cases I'm requested to provide one. (Windows has asked for this. Older version of Ubuntu has asked for this. It may also be when using BT 2.0 dongles, vs. BT 2.1 and up?).
Bluetooth provided with Ubuntu 10 on my PC requires neither PIN nor pairing.
Am I missing a piece of config that says, i) auto-pair devices, ii) don't request a PIN if none is required?
Is there a guide to this online? Documentation seems limited.
Related
Since upgrading to macOS Monterey, we have been unable to create a Bluetooth SPP connection to any hardware device.
The SPP service does not appear to be supported. When listing the services for the device, the SPP service is not listed at all, as it was in previous OS versions.
SPP Connection to the device is blocked by the operating system (except in extreme cases where we open a socket connection while the device is still connecting to other Bluetooth services)
We are using a headphone-type device that successfully pairs and connects to the computer with A2DP, HFP and a few other standard services. However, it is unable to connect to SPP service, which was previously available up until Big Sur. Has anyone else faced a similar issue -- and are there currently workarounds to establish a stable Bluetooth SPP connection on macOS Monterey?
After communications with Apple support, the issue has been resolved as of Monterey 12.3 Beta 4.
1 - RFCOMM handles are now properly returned.
2 - IOBluetooth.recentDevices() still does not return devices, which was part of the problem described above, but can be circumvented by leveraging IOBluetooth.pairedDevices() instead.
What I want to do:
An AI program on a host machine, reading inputs from a camera sensing the screen of the target machine and outputting controls to the target machine via USB connection--programming the host machine's USB host as a USB peripheral connected to the target machine.
What I want to do step by step: (is it possible to implement the steps below?)
Have a host machine A and a target machine B.
Connect A and B with a USB 3.0 Type-A male-male cable.
The USB connection shows up as an HID keyboard device on B.
Write code to simulate key presses on A that sends to B.
(Eg. calling press('F') on a program running on A would type F to B's input)
It shouldn't require any program installed on B.
What I already searched:
USB 3.0 Host to host connection is possible:
https://superuser.com/questions/795053/how-do-i-connect-two-computers-using-usb-3-0
USB 2.0 Host to host connection is impossible:
https://superuser.com/questions/99274/how-to-connect-two-computers-with-usb
Similar questions asked without the assumption that USB 3.0 Host to Host connection is possible:
https://superuser.com/questions/1128365/simulate-usb-keyboard-from-machine
Setting up a computer to act as an HID device connected to another computer via ps/2,usb or another wired connection
https://superuser.com/questions/507921/computer-to-act-as-keyboard?rq=1
Suggestions in ascending order of feasibility:
USB Gadgets
You are using linux, so the default way would be to create/configure/load a gadget driver. Have a look at this tutorial, though for a raspberry, should work on your PC too. However, I could not find any information regarding the use of USB3 - the tutorial assumes your host is using one of it's OTG ports, which your PC most likely does not have. So whether this works with your USB3.1 Type-A-to-Type-A connection you'll need to test.
USBIP
The idea of sharing USB devices (not just keyboards) is not really new. With USBIP you can "export" any local USB device to the network, and your client will need the client-side USBIP driver to access the keyboard.
Dont bother with USB at all, just use Ethernet
I'd simply write two userland scripts/programs that send/receive+execute the keystrokes. Very easy to implement, you're probably familiar with python anyway.
If you absolutely cant have software installed on the client-PC and your Type-C-to-Type-C connection doesnt support USB Gadgets, there's another way. It basically involves the use of two USB-to-serial adapters (~15$) and a serial cable. While this wont be enumerated as a keyboard, but rather as serial port, it's the lowest-effort solution to transfer data without additional software on the client. Both computers will just do file I/O. If your computers still have COM-ports, you can even omit the serial converters!
I have a linux platform* that is connected as a usb device to an automotive device which acts as the USB host. The two devices should communicate over CDC/NCM, but the linux platform is not recognised by the automotive device and therefore the connection is not established. Surprisingly a connection to my computer is established correctly.
I now need to create a trace of that USB connection in order to check if there is an error in the USB handshake that can't be handled by the automotive device. As I cannot access the USB host, I need to create the trace from the gadget side.
I tried using usbmon and tcpdump, but this seems to work only for USB controllers configured as hosts on the tracing platform, not for ones configured as devices.
How can I configure usbmon to work also on devices?
If that is not possible are there any other possibilities to achieve this? (preferrably without hacking any drivers...)
Or do I have to use a Hardware USB sniffer?
BTW, all required modules (esp. g_ncm) are correctly loaded.
Thank you for your help!
stefan
*custom distribution on a freescale iMX6 processor (ARM), Kernel Version 3.0.35
Here is my problem, I want to develop a .NET application to communicate with a BLE CSR dongle (i.e. uses non-MS stack driver). In windows 8.1, you have to pair the BLE device in the computer's bluetooth settings before the application can use it. It's straight forward, you goto pc settings bluetooth and search for devices. From what I can tell, if you have a dongle that cannot support the ms stack, this bluetooth option disappears in pc settings, and you cannot pair your device using the standard way. I tested this on a machine with both a MS-stack capable dongle and a CSR (non-MS-stack) dongle. If I disabled the MS-stack dongle (in device manager), and noticed the option for bluetooth under pc settings->devices disappears immediately. Once re-enabled, it returns.
So my question is how does one pair a device using a non-ms stack dongle to have the same effect as done under pc settings when using an dongle with the MS-stack?
Many thanks
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.