FAQ Database Discussion Community


Linux libudev test application not receiving REMOVE events

c,linux,usb,udev
I am creating a test application for a new platform that we are working on to test libudev and make sure our C application will be able to be properly notified when a particular usb device is inserted or removed. On our system every time this device is removed and...

Linux USB horror

linux,linux-kernel,usb
I've written a program, which creates a file on a mounted USB device. This can be done using a text based UI through an RS232 connection. However, something seems to be off. 1 in 5 times, the whole process of writing to the USB device fails and I get the...

Is PID = 0 a valid for usb device?

usb,driver,device,pid,wdk
I'm going to create device with Product Id (PID) = 0x0000, create driver for this device and sign it using Microsoft Windows Driver Kit (WDK). Is 0x0000 a valid PID for USB device in Windows? PID=0x0000 will be a generic PID for all my devices (for development purposes), because I...

Python USB sometimes not recognized

python,python-2.7,automation,usb
I have code that is supposed to check whether a certain file exists in a USB stick that is plugged in by the user when prompted. The issue is that the script sometimes succeeds and sometimes fails on the exact same machine with the same USB stick with the batch...

Without connecting my phone via usb, is it possible to install an app I made on Android Studio?

android,android-studio,usb
I just bought a second hand phone and when I connected it to the computer it wasn't recognized (code 43). Since I really like the phone would it be possible for me to install apps I make on android studio another way than with an USB cable ? Like via...

ExternalAccessory : Receive Data using USB cable

ios,objective-c,iphone,usb,external-accessory
The project that I am going to work that already develop in android platform. Android application receive data from a desktop system as soon as USB connected device with desktop. I am quite sure, to develop this I need to use ExternalAccessory.Framework. I am searching for tutorial for this but...

Is it possible to get PC's # of physical USB ports?

c#,.net,usb,wmi,wmic
I'm trying to get number of physical USB ports of PC for different Windows operating systems. To start with it seemed like an easy task but now I'm getting desperate. Maybe this question is not even valid since I don't know how USB ports are treated on hardware level. I...

How to manage USB on Android?

android,usb,port,devices
CODE IDEA: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE); HashMap<String,UsbDevice> stringUsbDeviceHashMap=manager.getDeviceList(); Log.e("asdadd", String.valueOf(stringUsbDeviceHashMap.size())); } 5310-5310/com.example.AppUSB E/asdadd﹕ 0 CMD ADB: C:\Users\Serg>adb devices List of devices attached DMJNPRCAP7IJGQFA device Why do I get 0 for the connected devices, if we have 1 single...

UART over USB for STM32 Micro-controller

embedded,usb,stm32,uart,usbserial
I'm trying to implement UART over a USB interface on the STM324x9I-EVAL development board. The purpose is to send commands to a servo controller (or other hardware, for that matter) serially. I've successfully implemented the USB_Device_CDC example on the development board but am unsure exactly how this works without a...

Try to use usb4java highlevel librairie

java,usb,usb4java
So here it is my program: public static void main(String[] args) { UsbServices services = null; try { services = UsbHostManager.getUsbServices(); hub = services.getRootUsbHub(); } catch (SecurityException | UsbException e) { System.out.println(e.getMessage()); e.printStackTrace(); } } And I have created the file 'javax.usb.properties' with inside: javax.usb.services = org.usb4java.javax.Services Like it's said...

Vodafone Mobile Broadband K3765-Z not working in jessie but was working in wheezy

networking,usb,debian,wireless,umts
I was working on Debian stable=wheezy until last week. Using my Surfstick was fine - configured by network-Manager. After updating to jessie I'm not able to connect. The stick is properly found. lsusb shows Bus 003 Device 002: ID 19d2:2002 ZTE WCDMA Technologies MSM nmcli results in ============================================================================= Status von...

How to disable battery charging during ADB connection?

android,usb,adb
Problem description: Each time wen I connect USB cable between PC and my mobile phone the battery automatically is charged. I want to use ADB protocol but I don't want to charge my battery during ADB connection. Is it possible to to turn off this charging? And ofcourse how can...

USB OTG suspend

android,usb,usb-otg
I am working on a android phone which supports USB OTG. Suppose we connect a USB hub (bus-powered /self-powered) to the android phone and there is no device connected on the hub. Should the phone go into deep sleep (suspend)?...

How can I communicate an Android Accessory with a USB Serial Port?

android,usb,accessory
Hereby the situation: I'm working on a Android Tablet that must work in Accessory mode. Reason why is because the tablet can't provide enough power to perform the communication with a Serial USB microcontroller and remain charging it's battery. In order to achieve a successful communication, I must be able...

Reading data from USB device (Waterrower S4 Monitor) with libusb and Ruby

ruby,osx,usb,osx-yosemite,libusb
I bought a Waterrower which has an S4 Performance Monitor that has a Micro-USB connector on its back and I thought it would be nice to be able to fetch the data that comes from the S4 and do something nice with it. I do know some Ruby but I'm...

Confused with output to console, C / USB CDC / PIC18F2550

c,usb,pic,cdc
I have a problem that is probably a simple misunderstanding on my end. I have a PIC18F2550 device with a USB CDC firmware. I would like to send it a command to output something to the console every second. However, it doesn't seem to work. I put in a loop...

How todetect usb vendor id and product id using java

java,usb
I am writing an java application that detects usb device.When i executes the program it is showing all the usb devices in pc actually but i want the connected usb device only this is my java code: package com.lakshman.sundeep; import org.usb4java.Context; import org.usb4java.Device; import org.usb4java.DeviceDescriptor; import org.usb4java.DeviceList; import org.usb4java.LibUsb; import...

Android: connecting to USB device, wait for permission

java,android,permissions,usb
I'm trying to do this: connect to USB device and get the opened (or failed) connection. I did the logic according to examples and explanations that I have found, but I have problem with waiting for permission grant. First I tried a "good" way of using wait()+notifyAll(), than I tried...

Issues with PySerial: Port must be configured before it can be used

python,usb,pyserial
I am writing code (in python) to use serial communication with an Arduino, using the pySerial library, on Windows 7. However, I am having issues using the ports correctly. Here is my code: import serial #sets the connection parameters, relook at when know more ser = serial.Serial( port ='COM4', baudrate...

C# .NET ReadFile from USB AccessViolationException was unhandled

c#,.net,usb,dllimport,readfile
I am receiving an AccessViolationException when calling the ReadFile API. I have looked at all of the entries on StackOverflow dealing with similar issues and have not had any success deciphering what is wrong. Here is the relevant code in question: INVOKES [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] public...

Mount USB Key on Boot

linux,usb,boot,mount
OpenSuSE 12.3 I'm trying to auto mount a USB key on boot. The mount point always needs to be the same, for each drive that is added. Can this be done without specifying the disks format type ? I may be mounting vfat, or NTFS, or ext4.. it will depend...

Sending ArrayList() into byte[] format thru USB in Android

java,android,arrays,usb
My code uses a Modbus CRC16 protocol, which generates a List<Integer> with the hexadecimal values that must be written on the USB port. I'm trying to convert this ArrayList containing Integer objects to a byte[] array so I can write it via USB. I tried to implement using IntBuffer but...

Linux: Connect Seiko usb printer as serial port

linux,printing,serial-port,usb
I have a Seiko DPU-D2 printer. I'm connecting it to computer with usb port and I'm trying to write to it using serial. What I don't know is where this printer is mounted. What I have so far are those pieces of information: # lsusb Bus 002 Device 009: ID...

Device drive insertion handling win32 api

c++,windows,winapi,usb
In this msdn example, where device drive insertion is handled? Can someone explain me giving the sample code?

How do manufacturers Disable DFU on USB Flash Devices

usb,firmware,dfu
I am looking at the Phison 2307 Controller on USB 3.0 flash storage devices, I have seen a few examples using a Phison 2303 controller which have successfully updated and modified. I am interested to know how is this functionality is removed with the updated controller?

USB3 Controller & Kinect 2

controller,usb,driver,kinect,fresco
I recently updated a PC to Windows 8.1 in order to make it compatible to Kinect v2. It's an ASUS N53S with the following specs: CPU: Intel Core i7 - 2670QM (2.2GHz) RAM: 16 GB GPU: GEForce GT 550M USB3 Controller: Fresco Logic xHCI When running Kinect v2 Configuration Verifier...

STM32 STM32CubeF4 USB CDC operation

c,embedded,usb,stm32,cdc
I built the code from the STM32CubeF4 for the USB CDC example. I added the missing receive code for CDC_Receive_FS() in usbd_cdc_if.c. I loaded this into my STM32F4 Discovery and it works. A character typed on Tera Term returns and is displayed on Tera Term. I am hoping that someone...

Udev Rules and script issues

shell,usb,udev
So I want to make a udev rule which does, when I connect my usb key to my computer the rule mounts my usb key, takes a file from my computer, copies it to my usb key and then unmounts my usb. So I did my udev rule like that:...

Detect when USB device was disconnected using usbd_core.c

c,embedded,usb
So working on an embedded system I have a USB drive that is used to charge the device as well as reading some data. Using usbd_core.c I can check the status, when there's nothing connected the status is 4 (USBD_STATE_SUSPENDED). As soon as I connect something the status changes to...

C++ Win32 Not receiving DBT_DEVICEARRIVAL or DBT_DEVICEREMOVECOMPLETE on WM_DEVICECHANGE

c++,winapi,usb
I have been working on detecting USB insertion/removal. I have implemented code using CreateWindowEx(), passing a WNCLASSEX that with my window process callback. On inserting and removing my usb, I successfully receive the WM_DEVICECHANGE message, but the wParam is always set to DBT_DEVNODES_CHANGED. I never get either DBT_DEVICEARRIVAL or DBT_DEVICEREMOVECOMPLETE....

Programmatically switch USB between shared (disk mode) and mounted (charge only)

android,usb,storage
I have an old HTC Desire S connected to my PC with a USB cable, and am doing development work on both a PC program and an Android app. It is convenient for me to have the PC program write some test data to the Android device's SD card (needs...

Execute mutli command lines in java

java,command-line,usb
I need a multi command to bring the CMD to the root of the disc it runs on. This is how the structure looks on the USB \data \data\commands \Java \Java\bin App.jar App.bat This is how the "event" looks: String command = "cmd /c cd\\data\\commands && wscript \"invisible.vbs\" \"Ready2Go.bat\""; try...

Is there any way to see on linux the USB devices on realtime?

linux,usb,linux-device-driver,lsusb
My question is simple, is there a way to see in a terminal what usb devices do I have connected to my computer in real time? I already know lsusb, but it just show me the devices on the moment I ask it, I would like to be able to...

communicationg to device using cdc usb protocol in c# windows application

winforms,c#-4.0,usb,serial-communication,cdc
I need help to create a c# application for usb communication using cdc protocol. My application is communicating to device by using by using usb communication protocol.Can somebody give me a sample application in c# showing sending and receiving of data using "Communication Device Class" usb protocol. Thanks in advance...

How to get the file path from a device acting as a usb mass storage in android

android,usb,filepath,usb-otg
I am trying to get filenames(and also the filepath), from a Garmin device which acts as a usb mass storage. Connecting the device to the computer, the filepath is G:\Garmin. Connecting that to the android tablet using OTG and Explorer(i have check the app setting - the package name is...

Can you get a list of connected devices in java

java,eclipse,swing,usb
Im new to java and am just wondering if you can receive a list of connected USB devices, for example: If i created a java program to modify devices, i want the JFrame to display a list of devices for the user to select one... (That's not my idea, or...

Android : how to detect already connected usb device?

android,usb
I'm trying to detect usb devices which are already connected to android. I understand there are actions to detect when USB is either attached or detached. But I don't really get how to check devices after connecting usb device to android. Also, I've found that each USB device has it's...

Install Android app on device through wifi - no usb or emulator

android,debugging,android-emulator,usb,wifi
Just as it says in the title. It seems my smartphone data connectors are broken, and the emulators run far too slow on my computer (surprisingly because it is i7). So, is there any way I can use an alternative to usb debugging through WIFI instead of usb? ...

How to read Superspeed or Highspeed of a USB flash drive in C#

c#,usb,enumeration
I have found this question and answer within this site here:Detect if device is using USB 3.0 but when I ran the program, the result never returned a SuperSpeed connection. I plugged in the USB3.0 flash drive into the USB 3 port so it's supposed to return SuperSpeed to me....

How to differ between external HDD and internal ones?

c++,winapi,usb,sata
I want to know whether device is connected via USB (meaning it is a removable hard drive) or SATA (meaning it is an internal hard drive). That is how I get a list of devices SP_DEVINFO_DATA volumeData; volumeData.cbSize = sizeof (SP_DEVINFO_DATA); SP_DEVICE_INTERFACE_DATA volumeInterfaceData; volumeInterfaceData.cbSize = sizeof (SP_DEVICE_INTERFACE_DATA); wchar_t buffer[1024]; PSP_DEVICE_INTERFACE_DETAIL_DATA...

Which usb driver is called in order to transfer data?

linux-kernel,usb,linux-device-driver
I would like to change the behaviour of one of my USB flash drive by editing its driver, but i can't find which driver is called. I searched and i found that the drivers/usb/storage/transport.c is responsible for some exchanges beetween the host and the device (configuration), but i want to...

Safely eject/unmount usb filesystem on Windows 8.1 64-bit from C#

c#,winapi,usb,eject
Ok, so before people start screaming "DUPLICATE!" let me explain. I have spent the last few days trying to get some c# code to be able to safely eject a USB key. I have been attempting to use the code from here: http://www.codeproject.com/Articles/13530/Eject-USB-disks-using-C Which is the only real code result...

C++ Console Application Detect if a USB pluged in

c++,windows,usb,console-application,detect
Meanwhile I am working on some application with hardware interface connected over USB, so I would like to be notified if USB has been plugged in over some kind of event handler so I can connect to the device automatically. Microsoft has an posted an Example about (Registering for Device...

When to Update ALSA Audio Driver Buffer Pointer

linux-kernel,usb,linux-device-driver,alsa
I am writing an USB Audio Playback driver using ALSA APIs. For that I was trying to understand existing audio drivers in Linux kernel. But I get confused on when to update the kernel audio buffer pointer. We know kernel puts new audio data in a ring buffer and our...

Unable to debug after installing Android 5.1.1 on Nexus 5

android,osx,debugging,android-studio,usb
Today I received the Android 5.1.1 update on my Nexus 5. After updating the device I'm unable to connect it to adb (in Android Studio on Mac OS X) via USB. Developer options are enabled, tried to toggle usb debug off & on, changed usb memory emulation from storage to...

Best practices for implementing a thread to do fast, bulk, and continuous reading in C#?

c#,multithreading,io,usb,hid
How should the reading of bulk data from a device in C# be handled in .NET 4.0? Specifically I need to read quickly from a USB HID device that emits reports over 26 packets where order must be preserved. I've tried doing this in a BackgroundWorker thread. It reads one...

Using Delphi + Jedi, losing USB data when device sends it “too fast”

delphi,usb,hid,jedi
using Delphi XE2 and TJvHidDevice class from Jedi library, I managed to successfully communicate with a USB device (pic32mx7 board, with my code running on it). The usual way of "send request, wait for single response" works. The problem is with a command that results in a larger number of...

Get information on Usb Zwave key in Java [closed]

java,usb,driver
I would like to get informations about a Zwave usb key in java, to access to its functions because I would like to write a program who can handle different connected devices using Zwave network. Someone have an idea to get access to this informations and functions in Java ?...

Get detected device USB port from TJvHidDeviceController in delphi?

delphi,usb,port
I'm using TJvHidDeviceController to detect my electronic device connection into USB port. After detection I need to know its port name to use in TComPort object. (It is a simple Caller ID device). How can I know the detected device's port name(I want to know com port. for example COM1...

How do i access usb device info and explore it using java code?

java,usb
public void showInfo(){ com.codeminders.hidapi.ClassPathLibraryLoader.loadNativeHIDLibrary(); HIDManager hidManager = HIDManager.getInstance(); HIDDeviceInfo[] infos = hidManager.listDevices(); for (HIDDeviceInfo info : infos) { System.out.println("info: " + info.toString()); } } i used this method in my code but it occurs an exception on this line for(HIDDeviceInfo info : infos){ System.out.println("info: "+info.toString()); } Exception is: java.lang.NullPointerException at...

Arduino doesn't read a proper amount of bytes

c++,serial-port,arduino,usb,raspberry-pi
I have a Raspberry Pi connected to Arduino Mega with USB and trying to send a 8-byte package from RPI to Arduino. I'm using WiringPi serial library to accomplish this. RPI part scans serial buffer for data available. If not, it writes data to serial. for(;;) { if (int i...

How to know what block device correnponds to the lsusb output?

python,bash,usb,devices,lsusb
I need the information provides lsusb about Manufacturer company in usb pendrives, but I don't know how to link it with the block device. I'm using dbus and python for getting all information about pendrives connected in the system, but DriveVendor and DriveModel don't correspond with Manufacturer company showed with...