bluetooth device over USB using hciattach - linux

I was using bluetooth device on UART interface, but for some reason, we changed BT device to USB interface. we used hciattach command:
./hciattach /dev/ttyS1 any 115200 flow
for BT device over UART.
Now we changed to USB interface. I searched in intern and found
./hciattach /dev/ttyUSB1 any 115200 flow
for BT device attach.
We don't want to use UART device, is there any way I can use directly USB devices instead of using USB device as ttyUSB.
Thanks.

I found for USB BT device case, i don't need to attach the device, as i used to do it in UART devices case (./hciattach /dev/ttyS1 any 115200).
hciconfig identifies, device without hciattach. we just need to do "./hciconfig up" to make BT device run.
Thanks.

Related

How to capture Bluetooth traffic between wireless mouse and its USB dongle using Wireshark?

I just started using Wireshark, missing few basics.I want to capture BT traffic between mouse and its usb dongle.I used USBpcap as its between mouse and its USB dongle and I have WIFI enabled with promiscuous mode. I could not see any of BT protocols in the log. Should I use any other interface?Please help.

Read the Health/Status of USB Modem - Linux

I am using E8231 Huawei Modem.
I a currently debugging a network connectivity issue and a way to see the health of the USB Modem would be great.
The USB Modem has LED indicators on them which tell the status of the connection(Connecting/connected to 3g/3g+/offline).
I would like to know the same programmatically or from linux shell, what can I do?
you can use echo, putty, socat,... to send AT commands to the modem, see https://unix.stackexchange.com/questions/97242/how-to-send-at-commands-to-a-modem-in-linux , https://brunomgalmeida.wordpress.com/2012/04/06/send-at-commands-to-usb-modem , https://content.konekt.io/blog/using-at-commands-with-the-huawei-e303/
in http://www.zeeman.de/wp-content/uploads/2007/09/ubinetics-at-command-set.pdf is an AT command set for UbiNetics modem
in http://www.3g-modem-wiki.com/page/HUAWEI+AT-commands is a set of HUAWEI AT commands
USB modems are on /dev/ttyACMx or /dev/ttyUSBx (CDC device class, usually ACM sub-class, kernel module cdc_acm)

USB<>serial communication not working on linux

I'm currently working on a project in which I have to communicate with a custom-made sonar board over an USB<>Serial connection with cts/rts hardware flow control at a baud rate of 4,499,456.
MATLAB code for sending and receiving data is already available and fully tested on Windows.
The problem occurs when trying to execute the MATLAB code on linux (Ubuntu 14.10/15.04). Both the commands for toggling the LED on the board (write) as well as receiving information (read) are not working.
Python ports of the MATLAB code using the pyserial and pylibftdi library do allow writing, but also hang on receiving data.
Does anyone have any idea as to why it does work on Windows but not Ubuntu? Maybe a driver issue? Or something having to do with cts/rts on Linux?
lsusb output
Bus 002 Device 004: ID 0403:6014 Future Technology Devices International, Ltd FT232H Single HS USB-UART/FIFO IC
dmesg output
[11906.209231] usb 2-3: new high-speed USB device number 5 using ehci-pci
[11906.346701] usb 2-3: New USB device found, idVendor=0403, idProduct=6014
[11906.346713] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[11906.346720] usb 2-3: Product: USB <-> Serial Converter
[11906.346725] usb 2-3: Manufacturer: FTDI
[11906.346730] usb 2-3: SerialNumber: FT69T4N
[11906.351716] ftdi_sio 2-3:1.0: FTDI USB Serial Device converter detected
[11906.351800] usb 2-3: Detected FT232H
[11906.352234] usb 2-3: FTDI USB Serial Device converter now attached to ttyUSB1
Edit: Just logging my progress in case somebody encounters the same issue. The problem seems to lie in the baudrate; changing it to 115200 allows reading from the device, but messes up sending data to it.
Apparently the FTDI driver doesn't work to well with very high/non-standard baudrates. I ended up solving this by using a baudrate of 3,000,000

Virtual COM driver in Linux to receive data from USB device

I have a USB barcode reader which is developed for Windows only. But one of the developers told me that as soon as the device detects that it is connected to a virtual COM port it is ready to work.
So my question is whether I can create a virtual COM port on Linux and connect the device to this one.
Here the udevadm output when I switch on the device:
udevadm monitor --udev
UDEV [10487.232696] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
UDEV [10487.238105] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
UDEV [10507.430306] add /class/usbmisc (class)
UDEV [10507.453800] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2.1 (usb)
UDEV [10507.455899] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2.1/2-1.2.1:1.0 (usb)
UDEV [10507.456565] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2.1/2-1.2.1:1.1 (usb)
UDEV [10507.459065] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2.1/2-1.2.1:1.1/0003:1AC2:0135.0015 (hid)
UDEV [10507.461350] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2.1/2-1.2.1:1.1/usbmisc/hiddev0 (usbmisc)
UDEV [10507.461669] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2.1/2-1.2.1:1.1/0003:1AC2:0135.0015/hidraw/hidraw2 (hidraw)
The following is the dmsg output:
dmsg
[10473.572851] usb 2-1.2: New USB device found, idVendor=05e3, idProduct=0610
[10473.572863] usb 2-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[10473.572869] usb 2-1.2: Product: USB2.0 Hub
[10473.573596] hub 2-1.2:1.0: USB hub found
[10473.573971] hub 2-1.2:1.0: 4 ports detected
[10493.661296] usb 2-1.2.1: new high-speed USB device number 41 using ehci-pci
[10493.754539] usb 2-1.2.1: New USB device found, idVendor=1ac2, idProduct=0135
[10493.754550] usb 2-1.2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[10493.754557] usb 2-1.2.1: Product: *** USB DEVICE
[10493.754562] usb 2-1.2.1: Manufacturer: ***
[10493.754566] usb 2-1.2.1: SerialNumber: 00000017
[10493.757449] hid-generic 0003:1AC2:0135.0015: hiddev0,hidraw2: USB HID v1.10 Device [*** USB DEVICE ] on usb-0000:00:1d.0-1.2.1/input1
I played around with socat already, but I was not really successful. I would very much appreciate if one of you would be able to help me.
Thanks,
Ralf
I think you don't need to be thinking about virtual COM ports. This bar-code reader looks like it is an HID because I see messages about HID in your dmesg output. You could check for sure by looking at the actual USB descriptors of the device using lsusb.
Since it is an HID, the driver setup should be done automatically when you plug it in, and you should be able to just scan a barcode and it will probably show up on your Linux computer as if it were typed by a keyboard.
By the way, I don't think you can really "create" a virtual COM port. Normally the way it works is that the device's USB descriptors say that it has a USB CDC ACM virtual COM port, and the Linux USB drivers read these descriptors and use it to set up the PC side of the virtual COM port.

Discover where are my USB speakers (device)

I'm running Debian Sid and I want to know where are my USB speakers in system. For example: When I plug my pen drive, dmesg shows where it is (sda, sdb, etc). But when I plug my USB Speakers, it doesn't show anything:
[12032.284042] usb 2-2: new full speed USB device using ohci_hcd and address 2
[12032.497098] usb 2-2: New USB device found, idVendor=0d8c, idProduct=0103
[12032.497103] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[12032.497107] usb 2-2: Product: USB Sound Device
[12032.497109] usb 2-2: Manufacturer: C-Media INC.
[12032.497266] usb 2-2: configuration #1 chosen from 1 choice
How could I discover where it is? Is there a command to show devices connected?
Thank you.
It's added as the next available ALSA card.
cat /proc/asound/cards
The easiest way is to diff the listing of /dev before and after the device is connected.
(Oops, I see that I probably misunderstood the question. Sorry. I'll leave my answer in case it's remotely useful).
Try lsusb. It gives you an overview of USB devices connected.

Resources