Activation Codes and Methods, Hardware Details, Sniffing
Post Reply
tero999
Posts: 1
Joined: 11 Nov 2012, 23:01

E173s on raspberry pi sometimes works sometimes not

Post by tero999 » 11 Nov 2012, 23:07

Any ideas why usb modeswitch at random sometimes works and sometimes not?!
I have a raspberry pi with huawei e173 and whenn I turn it on sometimes lsusb shows correct ID and sometimes not?!
What can I actually do?

When is NOT working logs show this:

Code: Select all



USB_ModeSwitch log from Thu Jan  01 01:00:06 CET 1970

Raw args from udev: /1-1.3:1.0

Using global config file: /etc/usb_modeswitch.conf
Using top device dir /sys/bus/usb/devices/1-1.3
----------------
USB values from sysfs:
  manufacturer	HUAWEI
  product	HUAWEI Mobile
  serial	
----------------
bNumConfigurations is 1 - don't check for active configuration
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz
SCSI attributes not needed, moving on
checking config: pack/12d1:1c0b
! matched. Reading config data
Extracting config 12d1:1c0b from collection /usr/share/usb_modeswitch/configPack.tar.gz
config: TargetVendor set to 12d1
config: TargetProductList set to 1c05,1c07,1c08
Driver module is "option", ID path is /sys/bus/usb-serial/drivers/option1

Command to be run:
usb_modeswitch -I -W -D -s 20 -u -1 -b 1 -g 4 -v 12d1 -p 1c0b -f $configBuffer

Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are to be expected in the process)
--------------------------------

Reading long config from command line

 * usb_modeswitch: handle USB devices with multiple modes
 * Version 1.2.3 (C) Josua Dietze 2012
 * Based on libusb0 (0.1.12 and above)

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x12d1
DefaultProduct= 0x1c0b
TargetVendor=   0x12d1
TargetProduct=  not set
TargetClass=    not set
TargetProductList="1c05,1c07,1c08"

DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
QisdaMode=0
GCTMode=0
KobilMode=0
SequansMode=0
MobileActionMode=0
CiscoMode=0
MessageEndpoint=  not set
MessageContent="55534243123456780000000000000011062000000100000000000000000000"
NeedResponse=0
ResponseEndpoint= not set

InquireDevice disabled
Success check enabled, max. wait time 20 seconds
System integration mode enabled


Use given bus/device number: 001/004 ...
Looking for default devices ...
 bus/device number matched
  searching devices, found USB ID 12d1:1c0b
   found matching vendor ID
   found matching product ID
   adding device
 Found device in default mode, class or configuration (1)
Skipping the check for the current configuration
Using first interface: 0x00
Using endpoints 0x0f (out) and 0x8f (in)

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI
     Product: HUAWEI Mobile
  Serial No.: not provided
-------------------------
Looking for active driver ...
 OK, driver found ("usb-storage")
 OK, driver "usb-storage" detached
Setting up communication with interface 0
Using endpoint 0x0f for message sending ...
Trying to send message 1 to endpoint 0x0f ...
 OK, message successfully sent
Resetting response endpoint 0x8f
Resetting message endpoint 0x0f
Bus/dev search active, referring success check to wrapper. Bye.

ok:busdev
--------------------------------
(end of usb_modeswitch output)

Checking success of mode switch for max. 20 seconds ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...
 Reading attributes ...

Target config not matching - current values are
    1-1.3:1.0/bInterfaceClass: 08
    bConfigurationValue:       1
    bNumConfigurations:        1
    busnum:                    1
    devnum:                    4
    idProduct:                 1c0b
    idVendor:                  12d1
    manufacturer:              HUAWEI
    product:                   HUAWEI Mobile
    serial:                    

Mode switching may have failed. Exiting





But when IS working log show this

Code: Select all



USB_ModeSwitch log from Sun Nov  11 21:54:37 CET 2012

Raw args from udev: /1-1.3:1.0

Using global config file: /etc/usb_modeswitch.conf
Using top device dir /sys/bus/usb/devices/1-1.3
----------------
USB values from sysfs:
  manufacturer	HUAWEI
  product	HUAWEI Mobile
  serial	
----------------
bNumConfigurations is 1 - don't check for active configuration
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz
SCSI attributes not needed, moving on
checking config: pack/12d1:1c0b
! matched. Reading config data
Extracting config 12d1:1c0b from collection /usr/share/usb_modeswitch/configPack.tar.gz
config: TargetVendor set to 12d1
config: TargetProductList set to 1c05,1c07,1c08
Driver module is "option", ID path is /sys/bus/usb-serial/drivers/option1

Command to be run:
usb_modeswitch -I -W -D -s 20 -u -1 -b 1 -g 5 -v 12d1 -p 1c0b -f $configBuffer

Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are to be expected in the process)
--------------------------------

Reading long config from command line

 * usb_modeswitch: handle USB devices with multiple modes
 * Version 1.2.3 (C) Josua Dietze 2012
 * Based on libusb0 (0.1.12 and above)

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x12d1
DefaultProduct= 0x1c0b
TargetVendor=   0x12d1
TargetProduct=  not set
TargetClass=    not set
TargetProductList="1c05,1c07,1c08"

DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
QisdaMode=0
GCTMode=0
KobilMode=0
SequansMode=0
MobileActionMode=0
CiscoMode=0
MessageEndpoint=  not set
MessageContent="55534243123456780000000000000011062000000100000000000000000000"
NeedResponse=0
ResponseEndpoint= not set

InquireDevice disabled
Success check enabled, max. wait time 20 seconds
System integration mode enabled


Use given bus/device number: 001/005 ...
Looking for default devices ...
 bus/device number matched
  searching devices, found USB ID 12d1:1c0b
   found matching vendor ID
   found matching product ID
   adding device
 Found device in default mode, class or configuration (1)
Skipping the check for the current configuration
Using first interface: 0x00
Using endpoints 0x0f (out) and 0x8f (in)

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI
     Product: HUAWEI Mobile
  Serial No.: not provided
-------------------------
Looking for active driver ...
 OK, driver found ("usb-storage")
 OK, driver "usb-storage" detached
Setting up communication with interface 0
Using endpoint 0x0f for message sending ...
Trying to send message 1 to endpoint 0x0f ...
 OK, message successfully sent
Resetting response endpoint 0x8f
Resetting message endpoint 0x0f
 Could not reset endpoint (probably harmless): -9
 Device is gone, skipping any further commands
Bus/dev search active, referring success check to wrapper. Bye.

ok:busdev
--------------------------------
(end of usb_modeswitch output)

Checking success of mode switch for max. 20 seconds ...
 Waiting for device file system (1 sec.) ...
 Waiting for device file system (2 sec.) ...
 Waiting for device file system (3 sec.) ...
 Waiting for device file system (4 sec.) ...
 Waiting for device file system (5 sec.) ...
 Waiting for device file system (6 sec.) ...
 Reading attributes ...
 All attributes matched
Mode switching was successful, found 12d1:1c05 (HUAWEI: HUAWEI Mobile)
Logger is /usr/bin/logger
Now checking for bound driver ...
 driver has bound, device is known
Checking for AVOID_RESET_QUIRK kernel attribute
 AVOID_RESET_QUIRK activated

All done, exiting



benxico
Posts: 9
Joined: 11 May 2013, 16:35

Re: E173s sometime modem off, some time modem on

Post by benxico » 12 May 2013, 02:40

Hello,

I have probably the same problem.
I have a E173s 3G USB dongle (from Tmobile), on a raspberry with raspbian.
When I start the raspberry sometime the E173S is in modem on, some time in modem off.

When modem is off, dsmsg give :

Code: Select all

[    0.000000] Console: colour dummy device 80x30
[    0.000000] console [tty1] enabled
[    0.001011] Calibrating delay loop... 464.48 BogoMIPS (lpj=2322432)
[    0.060062] pid_max: default: 32768 minimum: 301
[    0.060414] Mount-cache hash table entries: 512
[    0.061184] Initializing cgroup subsys cpuacct
[    0.061240] Initializing cgroup subsys devices
[    0.061273] Initializing cgroup subsys freezer
[    0.061302] Initializing cgroup subsys blkio
[    0.061396] CPU: Testing write buffer coherency: ok
[    0.061730] hw perfevents: enabled with v6 PMU driver, 3 counters available
[    0.061872] Setting up static identity map for 0x39d3f8 - 0x39d454
[    0.063373] devtmpfs: initialized
[    0.074139] NET: Registered protocol family 16
[    0.080632] DMA: preallocated 4096 KiB pool for atomic coherent allocations
[    0.081730] bcm2708.uart_clock = 0
[    0.083094] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
[    0.083147] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.083184] mailbox: Broadcom VideoCore Mailbox driver
[    0.083278] bcm2708_vcio: mailbox at f200b880
[    0.083378] bcm_power: Broadcom power driver
[    0.083416] bcm_power_open() -> 0
[    0.083442] bcm_power_request(0, 8)
[    0.584128] bcm_mailbox_read -> 00000080, 0
[    0.584168] bcm_power_request -> 0
[    0.584194] Serial: AMBA PL011 UART driver
[    0.584335] dev:f1: ttyAMA0 at MMIO 0x20201000 (irq = 83) is a PL011 rev3
[    0.908238] console [ttyAMA0] enabled
[    0.931716] bio: create slab <bio-0> at 0
[    0.936599] SCSI subsystem initialized
[    0.940687] usbcore: registered new interface driver usbfs
[    0.946268] usbcore: registered new interface driver hub
[    0.951865] usbcore: registered new device driver usb
[    0.958203] Switching to clocksource stc
[    0.962442] FS-Cache: Loaded
[    0.965589] CacheFiles: Loaded
[    0.980367] NET: Registered protocol family 2
[    0.985654] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[    0.993396] TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
[    1.000187] TCP: Hash tables configured (established 16384 bind 16384)
[    1.006793] TCP: reno registered
[    1.010045] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    1.015943] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    1.022524] NET: Registered protocol family 1
[    1.027385] RPC: Registered named UNIX socket transport module.
[    1.033431] RPC: Registered udp transport module.
[    1.038153] RPC: Registered tcp transport module.
[    1.042898] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.050006] bcm2708_dma: DMA manager at f2007000
[    1.054787] bcm2708_gpio: bcm2708_gpio_probe c0515d98
[    1.060246] vc-mem: phys_addr:0x00000000 mem_base=0x1fa00000 mem_size:0x20000000(512 MiB)
[    1.069398] audit: initializing netlink socket (disabled)
[    1.074996] type=2000 audit(0.930:1): initialized
[    1.198194] VFS: Disk quotas dquot_6.5.2
[    1.202232] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.209292] FS-Cache: Netfs 'nfs' registered for caching
[    1.215039] NFS: Registering the id_resolver key type
[    1.220211] Key type id_resolver registered
[    1.224505] Key type id_legacy registered
[    1.228868] msgmni has been set to 971
[    1.234379] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    1.242078] io scheduler noop registered
[    1.246123] io scheduler deadline registered (default)
[    1.251305] io scheduler cfq registered
[    1.294280] Console: switching to colour frame buffer device 240x75
[    1.326806] kgdb: Registered I/O driver kgdboc.
[    1.332123] vc-cma: Videocore CMA driver
[    1.336230] vc-cma: vc_cma_base      = 0x00000000
[    1.341050] vc-cma: vc_cma_size      = 0x00000000 (0 MiB)
[    1.346604] vc-cma: vc_cma_initial   = 0x00000000 (0 MiB)
[    1.361399] brd: module loaded
[    1.369694] loop: module loaded
[    1.373388] vchiq: vchiq_init_state: slot_zero = 0xde000000, is_master = 0
[    1.381212] Loading iSCSI transport class v2.0-870.
[    1.387194] usbcore: registered new interface driver smsc95xx
[    1.393281] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    1.604287] Core Release: 2.80a
[    1.607552] Setting default values for core params
[    1.612572] Finished setting default values for core params
[    1.823359] Using Buffer DMA mode
[    1.826783] Periodic Transfer Interrupt Enhancement - disabled
[    1.832779] Multiprocessor Interrupt Enhancement - disabled
[    1.838486] OTG VER PARAM: 0, OTG VER FLAG: 0
[    1.842977] Dedicated Tx FIFOs mode
[    1.847606] dwc_otg: Microframe scheduler enabled
[    1.848042] dwc_otg bcm2708_usb: DWC OTG Controller
[    1.853254] dwc_otg bcm2708_usb: new USB bus registered, assigned bus number 1
[    1.860749] dwc_otg bcm2708_usb: irq 32, io mem 0x00000000
[    1.866471] Init: Port Power? op_state=1
[    1.870496] Init: Power Port (0)
[    1.873939] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.880897] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.888320] usb usb1: Product: DWC OTG Controller
[    1.893175] usb usb1: Manufacturer: Linux 3.6.11+ dwc_otg_hcd
[    1.899061] usb usb1: SerialNumber: bcm2708_usb
[    1.904526] hub 1-0:1.0: USB hub found
[    1.908430] hub 1-0:1.0: 1 port detected
[    1.912860] dwc_otg: FIQ enabled
[    1.912879] dwc_otg: NAK holdoff enabled
[    1.912900] Module dwc_common_port init
[    1.913128] Initializing USB Mass Storage driver...
[    1.918348] usbcore: registered new interface driver usb-storage
[    1.924599] USB Mass Storage support registered.
[    1.929499] usbcore: registered new interface driver libusual
[    1.935722] mousedev: PS/2 mouse device common for all mice
[    1.942113] bcm2835-cpufreq: min=700000 max=700000 cur=700000
[    1.947986] bcm2835-cpufreq: switching to governor powersavebcm2835-cpufreq: switching to governor powersave
[    1.958141] cpuidle: using governor ladder
[    1.962568] cpuidle: using governor menu
[    1.973583] sdhci: Secure Digital Host Controller Interface driver
[    1.986705] sdhci: Copyright(c) Pierre Ossman
[    1.998033] sdhci: Enable low-latency mode
[    2.052549] mmc0: SDHCI controller on BCM2708_Arasan [platform] using platform's DMA
[    2.067584] mmc0: BCM2708 SDHC host at 0x20300000 DMA 2 IRQ 77
[    2.082643] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.101081] usbcore: registered new interface driver usbhid
[    2.113838] Indeed it is in host mode hprt0 = 00021501
[    2.130801] usbhid: USB HID core driver
[    2.162851] TCP: cubic registered
[    2.192357] Initializing XFRM netlink socket
[    2.203782] mmc0: could read SD Status register (SSR) at the 2th attempt
[    2.222333] NET: Registered protocol family 17
[    2.244374] Key type dns_resolver registered
[    2.255963] mmc0: new high speed SDHC card at address b368
[    2.284966] mmcblk0: mmc0:b368 NCard 3.70 GiB
[    2.281836] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
[    2.309735]  mmcblk0: p1 p2
[    2.320182] registered taskstats version 1
[    2.392377] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    2.406559] Indeed it is in host mode hprt0 = 00001101
[    2.632642] usb 1-1: New USB device found, idVendor=0424, idProduct=9512
[    2.646616] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.661711] hub 1-1:1.0: USB hub found
[    2.674201] hub 1-1:1.0: 3 ports detected
[    2.962535] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    3.005114] EXT4-fs (mmcblk0p2): recovery complete
[    3.019996] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    3.035426] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    3.050589] devtmpfs: mounted
[    3.061676] Freeing init memory: 128K
[    3.073154] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    3.087643] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    3.106337] smsc95xx v1.0.4
[    3.177917] smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:22:27:ad
[    3.292588] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[    3.424415] usb 1-1.2: New USB device found, idVendor=05e3, idProduct=0608
[    3.440042] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    3.455192] usb 1-1.2: Product: USB2.0 Hub
[    3.469309] hub 1-1.2:1.0: USB hub found
[    3.482083] hub 1-1.2:1.0: 4 ports detected
[    3.592632] usb 1-1.3: new low-speed USB device number 5 using dwc_otg
[    3.733018] usb 1-1.3: New USB device found, idVendor=413c, idProduct=2103
[    3.756196] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    3.771316] usb 1-1.3: Product: Dell USB/PS2 Combo Rackmount Keyboard
[    3.786922] usb 1-1.3: Manufacturer: LITE-ON Technology
[    3.814638] input: LITE-ON Technology Dell USB/PS2 Combo Rackmount Keyboard as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/input/input0
[    3.846292] hid-generic 0003:413C:2103.0001: input,hidraw0: USB HID v1.00 Keyboard [LITE-ON Technology Dell USB/PS2 Combo Rackmount Keyboard] on usb-bcm2708_usb-1.3/input0
[    3.884010] input: LITE-ON Technology Dell USB/PS2 Combo Rackmount Keyboard as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.1/input/input1
[    3.929882] hid-generic 0003:413C:2103.0002: input,hidraw1: USB HID v1.10 Mouse [LITE-ON Technology Dell USB/PS2 Combo Rackmount Keyboard] on usb-bcm2708_usb-1.3/input1
[    4.779310] udevd[153]: starting version 175
[    5.382778] usb 1-1.2.2: new high-speed USB device number 6 using dwc_otg
[    5.783957] usb 1-1.2.2: New USB device found, idVendor=12d1, idProduct=1c0b
[    5.822396] usb 1-1.2.2: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[    5.852399] usb 1-1.2.2: Product: HUAWEI Mobile
[    5.878195] usb 1-1.2.2: Manufacturer: HUAWEI
[    5.992638] scsi0 : usb-storage 1-1.2.2:1.0
[    6.022480] scsi1 : usb-storage 1-1.2.2:1.1
[    6.332613] Registered led device: led0
[    8.466057] scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[    8.483464] scsi 1:0:0:0: Direct-Access     HUAWEI   SD Storage       2.31 PQ: 0 ANSI: 2
[    8.536290] sd 1:0:0:0: [sda] Attached SCSI removable disk
[    8.809883] sr0: scsi-1 drive
[    8.931756] cdrom: Uniform CD-ROM driver Revision: 3.20
[    9.022399] sr 0:0:0:0: Attached scsi CD-ROM sr0
[   11.216147] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   11.678560] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   12.464986] bcm2835 ALSA card created!
[   12.490344] bcm2835 ALSA chip created!
[   12.513672] bcm2835 ALSA chip created!
[   12.531003] bcm2835 ALSA chip created!
[   12.549567] bcm2835 ALSA chip created!
[   12.570489] bcm2835 ALSA chip created!
[   12.587777] bcm2835 ALSA chip created!
[   12.602646] bcm2835 ALSA chip created!
[   12.704656] usb 1-1.2.2: usbfs: process 674 (usb_modeswitch) did not claim interface 0 before use
[   12.746570] usb 1-1.2.2: usbfs: process 674 (usb_modeswitch) did not claim interface 0 before use
[   12.787734] usb 1-1.2.2: usbfs: process 674 (usb_modeswitch) did not claim interface 0 before use
[   20.300956] NET: Registered protocol family 10
[   20.302619] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   20.318179] Bridge firewalling registered
[   20.560712] device eth0 entered promiscuous mode
[   20.609374] IPv6: ADDRCONF(NETDEV_UP): br0: link is not ready
[   21.795777] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   21.797848] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
[   21.803847] br0: port 1(eth0) entered forwarding state
[   21.803901] br0: port 1(eth0) entered forwarding state
[   21.804050] IPv6: ADDRCONF(NETDEV_CHANGE): br0: link becomes ready
[   28.079734] Adding 102396k swap on /var/swap.  Priority:-1 extents:1 across:102396k SS
[   36.822334] br0: port 1(eth0) entered forwarding state

Code: Select all

root@raspberrypi:/# lsusb | grep Huawei
Bus 001 Device 006: ID 12d1:1c0b Huawei Technologies Co., Ltd. E173s 3G broadband stick (modem off)
The usb_modeswitch failed to change (modem off) to (modem on)

Code: Select all

root@raspberrypi:/# usb_modeswitch -c 12d1:1c0b
Error: Could not find file 12d1:1c0b

root@raspberrypi:/# usb_modeswitch -c /etc/usb_modeswitch.d/12d1\:1c0b

Looking for target devices ...
 No devices in target mode or class found
Looking for default devices ...
   found matching product ID
   adding device
 Found device in default mode, class or configuration (1)
Accessing device 006 on bus 001 ...
Getting the current device configuration ...
 OK, got current device configuration (1)
Using first interface: 0x00
Using endpoints 0x0f (out) and 0x8f (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: HUAWEI
   Model String: Mass Storage
Revision String: 2.31
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI
     Product: HUAWEI Mobile
  Serial No.: not provided
-------------------------
Setting up communication with interface 0
Using endpoint 0x0f for message sending ...
Trying to send message 1 to endpoint 0x0f ...
 OK, message successfully sent
Resetting response endpoint 0x8f
Resetting message endpoint 0x0f

Checking for mode switch (max. 20 times, once per second) ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 No new devices in target mode or class found

Mode switch has failed. Bye.
the config file /etc/usb_modeswitch.d/12d1:1c0b :
########################################################
# Huawei E173s

DefaultVendor= 0x12d1
DefaultProduct= 0x1c0b

TargetVendor= 0x12d1
TargetProduct= 0x1c05

CheckSuccess=20

MessageEndpoint= 0x0f
MessageContent= "55534243123456780000000000000011062000000100000000000000000000"
WaitBefore=3

I have created /etc/usb_modeswitch.conf
With EnableLogging=1
But no log in /var/log , no usb_modeswitch_<device> file in it.

If I unplug the E173s USB 3G Dongle and plug it again The E173s go modem on :

Code: Select all

root@raspberrypi:/# lsusb | grep Huawei
Bus 001 Device 008: ID 12d1:1c05 Huawei Technologies Co., Ltd. E173s 3G broadband stick (modem on)
I get this in dmesg :

Code: Select all

[code][    5.382778] usb 1-1.2.2: new high-speed USB device number 6 using dwc_otg
[    5.783957] usb 1-1.2.2: New USB device found, idVendor=12d1, idProduct=1c0b
[    5.822396] usb 1-1.2.2: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[    5.852399] usb 1-1.2.2: Product: HUAWEI Mobile
[    5.878195] usb 1-1.2.2: Manufacturer: HUAWEI
[    5.992638] scsi0 : usb-storage 1-1.2.2:1.0
[    6.022480] scsi1 : usb-storage 1-1.2.2:1.1
[    6.332613] Registered led device: led0
[    8.466057] scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[    8.483464] scsi 1:0:0:0: Direct-Access     HUAWEI   SD Storage       2.31 PQ: 0 ANSI: 2
[    8.536290] sd 1:0:0:0: [sda] Attached SCSI removable disk
[    8.809883] sr0: scsi-1 drive
[    8.931756] cdrom: Uniform CD-ROM driver Revision: 3.20
[    9.022399] sr 0:0:0:0: Attached scsi CD-ROM sr0
[/code]

And everything work find, I can up the ppp0 interface and I get the 3G connection.

Code: Select all

root@raspberrypi:/# ifup ppp0
Editing `/etc/wvdial.conf'.

Scanning your serial ports for a modem.

ttyUSB0<*1>: ATQ0 V1 E1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 Z -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- COMMAND NOT SUPPORT
ttyUSB0<*1>: Modem Identifier: ATI -- Manufacturer: huawei
ttyUSB0<*1>: Speed 9600: AT -- OK
ttyUSB0<*1>: Max speed is 9600; that should be safe.
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyUSB1<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyUSB1<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 9600 baud
ttyUSB1<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
ttyUSB2<*1>: ATQ0 V1 E1 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 Z -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- COMMAND NOT SUPPORT
ttyUSB2<*1>: Modem Identifier: ATI -- Manufacturer: huawei
ttyUSB2<*1>: Speed 9600: AT -- OK
ttyUSB2<*1>: Max speed is 9600; that should be safe.
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK

Found a modem on /dev/ttyUSB0.
Modem configuration written to /etc/wvdial.conf.
ttyUSB0<Info>: Speed 9600; init "ATQ0 V1 E1 S0=0 &C1 &D2"
ttyUSB2<Info>: Speed 9600; init "ATQ0 V1 E1 S0=0 &C1 &D2"
I get an ip, and I can ping internet or what ever I need to do :

Code: Select all

root@raspberrypi:/# ifconfig
ppp0      Link encap:Protocole Point-à-Point
          inet adr:10.101.5.102  P-t-P:10.64.64.64  Masque:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:3
          RX bytes:128 (128.0 B)  TX bytes:2081 (2.0 KiB)
I could put a relay to be able to power off and on the E173s USB 3G Dongle from the gpio of the raspberry, but if my understanding is right, usb_modeswitch should able me to change (modem off) state to (modem on) state.

I don't know what to do now, any help will be appreciated :-)

Bests Regards,

Benxico

PS : sorry for my bad english, I'm french.

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: E173s on raspberry pi sometimes works sometimes not

Post by LOM » 12 May 2013, 06:01

Raspberry Pi has USB port problems (google it ) and that is likely the reason for the misbehaviour that you see.

usbmodeswitch will not produce a log unless you install the complete package (wrapper and shell script) and not only the binary.
Read the usbmodeswitch main page and its documentation!

benxico
Posts: 9
Joined: 11 May 2013, 16:35

Re: E173s on raspberry pi sometimes works sometimes not

Post by benxico » 12 May 2013, 15:42

Hello,
Raspberry Pi has USB port problems (google it ) and that is likely the reason for the misbehaviour that you see.
Erff this should mean it will be the same for all 3G dongle using the "ZeroCD (TM)" feature.
I will "google it", and if there is no solution I will see if I can put a 3G device that do not need USB_modeswitch (with only 3G modem feature), like Huawei E220.
Or putting a relay on the USB power cable, to be able to "unplug electrically" the 3G dongle.

For information I use a usb hub with external powersupply (5v 2A). I have cut the red wire in usb cable between the rasbperry and the usb hub, so normally the usb hub is totally independant electrically

---

Other hardware solution could be instead of using a relay, to use the gpio port with uart connectivity to connect a sister board to the raspberry with USB connectivity. But this is out the subject of this forum :wink:

---

For the USB_ModeSwitch problem, I'm doing my testing on a Raspberry model B. On model B, the 2 USB ports are provided by the ethernet chip.
I will see if there is the same behaviour with model A, only one USB port directly provided by the SOC, if the bug come from the ethernet chip it could work.

I will test on a notebook with debian and or unbuntu, this way I will see if my setting are working. If Yes It will definitly show me than it come from the Raspberry Pi USB port problems.

I will let you know the result during the week.

---
usbmodeswitch will not produce a log unless you install the complete package (wrapper and shell script) and not only the binary.
Read the usbmodeswitch main page and its documentation!
I read the documentation yesterday, but as I m starting with linux (only some few days on raspbian) and as my english is not perfect, I didn't get that the binary will not produce log.

Thx a lot for your quick answer this give me enaugh information to go forward ;-)
I come back next week with question and or solution.

Bests Regards,

Benxico

benxico
Posts: 9
Joined: 11 May 2013, 16:35

Re: E173s on raspberry pi sometimes works sometimes not

Post by benxico » 13 May 2013, 20:02

Hello,

test done with raspberry model A, same behaviour.
It seems to be more often modem on, but I'm not sure of this, just a feeling :-(

So I will probably use an usb 3G dongle like the Huawei E220, normally this dongle don't need to use usb_modeswitch.

Bests Regards,

Benxico

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Re: E173s on raspberry pi sometimes works sometimes not

Post by Josh » 15 May 2013, 08:37

The Huawei E220 is the only modem which is mode-switched by the Linux usb-storage driver. Later, the decision was made to never include mode switching there, and the proc for the E220 stayed in only for compatibility reasons.

In a nutshell: the Huawei E220 is mode-switched like all the other ZeroCD devices.

benxico
Posts: 9
Joined: 11 May 2013, 16:35

Re: E173s on raspberry pi sometimes works sometimes not

Post by benxico » 04 Jun 2013, 10:39

Hello Josh,

thanks for the informations about huawei E220.

I have done a lot of test with the Huawei E220, it's working perfectly with rasberry and raspbian.
About 100 hardreboot (taking off the powercord), and 100 times the modem huawei E220 come up ;-)
Tested on raspberry A and B with and without usb hub.

It seems that the fact the E220 is mode-switched by the Linux usb-storage driver, made it working well with the raspberry.
Without needed to power off the E220 to be able to mode-schitch it correctly.

So for the moment I will use E220 for my project with the Raspberry.

Bests Regards,

Benxico

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Re: E173s on raspberry pi sometimes works sometimes not

Post by Josh » 04 Jun 2013, 10:53

You can determine if usb_modeswitch is in fact causing a problem by blacklisting usb-storage and using usb_modeswitch instead on the E220.

There may also be power or firmware issues involved.

benxico
Posts: 9
Joined: 11 May 2013, 16:35

Re: E173s on raspberry pi sometimes works sometimes not

Post by benxico » 04 Jun 2013, 11:30

For the power I have plug the E220, and before the E173S, to a powered usb switch with a 5V 3A power unit.
As it works well when it is connected to a computer running Windows with the same powered usb switch, power issue should not be involved here.

To be sure I have to make some test under debian and ubuntu on my computer (Dell D630) to compare behaviour with raspbian.
I will do it when I have some time, because for the moment I'm running windows XP on this computer.

And I will do a test for the power issue, cutting an usb cable to plug directly red and black wire on the 5V 3A power unit.
But I really don't think there is power issue, as it's working well when the E173s is in "modem" on statue.

I come back to give the result of my test when it's done.

Thanks for following this problem ;-)

----

Edit :

After test there is less problem with usb_storage but sometime I have to unplug and replug the E220 to make it working again (simple reboot dont put off electrically the E220 so it's not enaugh).

To avoid problem, I use the AT command on Huawei E220 that allow to put off the virtual CD room partition off :

apt-get install picocom

picocom /dev/ttyUSB0 -b 9600 -l

you should see :

Code: Select all

picocom v1.7

port is        : /dev/ttyUSB0
flowcontrol    : none
baudrate is    : 9600
parity is      : none
databits are   : 8
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
nolock is      : yes
send_cmd is    : sz -vv
receive_cmd is : rz -vv
imap is        :
omap is        :
emap is        : crcrlf,delbs,

Terminal ready
if you type :
AT
followed by press “Enter” (the key) it should display “OK”
now type :
AT^U2DIAG=0

This command will turn off the cd partition of the huawei E220.
U2DIAG-command can activate different operating modes of the modem:

AT^U2DIAG=0 – the device is only modem
AT^U2DIAG=1 – device is in modem mode + CD ROM
AT^U2DIAG=255 – the device in modem mode + CD ROM + card reader
AT^U2DIAG=256 – the device in modem mode + card reader

There is some more possibility with U2DIAG check on google :)

Use Ctrl+A+X (in this order) to exit picocom.
It's done, if you connect the dongle E220 on a windows PC you will not have any more the installation sofware from the virtualcd, but just the modem :)

Post Reply