OpenWrt Forum Archive

Topic: D-Link DAP-1350 "pocket" AP/router/client

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

DAP-1305: http://www.dlink.ca/products/?pid=753

First of all, the DAP-1305 is meant for people who travel a lot.. even has a faux-leather travelling case, USB to DC-AC adapter, USB-A to USB-A for power and host (..untested).

The device has a small "mode" switch, AP/RT/CL, for Access point (bridge), Router or Client.

I got this device a little while ago to work around some of the current limitations of OpenBSD's 802.11 stack, mainly, HostAP support is incomplete and a lot of portable devices don't play well with it.. due to lack of Wifi power saving features.

While unpacking it a GPL notice slip fell out, I had hoped there was already some sort of community support for custom firmware on this particular device from 2010.. however, all that exists is two source tarballs on dlinks ftp server.

I spent a few days installing a distribution of Linux on my laptop to sort through the source dump and try to see if it included everything needed to build a firmware. The good news is, yes, it does. Unfortunately a lot of modifications are needed to get the build system to play nice, it assumes root permissions.. and bails trying to build the bundled applications.

The really good news is it includes a copy of the rootfs image as a tarball, all firmware modules (..blobs/cgi/http docs) are in the image, and the included kernel does compile.

Once I extracted that, I had to modify a few build scripts, fix up permissions and create a suitable image that can be flashed via the HTTP interface.

So far all I've changed on the firmware other than the kernel is rc.d/rcS (..to start telnetd), add a few iptables rules and add a dmesg binary so I could include it with my post:

<5>Linux version 2.6.21 (brynet@xxxx) (gcc version 3.4.2) #423 Thu Sep 8 19:35:30 EDT 2011
<4>
<4> The CPU feqenuce set to 384 MHz
<4>CPU revision is: 0001964c
<4>Determined physical RAM map:
<4> memory: 02000000 @ 00000000 (usable)
<7>On node 0 totalpages: 8192
<7>  DMA zone: 64 pages used for memmap
<7>  DMA zone: 0 pages reserved
<7>  DMA zone: 8128 pages, LIFO batch:0
<7>  Normal zone: 0 pages used for memmap
<4>Built 1 zonelists.  Total pages: 8128
<5>Kernel command line: console=ttyS1,115200 root=/dev/mtdblock5 init=/sbin/init
<4>Primary instruction cache 32kB, physically tagged, 4-way, linesize 32 bytes.
<4>Primary data cache 16kB, 4-way, linesize 32 bytes.
<6>Synthesized TLB refill handler (20 instructions).
<6>Synthesized TLB load handler fastpath (32 instructions).
<6>Synthesized TLB store handler fastpath (32 instructions).
<6>Synthesized TLB modify handler fastpath (31 instructions).
<6>Cache parity protection disabled
<4>cause = 800008, status = 1100ff00
<4>PID hash table entries: 128 (order: 7, 512 bytes)
<4>calculating r4koff... 00177000(1536000)
<4>CPU frequency 384.00 MHz
<4>Using 192.000 MHz high precision timer.
<4>Console: colour dummy device 80x25
<4>Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
<4>Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
<6>Memory: 28988k/32768k available (2720k kernel code, 3780k reserved, 511k data, 136k init, 0k highmem)
<7>Calibrating delay loop... 255.48 BogoMIPS (lpj=510976)
<4>Mount-cache hash table entries: 512
<6>NET: Registered protocol family 16
<5>SCSI subsystem initialized
<6>usbcore: registered new interface driver usbfs
<6>usbcore: registered new interface driver hub
<6>usbcore: registered new device driver usb
<6>NET: Registered protocol family 2
<6>Time: MIPS clocksource has been installed.
<4>IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
<4>TCP established hash table entries: 1024 (order: 1, 8192 bytes)
<4>TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
<6>TCP: Hash tables configured (established 1024 bind 1024)
<6>TCP reno registered
<4>Load RT2880 Timer Module(Wdg/Soft)
<6>squashfs: version 3.2-r2 (2007/01/15) Phillip Lougher
<4>squashfs: LZMA suppport for slax.org by jro
<6>io scheduler noop registered (default)
<4>Ralink gpio driver initialized
<6>HDLC line discipline: version $Revision: 1.1.1.1 $, maxframe=4096
<6>N_HDLC line discipline registered.
<6>Serial: 8250/16550 driver $Revision: 1.3 $ 2 ports, IRQ sharing disabled
<6>serial8250: ttyS0 at I/O 0xb0000500 (irq = 37) is a 16550A
<6>serial8250: ttyS1 at I/O 0xb0000c00 (irq = 12) is a 16550A
<4>rdm_major = 254
<6>PPP generic driver version 2.4.2
<6>PPP Deflate Compression module registered
<6>PPP BSD Compression module registered
<6>PPP MPPE Compression module registered
<6>NET: Registered protocol family 24
<6>PPTP driver version 0.7.12
<5>ralink flash device: 0x800000 at 0x1f000000
<6>Ralink SoC physically mapped flash: Found 1 x16 devices at 0x0 in 16-bit bank
<4> Amd/Fujitsu Extended Query Table at 0x0040
<5>number of CFI chips: 1
<5>cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
<5>Creating 6 MTD partitions on "Ralink SoC physically mapped flash":
<5>0x00000000-0x00030000 : "Bootloader"
<5>0x00030000-0x00040000 : "Factory"
<5>0x00040000-0x00070000 : "Config"
<5>0x00070000-0x000b0000 : "Language"
<5>0x000b0000-0x001c0000 : "Kernel"
<5>0x001c0000-0x00800000 : "RootFS"
<6>block2mtd: version $Revision: 1.1.1.1 $
<4>nf_conntrack version 0.5.0 (256 buckets, 2048 max)
<4>ip_tables: (C) 2000-2006 Netfilter Core Team, Type=Linux
<5>ClusterIP Version 0.8 loaded successfully
<6>TCP cubic registered
<6>NET: Registered protocol family 1
<6>NET: Registered protocol family 10
<6>lo: Disabled Privacy Extensions
<4>ip6_tables: (C) 2000-2006 Netfilter Core Team
<6>IPv6 over IPv4 tunneling driver
<6>sit0: Disabled Privacy Extensions
<6>NET: Registered protocol family 17
<5>Bridge firewalling registered
<6>802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
<6>All bugs added by David S. Miller <davem@redhat.com>
<4>GDMA1_MAC_ADRH -- : 0x00000000
<4>GDMA1_MAC_ADRL -- : 0x00000000
<4>Ralink APSoC Ethernet Driver Initilization. v2.00  256 rx/tx descriptors allocated, mtu = 1500!
<4>GDMA1_MAC_ADRH -- : 0x00000018
<4>GDMA1_MAC_ADRL -- : 0xe7d6aa9c
<1>PROC INIT OK!
<4>VFS: Mounted root (squashfs filesystem) readonly.
<6>Freeing unused kernel memory: 136k freed
<4>Algorithmics/MIPS FPU Emulator v1.5
<4>physdev match: using --physdev-out in the OUTPUT, FORWARD and POSTROUTING chains for non-bridged traffic is not supported anymore.
<4>physdev match: using --physdev-out in the OUTPUT, FORWARD and POSTROUTING chains for non-bridged traffic is not supported anymore.
<4>physdev match: using --physdev-out in the OUTPUT, FORWARD and POSTROUTING chains for non-bridged traffic is not supported anymore.
<4>module info: clear_dev_counters init - debug mode is disabled
<4>rt2860v2_ap: module license 'unspecified' taints kernel.
<4>
<4>
<4>=== pAd = c001c000, size = 506960 ===
<4>
<4><-- RTMPAllocAdapterBlock, Status=0
<4>RX DESC a189e000  size = 2048
<4><-- RTMPAllocTxRxRingMemory, Status=0
<4>Key1Str is Invalid key length(0) or Type(0)
<4>Key2Str is Invalid key length(0) or Type(0)
<4>Key3Str is Invalid key length(0) or Type(0)
<4>Key4Str is Invalid key length(0) or Type(0)
<4>1. Phy Mode = 0
<4>2. Phy Mode = 0
<4>3. Phy Mode = 0
<4>MCS Set = 00 00 00 00 00
<4>SYNC - BBP R4 to 20MHz.l
<4>Main bssid = [omit]
<4><==== rt28xx_init, Status=0
<4>0x1300 = 00064300
<4>
<4>phy_tx_ring = 0x0143c000, tx_ring = 0xa143c000
<4>
<4>phy_rx_ring = 0x00000000, rx_ring = 0x00000000
<4>CDMA_CSG_CFG = 81000000
<4>GDMA1_FWD_CFG = 10000
<6>device ra0 entered promiscuous mode
<4>ra2880stop()...Done
<4>Free TX/RX Ring Memory!
<4>GDMA1_MAC_ADRH -- : 0x00000018
<4>GDMA1_MAC_ADRL -- : 0xe7d6aa9c
<4>
<4>phy_tx_ring = 0x01840000, tx_ring = 0xa1840000
<4>
<4>phy_rx_ring = 0x0143d000, rx_ring = 0xa143d000
<4>CDMA_CSG_CFG = 81000000
<4>GDMA1_FWD_CFG = 10000
<6>device eth2 entered promiscuous mode
<6>eth2: duplicate address detected!
<6>br0: port 2(eth2) entering learning state
<6>br0: port 1(ra0) entering learning state
<6>br0: duplicate address detected!
<6>br0: topology change detected, propagating
<6>br0: port 2(eth2) entering forwarding state
<6>br0: topology change detected, propagating
<6>br0: port 1(ra0) entering forwarding state
<7>br0: no IPv6 routers present
<6>dwc_otg: version 2.72a 24-JUN-2008
<6>DWC_otg: Core Release: 2.66a
<6>DWC_otg: Periodic Transfer Interrupt Enhancement - disabled
<6>DWC_otg: Multiprocessor Interrupt Enhancement - disabled
<6>DWC_otg: Using DMA mode
<6>DWC_otg: Device using Buffer DMA mode
<6>dwc_otg lm0: DWC OTG Controller
<6>dwc_otg lm0: new USB bus registered, assigned bus number 1
<6>dwc_otg lm0: irq 18, io mem 0x00000000
<6>DWC_otg: Init: Port Power? op_state=1
<6>DWC_otg: Init: Power Port (0)
<6>usb usb1: configuration #1 chosen from 1 choice
<6>hub 1-0:1.0: USB hub found
<6>hub 1-0:1.0: 1 port detected
<3>DWC_otg: Device Not Supported
<3>hub 1-0:1.0: over-current change on port 1
<7>jcpcore: start
<7>sxuptp_keepalive_thread: start
<7>jcp_command_register: new command registered GET USB_PORT_NAME
<7>jcp_command_register: new command registered GET SCANNER PORT_NAME
<7>jcp_command_register: new command registered GET SCANNER_STATUS
<7>jcp_command_register: new command registered GET USB_DEVICE_LIST
<7>jcp_command_register: new command registered EXEC SCANNER CONNECT
<7>jcp_command_register: new command registered EXEC SCANNER DISCONNECT
<6>usbcore: registered new interface driver sxuptp_generic
<7>br0: no IPv6 routers present

Anyone else playing with one of these devices? any write-up on getting the OpenWrt firmware on it?

(Last edited by brynet on 28 Sep 2011, 19:51)

icheyne wrote:

It would be great to see some progress with this. It would make an ideal base for a PirateBox.

http://wiki.daviddarts.com/PirateBox
http://forum.daviddarts.com/read.php?2,1184

I've found some datasheets and additional info, it uses the RT3052F SoC which has a 32-bit MIPS 24KEc core.. I believe Linux/OpenWrt do have some support, but not explicitly for the DAP-1350 platform.

I'm not really motivated to port OpenWrt, I've managed to change what I need in the stock firmware.

There is a port of FreeBSD to this device though which I've been following, I believe the kernel bits are upstream now.. and the zrouter project is working on a more suitable distribution for these space/memory constrained embedded devices.

It is a shame that the community hasn't picked up on this little device.

Thanks for the excellent answer.

Please forgive the noob question, but what kind of skills and effort would it take to port OpenWRT to the DAP-1350?

That's a start. Thank you.

Hello, newbest of all newbies here.  also i'm lazy at times (choosing my binges). 

i have been frustrated by the fact (?) that the usb port is not shareable (usable) in the DAP 1350 client mode (does the usb self power thing prevents its use for signal transmission?).  I was wondering what changes, if possible, and with a lazy perspective, would the code you presented or the original GPL code, need to have in order to allow usb port sharing in wireless client mode, allowing some sort of print server ability to this nice little device. 

I don't need the usb powerability, btw.

Also, do you think i could build the binary that could be flashed via http interface, in a virtual linux machine on my windows, on some minimal linux-windows interface (smaller than cygwin).

Would you be able to provide me with a binary of your code for flashing?

Any answer or bits or hints are welcome.  Also, if i'm completely and appartently clueless, feel free to point that out.

PS: also please allow for some english syntax singularities, not my first language. %-)

Technically the USB port is intended for D-Link supported features and add-on devices..  I don't recall what USB kernel modules are in the stock firmware, but if you compiled the needed modules for USB printing along with the relevant userland bits (..cups/lpd?) you could probably use the device as a print server.

D-Link has a tarball (..SDK, actually), which includes a compiler/linker, the source and other binaries.. some proprietary, like imghdr which appends a header to the firmware (kernel+rootfs) so that it can be flashed over HTTP.

I don't really have anything that would be suitable for you to flash on your device, sorry.

(Last edited by brynet on 12 Jan 2012, 01:55)

brynet wrote:

Technically the USB port is intended for D-Link supported features and add-on devices..  I don't recall what USB kernel modules are in the stock firmware, but if you compiled the needed modules for USB printing along with the relevant userland bits (..cups/lpd?) you could probably use the device as a print server.

D-link already provides a software called SharePort (which is a d-link logoed version of sx-link, always a step behind), which enables sharing of printers or drives as if connected to usb (for any on local net).  So the printer bit is not my problem.  but thanks, if i get the courage i might look into the starting info you gave.

My real problem, is that this Shareport (or sx-link) can see the usb port in the router or ap mode of the 1350 device, but not in its client mode.  The thin doc that came with the device, states that only in the router mode can the usb port be used for sharing.  In reality, the http interface for controlling the port exists only in router mode, but the port is still accessible by Shareport, if i am not confused, in the ap mode as well. That is not true (to the extent of my experiments and knowledge at this point), with the client mode.   You did mention the usb port of this device in other posts, so i assumed you had some interest in that question.


brynet wrote:

D-Link has a tarball (..SDK, actually), which includes a compiler/linker, the source and other binaries.. some proprietary, like imghdr which appends a header to the firmware (kernel+rootfs) so that it can be flashed over HTTP.

I assume here that you reger to the compressed gpl files available through the main d-link site (not ftp anymore).

Thank you for your attention.

(Last edited by dbab on 12 Jan 2012, 07:55)

I can't help you with that, I have no idea how SharePort works (..or any other USB over IP implementation).. I don't run Windows or OS X.

Apologies, I wasn't aware of them moving it off FTP, but yes, that was what I was referring to.

brynet wrote:

I can't help you with that, I have no idea how SharePort works (..or any other USB over IP implementation).. I don't run Windows or OS X.

Apologies, I wasn't aware of them moving it off FTP, but yes, that was what I was referring to.

It is alright, i think i'll give the SDK a try, to see how to expose the usb port (just see what's differs from that point of view in the three modes).

could you think of a non-marketting reason to restrict the availability of the usb port in some of the modes (router, ap, but not client?)?  I think the port is available to power the device in all modes, but not for sharing usb devices.

thks

I'm not sure if I should be redistributing this, but here is a my firmware for the North American DAP-1350. It's modified stock, mostly original with the exception of a few changes.

UPDATE OCTOBER 2014, I'm no longer hosting this firmware. You should
be running OpenWrt Barrier Breaker 14.07 or newer instead. The factory
stock firmware is STILL VULNERABLE. So don't use it, or mine! :-)

NOTE: This firmware was based on 1.11, the latest firmware is 1.13. A
vulnerability was also discovered effecting stock firmware (..including
the one below). See here.

=====

http://devio.us/~brynet/DAP-1350_A1_FW_ … elnetd.bin
SHA1 (DAP-1350_A1_FW_111NA_telnetd.bin) = 091faaae24dc88a89c053f119068e1db4b82c040

1) The kernel was recompiled, the build configuration was changed to enable CONFIG_NETFILTER_XT_MATCH_PHYSDEV.
2) The companion iptables module was added to /lib/iptables/libipt_physdev.so.
3) /etc/rc.d/rcS was modified to block port 23/80 over wireless to the device (..but still forwarded), this prevents access to the web configuration interface over HTTP and also restricts telnet access.
4) I compiled and added /bin/dmesg to the image.
5) I have customized /etc/passwd, the root password is dap1350.. and it can't be changed.

The rest of the userland is from the rootfs image distributed in the GPL source tarball, unmodified.

I've only tested this firmware in AP mode, but I don't predict any issues running in the other modes. No guarantees or anything etc, also, it's a RAM filesystem so any changes you make will not be preserved.

You can flash back to a vanilla firmware over HTTP.

(Last edited by brynet on 26 Oct 2014, 20:25)

Thank you, this could serve as an exercise in my adventure through the SDK.  one example of limited modifications with description of intent, and scope of code modifications.   I will have some fun, thanks.

D.

Support for the DAP-1350 was added to openwrt trunk back in July, it was ported by Yoichi Shinoda.

An important fix was also committed last month, AFTER the 12.09-beta.

That means you should avoid the binaries released on September 4th, wait for the imminent AA release.. or build your own firmware (trunk/AA branch).

The 12.09-beta .ipk packages should work fine.

So is this officially supported in the trunk now?  As in, can a code-incompetent person such as myself download a file, load it into the router's web interface, and *presto* have openwrt?  Or do I have to compile stuff myself, or connect in serial mode or do anything more involved?

I love OpenWRT for the flexibility it allows me in my network, but as far as the actual installation, I can't do much more beyond uploading a .bin file via the built-in firmware upgrade interface wink

Doktor Jones wrote:

As in, can a code-incompetent person such as myself download a file, load it into the router's web interface, and *presto* have openwrt?  Or do I have to compile stuff myself, or connect in serial mode or do anything more involved?

AA 12.09-beta2 and 12.09-rc1work fine for me, but I'm only using the device as a wireless bridge.

I think rc1 contains luci. If you want USB support, you'll need to build trunk.

I'd personally avoid using the stock firmware on a public network.

(Last edited by brynet on 27 Dec 2012, 14:27)

Thanks for the quick responses!  I'm not worried about USB support or exploits, I'm just looking for a tiny device to use as a wireless->ethernet bridge on my (secured) home network besides the TP-Link TL-WR703 (which will take like a month to ship from China).

I'm specifically looking for OpenWRT-compatible devices -- of which there don't seem to be many in a "pocket-sized" form factor -- because I've already encountered some routers that don't support bridging, and have been able to easily install OpenWRT on a cheap Asus router to achieve a similar goal at my brother-in-law's house.

you can look for mr3020, maybe it's available in your country wink

anyway if you could, one month it's worth waiting for the 703, just buy 3 of them so you are ok for the next 2 times you will need one of those "magic boxes" ^^

brynet wrote:

AA 12.09-beta2 and 12.09-rc1work fine for me

flashing the OpenWRT image thru D-Link's web interface doesn't work for me, gives an error: "The chosen file is not a firmware file." What was your original D-Link FW version that allowed flashing? or which OpenWRT image did you flash initially?

(Last edited by 0fun on 9 Mar 2013, 19:12)

0fun wrote:

flashing the OpenWRT image thru D-Link's web interface doesn't work for me, gives an error: "The chosen file is not a firmware file."

You need to use the *-squashfs-factory.bin from the D-Link web interface, not sysupgrade.

brynet wrote:
0fun wrote:

flashing the OpenWRT image thru D-Link's web interface doesn't work for me, gives an error: "The chosen file is not a firmware file."

You need to use the *-squashfs-factory.bin from the D-Link web interface, not sysupgrade.

i know, that's the one i'm using. i tried beta as well. flashing from emergency recovery mode (power on the router with reset button pressed for 5 seconds) also gives a similar error...
were you using D-Link's "WW" firmware versions?

0fun wrote:

were you using D-Link's "WW" firmware versions?

The DAP openwrt factory image is generated for NA/North American devices. For yours, you'll need to change the signature string passed to the mkdapimg utility.. unfortunately this does mean building your own firmware.

Edit target/linux/ramips/image/Makefile, find RT3052-AP-DAP1350-3 and change it to RT3052-AP-DAP1350WW-3.

Some devices may also expect RT3052-AP-DAP1350EU-3.

You should probably file a bug report, also report back if it works! :-)

(Last edited by brynet on 9 Mar 2013, 22:36)

brynet wrote:

unfortunately this does mean building your own firmware.

indeed sounds like that's the problem, but i am new to OpenWRT and have no idea how to build my own firmware yet. i will come back to this issue in a few weeks. thank you for your help!

0fun wrote:

indeed sounds like that's the problem, but i am new to OpenWRT and have no idea how to build my own firmware yet. i will come back to this issue in a few weeks. thank you for your help!

I was looking over the header format again, it seems the image checksum is calculated excluding the header.. so you could open the image in a hex editor and change the signature string, the field is 20 bytes long.

I'd still recommend learning the OpenWRT buildroot system, the Wiki is helpful for that. It's all pretty self-contained, so it's not to difficult to get working.

The discussion might have continued from here.