Recent

Author Topic: [SOLVED] How to open UPnP port with synapse  (Read 15192 times)

rvk

  • Hero Member
  • *****
  • Posts: 7063
Re: [SOLVED] How to open UPnP port with synapse
« Reply #60 on: June 15, 2023, 12:21:11 pm »
In the last version I added discovery.
When passing an empty RouterIP (or omit the param in Create) the class will do a discovery to find the UPnP device.

Latest version is here https://github.com/rvk01/upnp

I haven't found any problems with Lease duration 0 timing out on my router.

(This version is now done, if there are any comments or suggestions, they are welcome.)

Key-Real

  • Sr. Member
  • ****
  • Posts: 413
Re: [SOLVED] How to open UPnP port with synapse
« Reply #61 on: November 21, 2023, 03:04:04 pm »
Unfortunly the Unit doesn't work under windows!

rvk

  • Hero Member
  • *****
  • Posts: 7063
Re: [SOLVED] How to open UPnP port with synapse
« Reply #62 on: November 21, 2023, 03:34:58 pm »
Unfortunly the Unit doesn't work under windows!
Sure it does.

But saying it doesn't work doesn't give us much to help you.
« Last Edit: November 21, 2023, 03:37:58 pm by rvk »

Key-Real

  • Sr. Member
  • ****
  • Posts: 413
Re: [SOLVED] How to open UPnP port with synapse
« Reply #63 on: November 21, 2023, 03:49:31 pm »
Just tell me that You need, I'll provide the log

rvk

  • Hero Member
  • *****
  • Posts: 7063
Re: [SOLVED] How to open UPnP port with synapse
« Reply #64 on: November 21, 2023, 03:52:16 pm »
Just tell me that You need, I'll provide the log
You say "doesn't work".
What doesn't work?
Does it compile? If not, what is the compile error?
Do you get an error when running? What error?

Do you get anything?

Please be more specific to what your problem is.


Key-Real

  • Sr. Member
  • ****
  • Posts: 413
Re: [SOLVED] How to open UPnP port with synapse
« Reply #65 on: November 21, 2023, 04:23:38 pm »
UPnP.IsUPnPAvailable returns false

rvk

  • Hero Member
  • *****
  • Posts: 7063
Re: [SOLVED] How to open UPnP port with synapse
« Reply #66 on: November 21, 2023, 04:28:07 pm »
UPnP.IsUPnPAvailable returns false
So, are you sure UPNP is enabled on your router?

Still works for me on Windows (had to enable UPNP because I have that disabled by default on my router).

Quote
UPnP device is available at http://192.168.2.1:45956/ctl/IPConn

Internal IP: 192.168.2.11
External IP: x.x.x.x
Status: Connected
Last error: ERROR_NONE
Uptime router: 45 days 0 hours 58 minutes and 19 seconds

SetPortMapping OK
Portmappings:
0 TCP 8000->192.168.2.11:8081  0 s

Check port. Press Enter to delete and terminate

Key-Real

  • Sr. Member
  • ****
  • Posts: 413
Re: [SOLVED] How to open UPnP port with synapse
« Reply #67 on: November 21, 2023, 04:31:16 pm »
it works under the same router configuration under linux

rvk

  • Hero Member
  • *****
  • Posts: 7063
Re: [SOLVED] How to open UPnP port with synapse
« Reply #68 on: November 21, 2023, 04:46:53 pm »
Maybe the firewall is blocking the messages?

I've added a debugprocedure for .Create so you can see if you receive any M-SEARCH messages back from the network.

https://github.com/rvk01/upnp

Key-Real

  • Sr. Member
  • ****
  • Posts: 413
Re: [SOLVED] How to open UPnP port with synapse
« Reply #69 on: November 21, 2023, 05:19:38 pm »
procedure debuglog(Value: String);
begin
   logwrite(value);
end;

UPnP:= TUPnP.Create('0.0.0.0', @debuglog);

returns:

"M-SEARCH found the following: " [empty string]

rvk

  • Hero Member
  • *****
  • Posts: 7063
Re: [SOLVED] How to open UPnP port with synapse
« Reply #70 on: November 21, 2023, 05:28:41 pm »
"M-SEARCH found the following: " [empty string]
Then something is blocking the UDP messages from reaching your program.

Virusscanner? Firewall?

You could try any other program which does a M-SEARCH scan to see if that works.
Like http://miniupnp.free.fr/ (it has a github page here https://github.com/miniupnp/miniupnp)

Command "upnpc -L" should provide you with the text "Found valid IGD: xxx etc".

Key-Real

  • Sr. Member
  • ****
  • Posts: 413
Re: [SOLVED] How to open UPnP port with synapse
« Reply #71 on: November 21, 2023, 05:31:31 pm »
can You pls compile it for me?

Key-Real

  • Sr. Member
  • ****
  • Posts: 413
Re: [SOLVED] How to open UPnP port with synapse
« Reply #72 on: November 21, 2023, 05:48:09 pm »
mingw gcc returns me errors

rvk

  • Hero Member
  • *****
  • Posts: 7063
Re: [SOLVED] How to open UPnP port with synapse
« Reply #73 on: November 21, 2023, 06:10:08 pm »
can You pls compile it for me?
You can download a Windows version on both sites.

For example https://github.com/miniupnp/miniupnp/releases
and here http://miniupnp.free.fr/files/

Key-Real

  • Sr. Member
  • ****
  • Posts: 413
Re: [SOLVED] How to open UPnP port with synapse
« Reply #74 on: November 21, 2023, 06:12:47 pm »
$ ./upnpc-shared -l
upnpc : miniupnpc library test client, version 2.1.
 (c) 2005-2018 Thomas Bernard.
Go to http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
for more information.
List of UPNP devices found on the network :
 desc: http://192.168.0.1:49153/IGDdevicedesc_brlan0.xml
 st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

Found valid IGD : http://192.168.0.1:49153/upnp/control/WANIPConnection0
Local LAN ip address : 192.168.0.5
Connection Type : IP_Routed
Status : Connected, uptime=0s, LastConnectionError : ERROR_NONE
MaxBitRateDown : 100000000 bps (100.0 Mbps)   MaxBitRateUp 100000000 bps (100.0 Mbps)
ExternalIPAddress = 31.18.189.13
 i protocol exPort->inAddr:inPort description remoteHost leaseTime
GetGenericPortMappingEntry() returned 713 (SpecifiedArrayIndexInvalid)

 

TinyPortal © 2005-2018