Activation Codes and Methods, Hardware Details, Sniffing
xoric
Posts: 10
Joined: Sun Apr 22, 2018 2:13 pm

(SOLVED): XS W21s_MessageContent

Post by xoric » Sun Apr 22, 2018 2:31 pm

Hello,

i get from my provider the Usb Modem XS Stick W21s. If i connected in a VM Win7 machine the Stick will switched to modem mode, then i can it use on my Debian stretch system after unconnecting from VM win7. But i can't switch mode on linux alone.
i used fallowing command:
usb_modeswitch -v 1c9e -p 3003 -M '55534243123456788000000080000606f50402527000000000000000000000'

with this output:

Code: Select all

Look for default devices ...
   product ID matched
 Found devices in default mode (1)
Access device 005 on bus 003
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 8
Use endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: Manufacturer
     Product: USB Modem
  Serial No.: 0123456789ABCDEF
-------------------------
Looking for active driver ...
 OK, driver detached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
 OK, message successfully sent
Read the response to message 1 (CSW) ...
 Response reading failed (error -9)
 Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!
can somebody give the right MessageContent for this device?

regards xoric
Last edited by xoric on Sun Jun 03, 2018 7:13 pm, edited 1 time in total.

LOM
Posts: 1286
Joined: Wed Jul 11, 2012 3:14 pm
Location: Koh Samui, TH

Re: XS W21s_MessageContent

Post by LOM » Sun Apr 22, 2018 5:36 pm

Try

MessageContent="55534243785634120100000080000601000000000000000000000000000000"

which equals OptionMode=1 in a device config file for usb_modeswitch version 2.3 and higher.

xoric
Posts: 10
Joined: Sun Apr 22, 2018 2:13 pm

Re: XS W21s_MessageContent

Post by xoric » Sun Apr 22, 2018 7:13 pm

MessageContent="55534243785634120100000080000601000000000000000000000000000000"
thx, but it doesn't works. one character is missing, i put a zero to end, but the same. On windows software pin is asked.

is it a way to findout MessageContent?

regards
xoric

Josh
Site Admin
Posts: 6534
Joined: Sat Nov 03, 2007 12:30 am

Re: XS W21s_MessageContent

Post by Josh » Sun Apr 22, 2018 10:35 pm

xoric wrote:...
Trying to send message 1 to endpoint 0x01 ...
OK, message successfully sent
Read the response to message 1 (CSW) ...
Response reading failed (error -9)
Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!
How did you determine that the mode switch has not worked? This output looks quite normal.

xoric
Posts: 10
Joined: Sun Apr 22, 2018 2:13 pm

Re: XS W21s_MessageContent

Post by xoric » Sun Apr 22, 2018 11:01 pm

'cause the output from command:
ls /dev/ | grep ttyUSB
is empty and the LED on device is still blinking red, after device is switched to modem mode on windows, the led blinking green and output from command is:

ttyUSB0
ttyUSB1
ttyUSB2 ...

after a time, e.g a minute, device works normally and connected to internet via Network Manager.
i try different options, but all fail,
my idea is, MessageContent is wrong or maybe device is not supported.

xoric

Josh
Site Admin
Posts: 6534
Joined: Sat Nov 03, 2007 12:30 am

Re: XS W21s_MessageContent

Post by Josh » Mon Apr 23, 2018 8:02 am

After running the mode-switch command from your first post, run "dmesg". Look what has happened in the last 20 or so lines with regard to USB.

xoric
Posts: 10
Joined: Sun Apr 22, 2018 2:13 pm

Re: XS W21s_MessageContent

Post by xoric » Mon Apr 23, 2018 6:39 pm

here is dmesg after run usb_modeswitch:

Code: Select all

[  227.659236] usb 1-1.1: Product: USB Modem
[  227.659237] usb 1-1.1: Manufacturer: Manufacturer
[  227.659239] usb 1-1.1: SerialNumber: 0123456789ABCDEF
[  228.185758] usb-storage 1-1.1:1.0: USB Mass Storage device detected
[  228.185823] scsi host6: usb-storage 1-1.1:1.0
[  228.185879] usbcore: registered new interface driver usb-storage
[  228.186680] usbcore: registered new interface driver uas
[  229.191322] scsi 6:0:0:0: Direct-Access     USBModem Disk             2.31 PQ: 0 ANSI: 2
[  229.193486] scsi 6:0:0:1: CD-ROM            USBModem Disk             2.31 PQ: 0 ANSI: 2
[  229.193949] sd 6:0:0:0: Attached scsi generic sg3 type 0
[  229.212039] sr 6:0:0:1: [sr1] scsi-1 drive
[  229.212237] sr 6:0:0:1: Attached scsi CD-ROM sr1
[  229.212322] sr 6:0:0:1: Attached scsi generic sg4 type 5
[  229.234043] sd 6:0:0:0: [sdc] Attached SCSI removable disk
[  257.992236] usbcore: registered new interface driver usbserial
[  257.992249] usbcore: registered new interface driver usbserial_generic
[  257.992257] usbserial: USB Serial support registered for generic
here dmesg after switched by windows:

Code: Select all

[  142.502208] usb-storage 1-1.1:2.4: USB Mass Storage device detected
[  142.502333] scsi host6: usb-storage 1-1.1:2.4
[  143.527174] scsi 6:0:0:0: Direct-Access     USBModem Disk             2.31 PQ: 0 ANSI: 2
[  143.529413] scsi 6:0:0:1: CD-ROM            USBModem Disk             2.31 PQ: 0 ANSI: 2
[  143.529795] sd 6:0:0:0: Attached scsi generic sg3 type 0
[  143.547872] sr 6:0:0:1: [sr1] scsi-1 drive
[  143.548004] sr 6:0:0:1: Attached scsi CD-ROM sr1
[  143.548068] sr 6:0:0:1: Attached scsi generic sg4 type 5
[  143.574408] sd 6:0:0:0: [sdc] Attached SCSI removable disk
[  234.172475] usbcore: registered new interface driver usbserial
[  234.172486] usbcore: registered new interface driver usbserial_generic
[  234.172494] usbserial: USB Serial support registered for generic
[  234.172505] usbserial_generic 1-1.1:2.0: The "generic" usb-serial driver is only for testing and one-off prototypes.
[  234.172507] usbserial_generic 1-1.1:2.0: Tell linux-usb@vger.kernel.org to add your device to a proper driver.
[  234.172508] usbserial_generic 1-1.1:2.0: generic converter detected
[  234.172561] usb 1-1.1: generic converter now attached to ttyUSB0
[  234.172573] usbserial_generic 1-1.1:2.1: The "generic" usb-serial driver is only for testing and one-off prototypes.
[  234.172574] usbserial_generic 1-1.1:2.1: Tell linux-usb@vger.kernel.org to add your device to a proper driver.
[  234.172575] usbserial_generic 1-1.1:2.1: generic converter detected
[  234.172610] usb 1-1.1: generic converter now attached to ttyUSB1
[  234.172617] usbserial_generic 1-1.1:2.2: The "generic" usb-serial driver is only for testing and one-off prototypes.
[  234.172618] usbserial_generic 1-1.1:2.2: Tell linux-usb@vger.kernel.org to add your device to a proper driver.
[  234.172620] usbserial_generic 1-1.1:2.2: generic converter detected
[  234.172647] usb 1-1.1: generic converter now attached to ttyUSB2
[  234.172655] usbserial_generic 1-1.1:2.3: The "generic" usb-serial driver is only for testing and one-off prototypes.
[  234.172656] usbserial_generic 1-1.1:2.3: Tell linux-usb@vger.kernel.org to add your device to a proper driver.
[  234.172657] usbserial_generic 1-1.1:2.3: generic converter detected
[  234.172687] usb 1-1.1: generic converter now attached to ttyUSB3
you can see, the mode switch works only on windows.

it seems usb_modeswitch does not support this stick. on windows the XsManager asked for PIN. anyone ideas?

regards xoric

Josh
Site Admin
Posts: 6534
Joined: Sat Nov 03, 2007 12:30 am

Re: XS W21s_MessageContent

Post by Josh » Mon Apr 23, 2018 8:41 pm

What is the USB ID of the modem before and after the mode-switch command? (Run "lsusb" as advised)

xoric
Posts: 10
Joined: Sun Apr 22, 2018 2:13 pm

Re: XS W21s_MessageContent

Post by xoric » Mon Apr 23, 2018 9:30 pm

its allways the same:

Code: Select all

[msi-deb6]/home/user> lsusb
Bus 002 Device 003: ID 1770:ff00  
Bus 002 Device 002: ID 8087:8000 Intel Corp. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 8087:07dc Intel Corp. 
Bus 001 Device 004: ID 093a:2521 Pixart Imaging, Inc. Optical Mouse
Bus 001 Device 002: ID 8087:8008 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 1c9e:3003 OMEGA TECHNOLOGY 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[msi-deb6]/home/user> lsusb
Bus 002 Device 003: ID 1770:ff00  
Bus 002 Device 002: ID 8087:8000 Intel Corp. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 8087:07dc Intel Corp. 
Bus 001 Device 004: ID 093a:2521 Pixart Imaging, Inc. Optical Mouse
Bus 001 Device 002: ID 8087:8008 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 1c9e:3003 OMEGA TECHNOLOGY 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 
the line with OMEGA ...

xoric

LOM
Posts: 1286
Joined: Wed Jul 11, 2012 3:14 pm
Location: Koh Samui, TH

Re: XS W21s_MessageContent

Post by LOM » Tue Apr 24, 2018 2:19 am

This device does not change its USB ID after being switched, 1c9e:3003 is the ID both before and after switching.

Try the cmd:
usb_modeswitch -v 1c9e -p 3003 -K

or alternatively:
eject /dev/sr1

xoric
Posts: 10
Joined: Sun Apr 22, 2018 2:13 pm

Re: XS W21s_MessageContent

Post by xoric » Wed Apr 25, 2018 8:40 pm

both don't work.
if i deactivate PIN green LED on device shown at startup, but device is still in cd-rom mode and usb-modeswitch don't switched into modem mode. i try different options with same result, throughout LED is blinking green.
Only software from vendor on win7 is able to switch mode.

here is output from usb-switch:

Code: Select all

[msi-deb6]/home/user> usb_modeswitch -v 1c9e -p 3003 -W -K
Take all parameters from the command line


 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.5.0 (C) Josua Dietze 2017
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x1c9e
DefaultProduct= 0x3003

StandardEject=1

Look for default devices ...
  found USB ID 1770:ff00
  found USB ID 8087:8000
  found USB ID 1d6b:0002
  found USB ID 8087:07dc
  found USB ID 093a:2521
  found USB ID 1c9e:3003
   vendor ID matched
   product ID matched
  found USB ID 8087:8008
  found USB ID 1d6b:0002
  found USB ID 1d6b:0003
  found USB ID 1d6b:0002
 Found devices in default mode (1)
Access device 008 on bus 003
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 8
Use endpoints 0x01 (out) and 0x81 (in)


USB description data (for identification)
-------------------------
Manufacturer: Manufacturer
     Product: USB Modem
  Serial No.: 0123456789ABCDEF
-------------------------
Sending standard EJECT sequence
Looking for active driver ...
 OK, driver detached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
 OK, message successfully sent
Read the response to message 1 (CSW) ...
 Response reading failed (error -9)
 Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!
how can i identify correct MessageContent and other options for this device?

xoric

LOM
Posts: 1286
Joined: Wed Jul 11, 2012 3:14 pm
Location: Koh Samui, TH

Re: XS W21s_MessageContent

Post by LOM » Thu Apr 26, 2018 6:35 am

xoric wrote: how can i identify correct MessageContent and other options for this device?

xoric
You can sniff the modeswitch message used by windows, see
http://www.draisberghof.de/usb_modeswitch/#contrib

before you do that you can try this message:
'55534243123456788000000080010606f50402527000000000000000000000'

which is a variant of what you first used. Your dmesg log shows that the virtual cd-rom is on
SCSI LUN 1 so I have modified the message to reflect that.

xoric
Posts: 10
Joined: Sun Apr 22, 2018 2:13 pm

Re: XS W21s_MessageContent

Post by xoric » Fri Apr 27, 2018 6:31 pm

hello,
thx to LOM for new MessageContent and the link to software.

unfortunately both brings no solution. the messagecontent don't works, same result as bevore. its always the same, no errors on usb_modeswitch output, but no switching.
the link is missing. i try to download similiar softwar, without success.
if anybody have working usb sniffer, tell me.
at the moment this works:
- start win-vm, switch mode with software from vendorand use on stretch or stay in vm.

for me thazs enough, i haven't ideas to solve in other way.

xoric

xoric
Posts: 10
Joined: Sun Apr 22, 2018 2:13 pm

Re: XS W21s_MessageContent

Post by xoric » Sun Jun 03, 2018 2:34 pm

i found one usbsniffer program on net and try it out.

the output is like this:

Code: Select all

000351: Bulk or Interrupt Transfer (DOWN), 2018-06-02 14:14:25,9270379 +0,0000021 (1. Device: USB Modem )
Pipe Handle: 0x37a22c8 (Endpoint Address: 0x5)
Send 0x1f bytes to the device
 55 53 42 43 F0 E8 6B 05 12 00 00 00 80 01 0C 03   USBCðèk.....€...
 00 00 00 12 00 00 00 00 00 00 00 00 00 00 00      ...............
001267: Bulk or Interrupt Transfer (DOWN), 2018-06-02 14:14:27,8651704 +0,0000121 (1. Device: USB Modem )
Pipe Handle: 0x37a22c8 (Endpoint Address: 0x5)
Send 0x1f bytes to the device
 55 53 42 43 90 A4 27 06 00 80 00 00 80 01 0A 28   USBC¤'..€..€..(
 00 00 00 23 F4 00 00 40 00 00 00 00 00 00 00      ...#ô..@.......
for (UP) is Endpoint Address: 0x85

there is many Contents here is summary:

Code: Select all

5553424340E6AE032400000080000612000000240000000000000000000000
5553424340E6AE03FC00000080000A2300000000000000FC00000000000000
5553424340E6AE031200000080000C03000000120000000000000000000000
5553424360DAC1060002000080000A28000000000000000100000000000000
5553424390A42706C00000008000061A001C00C00000000000000000000000
5553424360DAC106C00000008000061A000800C00000000000000000000000
5553424390A427061800000000000615100000180000000000000000000000
5553424390A427061200000080000C03000000120000000000000000000000
5553424360DAC1061200000080000C03000000120000000000000000000000
5553424360DAC1060800000080000A25000000000000000000000000000000
55534243F0E86B050800000080010A4A010000000000000800000000000000
55534243F0E86B051200000080010C03000000120000000000000000000000
5553424390A427060080000080010A2800000023F400004000000000000000
maybe there are more. one or more of them succeed on windows, but no one work on linux.

the endpoint addresses work neither.

Code: Select all

 -> usb_modeswitch -v 1c9e -p 3003 -m 0x5 -r 0x85 -M '5553424340E6AE032400000080000612000000240000000000000000000000'
Look for default devices ...
   product ID matched
 Found devices in default mode (1)
Access device 021 on bus 003
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 8
Use endpoints 0x05 (out) and 0x85 (in)

USB description data (for identification)
-------------------------
Manufacturer: Manufacturer
     Product: USB Modem 
  Serial No.: 0123456789ABCDEF
-------------------------
Looking for active driver ...
 OK, driver detached
Set up interface 0
Use endpoint 0x05 for message sending ...
Trying to send message 1 to endpoint 0x05 ...
 Sending the message returned error -1. Try to continue
Read the response to message 1 (CSW) ...
 Response reading failed (error -1)
 Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!
for reading : (error -8) , -9, -7 ....

have anyone an idea?

xoric

LOM
Posts: 1286
Joined: Wed Jul 11, 2012 3:14 pm
Location: Koh Samui, TH

Re: XS W21s_MessageContent

Post by LOM » Sun Jun 03, 2018 5:21 pm

The communication you have logged is probably to the device after it has been switched.
Start with posting the output of lsusb -vd 1c9e:3003, first before you let windows switch it and then again after windows has switched it into modem mode.
xoric wrote:

Code: Select all

 -> usb_modeswitch -v 1c9e -p 3003 -m 0x5 -r 0x85 -M '5553424340E6AE032400000080000612000000240000000000000000000000'
Look for default devices ...
   product ID matched
 Found devices in default mode (1)
Access device 021 on bus 003
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 8
Use endpoints 0x05 (out) and 0x85 (in)

USB description data (for identification)
-------------------------
Manufacturer: Manufacturer
     Product: USB Modem 
  Serial No.: 0123456789ABCDEF
-------------------------
Looking for active driver ...
 OK, driver detached
Set up interface 0
Use endpoint 0x05 for message sending ...
Trying to send message 1 to endpoint 0x05 ...
 Sending the message returned error -1. Try to continue
Read the response to message 1 (CSW) ...
 Response reading failed (error -1)
 Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!
Here you should had run lsusb to check if the USB Id had changed, "Device is gone, skip any further commands" means that the initial USB Id disappeared so switching was successful.
The device did probably reappear with the same USB Id so then you would have to run the verbose lsusb -vd 1c9e:3003 and notice if there are any differences compared to the same verbose lsusb for an un-switched device.

Post Reply