Re: Can't switch Alcatel onetouch X602D successfully
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
Then check if this manual cmd also segfaults:
usb_modeswitch -v 1bbb -p 022c -u 2
Re: Can't switch Alcatel onetouch X602D successfully
In Fedora 19 there are no record for this Vendor, and yes segfault just after manual run.
Re: Can't switch Alcatel onetouch X602D successfully
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.
I suspect this is a timing problem.
Re: Can't switch Alcatel onetouch X602D successfully
Tried values up to 20 seconds. No luck..
Re: Can't switch Alcatel onetouch X602D successfully
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
Re: Can't switch Alcatel onetouch X602D successfully
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 ):
Tried values from 3 to 20 seconds.
Also I did another test - DisableSwitching=1, waited until dongle start as storage device, and then initiated
still segfault:
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]
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
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]
Re: Can't switch Alcatel onetouch X602D successfully
Well, I decided to get rid from that dongle, so there are no new info. I will get another one.
Re: Can't switch Alcatel onetouch X602D successfully
I have just ordered one ... let's see if I can 'create' the problem on my systems.
Re: Can't switch Alcatel onetouch X602D successfully
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):
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):
Workaround from here: http://www.kasatkin.org/doku.php?id=blo ... atel_x602d (in Russian only)
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
Code: Select all
# Alcatel x602d 3G modem
#
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="022c", RUN+="/usr/local/bin/alcatel-x602d"
Re: Can't switch Alcatel onetouch X602D successfully
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.
I'm still waiting.
Re: Can't switch Alcatel onetouch X602D successfully
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.
It turned out that the configuration check of usb_modeswitch was buggy in two places. I will issue a bugfix release.
Re: Can't switch Alcatel onetouch X602D successfully
Wow, this is great news!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.
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!
Re: Can't switch Alcatel onetouch X602D successfully
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.
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.
Re: Can't switch Alcatel onetouch X602D successfully
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:
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.
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"
Is my config wrong, or does the bugfix need some additional love?
Happy to provide more info/testing if needed.
Re: Can't switch Alcatel onetouch X602D successfully
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.
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.