Activation Codes and Methods, Hardware Details, Sniffing
Post Reply
aalba
Posts: 2
Joined: 22 Apr 2010, 09:19

D-Link DWM-156

Post by aalba » 22 Apr 2010, 10:05

Hi,

This device has a peculiar mode switch method:

In Ubuntu Lucid beta the usb storage is automatically mounted on /media/CONNMGR with id 0x07d1:0xa800. To mode switch you just create a 0 byte file in the root directory named wcdma.cfg

#usb storage mounted in /media/CONNMGR
touch /media/CONNMGR/wcdma.cfg


The creation of this file triggers the mode switch to 0x07d1:0x3e02. I have tested this and the subsequent device (ttyUSB0-3 created) works with option.ko using ttyUSB0 as the data port. (BTW ttyUSB2 and ttyUSB3 also respond to modem-manager probes, there is a race condition, and ttyUSB0 isn't always exported as the modem - but that's another problem.)

Can the usb_modeswitch framework cater to this?
I.e., what is the MessageContent equivalent to "touch/media/CONNMGR/wcdma.cfg"


Thank you.

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

Re: D-Link DWM-156

Post by Josh » 22 Apr 2010, 11:01

aalba wrote:To mode switch you just create a 0 byte file in the root directory named wcdma.cfg
How did you find out? Did you sniff in Windows?
I would be amazed if the Windows driver does the same thing, mounting before switching ...
aalba wrote:BTW ttyUSB2 and ttyUSB3 also respond to modem-manager probes, there is a race condition, and ttyUSB0 isn't always exported as the modem - but that's another problem.
This is a known annoyance. It should be easy to find the right (interrupt) port if the device provides more than one. USB_ModeSwitch adds a symlink to that port in the newest release.
aalba wrote:Can the usb_modeswitch framework cater to this?
I.e., what is the MessageContent equivalent to "touch/media/CONNMGR/wcdma.cfg"
Well, there is not really a limit to what the wrapper can do; the challenge would be to control the mounting procedure for every distribution.


aalba
Posts: 2
Joined: 22 Apr 2010, 09:19

Post by aalba » 23 Apr 2010, 02:46

I have yet to sniff Windows but I found this on the following weblink (in Chinese) -
http://smallhose.blogspot.com/2009/12/u ... -375g.html

Pretty bizarre mode switch - but I'll proceed to sniff Windows and see the result.

RoganDawes
Posts: 3
Joined: 19 Jul 2010, 15:47

Post by RoganDawes » 19 Jul 2010, 16:23

Any progress on this modem? My folks bought one, and I can't get it to work for them, unfortunately.

Anything I can do to assist? I could try snooping under OS X or Windows if necessary.

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

Post by Josh » 19 Jul 2010, 23:09

Oh, yes, please!

I don't know anything about sniffing on the Mac, I'm afraid; but Windows (XP) should work of course.

For a very short primer see "How to Contribute" on the usb_modeswitch doc page (has a link to the recommended Windows sniffer).
A more detailed example about the necessary steps is shown here:
http://www.draisberghof.de/usb_modeswit ... php?p=2422


proyvind
Posts: 18
Joined: 12 Aug 2010, 03:37

Post by proyvind » 02 Sep 2010, 19:11

hm, for my DWM-156 it's sufficient to just detach storage for it to switch mode..

Here's a simple patch with the config:
http://svn.mandriva.com/cgi-bin/viewvc. ... iew=markup

RoganDawes
Posts: 3
Joined: 19 Jul 2010, 15:47

Post by RoganDawes » 02 Sep 2010, 20:35

proyvind wrote:hm, for my DWM-156 it's sufficient to just detach storage for it to switch mode..

Here's a simple patch with the config:
http://svn.mandriva.com/cgi-bin/viewvc. ... iew=markup
You mean, effectively, just rmmod'ing the usb-storage driver?

proyvind
Posts: 18
Joined: 12 Aug 2010, 03:37

Post by proyvind » 02 Sep 2010, 20:53

no, it won't unload the usb-storage module (I doubt that would cause the switch anyways, also as you may have more than device using the module, that wouldn't be very reliable, safe or anything... :p).

it will detach the device only (similar to eject)

Fuego
Posts: 1
Joined: 28 Jan 2011, 05:41

D-Link DWM-156

Post by Fuego » 28 Jan 2011, 06:00

The detach method doesn't seem to work for me. I did find that eject -s sr0 (or 1,2, etc. depending on what has been assigned to the fake CDROM "ConnMgr Storage") does switch the device, though - but then the device has had a firmware update, even though the hardware is an earlier version than what is on sale today.

>lsusb | grep D-Link
Bus 001 Device 018: ID 07d1:a800 D-Link System

>eject -s sr1

>lsusb | grep D-Link
Bus 001 Device 019: ID 07d1:3e02 D-Link System

This is under Fedora 14, 64 bit .

A little bit more digging and I've come up with:

########################################################
# D-Link DWM-156 HSUPA 3.75G USB Modem
# 07d1:a800 <--> 07d1:3e02
# H/W Ver. A1
# F/W Ver. 1.04 Upgraded to 1.05b01
# Upgrades at ftp://ftp.dlink.co.uk/dwm_3G/DWM-156/
# 27-Jan-2011

DefaultVendor= 0x07d1
DefaultProduct= 0xa800
TargetVendor= 0x07d1
TargetProduct= 0x3e02

DetachStorageOnly=0

# Standard SCSI eject
MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
MessageEndpoint=0x01
ResponseEndpoint=0x81
Interface=0x00
NeedResponse=0
CheckSuccess=20

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

Post by Josh » 05 Feb 2011, 19:19

Sorry for the late answer ...

Your contribution is much appreciated! Of course I'll add the device to the next data package, and I'll include your comments about the firmware upgrade.

If you want, give me your real name (or any nickname) via PM or e-mail, and I'll add you as the contributor for this device.


udippel
Posts: 3
Joined: 17 Feb 2013, 05:52

Re: D-Link DWM-156

Post by udippel » 17 Feb 2013, 06:13

Fuego wrote:The detach method doesn't seem to work for me. I did find that eject -s sr0 (or 1,2, etc. depending on what has been assigned to the fake CDROM "ConnMgr Storage") does switch the device, though - but then the device has had a firmware update, even though the hardware is an earlier version than what is on sale today.

>lsusb | grep D-Link
Bus 001 Device 018: ID 07d1:a800 D-Link System

>eject -s sr1

>lsusb | grep D-Link
Bus 001 Device 019: ID 07d1:3e02 D-Link System
I have a DVM-156 of a slightly different version, and don't manage to get it working under Ubuntu 12.10.
I read and searched for the last hours and this place seems to be the closest.
Here is the basic info:

$ lsusb
Bus 001 Device 004: ID 2001:7d00 D-Link Corp.

$ dmesg
[ 2159.459080] usb 1-2: new high-speed USB device number 3 using ehci_hcd
[ 2159.591866] usb 1-2: New USB device found, idVendor=2001, idProduct=a80b
[ 2159.591877] usb 1-2: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[ 2159.591884] usb 1-2: Product: D-Link DWM-156
[ 2159.591889] usb 1-2: Manufacturer: D-Link,Inc
[ 2159.591894] usb 1-2: SerialNumber: 532274409833040
[ 2159.593378] scsi7 : usb-storage 1-2:1.0
[ 2160.590971] scsi 7:0:0:0: CD-ROM HSPA USB SCSI CD-ROM 6229 PQ: 0 ANSI: 0 CCS
[ 2160.595305] sr1: scsi3-mmc drive: 0x/0x caddy
[ 2160.595595] sr 7:0:0:0: Attached scsi CD-ROM sr1
[ 2160.598099] sr 7:0:0:0: Attached scsi generic sg7 type 5
[ 2160.966761] usb 1-2: USB disconnect, device number 3
[ 2161.716751] usb 1-2: new high-speed USB device number 4 using ehci_hcd
[ 2161.850067] usb 1-2: New USB device found, idVendor=2001, idProduct=7d00
[ 2161.850079] usb 1-2: New USB device strings: Mfr=5, Product=6, SerialNumber=0
[ 2161.850086] usb 1-2: Product: D-Link DWM-156
[ 2161.850091] usb 1-2: Manufacturer: D-Link,Inc
[ 2161.851828] scsi8 : usb-storage 1-2:1.2
[ 2162.848410] scsi 8:0:0:0: Direct-Access HSPA USB SCSI CD-ROM 6229 PQ: 0 ANSI: 0 CCS
[ 2162.849847] sd 8:0:0:0: Attached scsi generic sg7 type 0
[ 2162.857127] sd 8:0:0:0: [sdg] Attached SCSI removable disk
[ 2164.162903] show_signal_msg: 45 callbacks suppressed
[ 2164.162915] usb_modeswitch_[6067]: segfault at 0 ip 00007fed729a4101 sp 00007fffff6fc738 error 4 in libc-2.15.so[7fed7291b000+1b5000]

What I read above does not seem to work (or I don't understand it):
$ ls -l /dev/sr*
brw-rw----+ 1 root cdrom 11, 0 Feb 17 03:25 /dev/sr0
$ eject -s sr0
eject: unable to eject, last error: Success
$ eject -s sr1
eject: unable to find or open device for: `sr1'
$ eject -s sg7
eject: unable to open `/dev/sg7'

$ lsusb -v

Code: Select all

Bus 001 Device 004: ID 2001:7d00 D-Link Corp.                                                                                                                                                 
Couldn't open device, some information will be missing                                                                                                                                        
Device Descriptor:                                                                                                                                                                            
  bLength                18                                  
  bDescriptorType         1                            
  bcdUSB               2.00                                                       
  bDeviceClass            0 (Defined at Interface level)       
  bDeviceSubClass         0                                                 
  bDeviceProtocol         0                                                     
  bMaxPacketSize0        64                                                 
  idVendor           0x2001 D-Link Corp.                               
  idProduct          0x7d00                                 
  bcdDevice            2.00                                   
  iManufacturer           5                              
  iProduct                6                              
  iSerial                 0                                 
  bNumConfigurations      1                      
  Configuration Descriptor:                  
    bLength                 9                  
    bDescriptorType         2
    wTotalLength          104
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      2 
      bInterfaceProtocol      1 
      iInterface              1 
      ** UNRECOGNIZED:  05 24 00 10 01
      ** UNRECOGNIZED:  04 24 02 0f
      ** UNRECOGNIZED:  05 24 06 00 01
      ** UNRECOGNIZED:  05 24 01 03 01
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               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  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              3 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              4 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0

What can I do to make it work, respectively extract the details to be added to this software?

Uwe

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: D-Link DWM-156

Post by LOM » 17 Feb 2013, 14:56

Your stick is already in modem mode so you don't need to do any of those eject commands but you'll have to load the drivers manually:

modprobe usb_wwan
modprobe option
echo "2001 7d00" > / sys/bus/usb-serial/drivers/option1/new_id"

and this will give you a ttyUSB0 and a ttyUSB1 device under /dev
ttyUSB0 is the modem.

udippel
Posts: 3
Joined: 17 Feb 2013, 05:52

Re: D-Link DWM-156

Post by udippel » 17 Feb 2013, 16:21

@LOM:
Thanks very much! It actually does work when typed liked that.
The ugly segfault still occurs, though.

Anything I can help with to make this stick work in future out of the box?

Uwe
:D

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: D-Link DWM-156

Post by LOM » 18 Feb 2013, 06:44

udippel wrote:@LOM:
Thanks very much! It actually does work when typed liked that.
The ugly segfault still occurs, though.

Anything I can help with to make this stick work in future out of the box?

Uwe
:D
The segfault is probably caused by Ubuntu's implementation of usb_modeswitch or from using an older version of usb_modeswitch together with a later version of libc, this is something you should report to Ubuntu developers.

You will have to load the drivers manually until the stick gets included in the option driver, the echo command only adds a
a temporary on-the-fly support.

Can you please give me the version number from the sticks label, I alrady know about versions A1 and A3 and they have
a quite different usb id.

udippel
Posts: 3
Joined: 17 Feb 2013, 05:52

Re: D-Link DWM-156

Post by udippel » 18 Feb 2013, 07:29

Thanks so much! - It is a pleasure working with you.

I will file a bug report with Ubuntu, yes.
I am aware I have to use some script to make it come up semi-automatic.
The version number is A6 (HW) and 6 0 5 WW (FW).
FCC ID would be KAZWM156A6

Thanks again,

Uwe

Post Reply