OpenWrt Forum Archive

Topic: Tp-LINK MR3020 & d-LINK DWM-221

The content of this topic has been archived on 16 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I just managed to make the this two guys work flawlessly on the latest snapshots/trunk and I'd like to share my recipe.

In order to make the device work as a 3g modem:

1) Install required packages

opkg update
opkg install comgt kmod-usb-serial kmod-usb-serial-option kmod-usb-serial-wwan usb-modeswitch

2) Create a file named dlink.json with your favorite text editor and put it in /etc/dlink.json
3) Edit the file adding this content

{
        "messages" : [
                        "555342435b000000000000000001061e000000000000000000000000000000",
                        "555342435c000000000000000001061b000000010000000000000000000000",
                        "555342435d000000000000000001061b000000020000000000000000000000",
                        ],
                        "devices" : {
                                        "2001:a401": {
                                                                "*": {
                                                                "t_vendor": 8193,
                                                                "t_product": [ 32281 ],
                                                                "msg": [ 0, 1, 2 ]
                                                                        }
                                                        },
                                }
}

4) edit /etc/rc.local adding this line before the exit 0 line

echo '0x2001 0x7e19' > /sys/bus/usb-serial/drivers/option1/new_id

5) reboot. The modem will switch and configured on /dev/ttyUSB1

6) follow the instruction in this guide to configure your 3g connection: http://wiki.openwrt.org/doc/recipes/3gdongle.

Configuring a pivot overlay on the internal sd card proved to be a little more tricky but...

1) Follow this guide http://wiki.openwrt.org/doc/howto/obtai … e.generate to create an image with following packages

make image PROFILE=TLMR3020 PACKAGES="usb-modeswitch block-mount kmod-fs-ext4 kmod-usb2 kmod-usb-uhci kmod-usb-ohci kmod-usb-storage"

2) Flash the new firmware and login
3) Modify /sbin/block as follows

mkdir -p /sbin/block_
mv /sbin/block /sbin/block_/block
touch /sbin/block
chmod 755 /sbin/block

4) edit with your favorite editor /sbin/block with this content

#!/bin/sh
/sbin/usbmode -s -c /etc/dlink.json
for i in 1 2 3 4 5 6 7 8 9 10; do
  [ -e /dev/sda ] && break
  sleep 1 
done
exec /sbin/block_/block $*

5) create /etc/dlink.json as shown in point 2 and 3 of the previous list
6) edit /etc/rc.local as described in point 4 of the previous list
7) reboot. The modem will switch and configured on /dev/ttyUSB1
8) prepare the micro sd card with at last one etx4 partition and configure pivot /overlay as described in this guide http://wiki.openwrt.org/doc/howto/extroot
9) use opkg offline (you can use scp to upload packages to your /tmp directory) to install the following packages: comgt kmod-usb-serial kmod-usb-serial-option kmod-usb-serial-wwan
10) follow the instructions in this guide to configure your 3g connection: http://wiki.openwrt.org/doc/recipes/3gdongle

(Last edited by fabio.giglietto on 5 Sep 2015, 18:40)

Wow, finally big_smile
I have a Tp-link MR3040 and the same modem.
Openwrt 15.05 (final)
I've used your instructions, but with some differences:

- on dlink.json file, "2001:a406" instead of  "2001:a401"
-- The "right numbers" (vendor and product),  run "cat /sys/kernel/debug/usb/devices"
- Run "usbmode -s -v -c /etc/dlink.json"

digital wrote:

Wow, finally big_smile

You are prolly not the only one waiting for some kind of support for 2001:a406 so why don't you head over to the usb_modeswitch forum (see fabio's link) and report this new device so that it can be officially supported.

Folks, I'm newbie so please spare me :-) I've got this setup ( mr3020 + dwm-221 ) and want to make overlay on sd card within dwn-221. I've followed the suggestion as posted above however mr3020 won't boot. It always hangs with first 2 leds on and wps/reset led on. When I boot into failsafe mode and do mount_root, I can see the root partition extended. Any initial hints what could be wrong ?

Got a bit further. If I won't do '/sbin/usbmode -s -c /etc/dlink.json' change of DWM-221 then extroot works as expected...no issues at all and mr3020 boots up with overlayed root. Great.

Question then remains, where should I do usb switch of DWM-221 so that it will actually boot up. It's definitely hanging if I use modified /sbin/block ( as described in the first post above ).

Version :15.05.1

The solution works for Barrier Breaker?

I was thinking of buying the Dwm-221 but only have available the BB version of OpenWRT .

Works?

The discussion might have continued from here.