How to get UPNP working on DD-WRT

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
yeti
DD-WRT Novice


Joined: 19 May 2008
Posts: 13

PostPosted: Wed Jan 07, 2009 2:15    Post subject: How to get UPNP working on DD-WRT Reply with quote
I decided to share some wisdom. If it helped you, feel free to reply saying "thanks".

First of all:

I am running D-WRT v24-sp2 (01/01/09) mega - build 11296M NEWD Eko, on a WRT600N v.1.0. Not that it matters, of course, UPNP has been broken for quite a while now, and not just for my router.

Second:

I have no clue what's wrong with DD-WRT's UPNP server. I never figured out a way to fix it.

What I did do, however, is figure out a way to replace it with something that does work.

Here is what to do:

1) Turn OFF UPNP support in DD-WRT. That's right! Disable it completely!

2) "Borrow" MINIUPNPD from the latest OpenWRT: http://downloads.openwrt.org/kamikaze/8.09_RC1/brcm47xx/packages/miniupnpd_1.1-2_mipsel.ipk

I am not sure if this version works for everyone. I surely hope so. This is the binary for a Broadcom 47xx chipset router, like the one I use. There is a lot of other versions there if this one doesn't work.

3) Copy it into your router. You will need to TELNET or SSH into the router for that.

For me it was as simple as copying it onto a USB drive, plugging the USB drive into the router and mounting it under /mnt. Depending on your router, you might need to improvise.

4) Type this into a TELNET or an SSH session to the router:

ipkg update

I am not sure if this is really necessary, but it creates all the IPKG directories on the /jffs share. That's ultimately what I was after.

5) Type this into a TELNET or an SSH session to the router:

ipkg install /mnt/miniupnpd_1.1-2_mipsel.ipk

And then wait a bit. For me it took about 10-15 seconds.

6) Congratulations! MiniUPNPD is now installed! It helped itself to your /jffs share and installed a whole bunch of useless scripts there. You just want the binary, ignore the rest.

7) Type this into a TELNET or an SSH session to the router:

iptables -t filter -N MINIUPNPD
iptables -t filter -I FORWARD 4 -j MINIUPNPD
iptables -t nat -N MINIUPNPD
iptables -t nat -I PREROUTING 1 -j MINIUPNPD

You might need to adjust the location of the MiniUPNP chain within your FORWARD and PREROUTING chains, but for me those values work quite nicely.

8 ) Run a test. Type:

miniupnpd -i $(nvram get wan_iface) -o $(nvram get wan_ipaddr) -a $(nvram get lan_ipaddr) -t $(nvram get upnp_ssdp_interval) -p 5431 -U -d

UPNP should now work for your network. Try it and watch the terminal to the router as it maps ports on your firewall.

9) If you are happy, create the scripts to start it automatically as a daemon:

Paste this into Administration > Commands on the Web interface:

miniupnpd -i $(nvram get wan_iface) -o $(nvram get wan_ipaddr) -a $(nvram get lan_ipaddr) -t $(nvram get upnp_ssdp_interval) -p 5431 -U

And press the "Save Startup" button.

Next paste this into Administration > Commands on the Web interface:

iptables -t filter -N MINIUPNPD
iptables -t filter -I FORWARD 4 -j MINIUPNPD
iptables -t nat -N MINIUPNPD
iptables -t nat -I PREROUTING 1 -j MINIUPNPD

And press the "Save Firewall" button. These are the firewall rules from above.

10) Reboot your router and enjoy.
Sponsor
frager
DD-WRT Novice


Joined: 17 Jun 2006
Posts: 41

PostPosted: Tue Sep 08, 2009 21:22    Post subject: Reply with quote
Just wanted to say thanks for your guide !
G462
DD-WRT Novice


Joined: 11 Sep 2012
Posts: 3

PostPosted: Tue Sep 11, 2012 22:21    Post subject: Reply with quote
miniupnpd url update:

http://downloads.openwrt.org/kamikaze/8.09.2/brcm47xx/packages/miniupnpd_1.4-1_mipsel.ipk
slobodan
DD-WRT Guru


Joined: 03 Nov 2011
Posts: 1248
Location: Zwolle

PostPosted: Tue Sep 11, 2012 23:41    Post subject: Reply with quote
It is true that older builds had a broken UPnP. It has been solved in the builds from December 2011 and afterwards.
_________________
Asus RT-N16 running Merlin (latest), formerly used Kong 22000++ kingkong-nv32k-broadcom with OTRW2

E4200 V1 running Kong 22000++ kingkong-nv60k-broadcom with OTRW2

2 times Linksys WRT610N V2 converted to E3000 running Kong 22000++ usb-ftp-samba3-dlna-nv60k-broadcom with OTRW2 (bridged with LAN cable)


G462
DD-WRT Novice


Joined: 11 Sep 2012
Posts: 3

PostPosted: Wed Sep 12, 2012 6:31    Post subject: Reply with quote
Alas! My WNDR3300 is stuck in 2009 (as far as I've seen)
Veekins
DD-WRT Novice


Joined: 11 Oct 2012
Posts: 22
Location: Dusseldorf, Germany

PostPosted: Thu Oct 11, 2012 6:35    Post subject: Reply with quote
The UPnP daemon seems to be broken in recent builds as well. (At least for my E3200)

Edit: Nevermind, I was stupid. I forgot to set up the JFFS partition properly. Works now.
cp.engr
DD-WRT Novice


Joined: 27 Oct 2012
Posts: 1

PostPosted: Sat Oct 27, 2012 22:50    Post subject: Reply with quote
slobodan wrote:
It is true that older builds had a broken UPnP. It has been solved in the builds from December 2011 and afterwards.

AFAICT, that means that the fix is not yet included in the latest stable release--which, at the time of this writing, is v24-sp1 (released July 27, 2008).
Veekins
DD-WRT Novice


Joined: 11 Oct 2012
Posts: 22
Location: Dusseldorf, Germany

PostPosted: Tue Nov 06, 2012 11:49    Post subject: Reply with quote
cp.engr wrote:
slobodan wrote:
It is true that older builds had a broken UPnP. It has been solved in the builds from December 2011 and afterwards.

AFAICT, that means that the fix is not yet included in the latest stable release--which, at the time of this writing, is v24-sp1 (released July 27, 2008).


It is still broken in current testing releases. (At least for the E3200 build)
It only responds to requests regarding device information (responding with the devices' UUID and IP); it does not offer the option to set up port forwardings. Additionally, the upnp daemon is rarely started on boot and tends to break for no reason.

miniupnpd at least works most of the time, even if setting it up is a hassle...

I don't see a reason why they shouldn't include it in DD-WRT.

@OP
Little addition: Windows users might want to use WinSCP along with an SSH connection. You get a sweet directory manager and copying files to your router is easily done with a few clicks.

_________________
Linksys E3200 - Fractal mega build r20202
TP-LINK TL-WR1043ND - OpenWRT Attitude Adjustment beta2
Speedport W303V - OpenWRT AA-beta2
MountainX
DD-WRT Novice


Joined: 28 Dec 2013
Posts: 5

PostPosted: Sat Dec 28, 2013 0:16    Post subject: Latest news? Reply with quote
I'm looking for the latest news on UPnP in DD-WRT. I'm having trouble getting some parts of UPnP working.

My specific problem is that I cannot get any DLNA controllers to work when I try to render from my server to my receiver. The DLNA controllers I have tried include BubbleUPnP and MediaHouse UPnP and others (all Android). The error is "Transport is locked (code: 705)" on BubbleUPnP or "action timed out" on MediaHouse.

That's what brought me to this thread.

In my LAN I am running minidlna on Ubuntu Linux 12.04 on my server. (I like minidlna and want to stick with it.) I have an Onkyo TX NR509 receiver and it generally works with minidlna now -- as long as I'm not trying to use a DLNA controller. My my Android device is a Samsung Galaxy S4 with Cyanogenmod 10.2. My router is a Linksys e3000 running dd-wrt (Firmware: DD-WRT v24-sp2 (06/14/11) big).

I don't want to upgrade my router firmware unless I know for sure that doing so will solve this issue. (My router settings and my LAN are fairly complex.)
LOM
DD-WRT Guru


Joined: 28 Dec 2008
Posts: 7079

PostPosted: Sat Dec 28, 2013 2:08    Post subject: Re: Latest news? Reply with quote
MountainX wrote:
I'm looking for the latest news on UPnP in DD-WRT. I'm having trouble getting some parts of UPnP working.



The UPnP server in dd-wrt does only do WAN Gateway services and is intended for WAN to LAN port forwarding, it is not an UPnP-AV server.

You'll have to setup your own UPnP-AV or DLNA server for your LAN, it will not interfere with the ddwrt UPnP server as long as it only offers AV services.

_________________
I'm on a whiskey diet, lost 3 days already
MountainX
DD-WRT Novice


Joined: 28 Dec 2013
Posts: 5

PostPosted: Sat Dec 28, 2013 2:12    Post subject: Re: Latest news? Reply with quote
LOM wrote:

The UPnP server in dd-wrt does only do WAN Gateway services and is intended for WAN to LAN port forwarding, it is not an UPnP-AV server.

You'll have to setup your own UPnP-AV or DLNA server for your LAN, it will not interfere with the ddwrt UPnP server as long as it only offers AV services.


Hi. I appreciate the reply, but you misunderstood my question. I already have a DLNA server on my network. It is minidlna running on Ubuntu, as I mentioned. And it works just fine when there are just two points: the server and the player.

The problem I'm having is getting a DLNA controller (such as BubbleUPnP) to work. One guy with a similar problem said he solved it by upgrading his router firmware, but he didn't provide details.

So I would still appreciate feedback on what the problem might be. I don't want to upgrade my firmware unless the problem I'm seeing is related to the DD-WRT firmware version I'm running. (Sometimes an update can cause more problems than it fixes.)
LOM
DD-WRT Guru


Joined: 28 Dec 2008
Posts: 7079

PostPosted: Sat Dec 28, 2013 2:23    Post subject: Reply with quote
Are your devices wireless or wired connected?
If wired then it can't be a ddwrt problem.

_________________
I'm on a whiskey diet, lost 3 days already
MountainX
DD-WRT Novice


Joined: 28 Dec 2013
Posts: 5

PostPosted: Sat Dec 28, 2013 2:27    Post subject: Reply with quote
LOM wrote:
Are your devices wireless or wired connected?
If wired then it can't be a ddwrt problem.


I'm a little confused by your logic...

The minidlna server is connected to the DD-WRT router via a wired connection.

The Onkyo is connected to the DD-WRT router via a wired connection.

The DLNA controller runs on my Android phone, so it is wireless.

DD-WRT manages the router that controls my entire LAN, including wired devices.
LOM
DD-WRT Guru


Joined: 28 Dec 2008
Posts: 7079

PostPosted: Sat Dec 28, 2013 3:12    Post subject: Reply with quote
Since the problem is related to wireless then change your WMM setting on the ddwrt wireless page and see if it makes any difference.
The WMM support in the wireless driver was not that great two and a half year ago so you may have to update to a more recent build version but don't go past r21676.

_________________
I'm on a whiskey diet, lost 3 days already
MountainX
DD-WRT Novice


Joined: 28 Dec 2013
Posts: 5

PostPosted: Sat Dec 28, 2013 3:32    Post subject: Reply with quote
LOM wrote:
Since the problem is related to wireless then change your WMM setting on the ddwrt wireless page and see if it makes any difference.
The WMM support in the wireless driver was not that great two and a half year ago so you may have to update to a more recent build version but don't go past r21676.


Thanks for that.

Would WMM only affect the actual streaming of the media? It seems related to prioritizing packets. The error I am seeing apparently happens before streaming begins. Do you know what "Transport is locked (code: 705)" means?

Also, I appreciate the tip about not upgrading to a version past r21676. Can you explain why?

Thanks
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum