Author Message

<  Device Information  ~  digicom 8E4455

PostPosted: Fri Mar 26, 2010 5:05 pm Reply with quote
Posts: 8 Joined: Fri Mar 26, 2010 9:37 am
hello everybody!! :D

i'm trying to use usb_modeswitch to be able to use a digicom 8E4455 modem, but i still have not found the way.... :?

let's start with the device data:

Code:
# lsusb
Bus 001 Device 018: ID 1266:1000


Code:
lsusb -v -s 001:018

Bus 001 Device 018: ID 1266:1000
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x1266
  idProduct          0x1000
  bcdDevice            0.00
  iManufacturer           3 Pirelli, Inc.
  iProduct                2 Pirelli 3.5G HSPA Adapter
  iSerial                 4 358094022252903
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          1 Pirelli Configuration
    bmAttributes         0xa0
      Remote Wakeup
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk (Zip)
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               none
          Usage Type               Data
        wMaxPacketSize     0x0200  bytes 512 once
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               none
          Usage Type               Data
        wMaxPacketSize     0x0200  bytes 512 once
        bInterval               0
  Language IDs: (length=4)
     0409 English(US)


since it doesn't seem to be in the supported hardware list, i downloaded the sniffusb software, plug the modem on a windows pc and check the packets...

then i tried to use those strings to make it switch to modem under linux too, adding a section to /etc/usb_modeswitch.setup:

Code:
########################################################
# digicom 8E4455

DefaultVendor= 0x1266
DefaultProduct=0x1000

TargetVendor=  0x1266
TargetProduct= 0x1009

CheckSuccess=20

MessageEndpoint=0x01
MessageContent="55534243a804a4ff000000000000061b000000020000000000000000000000"


and creating a file named /etc/usb_modeswitch.d/1266:1000 with the same info....

but.... if i try to run usb_modeswitch, the output is the following:

Code:
# usb_modeswitch

Looking for target devices ...
 Found devices in target mode or class (1)
Looking for default devices ...
 Found devices in default mode or class (1)
Accessing device 018 on bus 001 ...
Using endpoints 0x01 (out) and 0x81 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
 OK, driver found ("dummy")
 OK, driver "dummy" detached

SCSI inquiry data (for identification)
-------------------------
  Vendor String: Pirelli
   Model String: CDROM
Revision String: 2.01
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: Pirelli, Inc.
     Product: Pirelli 3.5G HSPA Adapter
  Serial No.: 358094022252903
-------------------------
Setting up communication with interface 0 ...
Trying to send the message to endpoint 0x01 ...
 OK, message successfully sent
 Device is gone, skipping any further commands

Checking for mode switch (max. 20 times, once per second) ...
 Original device is gone already, not checking
 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.



of course, i did not use only that string, but i tried with all the string sent to the device... all with the same result.... :(


do you think i did some mistakes and/or missed some steps in the process??
thanks a lot in advance for any help or suggestion you may provide!! :wink:


Offline
PostPosted: Fri Mar 26, 2010 5:50 pm Reply with quote
Site Admin Posts: 6430 Joined: Sat Nov 03, 2007 12:30 am
What you have found is an EJECT command which is often used for mode switching. And the line saying "Device is gone, skipping any further commands" indcates that something happened with the device after running usb_modeswitch, which is to be expected.
So far, so good.

Note: during research, leave away the "CheckSuccess" option (comment it out).

What does "lsusb" say after you run the command that you posted?

And what is the output of "dmesg" after running the command?

If you want, post the sniffing log from Windows on pastebin; but I suppose you got it right.



Last edited by Josh on Tue Mar 30, 2010 9:51 am, edited 1 time in total.

Offline
PostPosted: Fri Mar 26, 2010 6:05 pm Reply with quote
Posts: 8 Joined: Fri Mar 26, 2010 9:37 am
Josh wrote:
What you have found is an EJECT command which is often used for mode switching. And the line saying "Device is gone, skipping any further commands" indcates that something happened with the device after running usb_modeswitch, which is to be expected.
So far, so good.

nice.. :)

Josh wrote:
Note: during research, leave away the "CheckSuccess" option (comment it out).

ok, thanks for hint... :wink:

Josh wrote:
What does "lsusb" say after you run the command that you posted?

it doesn't change, while with sniffusb i noticed that it should change to 1266:1009

Josh wrote:
And what is the output of "dmesg" after running the command?


it adds the last line:

Code:
# dmesg | tail
usb 1-5: new high speed USB device using ehci_hcd and address 6
usb 1-5: configuration #1 chosen from 1 choice
scsi3 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 6
usb-storage: waiting for device to settle before scanning
scsi 3:0:0:0: CD-ROM            Pirelli  CDROM            2.01 PQ: 0 ANSI: 4
sr0: scsi-1 drive
sr 3:0:0:0: Attached scsi CD-ROM sr0
usb-storage: device scan complete
usb 1-5: usbfs: process 3523 (usb_modeswitch) did not claim interface 0 before use



Josh wrote:
If you want, post the sniffing log from Windows on pastebin; but I suppose you got it right.

i didn't know that service.. i tried to post the log here, but it was just too long.... :lol:

http://pastebin.com/tb0cQR1w



thanks a lot for help!! :D



ps: no need to hurry up, 'cos i won't be able to check the replies before monday morning... :roll:

have a nice weekend!! :D


Offline
PostPosted: Sun Mar 28, 2010 3:25 pm Reply with quote
Site Admin Posts: 6430 Joined: Sat Nov 03, 2007 12:30 am
OK, had a look at the log. You got everything right regarding the sniffing.

What I find interesting is a command that I never encountered before: immediately ahead of the "06 1b" command (which is "eject") there's a "06 1e"; according to the command specification this means "Prevent/ Allow Medium Removal", in your case enabling removal.

It would be worth trying to send both commands in the right order; you'd have to do this on the command line though.
If that doesn't change anything, I'll make an experimental version of usb_modeswitch which can take up to three different MessageContents.

Some more questions, to possibly cover everything:

- During Windows sniffing, does the first ID (1266:1000) change its state to not present after the driver does the switch? And vice versa with the target ID (1266:1009) ?

- After your previous attempts with the "06 1b" command, did "lsusb -v" indicate any change of the device state?



Offline
PostPosted: Mon Mar 29, 2010 10:39 am Reply with quote
Posts: 8 Joined: Fri Mar 26, 2010 9:37 am
Josh wrote:
OK, had a look at the log. You got everything right regarding the sniffing.

nice!! thanks for checking!! :wink:

Josh wrote:
What I find interesting is a command that I never encountered before: immediately ahead of the "06 1b" command (which is "eject") there's a "06 1e"; according to the command specification this means "Prevent/ Allow Medium Removal", in your case enabling removal.

It would be worth trying to send both commands in the right order; you'd have to do this on the command line though.


it (almost) works!! :D

i sent both strings using the following commands:

Code:
usb_modeswitch -v 0x1266 -p 0x1000 -m 0x01 -M "55534243a804a4ff000000000000061e000000000000000000000000000000"
usb_modeswitch -v 0x1266 -p 0x1000 -m 0x01 -M "55534243a804a4ff000000000000061b000000020000000000000000000000"


and now lsusb tells me that it changed to 1266:1009!! 8)

the problem is that it switched to usb storage instead of modem...


Code:
# dmesg | tail
usb 1-5: usbfs: process 13866 (usb_modeswitch) did not claim interface 0 before use
usb 1-5: USB disconnect, address 8
usb 1-5: new high speed USB device using ehci_hcd and address 9
usb 1-5: configuration #1 chosen from 1 choice
scsi6 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 9
usb-storage: waiting for device to settle before scanning
scsi 6:0:0:0: Direct-Access     Pirelli  MMC Storage      1.01 PQ: 0 ANSI: 2
sd 6:0:0:0: [sdb] Attached SCSI removable disk
usb-storage: device scan complete



i guess i have to try with more strings...


Josh wrote:
If that doesn't change anything, I'll make an experimental version of usb_modeswitch which can take up to three different MessageContents.

Some more questions, to possibly cover everything:

- During Windows sniffing, does the first ID (1266:1000) change its state to not present after the driver does the switch? And vice versa with the target ID (1266:1009) ?

yes, exactly... :wink:
but it does not show only one device with id 1266:1009....

i made 2 screenshots of the usbsniffer window, before and after switch:

Image
Image


Josh wrote:
- After your previous attempts with the "06 1b" command, did "lsusb -v" indicate any change of the device state?

with only "06 1b" string, nothing changes... :)


Offline
PostPosted: Mon Mar 29, 2010 3:56 pm Reply with quote
Site Admin Posts: 6430 Joined: Sat Nov 03, 2007 12:30 am
Nah, don't worry about the storage after switching. Many devices expose a flash card slot or even the install "CDROM" after switching. And that is the reason you get several "subdevices" in the sniffer window. As it says, it's a "Composite Device".

All that's missing is the serial driver, then you should see the "ttyUSB" devices appearing.

After changing the ID, do this (as root):
Code:
# modprobe -v option
# echo "1266 1009" > /sys/bus/usb-serial/drivers/option1/new_id
Then run "dmesg" ...



Offline
PostPosted: Mon Mar 29, 2010 4:55 pm Reply with quote
Posts: 8 Joined: Fri Mar 26, 2010 9:37 am
great!! :D

Code:
# dmesg | tail
usb-storage: waiting for device to settle before scanning
scsi 11:0:0:0: Direct-Access     Pirelli  MMC Storage      1.01 PQ: 0 ANSI: 2
sd 11:0:0:0: [sdb] Attached SCSI removable disk
usb-storage: device scan complete
option 1-5:1.0: GSM modem (1-port) converter detected
usb 1-5: GSM modem (1-port) converter now attached to ttyUSB0
option 1-5:1.1: GSM modem (1-port) converter detected
usb 1-5: GSM modem (1-port) converter now attached to ttyUSB1
option 1-5:1.2: GSM modem (1-port) converter detected
usb 1-5: GSM modem (1-port) converter now attached to ttyUSB2


thanks again for the hint!! 8)


so, basically, what i have to do is run usb_modeswitch 2 times, or is there a way to send both strings at the same time??


Offline
PostPosted: Mon Mar 29, 2010 5:01 pm Reply with quote
Site Admin Posts: 6430 Joined: Sat Nov 03, 2007 12:30 am
For now, you could put both commands into a script, and even run it from an udev rule.

I have to extend the program to enable the second MessageContent. And I'm afraid I will have to come back to you for testing ...
8)


Offline
PostPosted: Mon Mar 29, 2010 5:06 pm Reply with quote
Posts: 8 Joined: Fri Mar 26, 2010 9:37 am
Josh wrote:
For now, you could put both commands into a script, and even run it from an udev rule.

I have to extend the program to enable the second MessageContent. And I'm afraid I will have to come back to you for testing ...
8)

oki!! :D

i checked the "notify" flag on this topic... :wink:


Offline
PostPosted: Wed Mar 31, 2010 11:05 pm Reply with quote
Site Admin Posts: 6430 Joined: Sat Nov 03, 2007 12:30 am
Well, the time is here.

There is an alpha version of 1.1.2 on the server:
get it and "make install" it.

Enable logging right away in /etc/usb_modeswitch.conf to see what's happening when plugging (in /var/log/usb_modeswitch_<devnum>).



Offline
PostPosted: Thu Apr 01, 2010 10:44 am Reply with quote
Posts: 8 Joined: Fri Mar 26, 2010 9:37 am
i installed the new version and set EnableLogging=1 in /etc/usb_modeswitch.conf, but i find nothing in /var/log...
maybe i should change some settings in /etc/syslog.conf too?? :)

as a sidenote, on my developing machine i use trustix, and it doesn't have udev installed.... :oops:


ps: i had to rebuild the application, else i only had a Floating point exception... :wink:


Offline
PostPosted: Thu Apr 01, 2010 1:30 pm Reply with quote
Site Admin Posts: 6430 Joined: Sat Nov 03, 2007 12:30 am
If you have no udev you have to do a manual call.

Try:
usb_modeswitch -W -I -c /etc/usb_modeswitch.d/1266\:1000

You would still have to load the driver manually afterwards. The udev-ready package does all that with no interaction.



Offline
PostPosted: Thu Apr 01, 2010 4:30 pm Reply with quote
Posts: 8 Joined: Fri Mar 26, 2010 9:37 am
sorry for delay, but i had to fix some issues with my development machine.... :oops:

btw, that's what i get when i run the new version:

Code:
# usb_modeswitch -W -I -c /etc/usb_modeswitch.d/1266\:1000
Reading config file: /etc/usb_modeswitch.d/1266:1000

 * usb-modeswitch: handle USB devices with multiple modes
 * Version 1.1.1 (C) Josua Dietze 2010
 * Based on libusb0 (0.1.12 and above)

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x1266
DefaultProduct= 0x1000
TargetVendor=   0x1266
TargetProduct=  not set
TargetProductList=1002,1003,1004,1005,1006,1007,1008,1009,100a,100b,100c,100d,100e,100f,1011,1012
TargetClass=    not set

DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
GCTMode=0
MessageEndpoint= not set
MessageContent="5553424312345678000000000000061e000000000000000000000000000000"
MessageContent2="5553424387654321000000000000061b000000020000000000000000000000"
NeedResponse=1
ResponseEndpoint= not set
Interface=0x00

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


Looking for target devices ...
  searching devices, found USB ID 1266:1000
   found matching vendor ID
  searching devices, found USB ID 0000:0000
  searching devices, found USB ID ffff:0005
  searching devices, found USB ID 0000:0000
  searching devices, found USB ID 0000:0000
  searching devices, found USB ID 0000:0000
 No devices in target mode or class found
Looking for default devices ...
  searching devices, found USB ID 1266:1000
   found matching vendor ID
   found matching product ID
   adding device
  searching devices, found USB ID 0000:0000
  searching devices, found USB ID ffff:0005
  searching devices, found USB ID 0000:0000
  searching devices, found USB ID 0000:0000
  searching devices, found USB ID 0000:0000
 Found devices in default mode or class (1)
Accessing device 008 on bus 001 ...
Using endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: Pirelli, Inc.
     Product: Pirelli 3.5G HSPA Adapter
  Serial No.: 358094022252903
-------------------------
Looking for active driver ...
 OK, driver found ("dummy")
 OK, driver "dummy" detached
Setting up communication with interface 0 ...
Trying to send the message to endpoint 0x01 ...
 OK, message successfully sent
Reading the response to the message ...
 OK, response successfully read (13 bytes).
Trying to send message 2 to endpoint 0x01 ...
 OK, message successfully sent
Reading the response to the message ...
 OK, response successfully read (13 bytes).

Checking for mode switch (max. 20 times, once per second) ...
 Waiting for original device to vanish ...
 Original device can't be accessed anymore. Good.
 Searching for target devices ...
  searching devices, found USB ID 1266:1009
   found matching vendor ID
   found matching product ID from list
  searching devices, found USB ID 0000:0000
  searching devices, found USB ID ffff:0005
  searching devices, found USB ID 0000:0000
  searching devices, found USB ID 0000:0000
  searching devices, found USB ID 0000:0000

Found target device 009 on bus 001

Target device description data
-------------------------
Manufacturer: Pirelli, Inc.
     Product: Pirelli 3.5G HSPA Adapter
  Serial No.: 358094022252903
-------------------------
 Found correct target device

Mode switch succeeded. Bye.



Code:
# dmesg | tail -n 20
usbcore: registered new interface driver usbserial_generic
drivers/usb/serial/usb-serial.c: USB Serial Driver core
drivers/usb/serial/usb-serial.c: USB Serial support registered for GSM modem (1-port)
usbcore: registered new interface driver option
drivers/usb/serial/option.c: USB Driver for GSM modems: v0.7.1
usb 1-5: USB disconnect, address 8
usb 1-5: new high speed USB device using ehci_hcd and address 9
usb 1-5: configuration #1 chosen from 1 choice
option 1-5:1.0: GSM modem (1-port) converter detected
usb 1-5: GSM modem (1-port) converter now attached to ttyUSB0
option 1-5:1.1: GSM modem (1-port) converter detected
usb 1-5: GSM modem (1-port) converter now attached to ttyUSB1
option 1-5:1.2: GSM modem (1-port) converter detected
usb 1-5: GSM modem (1-port) converter now attached to ttyUSB2
scsi3 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 9
usb-storage: waiting for device to settle before scanning
scsi 3:0:0:0: Direct-Access     Pirelli  MMC Storage      1.01 PQ: 0 ANSI: 2
sd 3:0:0:0: [sdb] Attached SCSI removable disk
usb-storage: device scan complete


i don't see anything in /var/log/ but it seems to work fine!! :D


Offline
PostPosted: Thu Apr 01, 2010 5:36 pm Reply with quote
Site Admin Posts: 6430 Joined: Sat Nov 03, 2007 12:30 am
That is excellent news! Thanks for testing.

Now I can finish the new release. People with mainstream installations should not even notice the switching.
Yawgmoth wrote:
I don't see anything in /var/log/ but it seems to work fine!! :D
No problem there, you only would see it with udev installed and the wrapper active.

Have a good time ! :wink:



Offline
PostPosted: Thu Apr 01, 2010 5:59 pm Reply with quote
Posts: 8 Joined: Fri Mar 26, 2010 9:37 am
nice!! thanks a lot for your help!! :D


Offline

Display posts from previous:  Sort by:

All times are UTC+02:00
Page 1 of 1
15 posts
Users browsing this forum: No registered users and 1 guest
Search for:
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
cron