Activation Codes and Methods, Hardware Details, Sniffing
LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: Can't switch Alcatel onetouch X602D successfully

Post by LOM » 01 Jul 2015, 17:14

Comment out the usb id in the udev rules file so that you don't get an automatic switch via udev.

Then check if this manual cmd also segfaults:

usb_modeswitch -v 1bbb -p 022c -u 2

sasha
Posts: 8
Joined: 30 Jun 2015, 15:40

Re: Can't switch Alcatel onetouch X602D successfully

Post by sasha » 02 Jul 2015, 11:28

In Fedora 19 there are no record for this Vendor, and yes segfault just after manual run.

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

Re: Can't switch Alcatel onetouch X602D successfully

Post by Josh » 02 Jul 2015, 23:59

Try to increase the "delay_use" value of the usb-storage driver, either in the sysfs tree directly or use the convenience feature in /etc/usb_modeswitch.conf.

I suspect this is a timing problem.

sasha
Posts: 8
Joined: 30 Jun 2015, 15:40

Re: Can't switch Alcatel onetouch X602D successfully

Post by sasha » 03 Jul 2015, 10:58

Tried values up to 20 seconds. No luck..

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

Re: Can't switch Alcatel onetouch X602D successfully

Post by Josh » 03 Jul 2015, 15:09

With that higer delay, do you still get this line in dmesg output?

Code: Select all

usb 1-3: usbfs: interface 0 claimed by usb-storage while 'usb_modeswitch' sets config #2

sasha
Posts: 8
Joined: 30 Jun 2015, 15:40

Re: Can't switch Alcatel onetouch X602D successfully

Post by sasha » 03 Jul 2015, 15:58

Yes. No matter what is set to SetStorageDelay=, 6..7 seconds after dongle was connected I get segfault (dongle was connected at 16:51:50 ):

Code: Select all

[Fri Jul  3 16:51:56 2015] usb 1-3: new high-speed USB device number 13 using ehci-pci
[Fri Jul  3 16:51:57 2015] usb 1-3: New USB device found, idVendor=1bbb, idProduct=022c
[Fri Jul  3 16:51:57 2015] usb 1-3: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[Fri Jul  3 16:51:57 2015] usb 1-3: Product: HSPA+ USB Modem
[Fri Jul  3 16:51:57 2015] usb 1-3: Manufacturer: Spreadtrum
[Fri Jul  3 16:51:57 2015] usb-storage 1-3:1.0: USB Mass Storage device detected
[Fri Jul  3 16:51:57 2015] scsi host12: usb-storage 1-3:1.0
[Fri Jul  3 16:51:57 2015] usb 1-3: usbfs: interface 0 claimed by usb-storage while 'usb_modeswitch' sets config #2                                              		
[Fri Jul  3 16:51:57 2015] usb_modeswitch[8480]: segfault at 10000000b ip 00007fdc9ac7b73e sp 00007ffd73044400 error 4 in libusb-1.0.so.0.1.0[7fdc9ac75000+17000]           	
Tried values from 3 to 20 seconds.

Also I did another test - DisableSwitching=1, waited until dongle start as storage device, and then initiated

Code: Select all

LIBUSB_DEBUG=4 usb_modeswitch -v 1bbb -p 022c -u 2
still segfault:

Code: Select all

[Fri Jul  3 16:55:25 2015] usb 1-3: new high-speed USB device number 15 using ehci-pci
[Fri Jul  3 16:55:25 2015] usb 1-3: New USB device found, idVendor=1bbb, idProduct=022c
[Fri Jul  3 16:55:25 2015] usb 1-3: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[Fri Jul  3 16:55:25 2015] usb 1-3: Product: HSPA+ USB Modem
[Fri Jul  3 16:55:25 2015] usb 1-3: Manufacturer: Spreadtrum
[Fri Jul  3 16:55:25 2015] usb-storage 1-3:1.0: USB Mass Storage device detected
[Fri Jul  3 16:55:25 2015] scsi host14: usb-storage 1-3:1.0
[Fri Jul  3 16:55:45 2015] scsi 14:0:0:0: CD-ROM            USBModem Mass Storage     2.31 PQ: 0 ANSI: 2
[Fri Jul  3 16:55:45 2015] sr 14:0:0:0: [sr1] scsi-1 drive
[Fri Jul  3 16:55:45 2015] sr 14:0:0:0: Attached scsi CD-ROM sr1
[Fri Jul  3 16:55:45 2015] sr 14:0:0:0: Attached scsi generic sg6 type 5
[Fri Jul  3 16:55:48 2015] ISO 9660 Extensions: Microsoft Joliet Level 1
[Fri Jul  3 16:55:48 2015] ISO 9660 Extensions: IEEE_P1282
[Fri Jul  3 16:56:16 2015] usb 1-3: usbfs: interface 0 claimed by usb-storage while 'usb_modeswitch' sets config #2
[Fri Jul  3 16:56:16 2015] usb_modeswitch[9042]: segfault at 100000002 ip 00007f2e0e0d5e72 sp 00007ffc5106f910 error 4 in libc-2.21.so[7f2e0e052000+1b6000]

sasha
Posts: 8
Joined: 30 Jun 2015, 15:40

Re: Can't switch Alcatel onetouch X602D successfully

Post by sasha » 08 Jul 2015, 14:02

Well, I decided to get rid from that dongle, so there are no new info. I will get another one.

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

Re: Can't switch Alcatel onetouch X602D successfully

Post by Josh » 08 Jul 2015, 14:13

I have just ordered one ... let's see if I can 'create' the problem on my systems.

kainspb
Posts: 2
Joined: 13 Jul 2015, 18:55

Re: Can't switch Alcatel onetouch X602D successfully

Post by kainspb » 13 Jul 2015, 19:16

Hello folks!

I have found a workaround to successfully switch this device to a modem mode. I'm using this script (save it as /usr/local/bin/alcatel-x602d):

Code: Select all

#!/bin/bash
#
#

for i in /sys/bus/usb/devices/*; do
	if [[ `grep -s 1bbb ${i}/idVendor` ]] && [[ `grep -s 022c ${i}/idProduct` ]]; then
		DEVICE=$i
		break
	fi
done

if [[ -z ${DEVICE} ]]; then
	echo "Device not found"
	exit 1
fi

if [[ `cat ${i}/bNumConfigurations` == 2 ]]; then
	if [[ `cat ${i}/bConfigurationValue` == 1 ]]; then
		sudo sh -c "echo 2 > ${i}/bConfigurationValue"
		sudo modprobe option
		sudo sh -c "echo 1bbb 022c ff > /sys/bus/usb-serial/drivers/option1/new_id"
	fi
fi
I've checked it on Ubuntu Linux 14.04 and it worked perfectly. To automatically switch it when inserted I'm using this udev rule (save it as /etc/udev/rules.d/alcatel-x602d.rules):

Code: Select all

# Alcatel x602d 3G modem
#
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="022c", RUN+="/usr/local/bin/alcatel-x602d"
Workaround from here: http://www.kasatkin.org/doku.php?id=blo ... atel_x602d (in Russian only)

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

Re: Can't switch Alcatel onetouch X602D successfully

Post by Josh » 13 Jul 2015, 23:19

Of course this is a feasible workaround for your specific modem. However, I hope to be able to fix the problem once I get that X602D I ordered.

I'm still waiting.

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

Re: Can't switch Alcatel onetouch X602D successfully

Post by Josh » 14 Jul 2015, 21:33

I finally got the X602D.

It turned out that the configuration check of usb_modeswitch was buggy in two places. I will issue a bugfix release.

kainspb
Posts: 2
Joined: 13 Jul 2015, 18:55

Re: Can't switch Alcatel onetouch X602D successfully

Post by kainspb » 14 Jul 2015, 21:40

Josh wrote:I finally got the X602D.

It turned out that the configuration check of usb_modeswitch was buggy in two places. I will issue a bugfix release.
Wow, this is great news!

Thank you Josh for your work! It would be big relief to get rid of any workarounds with udev scripts and use this modem as plug and play device with usb_modeswitch.

Thank you again!

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

Re: Can't switch Alcatel onetouch X602D successfully

Post by Josh » 14 Jul 2015, 22:44

Well, it's actually the first modem in my collection that can be switched just by setting a different configuration. I could never test that properly before.

Fortunately, the crash happened after the modeswitch; however, the driver binding bit was never reached - and there was annother quirk waiting right there ...

Anyway, version 2.2.4 is ready - got to update the doc page yet.

lolo207
Posts: 3
Joined: 29 Jul 2015, 12:51

Re: Can't switch Alcatel onetouch X602D successfully

Post by lolo207 » 29 Jul 2015, 14:08

Hi Josh, I am having trouble with the alcatel X602D (provided by ISP in Africa), that I got to work only with kainspb's script above and 2.2.5.
It's running on the latest raspbian where I removed the apt provided package, and manually installed 2.2.5 (and data package) from the main site, following instructions

The issue without the script is that switching does not seem to happen.
My /etc/udev/rules.d/mymodemrules.rules:

Code: Select all

# this line does not work
ACTION=="add|change", SUBSYSTEM=="usb", SYSFS{idVendor}=="1bbb", SYSFS{idProduct}=="022c", RUN+="/sbin/modprobe option vendor=0x1bbb product=0x022c"

# Alcatel x602d 3G modem
#The line below works (after commenting out the one above)
ACTION=="add|change", SUBSYSTEM=="usb", ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="022c", RUN+="/usr/local/bin/alcatel-x602d"
I simply comment out one of the lines, do a "sudo service udev restart" and this seems to make or break my config. Nothing else is changed. Since there's already a "usb_modeswith '%b/%k'" rule, I have a feeling it is not run. If I comment out both of my rules, nothing happens either.

Is my config wrong, or does the bugfix need some additional love?

Happy to provide more info/testing if needed.

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

Re: Can't switch Alcatel onetouch X602D successfully

Post by Josh » 29 Jul 2015, 18:58

The "option" modules does not accept these parameters. They are for "usbserial".

With "option", use the new_id feature. usb_modeswitch does it automatically; did you try the full installation of both program and data package?

It runs well here on the Pi 2 with my own X602D, including driver module activation.

Post Reply