Activation Codes and Methods, Hardware Details, Sniffing
Post Reply
nicko77
Posts: 4
Joined: 10 Mar 2016, 18:44

D-LINK DWM-157 rev C

Post by nicko77 » 10 Mar 2016, 19:06

Hello

I try to connect to a raspberry the new dongle D-LINK DWM-157. I have last version of usb_modeswitch 2.3.0.

Try to switch to modem mode to use it with raspiSMS, but do not work. Here are the nformations :

lsusb
Bus 001 Device 009: ID 2001:a407 D-Link Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


Try with the information found on the board for the rev B1 :

# D-Link DWM-157 B1

DefaultVendor= 0x2001
DefaultProduct= 0xa407

TargetVendor= 0x2001
TargetProduct= 0x7d02

MessageContent="5553424312345678000000000000061b000000020000000000000000000000"



Launch the command :

Look for target devices ...
No devices in target mode or class found
Look for default devices ...
product ID matched
Found devices in default mode (1)
Access device 011 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
Use endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: D-Link,Inc
Product: D-Link DWM-157
Serial No.: 536512507515960
-------------------------
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 successfully read (13 bytes).
Reset response endpoint 0x81
Reset message endpoint 0x01
-> Run lsusb to note any changes. Bye!

It switch to this mode :

Bus 001 Device 012: ID 2001:7d0e D-Link Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

dmesg
[ 2700.050862] usb 1-1.4: Manufacturer: D-Link,Inc
[ 2700.053984] cdc_mbim 1-1.4:1.0: cdc-wdm0: USB WDM device
[ 2700.054886] cdc_mbim 1-1.4:1.0 wwan0: register 'cdc_mbim' at usb-3f980000.usb-1.4, CDC MBIM, 6a:b2:5b:81:77:8c
[ 2700.063621] usb-storage 1-1.4:1.6: USB Mass Storage device detected
[ 2700.063917] scsi host8: usb-storage 1-1.4:1.6
[ 2701.059968] scsi 8:0:0:0: Direct-Access HSPA USB SCSI CD-ROM 6225 PQ: 0 ANSI: 0 CCS
[ 2701.062249] sd 8:0:0:0: Attached scsi generic sg0 type 0
[ 2701.080172] sd 8:0:0:0: [sda] Test WP failed, assume Write Enabled
[ 2701.080865] sd 8:0:0:0: [sda] Asking for cache data failed
[ 2701.080890] sd 8:0:0:0: [sda] Assuming drive cache: write through
[ 2701.082661] sd 8:0:0:0: [sda] Attached SCSI removable disk



But can't find any /dev/ttyUSB device. It switch to WDM mode and mount an interface wwan0.

Any help ? or this device do not have modem mode ?

Thanks

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

Re: D-LINK DWM-157 rev C

Post by LOM » 11 Mar 2016, 13:10

nicko77 wrote: Any help ? or this device do not have modem mode ?
It is a device which I've not seen before but I guess it has a ppp dialup modem interface like its cousins have.
I assume you don't have the full lsusb cmd on your RPi but if you have then please give me the output from lsusb -v -d 2001:a407 and lsusb -v -d 2001:7d0e.

Otherwise a cat /sys/kernel/debug/usb/devices or cat /proc/bus/usb/devices for each of the two id's could be helpful.
I can then tell you a bit more about your device.

nicko77
Posts: 4
Joined: 10 Mar 2016, 18:44

Re: D-LINK DWM-157 rev C

Post by nicko77 » 14 Mar 2016, 18:44

Hello

Here are the info for :

lsusb -v -d 2001:a407

Code: Select all

Bus 001 Device 100: ID 2001:a407 D-Link Corp.
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          0xa407
  bcdDevice            3.00
  iManufacturer           2 D-Link,Inc
  iProduct                3 D-Link DWM-157
  iSerial                 4 536512507515960
  bNumConfigurations      3
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      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-Only
      iInterface              1 Mass Storage
      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
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     2
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower               98mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              1 Mass Storage
      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
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     3
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              1 Mass Storage
      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
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  bNumConfigurations      3
Device Status:     0x0002
  (Bus Powered)
  Remote Wakeup Enabled
and the device :

Code: Select all

T:  Bus=01 Lev=02 Prnt=96 Port=04 Cnt=02 Dev#=100 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  3
P:  Vendor=2001 ProdID=a407 Rev= 3.00
S:  Manufacturer=D-Link,Inc
S:  Product=D-Link DWM-157
S:  SerialNumber=536512507515960
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
C:  #Ifs= 1 Cfg#= 2 Atr=a0 MxPwr= 98mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
C:  #Ifs= 1 Cfg#= 3 Atr=e0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
When it switch to 7d0e

lsusb -v -d 2001:7d0e.

Code: Select all

Bus 001 Device 101: ID 2001:7d0e D-Link Corp.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 ?
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  idVendor           0x2001 D-Link Corp.
  idProduct          0x7d0e
  bcdDevice            3.00
  iManufacturer           9 D-Link,Inc
  iProduct               10 D-Link DWM-157
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          228
    bNumInterfaces          7
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass          2 Communications
      bFunctionSubClass      14
      bFunctionProtocol       0
      iFunction               1 COM(comm_if)
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass     14
      bInterfaceProtocol      0
      iInterface              1 COM(comm_if)
      CDC Header:
        bcdCDC               1.10
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1
      CDC MBIM:
        bcdMBIMVersion       1.00
        wMaxControlMessage   512
        bNumberFilters       16
        bMaxFilterSize       64
        wMaxSegmentSize      1500
        bmNetworkCapabilities 0x20
          8-byte ntb input size
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x88  EP 8 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      2
      iInterface              2 COM(data_if)
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      2
      iInterface              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  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        2
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      2
      bInterfaceProtocol      1
      iInterface              3 COM(comm_if)
      ** UNRECOGNIZED:  05 24 00 10 01
      ** UNRECOGNIZED:  04 24 02 0f
      ** UNRECOGNIZED:  05 24 06 02 03
      ** UNRECOGNIZED:  05 24 01 03 03
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x87  EP 7 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               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        3
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              5 COM(data_if)
      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
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        4
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              6 COM(data_if)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 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     0x04  EP 4 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        5
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              7 COM(data_if)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 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     0x05  EP 5 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        6
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              8 Mass Storage
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x86  EP 6 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     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 ?
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0002
  (Bus Powered)
  Remote Wakeup Enabled
and device

Code: Select all

T:  Bus=01 Lev=02 Prnt=96 Port=04 Cnt=02 Dev#=101 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=2001 ProdID=7d0e Rev= 3.00
S:  Manufacturer=D-Link,Inc
S:  Product=D-Link DWM-157
C:* #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=500mA
A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim
E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=125us
I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=01 Driver=(none)
E:  Ad=87(I) Atr=03(Int.) MxPS=  64 Ivl=500us
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 6 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

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

Re: D-LINK DWM-157 rev C

Post by LOM » 15 Mar 2016, 06:04

Your DWM-157C1 has the same interface layout as DWM-157B1:


MI_00 D-Link Mobile Broadband Device #2 network adapter
MI_02 D-Link HSPA+DataCard Diagnostics Interface (also ppp modem)
MI_03 D-Link HSPA+DataCard NMEA Device
MI_04 D-Link HSPA+DataCard Speech Port
MI_05 D-Link HSPA+DataCard Debug Port
MI_06 USB Mass Storage Device

The device is too new for being supported in the linux serial driver named option but it will be loaded and bound to your device if you let usb_modeswitch run automatically without invoking it manually.
For that to work you'll have to create a new device config file, you can use the one for 157B1 but with the new usb id's. Please note that the 157B1 device config file you've been looking at is old, make sure that you have the latest usb_modeswitch data package installed before creating the new config file.
The config file for DWM-157B1 from the latest data package looks like this:

# D-Link DWM-157 B1
TargetVendor=0x2001
TargetProduct=0x7d02
StandardEject=1

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

Re: D-LINK DWM-157 rev C

Post by Josh » 15 Mar 2016, 14:57

I have noted this as a new device for the next release.

nicko77
Posts: 4
Joined: 10 Mar 2016, 18:44

Re: D-LINK DWM-157 rev C

Post by nicko77 » 16 Mar 2016, 22:13

LOM wrote:# D-Link DWM-157 B1
TargetVendor=0x2001
TargetProduct=0x7d02
StandardEject=1

Hello

I try with this configuration (add the device in rules.d and custom device). It switch auto but it's not going to 0x7d02 mode (still in cdc mode 7d0e)

Code: Select all

USB_ModeSwitch log from Wed Mar 16 20:08:09 UTC 2016

Use global config file: /etc/usb_modeswitch.conf

Started via systemd
Raw args from udev: _1-1.4

Use top device dir /sys/bus/usb/devices/1-1.4
Check class of first interface ...
 Interface 0 class is 08.

----------------
USB values from sysfs:
  manufacturer  D-Link,Inc
  product       D-Link DWM-157
  serial        536512507515960
----------------
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz
ConfigList: /etc/usb_modeswitch.d/2001:a407 /usr/share/usb_modeswitch/2001:a407
pack/
SCSI attributes not needed, move on
Check config: /etc/usb_modeswitch.d/2001:a407
! matched. Read config data
Use config file from override folder /etc/usb_modeswitch.d
Logger is /usr/bin/logger
Driver module is "option", ID path is /sys/bus/usb-serial/drivers/option1

Device may have an MBIM configuration, check driver ...
 driver for MBIM devices is available
Find MBIM configuration number ...
 No MBIM configuration found, switch to legacy modem mode
Unbinding driver
Command to be run:
usb_modeswitch -W -D  -b 1 -g 4 -v 2001 -p a407 -f $flags(config)

Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are to be expected in the process)
--------------------------------

Read long config from command line

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

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x2001
DefaultProduct= 0xa407
TargetVendor=   0x2001
TargetProduct=  0x7d02

StandardEject=1
System integration mode enabled

Use given bus/device number: 001/004 ...
Look for default devices ...
 bus/device number matched
  found USB ID 2001:a407
   vendor ID matched
   product ID matched
 Found devices in default mode (1)
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
Use endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: D-Link,Inc
     Product: D-Link DWM-157
  Serial No.: 536512507515960
-------------------------
Sending standard EJECT sequence
Looking for active driver ...
 No active driver found. Detached before or never attached
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 successfully read (13 bytes).
Trying to send message 2 to endpoint 0x01 ...
 OK, message successfully sent
Read the response to message 2 (CSW) ...
 Response successfully read (13 bytes).
Reset response endpoint 0x81
Reset message endpoint 0x01
 Device is gone, skip any further commands
ok:busdev
--------------------------------
(end of usb_modeswitch output)

Check success of mode switch for max. 20 seconds ...
 Wait for device file system (1 sec.) ...
 Read attributes ...
 Attributes are different but target values are unexpected:
    1-1.4:1.0/bInterfaceClass: 02
    bConfigurationValue:       1
    bNumConfigurations:        1
    busnum:                    1
    devnum:                    5
    idProduct:                 7d0e
    idVendor:                  2001
    manufacturer:              D-Link,Inc
    product:                   D-Link DWM-157
    serial:
Mode switching was successful, found 2001:7d0e (D-Link,Inc: D-Link DWM-157)
Now check for bound driver ...
 driver has bound, device is known
Check for AVOID_RESET_QUIRK kernel attribute
 AVOID_RESET_QUIRK activated

All done, exit

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

Re: D-LINK DWM-157 rev C

Post by LOM » 17 Mar 2016, 10:15

nicko77 wrote: Hello

I try with this configuration (add the device in rules.d and custom device). It switch auto but it's not going to 0x7d02 mode (still in cdc mode 7d0e)
Your device can only switch to 2001:7d0e , 2001:7d02 is for the B1 version so edit your config files TargetProduct to reflect that.
The only thing you miss now is the option serial driver which you'll have to bind by manual cmds:

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

You should then see 4 ttyUSB devices created in /dev , ttyUSB0 is the ppp dialup modem.

nicko77
Posts: 4
Joined: 10 Mar 2016, 18:44

Re: D-LINK DWM-157 rev C

Post by nicko77 » 18 Mar 2016, 20:49

LOM wrote:
nicko77 wrote: Hello

I try with this configuration (add the device in rules.d and custom device). It switch auto but it's not going to 0x7d02 mode (still in cdc mode 7d0e)
Your device can only switch to 2001:7d0e , 2001:7d02 is for the B1 version so edit your config files TargetProduct to reflect that.
The only thing you miss now is the option serial driver which you'll have to bind by manual cmds:

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

You should then see 4 ttyUSB devices created in /dev , ttyUSB0 is the ppp dialup modem.
Thank's it's work, i can see the four USB Devices.

Now there(re some sort of incompabilities with gammu .... (unknown error when send sms). will investigate with gammu forum.

thomasschaefer
Posts: 114
Joined: 17 Jul 2011, 12:08

Re: D-LINK DWM-157 rev C

Post by thomasschaefer » 16 Apr 2016, 21:25

You found your solution. I don't understand why you did not try the obviously method to use this modem.

Could you please post the result of this command?

Code: Select all

mbimcli -d /dev/cdc-wdm0 --query-device-caps
Thank you!

Regards,
Thomas Schäfer

PS: apt-get install libmbim-utils

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

Re: D-LINK DWM-157 rev C

Post by LOM » 17 Apr 2016, 06:25

thomasschaefer wrote:You found your solution. I don't understand why you did not try the obviously method to use this modem.

Could you please post the result of this command?

Code: Select all

mbimcli -d /dev/cdc-wdm0 --query-device-caps
Thank you!

Regards,
Thomas Schäfer

PS: apt-get install libmbim-utils
Not applicable for a user wanting to run raspiSMS on a Raspberry Pi

thomasschaefer
Posts: 114
Joined: 17 Jul 2011, 12:08

Re: D-LINK DWM-157 rev C

Post by thomasschaefer » 17 Apr 2016, 12:25

LOM wrote: Not applicable for a user wanting to run raspiSMS on a Raspberry Pi
I thought the forum of usb_modeswitch is a general mostly distribution and application independent forum?

It was just a friendly request - the user nicko77 could help other users with his information.
I haven't force him to use modemmanager. I just asked for more details about the mbim-information.

In the meantime I ordered this modem to get the information. But this is not the way that I understand under open software collaboration.

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

Re: D-LINK DWM-157 rev C

Post by LOM » 17 Apr 2016, 12:59

thomasschaefer wrote:
LOM wrote: Not applicable for a user wanting to run raspiSMS on a Raspberry Pi
I thought the forum of usb_modeswitch is a general mostly distribution and application independent forum?
The switch method and switch message are the same regardless of linux distro so we have got all info we need for adding it to usb_modeswitch, we have even got the detailed interface layout for both usb id's.

Why do you think that the obvious way for nicko77 to use the dongle is in mbim mode?
It is not obvious at all since raspiSMS communicates with a serial interface when the dongle has connected in ppp dialup mode and that is what nicko77 is intending to use it for.

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

Re: D-LINK DWM-157 rev C

Post by Josh » 17 Apr 2016, 15:46

Both of you have contributed considerably to this modest little project and I very much hope that it will stay that way!

I just cobbled together basic QMI and NCM support in Java for Android devices, and many web searches for information brought me back here to forum posts ...

I guess what I'm trying to get across is that there can hardly ever be an issue with too much information, in this forum or elsewhere ...

thomasschaefer
Posts: 114
Joined: 17 Jul 2011, 12:08

Re: D-LINK DWM-157 rev C

Post by thomasschaefer » 21 Apr 2016, 19:42

@Josh

Thanks for moderation and for your good project. I am still happy to contribute some things.

@LOM

I don't want a big battle. But I am convinced that ncm, mbim and qmi modules are often the better choice than the traditional serial port with ppp.

Mostly they are preferred by the manufactures under windows. So it is useful to evaluate the possibility under linux too.


This modem loads already the mbim-module. That was my obviously point where I would start.

And of course mbim is available at raspberry pi too.


Unfortunately my "dwm 157" was not the revision C.

Therefore I will open a new thread under setup discussion.

The B revsion seems to have the correct switch-sequence but ...

Regards,
Thomas Schäfer

Post Reply