Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    D-Link DWM-157 USB Stock not recognized

    Scheduled Pinned Locked Moved Hardware
    39 Posts 6 Posters 9.6k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T Offline
      Tagashy
      last edited by

      Hello,

      I have the same bug.

      To correct it i have to change the old product id (0x7d02 and 0xa707 for CD-ROM) for DWM-157 in the u3g driver with the new one (0x7d0e and 0xa407 for CD-ROM)

      if you want to change it those id are at line 1631 and 1632 of usbdev file (https://svnweb.freebsd.org/base/head/sys/dev/usb/usbdevs?view=markup&pathrev=277246)

      actualy i've done it only with freebsd 10.2 as for pfsense you need to recompile all the kernel with the new version of u3g (i am doing this as i'm writting those lines)

      Good luck.

      P.S sorry for my english it's not my native language

      1 Reply Last reply Reply Quote 0
      • H Offline
        heper
        last edited by

        If it works on stock freebsd 10.3 (version for upcomming pfSense 2.3) and/or you know how to make it work: file a bugreport on https://redmine.pfsense.org/projects/pfsense

        post all relevant info & the devs will probably take a look at it when time permits

        1 Reply Last reply Reply Quote 0
        • T Offline
          TheNetStriker
          last edited by

          I have exactly the same problem. My D-Link DWM-157 is also recognized as a CD Drive, but it has another USB ID: 2001:a407 (Europe version?)

          Can you also add this ID to the usb file?

          Edit: I just saw that Tagashy has mentioned this USB ID. I also found out how to switch the device to modem mode. Could you provide a compiled kernel for pfSense 2.2.6-RELEASE (amd64) so I can test the changes?

          1 Reply Last reply Reply Quote 0
          • P Offline
            peoples
            last edited by

            @TheNetStriker:

            I have exactly the same problem. My D-Link DWM-157 is also recognized as a CD Drive, but it has another USB ID: 2001:a407 (Europe version?)

            Can you also add this ID to the usb file?

            Edit: I just saw that Tagashy has mentioned this USB ID. I also found out how to switch the device to modem mode. Could you provide a compiled kernel for pfSense 2.2.6-RELEASE (amd64) so I can test the changes?

            @TheNetStriker … maybe you want to share the information on how to switch the DWM-157 stick to modem mode ?

            @heper ... i run pfsense 2.3 RC1 but my DWM-157 stick doesn't work.

            meanwhile i got the documents (attached) from d-link support. i can confirm that the following MessageContent is switching my stick to modem mode

            usb_modeswitch -v 2001 -p a407 -m 1 -M 555342431234567800000000000003f0010300000000000000000000000000 -R 1
            

            But it's reconized as ethernet UE0 device ? Sime ideas ?

            dwm-157_revc1_1481819.zip

            1 Reply Last reply Reply Quote 0
            • T Offline
              TheNetStriker
              last edited by

              @peoples:

              @TheNetStriker:

              I have exactly the same problem. My D-Link DWM-157 is also recognized as a CD Drive, but it has another USB ID: 2001:a407 (Europe version?)

              Can you also add this ID to the usb file?

              Edit: I just saw that Tagashy has mentioned this USB ID. I also found out how to switch the device to modem mode. Could you provide a compiled kernel for pfSense 2.2.6-RELEASE (amd64) so I can test the changes?

              @TheNetStriker … maybe you want to share the information on how to switch the DWM-157 stick to modem mode ?

              @heper ... i run pfsense 2.3 RC1 but my DWM-157 stick doesn't work.

              meanwhile i got the documents (attached) from d-link support. i can confirm that the following MessageContent is switching my stick to modem mode

              usb_modeswitch -v 2001 -p a407 -m 1 -M 555342431234567800000000000003f0010300000000000000000000000000 -R 1
              

              But it's reconized as ethernet UE0 device ? Sime ideas ?

              My device is now listed as ugen1.2. I think I used the wrong MessageContent. Any idea how I can change the device back? This command doesn't seam to work:

              usb_modeswitch -R -v 2001 -p 7d0e
              
              1 Reply Last reply Reply Quote 0
              • T Offline
                TheNetStriker
                last edited by

                @heper:

                If it works on stock freebsd 10.3 (version for upcomming pfSense 2.3) and/or you know how to make it work: file a bugreport on https://redmine.pfsense.org/projects/pfsense

                post all relevant info & the devs will probably take a look at it when time permits

                I don't think that this will be fixed with FreeBSD 10.3. I've looked at the latest usbdevs file and there is no device with id a407. So I think this should be reported to the FreeBSD project. It seams as there are multiple possible ways to report problems in FreeBSD. Which one would be correct? File a bug report on GitHUB maybe?

                1 Reply Last reply Reply Quote 0
                • C Offline
                  chedxb
                  last edited by

                  hello,

                  I am trying to make a D-Link DWM-157 D1 unit work on pfSense 2.4.4 and I have the same problem, pfSense sees it as CD-ROM despite it is shown as a "Known Working 3G-4G Modem" (https://docs.netgate.com/pfsense/en/latest/cellular/known-working-3g-4g-modems.html)

                  I followed the steps https://redmine.pfsense.org/issues/6226 and http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=4&t=2687 however it is insisting to be a CD-ROM instead of a modem.

                  Question: is it possible to use configuration=2 option instead of MessageContent in pfSense?

                  Best,

                  Savas

                  1 Reply Last reply Reply Quote 1
                  • stephenw10S Offline
                    stephenw10 Netgate Administrator
                    last edited by

                    If it has 2 (or more) usb config indexes you can force it to use a different one using a usb quirk option.

                    Try running usbconfig dump_all_desc against it.

                    Steve

                    1 Reply Last reply Reply Quote 0
                    • C Offline
                      chedxb
                      last edited by

                      Thanks Steve,

                      In the attached file, you can find the usbconfig dump_all_desc output.

                      How can I use the quirk option?

                      Best,

                      Savas
                      Shell Output.zip

                      1 Reply Last reply Reply Quote 1
                      • stephenw10S Offline
                        stephenw10 Netgate Administrator
                        last edited by

                        Ok, so that device has 3 config indexes:

                        ugen4.2: <D-Link,Inc D-Link DWM-157> at usbus4, cfg=1 md=HOST spd=HIGH
                        (480Mbps) pwr=ON (98mA)
                        bLength = 0x0012
                        bDescriptorType = 0x0001
                        bcdUSB = 0x0200
                        bDeviceClass = 0x0000 <Probed by interface class>
                        bDeviceSubClass = 0x0000
                        bDeviceProtocol = 0x0000
                        bMaxPacketSize0 = 0x0040
                        idVendor = 0x2001
                        idProduct = 0xa407
                        bcdDevice = 0x0300
                        iManufacturer = 0x0002 <D-Link,Inc >
                        iProduct = 0x0003 <D-Link DWM-157>
                        iSerialNumber = 0x0004 <531399703502680>
                        bNumConfigurations = 0x0003
                        Configuration index 0
                        bLength = 0x0009
                        bDescriptorType = 0x0002wTotalLength = 0x0020
                        bNumInterfaces = 0x0001
                        bConfigurationValue = 0x0001
                        iConfiguration = 0x0000 <no string>
                        bmAttributes = 0x00a0
                        bMaxPower = 0x00fa
                        Interface 0
                        bLength = 0x0009
                        bDescriptorType = 0x0004
                        bInterfaceNumber = 0x0000
                        bAlternateSetting = 0x0000
                        bNumEndpoints = 0x0002
                        bInterfaceClass = 0x0008 <Mass storage>
                        bInterfaceSubClass = 0x0006
                        bInterfaceProtocol = 0x0050
                        iInterface = 0x0001 <Mass Storage >
                        Endpoint 0
                        bLength = 0x0007
                        bDescriptorType = 0x0005
                        bEndpointAddress = 0x0081 <IN>
                        bmAttributes = 0x0002 <BULK>
                        wMaxPacketSize = 0x0200
                        bInterval = 0x0000
                        bRefresh = 0x0000
                        bSynchAddress = 0x0000
                        Endpoint 1
                        bLength = 0x0007
                        bDescriptorType = 0x0005
                        bEndpointAddress = 0x0001 <OUT>
                        bmAttributes = 0x0002 <BULK>
                        wMaxPacketSize = 0x0200
                        bInterval = 0x0000
                        bRefresh = 0x0000
                        bSynchAddress = 0x0000
                        Configuration index 1
                        bLength = 0x0009
                        bDescriptorType = 0x0002
                        wTotalLength = 0x0020
                        bNumInterfaces = 0x0001
                        bConfigurationValue = 0x0002
                        iConfiguration = 0x0000 <no string>
                        bmAttributes = 0x00a0
                        bMaxPower = 0x0031
                        Interface 0
                        bLength = 0x0009
                        bDescriptorType = 0x0004
                        bInterfaceNumber = 0x0000
                        bAlternateSetting = 0x0000
                        bNumEndpoints = 0x0002bInterfaceClass = 0x0008 <Mass storage>
                        bInterfaceSubClass = 0x0006
                        bInterfaceProtocol = 0x0050
                        iInterface = 0x0001 <Mass Storage >
                        Endpoint 0
                        bLength = 0x0007
                        bDescriptorType = 0x0005
                        bEndpointAddress = 0x0081 <IN>
                        bmAttributes = 0x0002 <BULK>
                        wMaxPacketSize = 0x0200
                        bInterval = 0x0000
                        bRefresh = 0x0000
                        bSynchAddress = 0x0000
                        Endpoint 1
                        bLength = 0x0007
                        bDescriptorType = 0x0005
                        bEndpointAddress = 0x0001 <OUT>
                        bmAttributes = 0x0002 <BULK>
                        wMaxPacketSize = 0x0200
                        bInterval = 0x0000
                        bRefresh = 0x0000
                        bSynchAddress = 0x0000
                        Configuration index 2
                        bLength = 0x0009
                        bDescriptorType = 0x0002
                        wTotalLength = 0x0020
                        bNumInterfaces = 0x0001
                        bConfigurationValue = 0x0003
                        iConfiguration = 0x0000 <no string>
                        bmAttributes = 0x00e0
                        bMaxPower = 0x0000
                        Interface 0
                        bLength = 0x0009
                        bDescriptorType = 0x0004
                        bInterfaceNumber = 0x0000
                        bAlternateSetting = 0x0000
                        bNumEndpoints = 0x0002
                        bInterfaceClass = 0x0008 <Mass storage>
                        bInterfaceSubClass = 0x0006
                        bInterfaceProtocol = 0x0050
                        iInterface = 0x0001 <Mass Storage >
                        Endpoint 0
                        bLength = 0x0007
                        bDescriptorType = 0x0005
                        bEndpointAddress = 0x0081 <IN>
                        bmAttributes = 0x0002 <BULK>
                        wMaxPacketSize = 0x0200
                        bInterval = 0x0000
                        bRefresh = 0x0000bSynchAddress = 0x0000
                        Endpoint 1
                        bLength = 0x0007
                        bDescriptorType = 0x0005
                        bEndpointAddress = 0x0001 <OUT>
                        bmAttributes = 0x0002 <BULK>
                        wMaxPacketSize = 0x0200
                        bInterval = 0x0000
                        bRefresh = 0x0000
                        bSynchAddress = 0x0000
                        

                        All show as mass storage devices though...

                        Try setting it manually first:
                        usbconfig ugen4.2 set_config 2
                        Or 1.

                        Though it looks like you might have the C1 variant from the usbmodeswitch forum discussion.

                        Steve

                        1 Reply Last reply Reply Quote 0
                        • C Offline
                          chedxb
                          last edited by

                          Thanks Steve,

                          when I tried usbconfig ugen4.2 set_config 2, I got the following message;

                          usbconfig - configure the USB subsystem
                          usage: usbconfig -u <busnum> -a <devaddr> -i <ifaceindex> [cmds...]
                          usage: usbconfig -d [ugen]<busnum>.<devaddr> -i <ifaceindex> [cmds...]
                          commands:
                          set_config <cfg_index>
                          .
                          .

                          then I tried the following;

                          usbconfig -d ugen4.2 set_config 0
                          usbconfig -d ugen4.2 set_config 1
                          usbconfig -d ugen4.2 set_config 2

                          however they didn't work, still shows as cd0

                          Best,

                          Savas

                          1 Reply Last reply Reply Quote 1
                          • C Offline
                            chedxb
                            last edited by chedxb

                            btw, when I was searching something useful in the USB stick, this is what I found,

                            intallation config file

                            DefaultVendor= 0x2001
                            DefaultProduct= 0xa407

                            TargetVendor= 0x2001
                            TargetProduct= 0x7d0e

                            MagicId=2ds2dse5w885d5d5we5d2d2d5sd4dgg4fdfd5

                            AutoRun=1

                            I tried to use the MagicId as MessageContent with USB_switch, however it didn't work.

                            Is there a way to convert the MagicId to MessageContent?

                            Best,

                            Savas

                            1 Reply Last reply Reply Quote 1
                            • stephenw10S Offline
                              stephenw10 Netgate Administrator
                              last edited by

                              Ah sorry missed the -d switch. Ok well if you have the C1version you will need to use usb_modeswitch.

                              Is the message content not in it already?

                              It may not help you though because neither of those IDs is known to pfSense/FreeBSD:
                              https://github.com/pfsense/FreeBSD-src/blob/ff7d4801f1b88de656e028209818ff005e8a1353/sys/dev/usb/usbdevs#L1663

                              Steve

                              1 Reply Last reply Reply Quote 0
                              • C Offline
                                chedxb
                                last edited by chedxb

                                Unfortunately there is no message content. I found this cryptic MagicId, however it didn't work.

                                btw, TargetVendor and TargetProduct are there,

                                731 vendor DLINK 0x2001 D-Link
                                813 product ABIT AK_020 0x7d0e 3G modem

                                Best,

                                Savas

                                1 Reply Last reply Reply Quote 1
                                • stephenw10S Offline
                                  stephenw10 Netgate Administrator
                                  last edited by

                                  Mmm, but that product is from a different vendor so it will not match.

                                  If you manage to make this work it will be via bunch of workarounds that may fail. I recommend using a different modem if you can.

                                  Steve

                                  1 Reply Last reply Reply Quote 0
                                  • C Offline
                                    chedxb
                                    last edited by

                                    Thanks Steve, I will try with a different modem.

                                    Best,

                                    Savas

                                    1 Reply Last reply Reply Quote 0
                                    • stephenw10S Offline
                                      stephenw10 Netgate Administrator
                                      last edited by

                                      If it is the C1 version it just needs to be ejected anyway:
                                      https://github.com/NetworkManager/usb_modeswitch-data/blob/master/usb_modeswitch.d/2001:a407

                                      And then it may appear as a usb Ethernet device which you can use directly. There are issues with that though.

                                      Steve

                                      1 Reply Last reply Reply Quote 0
                                      • C Offline
                                        chedxb
                                        last edited by

                                        I am afraid it is D1
                                        20190415_135623353_iOS.jpg

                                        1 Reply Last reply Reply Quote 0
                                        • C Offline
                                          chedxb
                                          last edited by

                                          I also tried usb_modeswitch -v 2001 -p a407 -K -W, however it didn't generate any verbose output.

                                          and this is what I see on the system log,

                                          Apr 15 18:17:57 kernel da0: quirks=0x2<NO_6_BYTE>
                                          Apr 15 18:17:57 kernel da0: Attempt to query device size failed: ILLEGAL REQUEST, Invalid field in CDB
                                          Apr 15 18:17:57 kernel da0: 40.000MB/s transfers
                                          Apr 15 18:17:57 kernel da0: <HSPA USB SCSI CD-ROM 6225> Removable Direct Access SCSI device
                                          Apr 15 18:17:57 kernel da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
                                          Apr 15 18:17:57 kernel umass0: <Mass Storage > on usbus4
                                          Apr 15 18:17:57 kernel umass0 on uhub1
                                          Apr 15 18:17:57 kernel ugen4.2: <D-Link,Inc D-Link DWM-157> at usbus4
                                          Apr 15 18:17:55 kernel ugen4.2: <D-Link,Inc D-Link DWM-157> at usbus4 (disconnected)
                                          Apr 15 18:17:55 kernel umass0: detached
                                          Apr 15 18:17:55 kernel (cd0:umass-sim0:0:0:0): Periph destroyed
                                          Apr 15 18:17:55 kernel cd0: <HSPA USB SCSI CD-ROM 6225> s/n 531399703502680 detached
                                          Apr 15 18:17:55 kernel cd0 at umass-sim0 bus 0 scbus2 target 0 lun 0
                                          Apr 15 18:17:55 kernel umass0: at uhub1, port 1, addr 2 (disconnected)
                                          Apr 15 18:17:36 kernel cd0: quirks=0x10<10_BYTE_ONLY>
                                          Apr 15 18:17:36 kernel cd0: 14MB (28672 512 byte sectors)
                                          Apr 15 18:17:36 kernel cd0: 40.000MB/s transfers
                                          Apr 15 18:17:36 kernel cd0: Serial Number 531399703502680
                                          Apr 15 18:17:36 kernel cd0: <HSPA USB SCSI CD-ROM 6225> Removable CD-ROM SCSI device
                                          Apr 15 18:17:36 kernel cd0 at umass-sim0 bus 0 scbus2 target 0 lun 0
                                          Apr 15 18:17:36 kernel umass0: <Mass Storage > on usbus4
                                          Apr 15 18:17:36 kernel umass0 on uhub1
                                          Apr 15 18:17:36 kernel ugen4.2: <D-Link,Inc D-Link DWM-157> at usbus4

                                          basically when I run usb_modeswitch -v 2001 -p a407 -K -W, it ejects cd0 and turns into da0, not modem.

                                          Best,

                                          Savas

                                          1 Reply Last reply Reply Quote 0
                                          • stephenw10S Offline
                                            stephenw10 Netgate Administrator
                                            last edited by

                                            Mmm, it sure looks like a C1 version in many ways. You see anything else in the system log after you do that?

                                            Try running usbconfig dump_all_desc against it after you have ejected it to change it's mode like LOM suggested.

                                            Steve

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.