USB error: couldn’t opendir(): No such file or directory

来源:互联网 发布:中美无人机 知乎 编辑:程序博客网 时间:2024/06/04 22:07

Solution – USB error: couldn’t opendir(): No such file or directory

“USB error: couldn’t opendir(): No such file or directory”

This was a dirty little error that made my life miserable for a while. Read down for the solution.

When it happened?

While trying to use Reliance Netconnect USB 3G dongle on Froyo v2.2 of android.

How it happened?

While executing the following command to switch the USB device to modem mode using ‘usb_modeswitch’ tool.

$ usb_modeswitch -I -W -c /etc/usb_modeswitch.conf

What is the solution?

Pre-requisites

  1. Turn on USBFS on kernel (CONFIG_USB_DEVICEFS in .config)  and use that uImage for booting.
  2. Download the usb_modeswitch arm application from here.
  3. Find out the Vendor ID and Product ID by connecting the dongle to a PC
  4. Once you download ‘usb_modeswitch’, there will be a folder ‘usb_modeswitch.d’ inside which look for a file named vendorID:productID of your device. (relce vendorID and productID with the values you found out in step 3). Use this file as argument to ‘usb_modeswtich’

Execution

  1. Once the board is booted, execute ‘mount -t usbfs usbfs /proc/bus/usb‘ from the terminal.
  2. Now execute the command ‘/system/bin/usb_modeswitch -I -W -c /etc/usb_modeswitch.conf
    1. Note – replace ‘usb_modeswitch.conf‘ with the configuration file corresponding to your 3G dongle.