Modify

Opened 4 years ago

Last modified 2 years ago

#10716 new defect

Mass storage missing from 3G dongle

Reported by: zxdavb Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: 3g dongle mass storage usb-serial usb-storage usb-modeswitch Cc:

Description

Hi,

Background: I use a Hauwei E367 3G dongle, which like many such 3G dongles requires the use of usb_modeswitch to be functional. FWIW, the relevant packages are:

    opkg install usb-modeswitch usb-modeswitch-data
    opkg install kmod-usb-serial
    opkg install kmod-usb-storage

There is an issue with the usb-serial package 'stealing' all the interfaces from the USB device, and therefore the mass storage is unavailable. That is, I get the following by default:

root@db-router:~# cat /proc/bus/usb/devices | grep Driver
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=usbserial_generic
I:* If#= 1 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=01 Prot=09 Driver=(none)
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=08 Driver=usbserial_generic
I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=03 Driver=usbserial_generic
I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=02 Driver=usbserial_generic
I:* If#= 5 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usbserial_generic
I:* If#= 6 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usbserial_generic

But I know that the device has both a 3G modem (e.g. /dev/ttyUSB0) AND mass-storage (e.g. /dev/sda1). However, if I execute the following:

root@db-router:/etc/modules.d# mv 60-usb-serial 61-usb-serial

After re-booting the router, I end up with:

root@db-router:~# cat /proc/bus/usb/devices | grep Driver
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=usbserial_generic
I:* If#= 1 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=01 Prot=09 Driver=(none)
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=08 Driver=usbserial_generic
I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=03 Driver=usbserial_generic
I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=02 Driver=usbserial_generic
I:* If#= 5 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
I:* If#= 6 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

Success!!

I am not sure of the wider impact of moving 60-usb-serial to 61-usb-serial (or 60-usb-storage to 59-usb-storage), so I will leave it up to you.

-zxdavb

Attachments (0)

Change History (7)

comment:1 Changed 4 years ago by jb

I've got an Hauwei E1752 3G dongle and also wants to use the microSD. The steps above work, but I need an additional step to "wake up" the microSD.

After boot I can only see /dev/sda

However whenever I do a "head /dev/sda > null" it recognises the partition and add /dev/sda1

From logread:

Feb  6 08:25:37 OpenWrt user.notice kernel: sd 8:0:0:0: [sda] 3932160 512-byte logical blocks: (2.01 GB/1.87 GiB)
Feb  6 08:25:37 OpenWrt user.err kernel: sd 8:0:0:0: [sda] Assuming drive cache: write through
Feb  6 08:25:37 OpenWrt user.err kernel: sd 8:0:0:0: [sda] Assuming drive cache: write through
Feb  6 08:25:37 OpenWrt user.info kernel:  sda: sda1

Having /dev/sda1 I can mount it.

comment:2 Changed 4 years ago by anonymous

TP-link MR3420 and Huawei E159 with SD card plus "Altitude Adjustment". System could not see disk partitions after boot, which cased problems with extroot.Backfire didn't show that kind of issues.

[ 11.050000] hub 1-0:1.0: USB hub found
[ 11.060000] hub 1-0:1.0: 1 port detected
[ 11.080000] Initializing USB Mass Storage driver...
[ 11.080000] usbcore: registered new interface driver usb-storage
[ 11.090000] USB Mass Storage support registered.
[ 11.380000] usb 1-1: new high-speed USB device number 2 using ehci-platform
[ 11.550000] scsi3 : usb-storage 1-1:1.3
[ 12.550000] scsi 3:0:0:0: Direct-Access HUAWEI MMC Storage 2.31 PQ: 0 ANSI: 2
[ 12.600000] sd 3:0:0:0: [sda] Attached SCSI removable disk
[ 31.520000] eth0: link down

comment:3 Changed 3 years ago by anonymous

tech@tech-Inspiron-N5010:~$ sudo usb_modeswitch -H -v 20a6 -p f00e

Looking for default devices …
found matching product ID
adding device
Found device in default mode, class or configuration (1)
Accessing device 007 on bus 002 …
Getting the current device configuration …
OK, got current device configuration (1)
Using first interface: 0×00
Using endpoints 0×01 (out) and 0×81 (in)
Inquiring device details; driver will be detached …
Looking for active driver …
No driver found. Either detached before or never attached

SCSI inquiry data (for identification)
————————-
Vendor String: Modem
Model String: Disk
Revision String: 2.31
————————-

USB description data (for identification)
————————-
Manufacturer: Modem
Product: Modem Device
Serial No.: 000000000002
————————-
Sending Huawei control message …
OK, Huawei control message sent
-> Run lsusb to note any changes. Bye.

tech@tech-Inspiron-N5010:~$ sudo modprobe usbserial vendor=0x20a6 product=0xf00e

usb-devices
T: Bus=02 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 7 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=20a6 ProdID=f00e Rev=00.00
S: Manufacturer=Modem
S: Product=Modem Device
S: SerialNumber=000000000002
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=500mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=(none)

i have tried this all i am using intex 3.5g modem and have tried to configure rules and modules also but nothing has worked can u tell me wats d real prob,i ll be grateful as i am really hassled by this.

comment:4 Changed 3 years ago by attila.lendvai@…

i can also confirm the symptom that if i plug in a Huawei 3g dongle with an MMC card in it using a tp-link 3020, then the partitions don't get propagated.

if i do fdisk -l /dev/sda (or use head as suggested above), then the partitions show up.

if i reboot the 3020 then partitions are visible, extroot works, etc (i think somehow what matters is that the usb dongle doesn't get detached from power).

comment:5 Changed 3 years ago by attila.lendvai@…

this is the workaround i added, but it's not something that should go into trunk as it is...

in /lib/preinit/50_determine_usb_root after the sleep $extroot_settle_time, i call this function:

wait_for_huawei_mmc() {
    # this is needed for the mmc card in some (all?) Huawei 3G dongle.
    # details: https://dev.openwrt.org/ticket/10716#comment:4
    # VID = 12d1 (Huawei Technologies Co., Ltd.)
    echo "Looking for any Huawei 3G dongles"
    if (/usr/bin/lsusb | grep -q "12d1:1001") then
        echo "Seems like we have a Huawei 3G dongle"
        # wait a bit to make sure the /dev/sda file of the mmc is already populated
        end=$(($(date +%s) + 20))
        while ! (blkid -U 05d615b3-bef8-460c-9a23-52db8d09e000) && [ $(date +%s) -lt $end ]
        do
            # we need to try to read from the device, otherwise partitions won't get populated.
            # this shouldn't be needed, but it is the case on openwrt 12.09 and 12d1:1001
            # TODO: read sd[a-f] to support multiple dongles?
            echo "Waiting for MMC drive to show up..."
            head -c 1k /dev/sda >/dev/null
            sleep 1
        done

        echo "Huawei 3G dongle kludge delay is done, root is '"`blkid -U 05d615b3-bef8-460c-9a23-52db8d09e000`"'"
        cat /proc/partitions

        #if [ ! -e /dev/sda ]; then
        #    echo "Still no /dev/sda?! Rebooting..."
        #    reboot
        #fi
    else
        echo "No Huawei 3G dongles found"
    fi
}

the thing is that the dongle advertises /dev/sda, but for the first few seconds it will say "No Media present" or something similar. when rebooting without taking away the power from the dongle this delay doesn't happen.

another peculiarity is that you need to try to actually try to read from the device for the partition table to get populated into /dev/sda1, etc.

on a related note, i had to copy the file, edit it, and overwrite using imagebuilder. not ideal, but i couldn't attach this as a hook, because of the structure of the file.

comment:6 Changed 3 years ago by attila.lendvai@…

forgot to mention that i've tried two different 3G dongles, both with the above mentioned lsusb id (Huawei E1550, E153), and they behave exactly the same in this regard.

comment:7 Changed 2 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.