Modify

Opened 7 years ago

Closed 4 years ago

Last modified 4 years ago

#9352 closed defect (obsolete)

usb-modeswitch not switching on boot.

Reported by: Crazy Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:

Description

Hi, I have a problem with usb-modeswitch that not switch on boot.
The only way is unplug and plug my internet key :(

Tested with Huawei e1820 and e352

Many thanks !

Attachments (0)

Change History (14)

comment:1 follow-ups: Changed 7 years ago by anonymous

You should try with the patch below:
http://luci.subsignal.org/~jow/usb-coldplug.patch

comment:2 in reply to: ↑ 1 Changed 7 years ago by Layne Edwards <ledwards@…>

Replying to anonymous:

You should try with the patch below:
http://luci.subsignal.org/~jow/usb-coldplug.patch

Here is the solution I came up with:

Index: feeds/packages/utils/usb-modeswitch/files/modeswitch.hotplug
===================================================================
--- feeds/packages/utils/usb-modeswitch/files/modeswitch.hotplug        (revision 26751)
+++ feeds/packages/utils/usb-modeswitch/files/modeswitch.hotplug        (working copy)
@@ -118,9 +118,13 @@
                }
 
                # If a candidate is remaining, start usb-modeswitch
-               [ -n "$configs" ] && {
+               local uptime
+               [ -n "$configs" ] && (
+                       uptime=$(cat /proc/uptime | awk -F. '{print $1}')
+                       [ $uptime -lt 60 ] && sleep 1 # sleep for 1 second on coldplug
                        log "$DEVICENAME: Selecting ${configs%% *} for mode switching"
-                       $modeswitch -c "${configs%% *}"
-               }
+                       $modeswitch -W -c "${configs%% *}" >> /tmp/log/usb-modeswitch
+                       [ $uptime -lt 60 ] && $modeswitch -W -c "${configs%% *}" >> /tmp/log/usb-modeswitch
+               ) &
        }
 fi

I found that forcing a subsequent modeswitch on coldboot solves the problem for me. The first modeswitch doesn't switch after 20 seconds. The second modeswitch switches right away. I'm not sure why it doesn't switch the first time, but I tried giving it more time and it didn't help.

JoW's solution may be a better option. I will try it.

Layne

comment:3 Changed 7 years ago by Layne Edwards <ledwards@…>

You might also want to update to the latest usb-modeswitch. See OpenWrt Developer Mailing List for patches update patches.

comment:4 follow-up: Changed 7 years ago by Crazy

Hi, i build r26837 from trunk and doesn't work.

This is the log:

BusyBox v1.18.4 (2011-05-06 09:17:21 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 ATTITUDE ADJUSTMENT (bleeding edge, r26833) ----------
  * 1/4 oz Vodka      Pour all ingredents into mixing
  * 1/4 oz Gin        tin with ice, strain into glass.
  * 1/4 oz Amaretto
  * 1/4 oz Triple sec
  * 1/4 oz Peach schnapps
  * 1/4 oz Sour mix
  * 1 splash Cranberry juice
 -----------------------------------------------------
root@OpenWrt:~# dmesg
Linux version 2.6.37.6 (nucleotec@nucleotec-linux) (gcc version 4.5.2 (Linaro GCC 4.5-2011.02-0) ) #1 Fri May 6 10:10:12 CEST 2011
CPU revision is: 00029029 (Broadcom BMIPS3300)
ssb: Core 0 found: ChipCommon (cc 0x800, rev 0x14, vendor 0x4243)
ssb: Core 1 found: Fast Ethernet (cc 0x806, rev 0x09, vendor 0x4243)
ssb: Core 2 found: MIPS 3302 (cc 0x816, rev 0x08, vendor 0x4243)
ssb: Core 3 found: USB 2.0 Host (cc 0x819, rev 0x02, vendor 0x4243)
ssb: Core 4 found: MEMC SDRAM (cc 0x80F, rev 0x04, vendor 0x4243)
ssb: Core 5 found: IEEE 802.11 (cc 0x812, rev 0x0D, vendor 0x4243)
ssb: Core 6 found: Roboswitch (cc 0x81C, rev 0x02, vendor 0x4243)
ssb: chipcommon status is 0x0
ssb: Found rev 0 PMU (capabilities 0x04A63400)
ssb: Initializing MIPS core...
ssb: set_irq: core 0x0806, irq 4 => 4
ssb: set_irq: core 0x0816, irq 5 => 2
ssb: set_irq: core 0x0812, irq 2 => 5
ssb: after irq reconfiguration
ssb: core 0x0800, irq : 2(S)  3* 4  5  6  D  I
ssb: core 0x0806, irq : 2(S)  3  4* 5  6  D  I
ssb: core 0x0816, irq : 2(S)* 3  4  5  6  D  I
ssb: core 0x0819, irq : 2(S)  3  4  5  6* D  I
ssb: core 0x080f, irq : 2(S)  3  4  5  6  D  I*
ssb: core 0x0812, irq : 2(S)  3  4  5* 6  D  I
ssb: core 0x081c, irq : 2(S)  3  4  5  6  D  I*
ssb: Sonics Silicon Backplane found at address 0x18000000
Serial init done.
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal   0x00000000 -> 0x00002000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00002000
On node 0 totalpages: 8192
free_area_init_node: node 0, pgdat 80264480, node_mem_map 81000000
  Normal zone: 64 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 8128 pages, LIFO batch:0
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line:  root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Primary instruction cache 16kB, VIPT, 4-way, linesize 16 bytes.
Primary data cache 16kB, 2-way, VIPT, cache aliases, linesize 16 bytes
Memory: 29692k/32768k available (2135k kernel code, 3076k reserved, 310k data, 152k init, 0k highmem)
NR_IRQS:128
console [ttyS0] enabled
Calibrating delay loop... 239.10 BogoMIPS (lpj=478208)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
Switching to clocksource MIPS
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
PCI: CLS 0 bytes, default 32
squashfs: version 4.0 (2009/01/31) Phillip Lougher
JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
msgmni has been set to 57
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver, 2 ports, IRQ sharing enabled
serial8250: ttyS0 at MMIO 0xb8000300 (irq = 3) is a U6_16550A
serial8250: ttyS1 at MMIO 0xb8000400 (irq = 3) is a U6_16550A
serial8250.0: ttyS0 at MMIO 0xb8000300 (irq = 3) is a U6_16550A
serial8250.0: ttyS1 at MMIO 0xb8000400 (irq = 3) is a U6_16550A
flash init: 0x1c000000 0x02000000
Physically mapped flash: Found 1 x16 devices at 0x0 in 8-bit bank. Manufacturer ID 0x000001 Chip ID 0x0000f6
Physically mapped flash: Found an alias at 0x400000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x800000 for the chip at 0x0
Physically mapped flash: Found an alias at 0xc00000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1000000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1400000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1800000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1c00000 for the chip at 0x0
Amd/Fujitsu Extended Query Table at 0x0040
  Amd/Fujitsu Extended Query version 1.1.
Physically mapped flash: Swapping erase regions for top-boot CFI table.
number of CFI chips: 1
Flash device: 0x400000 at 0x1fc00000
bootloader size: 262144
Looking for dual image
TRX offset : 0
Creating 4 MTD partitions on "Physically mapped flash":
0x000000000000-0x000000040000 : "cfe"
0x000000040000-0x0000003f0000 : "linux"
0x00000010e400-0x0000003f0000 : "rootfs"
mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
mtd: partition "rootfs" set to be root filesystem
mtd: partition "rootfs_data" created automatically, ofs=360000, len=90000
0x000000360000-0x0000003f0000 : "rootfs_data"
0x0000003f0000-0x000000400000 : "nvram"
b44: b44.c:v2.0
b44 ssb0:0: eth0: Broadcom 44xx/47xx 10/100BaseT Ethernet 00:90:4c:c0:00:00
BCM47xx Watchdog Timer enabled (30 seconds, nowayout)
TCP westwood registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
Freeing unused kernel memory: 152k freed
diag: Detected 'D-Link DIR-320'
b44 ssb0:0: eth0: Link is up at 100 Mbps, full duplex
b44 ssb0:0: eth0: Flow control is off for TX and off for RX
roboswitch: Probing device eth0: found a 5325! It's a 5350.
JFFS2 notice: (262) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (0 unchecked, 0 orphan) and 6 of xref (0 dead, 3 orphan) found.
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci_hcd ssb0:1: SSB OHCI Controller
ohci_hcd ssb0:1: new USB bus registered, assigned bus number 1
ohci_hcd ssb0:1: irq 6, io mem 0x18003000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
ohci_hcd ssb0:1: SSB EHCI Controller
ohci_hcd ssb0:1: new USB bus registered, assigned bus number 2
ohci_hcd ssb0:1: irq 6, io mem 0x18003800
ohci_hcd ssb0:1: USB 0.0 started, EHCI 1.00
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usb 2-1: new high speed USB device using ohci_hcd and address 2
scsi0 : usb-storage 2-1:1.0
scsi1 : usb-storage 2-1:1.1
scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
scsi 1:0:0:0: Direct-Access     HUAWEI   TF CARD Storage       PQ: 0 ANSI: 2
sd 1:0:0:0: [sda] Attached SCSI removable disk
b44 ssb0:0: eth0: powering down PHY
b44 ssb0:0: eth0: Link is up at 100 Mbps, full duplex
b44 ssb0:0: eth0: Flow control is off for TX and off for RX
Compat-wireless backport release: compat-wireless-2011-04-14
Backport based on wireless-testing.git master-2011-04-19
device eth0.0 entered promiscuous mode
device eth0 entered promiscuous mode
br-lan: port 1(eth0.0) entering forwarding state
br-lan: port 1(eth0.0) entering forwarding state
cfg80211: Calling CRDA to update world regulatory domain
b43-phy0: Broadcom 5354 WLAN found (core revision 13)
ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
Registered led device: b43-phy0::tx
Registered led device: b43-phy0::rx
Broadcom 43xx driver loaded [ Features: PL, GPIO LED Mask: 0x000f, Firmware-ID: FW13 ]
Broadcom 43xx-legacy driver loaded [ Features: PLID, Firmware-ID: FW10 ]
cfg80211: World regulatory domain updated:
cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
cfg80211:     (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
cfg80211:     (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
NTFS driver 2.1.29 [Flags: R/O MODULE].
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2006 Netfilter Core Team
NET: Registered protocol family 24
nf_conntrack version 0.5.0 (466 buckets, 1864 max)
xt_time: kernel timezone is -0000
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
usbcore: registered new interface driver ums-alauda
usbcore: registered new interface driver ums-cypress
usbcore: registered new interface driver ums-datafab
usbcore: registered new interface driver ums-freecom
usbcore: registered new interface driver ums-isd200
usbcore: registered new interface driver ums-jumpshot
usbcore: registered new interface driver ums-karma
usbcore: registered new interface driver ums-sddr09
usbcore: registered new interface driver ums-sddr55
usbcore: registered new interface driver ums-usbat
USB Serial support registered for GSM modem (1-port)
usbcore: registered new interface driver option
option: v0.7.2:USB Driver for GSM modems
b43-phy0: Loading firmware version 410.2160 (2007-05-26 15:32:10)
b43-phy0: Loading firmware version 410.2160 (2007-05-26 15:32:10)
device wlan0 entered promiscuous mode
br-lan: port 2(wlan0) entering forwarding state
br-lan: port 2(wlan0) entering forwarding state
device wlan0 left promiscuous mode
br-lan: port 2(wlan0) entering forwarding state
device wlan0 entered promiscuous mode
br-lan: port 2(wlan0) entering forwarding state
br-lan: port 2(wlan0) entering forwarding state

If I unplug and plug my Huawei e1820 connect

usb 2-1: USB disconnect, address 2
usb 2-1: new high speed USB device using ohci_hcd and address 3
scsi2 : usb-storage 2-1:1.0
scsi3 : usb-storage 2-1:1.1
usb 2-1: usbfs: process 1574 (usb_modeswitch) did not claim interface 0 before use
usb 2-1: USB disconnect, address 3
usb 2-1: new high speed USB device using ohci_hcd and address 4
option 2-1:1.0: GSM modem (1-port) converter detected
usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0
option 2-1:1.1: GSM modem (1-port) converter detected
usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1
option 2-1:1.2: GSM modem (1-port) converter detected
usb 2-1: GSM modem (1-port) converter now attached to ttyUSB2
option 2-1:1.3: GSM modem (1-port) converter detected
usb 2-1: GSM modem (1-port) converter now attached to ttyUSB3
scsi4 : usb-storage 2-1:1.4
scsi5 : usb-storage 2-1:1.5
scsi 4:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
scsi 5:0:0:0: Direct-Access     HUAWEI   TF CARD Storage       PQ: 0 ANSI: 2
sd 5:0:0:0: [sda] Attached SCSI removable disk
root@OpenWrt:~#

I installed:

root@OpenWrt:~# opkg list-installed
base-files - 68-r26833
blkid - 1.41.12-1
block-mount - 0.2.0-5
busybox - 1.18.4-1
chat - 2.4.4-17
comgt - 0.32-9
crda - 1.1.1-1
ddns-scripts - 1.0.0-13
dnsmasq - 2.57-1
dropbear - 0.53.1-3
firewall - 2-25
hotplug2 - 1.0-beta-4
iptables - 1.4.10-2
iptables-mod-conntrack - 1.4.10-2
iptables-mod-conntrack-extra - 1.4.10-2
iptables-mod-filter - 1.4.10-2
iptables-mod-ipopt - 1.4.10-2
iptables-mod-nat - 1.4.10-2
iw - 0.9.22-1
kernel - 2.6.37.6-1
kmod-b43 - 2.6.37.6+2011-04-19-3
kmod-b43legacy - 2.6.37.6+2011-04-19-3
kmod-cfg80211 - 2.6.37.6+2011-04-19-3
kmod-crc-ccitt - 2.6.37.6-1
kmod-crc16 - 2.6.37.6-1
kmod-crypto-aes - 2.6.37.6-1
kmod-crypto-arc4 - 2.6.37.6-1
kmod-crypto-core - 2.6.37.6-1
kmod-diag - 2.6.37.6-10
kmod-fs-ext4 - 2.6.37.6-1
kmod-fs-mbcache - 2.6.37.6-1
kmod-fs-ntfs - 2.6.37.6-1
kmod-ifb - 2.6.37.6-1
kmod-ipt-conntrack - 2.6.37.6-1
kmod-ipt-conntrack-extra - 2.6.37.6-1
kmod-ipt-core - 2.6.37.6-1
kmod-ipt-filter - 2.6.37.6-1
kmod-ipt-ipopt - 2.6.37.6-1
kmod-ipt-nat - 2.6.37.6-1
kmod-ipt-nathelper - 2.6.37.6-1
kmod-mac80211 - 2.6.37.6+2011-04-19-3
kmod-nls-base - 2.6.37.6-1
kmod-ppp - 2.6.37.6-1
kmod-pppoe - 2.6.37.6-1
kmod-sched - 2.6.37.6-1
kmod-scsi-core - 2.6.37.6-1
kmod-switch - 2.6.37.6-4
kmod-textsearch - 2.6.37.6-1
kmod-usb-core - 2.6.37.6-1
kmod-usb-ohci - 2.6.37.6-1
kmod-usb-serial - 2.6.37.6-1
kmod-usb-serial-option - 2.6.37.6-1
kmod-usb-serial-wwan - 2.6.37.6-1
kmod-usb-storage - 2.6.37.6-1
kmod-usb-storage-extras - 2.6.37.6-1
kmod-usb2 - 2.6.37.6-1
libblkid - 1.41.12-1
libc - 0.9.32-68
libgcc - linaro-68
libip4tc - 1.4.10-2
libiwinfo - 15
liblua - 5.1.4-8
libnl-tiny - 0.1-2
libuci - 2011-03-27.2-1
libuci-lua - 2011-03-27.2-1
libusb - 0.1.12-2
libuuid - 1.41.12-1
libxtables - 1.4.10-2
lua - 5.1.4-8
luci - 0.10+svn7030-1
luci-app-ddns - 0.10+svn7030-1
luci-app-firewall - 0.10+svn7030-1
luci-app-qos - 0.10+svn7030-1
luci-app-upnp - 0.10+svn7030-1
luci-i18n-english - 0.10+svn7030-1
luci-lib-core - 0.10+svn7030-1
luci-lib-ipkg - 0.10+svn7030-1
luci-lib-lmo - 0.10+svn7030-1
luci-lib-nixio - 0.10+svn7030-1
luci-lib-sys - 0.10+svn7030-1
luci-lib-web - 0.10+svn7030-1
luci-mod-admin-core - 0.10+svn7030-1
luci-mod-admin-full - 0.10+svn7030-1
luci-sgi-cgi - 0.10+svn7030-1
luci-theme-base - 0.10+svn7030-1
luci-theme-openwrt - 0.10+svn7030-1
miniupnpd - 1.5.20110309-1
mtd - 15
nvram - 9
opkg - 618-1
ppp - 2.4.4-17
ppp-mod-pppoe - 2.4.4-17
qos-scripts - 1.2.1-5
swap-utils - 2.13.0.1-4
tc - 2.6.35-3
uci - 2011-03-27.2-1
uhttpd - 22
usb-modeswitch - 1.1.4-1
usb-modeswitch-data - 20100826-1
wireless-tools - 29-4
wpad-mini - 20110421-1

Same problem also with TP-Link MR3420 and 1043ND.

Many thanks!

comment:5 in reply to: ↑ 4 Changed 7 years ago by Layne Edwards <ledwards@…>

Replying to Crazy:

Hi, i build r26837 from trunk and doesn't work.

Did you try either of the above two patches? You'll have to manually patch and rebuild. Nothing has made it to trunk yet.

comment:6 Changed 7 years ago by anonymous

Opss sorry ... please can you tell me how I can add patch ?

Many thanks Layne :)

comment:7 Changed 7 years ago by Crazy

Ok guys, I use this patch(http://luci.subsignal.org/~jow/usb-coldplug.patch) and now all is perfect !!

Please add this patch to trunk :)

Many thanks for your help Layne and Jow, I never see a support better of this.

comment:8 in reply to: ↑ 1 Changed 7 years ago by Layne Edwards <ledwards@…>

Replying to anonymous:

You should try with the patch below:
http://luci.subsignal.org/~jow/usb-coldplug.patch

This is also working well for me. I think this is the best option. I like it better than my hack. Thanks Jow!

comment:9 Changed 7 years ago by Crazy <matumminia@…>

I checked this patch also with usb extroot+usb-modeswitch and is perfect !

Thanks again !

comment:10 Changed 7 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

Added in r26848

comment:11 Changed 7 years ago by Crazy

  • Resolution fixed deleted
  • Status changed from closed to reopened

Hi, I don't know why but this fix isn't working with the new version of usb_modeswitch !

comment:12 Changed 4 years ago by nbd

  • Resolution set to obsolete
  • Status changed from reopened to closed

comment:13 Changed 4 years ago by abramm@…

This is still an issue with r40867. The usb-coldplug.patch works though.
Should this issue be re-opened?

comment:14 Changed 4 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 closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.