TinyUPnP
TinyUPnP copied to clipboard
Gateway info is not valid
Greeting, i tried to use your libraries to test on my esp32 and somehow end up with this error. I've tried with 2 different router, 1 is my ASUS TM- AC 1900 and the other is my Samsung S7 Mobile HotSpot and Tethering. I've double checked on the require "filled_in" info and tried with different listen port, also tried to change the LEASE_DURATION. Please help i'm getting lost...
No device on your network responded to the M-SEARCH message.
Can you confirm that your internal network is 192.168.29.0? do the routers have the same address format (except for the last number)? Can you please check that you router has UPnP enabled?
I do not know Samsung S7 Mobile HotSpot but I am guessing it is cellular network? I am not sure this can work since cellular networks to not give you much control, so I am not sure you will be able to check what I asked on this router.
Hi ofekp, thanks for the response. I'm able to setup port forwarding manually and verify it's working with my router by connecting to my esp32 from outside network. But i have no luck with trying to implement the libraries. I also set the UpnP feature enable at first.
Yes, the Samsung S7 Hotspot is just the cellular network as a 2nd test case for me. I was hoping it should work with my Asus router as first.
This seems to be related to issue https://github.com/ofekp/TinyUPnP/issues/35 I have merged the code few week ago, but it is not deployed to the Arduino Library Manager yet.
Can you take the code from master branch and try again? Simply use the code as you see it GitHub rather than use the library from the Library Manager.
Let me know how it went please.
I just deleted the libraries and used the latest from GitHub as you recommended but still no luck. Same result again, my router completely ignored the M-SEARCH message...
I've checked the router log to verify the Upnp feature is enabled
why is it listening on 5351?
Is that the UPnP? should be 1900...
Do you have access to 'upnpc' bash program? If so please show me the output for upnpc -l
Make sure it looks like this:
I did see a post about issues with UPnP specifically with your router: https://community.t-mobile.com/thread/140179
Have you tried that firmware update?
I just bought a new asus router RT-AX58U to try but still got the same result after update the firmware to latest...
I'm not sure about the 'upnpc' bash program but this is the log report from the router web page after i disabled and re-enabled the UPnP service. No idea why all Asus router keep listening on port 5351 by default...
I guess Asus routers doesn't work at all..
I am not yet sure it actually means they listen on that port, it might mean something else.
Can you please read this short post and perform the actions described in it? https://zapek.com/blog/how-to-fix-upnp-igd-not-working-on-asus-rt-ac87u/
Yes i've tried that also but not working either. For the RT-AX58U router, look like they have the "IGMP snooping" feature enabled by default.
Can you change this line to the 5351 port: https://github.com/ofekp/TinyUPnP/blob/master/src/TinyUPnP.h#L16
If that does not work, please restore 1900 port.
Then, we'll need to set you up with upnpc
tool.
Do you have a linux env somewhere? Old computer, Raspberry Pi? Anything?
Hi ofekp, i did try to mess with the port number from your source code. I just read that Asus router doesn't allow Upnp feature to the WAN, LAN devices only... I guess that's why no matter if i turn on or off Upnp feature there's no response at all... Here's the discussion: https://www.snbforums.com/threads/new-upnp-exploit-affecting-most-asus-routers-upnproxy-blackhat-proxies-via-nat-injections.46011/ Maybe i will swap out with another router with different brand tomorrow to see how's the library works ...
That looks unfortunate... But since you are contacting the router from the LAN I still don't think it should be a problem. The router should respond to M-SEARCH messages coming from the LAN, wifi or not...
I am willing to keep looking for the issue, but we will need to execute upnpc commands from within the LAN.
Do you have any other device in your network that is using UPnP and puts rules dynamically in your router?
yes, you are right. I just tried with a Netgear router and still no different... Currently, i don't have any device that using UPnP in my network.
The plot thickens! Please describe your network to me. Nice and easy, I want to know how many routers you have specifically. How many switches, how many devices. Anything you can think of please.
I found a workaround for upnpc
command in windows environment:
- go to http://miniupnp.free.fr/files/
- look for "latest files"
- in the table, find the one file that is called "upnpc-exe" (upnpc-exe-win32-20150918)
- download the folder and extract it somewhere (no installation needed)
- open win terminal (command prompt)
- enter the following command (change the folder path as needed):
C:\Users\user-name>C:\Users\user-name\Downloads\upnpc-exe-win32-20150918\upnpc-shared.exe -l
Then please copy paste the output here.
I still need to know the layout of your network too.
I use Comcast cable internet and have only 1 modem and 1 router. Currently running with 1 raspberry Pi that i can connect remotely with tightvnc service, 2 smart plug devices that i can control from anywhere, 1 PS4 and several mobile devices (iphones) and Smart TVs... very standard i think.
OK, sounds standard, please try the upnpc for windows and and let's see what we get.
Hi ofekp, I just ran the tool you suggested and here's the output...
Made a PR for you, if you feel adventurous (I have yet to test on my device) please give it a shot: https://github.com/ofekp/TinyUPnP/pull/53
Updated the PR. Please make sure to use commit with hash 94dc6cb
, thanks.
I've compiled and use the new version #94dc6cb you provided but same error...
Darn, I made a mistake that caused it to behave the same... new hash is b375e92
But please note that the output indicates that you're using the library from Arduino Library Manager and not from the branch I created.
You'll need to go to the folder where the package is and override the code there in both .h file and .cpp file.
Folder should look something like this:
D:\arduino-1.8.9\libraries\TinyUPnP\src
There you'll find the files that you need to change.
I've deleted the old library from Arduino Library Manager and use the branch that you created. The output displayed different but still no luck...
Still timeout? Can you please attach a text file of the output in following posts?
Seems like your Netgear router is also prone to UPnP issues: https://community.netgear.com/t5/General-WiFi-Routers-Non/UPnP-still-broken-on-R6400/m-p/1639401
The claim that: "UPnP is fixed by R6400 firmware version 1.0.1.46."
Can you please check what firmware you're running there?
Here's the output file
output.txt
The version i got is newer 1.0.4.84.
so no "timeout" message after the M-SEARCH is sent? Did you wait long enough?
Yes, i didn't capture all of them in the text file. My bad. This is the full log. output.txt
Added another device type, please give the PR another try.
Just did. Same result. Here's the log. output2.txt
Can you type in the path to the xml file in your browser that was printed by the upnpc command that you attached in this comment and attach the result here please?
Hi ofekp, this is what i got after entered the info you asked logfile.txt
Now this please: http://192.168.1.1:5000/Public_UPNP_WANIPConn.xml
And this: http://192.168.1.1:5000/Public_UPNP_WANPPPConn.xml
And this: http://192.168.1.1:5000/Public_UPNP_Layer3F.xml
😄
Here you go ! logfile_WAN.txt logfile_WANPP.txt UPNP_layer3F.txt