Page 1 of 1

Mode switch succeed but AT return error!

Posted: 28 Sep 2010, 05:05
by zhouqiqiu1982
I get a new 3G stick name HSDPA WIRELESS Mobile Connect recently, and it's original VID 05C6, PID 2000, after usb_modeswitching, it changes to VID 05C6 PID0015, and my switch is:55534243e00688882400000080000612000000240000000000000000000000
but, when I scan which interface is supported the AT commands, it return error, here is my log.

modem already switched /*modem has been switched*/
usbcore: deregistering driver usbserial_generic /*insmod usbserial*/
generic ttyUSB3: generic converter now disconnected from ttyUSB3
usbserial_generic 1-1:1.3: device disconnected
generic ttyUSB2: generic converter now disconnected from ttyUSB2
usbserial_generic 1-1:1.2: device disconnected
generic ttyUSB1: generic converter now disconnected from ttyUSB1
usbserial_generic 1-1:1.1: device disconnected
generic ttyUSB0: generic converter now disconnected from ttyUSB0
usbserial_generic 1-1:1.0: device disconnected
drivers/usb/serial/usb-serial.c: USB Serial deregistering driver generic
usbcore: deregistering driver usbserial
after_switch 392 cmd = insmod /lib/modules/2.6.15/kernel/usbserial.ko vendor=0x5c6 product=0x15
usbcore: registered new driver usbserial
drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
usbserial_generic 1-1:1.0: generic converter detected
usb 1-1: generic converter now attached to ttyUSB0
usbserial_generic 1-1:1.1: generic converter detected
cusb 1-1: generic converter now attached to ttyUSB1
usbserial_generic 1-1:1.2: generic converter detected
usb 1-1: generic converter now attached to ttyUSB2
usbserial_generic 1-1:1.3: generic converter detected
usb 1-1: generic converter now attached to ttyUSB3
usbcore: registered new driver usbserial_generic
drivers/usb/serial/usb-serial.c: USB Serial Driver core
cat demodem_scan 347 cinfo->interfaceNum = 4, cinfo->intInterfaceIndex = 1
zjg:device=ttyUSB
connect_modem 617 modem name is /dev/ttyUSB1
script is chat -s -v -f /etc/ppp/chat-modem-test
# cat devices /*view the devices, and can see that the vender interface*/

T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 1
B: Alloc= 0/800 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.15--LSDK-7.3.1.41 ehci_hcd
S: Product=ATH EHCI
S: SerialNumber=ar7240-ehci.0
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=256ms

T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 6 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=05c6 ProdID=0015 Rev= 0.00 /*PID and VID*/
S: Manufacturer=Qualcomm, Incorporated
S: Product=Global Wireless WCDMA DEV
S: SerialNumber=Usb MODEM Port
C:* #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=500mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usbserial_generic
E: Ad=87(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=08(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I: If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbserial_generic
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=128ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbserial_generic
E: Ad=84(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbserial_generic
E: Ad=86(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=06(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
# timeout set to 5 seconds /*send the AT command to detect the interfaces*/
abort on (BUSY)
abort on (NO ANSERT)
abort on (ERROR)
send (AT^M)
expect (OK)
cd /alarm
Failed
connect_modem 645 Connect Modem with chat -s -v -f /etc/ppp/chat-modem-test script failed.
Serial link disconnected.
connect_modem 617 modem name is /dev/ttyUSB1
script is chat -s -v -f /etc/ppp/chat-gsm-test-qualcomm
tRate:71
modemSignalGet 423 MODEM_LINK != minfo.modemStatus,minfo.modemStatus = 1
# cd /ttimeout set to 5 seconds
abort on (BUSY)
abort on (NO ANSERT)
abort on (ERROR)
send (ATZ^M)
Start...
expect (OK)
TZ^M^M
ERROR
-- failed
Failed (ERROR)
connect_modem 645 Connect Modem with chat -s -v -f /etc/ppp/chat-gsm-test-qualcomm script failed.
Serial link disconnected.
connect_modem 617 modem name is /dev/ttyUSB1
script is chat -s -v -f /etc/ppp/chat-gsm-test-anydata
# cd /dev/
# timeout set to 5 seconds
abort on (BUSY)
abort on (NO ANSERT)
abort on (ERROR)
send (ATZ^M)
Start...
expect (OK)
ATZ^M^M
ERROR
-- failed
Failed (ERROR)
connect_modem 645 Connect Modem with chat -s -v -f /etc/ppp/chat-gsm-test-anydata script failed.
Serial link disconnected.
zjg:device=ttyUSB
connect_modem 617 modem name is /dev/ttyUSB2




It seems that the mode switch works successfully , but no interfaces can support the AT commands, who can help me ? Any helps or advices are appreciated.

Posted: 06 Oct 2010, 14:22
by Josh
Did you notice the following in your device file?
I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usbserial_generic

This is a storage interface which has obviously bound to the serial driver. I suspect this might make the serial driver unreliable.

Once you fixed that (by providing "usb-storage" or by detaching "usbserial" from interface 0) the correct port should be the one which points to interface 1 (most likely the lowest "ttyUSB" number); this has the "Interrupt" transfer type which is usually needed for a connection port.


Posted: 09 Oct 2010, 04:51
by zhouqiqiu1982
OK, I will try it, thank you very much!

Posted: 09 Oct 2010, 11:06
by zhouqiqiu1982
I found it should be the problem with the usb-serial.ko with I used to attach the device. When I google the problem, I found the Qualcomm(05c6) device should use the other driver, not usb-serial.ko, the url is:http://lxr.linux.no/#linux+v2.6.35.7/dr ... qcserial.c. I patch my kernel(2.6.15), and compile the qcserial.ko, and insmod it , but still not work.
any advice is appreciated.

Posted: 10 Oct 2010, 13:47
by Josh
I have several devices with Qualcomm ID (05c6) that are working well with both "usbserial" and "option". I don't think that is the real problem.
As far as I know "qcserial" is made for special Qualcomm diagnostic ports, not for the main connection port. This diagnostic port may even accept AT commands but cannot be used for connection.

Anyway, I have a feeling that your modem is not at all in the right mode, even if it changed its IDs. The message you used for switching is a standard command which every host will send to every device immediately after connecting.

Do you have any sniffing logs from Windows? If so, post them on any server (zipped). Don't post them here please as they tend to be large.


Posted: 19 Oct 2010, 05:48
by zhouqiqiu1982
Josh wrote:I have several devices with Qualcomm ID (05c6) that are working well with both "usbserial" and "option". I don't think that is the real problem.
As far as I know "qcserial" is made for special Qualcomm diagnostic ports, not for the main connection port. This diagnostic port may even accept AT commands but cannot be used for connection.

Anyway, I have a feeling that your modem is not at all in the right mode, even if it changed its IDs. The message you used for switching is a standard command which every host will send to every device immediately after connecting.

Do you have any sniffing logs from Windows? If so, post them on any server (zipped). Don't post them here please as they tend to be large.
Thank you for your suggestions. Would you tell me what comand you use to switch the device' mode whose vid is 05c6?

Posted: 19 Oct 2010, 08:21
by Josh
Believe me, my devices are unrelated to your's; one is the "Option iCon" (see config file "05c6:1000:sVe=Option") and the other is my cell phone which has an ID of "05c6:3197" and does not need any switching because it works as a modem in its normal state.

A good candidate for a first attempt is always the "eject" sequence:
MessageContent="5553424312345678000000000000061b000000020000000000000000000000"

But if that fails, the only reliable way of finding your switching command is sniffing what the Windows driver does.


Posted: 11 Nov 2010, 11:02
by zhouqiqiu1982
Josh wrote:Believe me, my devices are unrelated to your's; one is the "Option iCon" (see config file "05c6:1000:sVe=Option") and the other is my cell phone which has an ID of "05c6:3197" and does not need any switching because it works as a modem in its normal state.

A good candidate for a first attempt is always the "eject" sequence:
MessageContent="5553424312345678000000000000061b000000020000000000000000000000"

But if that fails, the only reliable way of finding your switching command is sniffing what the Windows driver does.
Hi Josh, I get more information about this 3G modem. I found that when I plug it into the router, it's mode is a cd , and has the vender interfaces(FF), log is,

Start get card info
pro=15, vendor=5c6, index=1
Interface 0, type is 8
Interface 1, type is 255
Interface 2, type is 255
Interface 3, type is 255

so my programme would not call the usb_modeswitch function tu switch it's mode. but when I send the AT commands as follows:

"" 'AT+ZOPRT=5'
OK 'AT+ZCDRUN=8'
OK 'AT+ZPAS?'
OK 'AT+ZRSSI'

with the ttyUSB1~3, the last two commands return error and the first two are successful. So I think the modem is not in the modem mode.

so I do not know how to chang the mode into modem.

Posted: 11 Nov 2010, 19:01
by Josh
How do you know that "AT+ZCDRUN=8" will do anything good ?

This is a specialized command to switch one familiy of 3G sticks permanently to modem mode. It would be pure luck if it would do the same on your device ....

Posted: 12 Nov 2010, 10:45
by zhouqiqiu1982
Josh wrote:How do you know that "AT+ZCDRUN=8" will do anything good ?

This is a specialized command to switch one familiy of 3G sticks permanently to modem mode. It would be pure luck if it would do the same on your device ....
I follow the chat programme, and print the response of the 3G modem, it response OK. So I think the modem know the AT command AT+ZCDRUN. But when I send ATZ command, it return ERROR.

Posted: 12 Nov 2010, 19:51
by Josh
Why are you using this ZCDRUN command ?