Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPnP Errors 714 and 718 #69

Closed
ggonmar opened this issue Oct 27, 2020 · 6 comments
Closed

UPnP Errors 714 and 718 #69

ggonmar opened this issue Oct 27, 2020 · 6 comments

Comments

@ggonmar
Copy link

ggonmar commented Oct 27, 2020

Hi, I'm trying to use this library on my ESP8266, but I am getting some error on it, attaching the logs I get.

After some different M-SEARCH messages (I understand it is trying to find the correct one), I see there is a response from my router to the controller.
Then, I guess it checks if the UPnP entry has been inputted, and gets a 714 response (I've found it means "No such entry in array").
Following, I see the controller tries to add a new entry (addPortMappingEntry), and gets a 718 response ("mapping already exists").

I've checked on the router settings and I don't see any UPnP entry created by the controller, so I don't know what is happening.

Is this an issue on TinyUPnP? Can I get some assistance?

Library version: #65
Microcontroller: WeMos D1 R1 with ESP8266
Router: Sagemcom Livebox F@st 5656

Thank you!

debugUPnP.txt

@ggonmar
Copy link
Author

ggonmar commented Oct 27, 2020

Also, if I reset the microcontroller, then I get a faster error: Even though the controller connects to the wifi, TinyUPnP thinks the internet connection is bad and exits:

Testing WiFi connection for [192.168.1.23] ==> GOOD
Testing internet connection ==> BAD
ERROR: not connected to WiFi, cannot continue

I only manage to solve this by re-uploading the sketch to the device.

@ofekp
Copy link
Owner

ofekp commented Oct 27, 2020

Can you please download the following file and attach it here?
http://192.168.1.1:60000/045dde35/gateconnSCPD_IP.xml
It might also be here if the above link fails (without the port):
http://192.168.1.1/045dde35/gateconnSCPD_IP.xml`

Sometimes, routers only show static forwarding rules, and will not show you dynamically set rules, like the ones produced by this library. You do seem to have the rule in your router, judging by the last print:

Could not find port mapping in IGD
TinyUPnP configured port mappings:
0.   semaforito                    192.168.1.23      40000  40000  TCP    0  

We just need to find out why it is not read correctly when calling GetSpecificPortMappingEntry.

@ggonmar
Copy link
Author

ggonmar commented Oct 27, 2020

Yep, here's the xml (it worked on the first link, with the specified port)
It's strange though, because accessing the router config page I can see some uPnP rules configured by some apps, I assume dinamically (whatsapp, qtorrent...)
Also, accessing this same page, I never get to see the rule with "semaforito" name on it - should it be for the same reason?

Anyway, let me know how I can proceed and help fix the issue! :)
gateconnSCPD_IP.TXT

@ofekp
Copy link
Owner

ofekp commented Oct 27, 2020

Oh I was wrong, I think you printed the config and it confused me, this is not the print that shows the current rules in the router.
So indeed the placement of the new rule failed, though the error is weird to me.

Can you call this method and show me the result:
tinyUPnP.printAllPortMappings();

Can you please also send me this file:
http://192.168.1.1:60000/045dde35/gatedesc1.xml

Also, just verifying few things please:

  1. Did you try another port?
  2. Can you send me the rules that you can see in the router UPnP list? (you can mask sensitive info)
  3. Your router (gateway, connected to the modem) is indeed 192.168.1.1?
  4. Do you have any other router in your network?
  5. In your rule that you set with this library, I think you set the lease duration to 0, can you try a value of 36000?

@ggonmar
Copy link
Author

ggonmar commented Oct 29, 2020

Hey, thanks for reaching up, deeply appreciate it!
So it seems I got it working for this router by changing the port, but I do have some questions if I may ask them:

  • Port 7000 does work (as well as anything on the thousands), but 40000 does not. Is it possible that there is an upper boundary on the port number?

  • With port 7000, this worked with any value assigned to the Lease time, be it 10000 or 0 - what is the expected behavior of this number? 0 is "no expire"? 10000 is in ms?

  • I could not download the file on http://192.168.1.1:60000/045dde35/gatedesc1.xml - for some reason I get a 400 bad request... how could the esp8266 get something from it if my browser cannot?

  • lastly and most importantly: how can I set different external and internal port on the uPNP that I'm opening???

I apologize beforehand if it feels like I'm taking advantage of getting to send you some questions, but I hope this gets to you in good spirits and I get to learn a bit about all this!

Cheers

@ofekp
Copy link
Owner

ofekp commented Oct 31, 2020

Nice, I am very glad this worked now :)
There is indeed an upper limit (and a lower limit if you consider ports that are reserved for the OS) it is 65535, so 40K should have theoretically work just fine. You can try 42421 for example and see if it works, just to make sure the problem is confined to the 40K port only.
Yes, for 0 you can expect it to now expire, but most routers will not allow this, so the package should still run and make sure the rules are set.
Maybe we got the link wrong in some way?
Sadly, I did not support this as this is not very common, but this change is minor, do you feel like you want to try, I can give you pointers to what you should change.
:)

@ggonmar ggonmar closed this as completed Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants