Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9134769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:43:16+00:00 2026-06-17T08:43:16+00:00

I am connecting a USB device I built (dsPIC33E powered) to a generic 7

  • 0

I am connecting a USB device I built (dsPIC33E powered) to a generic 7″ A13-MID android.

I am using ADB over TCPIP with LogCat running.

When I plug in my device I get this in LogCat:

I/USB3G (90): event { 'add', '/devices/platform/sw_hcd_host0/usb1/1-1', 'usb', '', 189, 7 }
I/USB3G (90): path : '/sys/devices/platform/sw_hcd_host0/usb1/1-1'
I/USB3G (90): VID :size 5,vid_path '/sys/devices/platform/sw_hcd_host0/usb1/1-   1/idVendor',VID  '04d8'.
I/USB3G (90): PID :size 5,Pid_path '/sys/devices/platform/sw_hcd_host0/usb1/1-1/idProduct',PID  '003f'.
I/USB3G (90): cmd=/system/etc/usb_modeswitch.sh /system/etc/usb_modeswitch.d/04d8_003f &,
I/USB3G (90): excute ret : 0,err:No such file or directory

I have MissileLauncher Demo running in debug mode ADT.

I can set a breakpoint in Fire and when I press Fire button, the code breaks there (so debugging IS working).

I have set Product-ID and Vendor-ID to the correct values in device_filter.xml.

I then set a breakpoint here:

UsbDevice device = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
if (UsbManager.ACTION_USB_DEVICE_ATTACHED.equals(action)) {
    setDevice(device);
} else if (UsbManager.ACTION_USB_DEVICE_DETACHED.equals(action)) {
    if (mDevice != null && mDevice.equals(device)) {
        setDevice(null);
    }
}

When I step through the code after the break, the intent. line is executed but the following if statement is not entered and setDevice(device) is never called (neither is setDevice(null)).

I did expect setDevice(device) to be called. After all, I have the device plugged in, the android saw that I plugged it in (see LogCat above) and I have the device_filter.xml set correctly.

What am I missing?

Other info, an app I installed ‘USB Device’ sees the device but lists it under the Linux tab. I hope that is not bad news for me!

Thanks,
Dale

I tried to enumerate the devices individually but no ‘Yeah’ (in fact there were no devices returned in HashMap):

HashMap<String, UsbDevice> deviceList = mUsbManager.getDeviceList();
Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();
while(deviceIterator.hasNext()){
    UsbDevice device1 = deviceIterator.next();
    //your code
    if (device1.getVendorId()==1240) {
        savetofile("Yeah!");
    }
} 

Not sure if this is relevant or not but the android is rooted and it came that way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:43:17+00:00Added an answer on June 17, 2026 at 8:43 am

    Turned out that I needed to use root privileges and make the changes I found in this answered question:

    Android USB host and hidden devices

    I was on the right track and now I am 🙂 again. I am sure that someone else will find my quest to find this answer helpful.

    BUT, only the HashMap enumeration method works, the intent filter method still returns action as android.intent.action.MAIN.

    Thanks for input!

    Dale

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm connecting an HTC Nexus One to my PC via USB (using ADB), running
I have a USB device that I'm attempting to communicate to with my Android
I'm trying to write my own controller for a USB device instead of using
I am using the Linux driver g_ether to communicate Ethernet over USB for an
According to Android Honeycomb it supports USB peripherals. I am interested in connecting a
Is it possible me to start my android application if the user connecting USB
After connecting my device to my real device (Galaxy S / Android 2.3.3) and
I am able to transfer files from my android device to pc over WiFi
I'm using RegisterDeviceNotification to watch for changes to a USB device, using the WM_DEVICECHANGE
I have a USB GSM device which I use for Internet connection as well

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.