Recent

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

rvk

  • Hero Member
  • *****
  • Posts: 6925
Re: [SOLVED] How to open UPnP port with synapse
« Reply #90 on: November 21, 2023, 07:46:30 pm »
Changed the SCAN function to reset the Cnt counter to 0 when there is any M-SEARCH message.
So just a simple binary response (which can happen) will not increase the counter and the wait for router can continue.

https://github.com/rvk01/upnp

balazsszekely

  • Guest
Re: [SOLVED] How to open UPnP port with synapse
« Reply #91 on: November 21, 2023, 07:52:36 pm »
Quote
Maybe the first M-SEARCH result from the 192.168.0.1 doesn't contain the services.
That's why the Cnt counter is reset when LOCATION is found until there is one where services is included.
Yes. I double checked again and there are no services when connecting with 192.168.0.1

Quote
Did your first M-SEARCH result from 192.168.0.1 contain a LOCATION header?
Yes.

Quote
Changed the SCAN function to reset the Cnt counter to 0 when there is any M-SEARCH message.
So just a simple binary response (which can happen) will not increase the counter and the wait for router can continue.
With you new modification I got this(192.168.0.1):
Quote
debug --> M-SEARCH found the following:
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1801
DATE: Tue, 21 Nov 2023 18:50:00 GMT
EXT:
LOCATION: http://192.168.0.1:49152/wps_device.xml
SERVER: Unspecified, UPnP/1.0, Unspecified
ST: upnp:rootdevice
USN: uuid:00000000-0000-1000-0000-50c7bf396fa2::upnp:rootdevice


  debug --> M-SEARCH found the following:
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1801
DATE: Tue, 21 Nov 2023 18:50:00 GMT
EXT:
LOCATION: http://192.168.0.1:49152/wps_device.xml
SERVER: Unspecified, UPnP/1.0, Unspecified
ST: upnp:rootdevice
USN: uuid:00000000-0000-1000-0000-50c7bf396fa2::upnp:rootdevice


  debug --> M-SEARCH found the following:
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1801
DATE: Tue, 21 Nov 2023 18:50:00 GMT
EXT:
LOCATION: http://192.168.0.1:49152/wps_device.xml
SERVER: Unspecified, UPnP/1.0, Unspecified
ST: uuid:00000000-0000-1000-0000-50c7bf396fa2
USN: uuid:00000000-0000-1000-0000-50c7bf396fa2


  debug --> M-SEARCH found the following:
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1801
DATE: Tue, 21 Nov 2023 18:50:00 GMT
EXT:
LOCATION: http://192.168.0.1:49152/wps_device.xml
SERVER: Unspecified, UPnP/1.0, Unspecified
ST: uuid:00000000-0000-1000-0000-50c7bf396fa2
USN: uuid:00000000-0000-1000-0000-50c7bf396fa2


  debug --> M-SEARCH found the following:
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1801
DATE: Tue, 21 Nov 2023 18:50:00 GMT
EXT:
LOCATION: http://192.168.0.1:49152/wps_device.xml
SERVER: Unspecified, UPnP/1.0, Unspecified
ST: urn:schemas-wifialliance-org:device:WFADevice:1
USN: uuid:00000000-0000-1000-0000-50c7bf396fa2::urn:schemas-wifialliance-org:device:WFADevice:1


  debug --> M-SEARCH found the following:
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1801
DATE: Tue, 21 Nov 2023 18:50:00 GMT
EXT:
LOCATION: http://192.168.0.1:49152/wps_device.xml
SERVER: Unspecified, UPnP/1.0, Unspecified
ST: urn:schemas-wifialliance-org:device:WFADevice:1
USN: uuid:00000000-0000-1000-0000-50c7bf396fa2::urn:schemas-wifialliance-org:device:WFADevice:1


  debug --> M-SEARCH found the following:
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1801
DATE: Tue, 21 Nov 2023 18:50:00 GMT
EXT:
LOCATION: http://192.168.0.1:49152/wps_device.xml
SERVER: Unspecified, UPnP/1.0, Unspecified
ST: urn:schemas-wifialliance-org:service:WFAWLANConfig:1
USN: uuid:00000000-0000-1000-0000-50c7bf396fa2::urn:schemas-wifialliance-org:service:WFAWLANConfig:1


  debug --> M-SEARCH found the following:
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1801
DATE: Tue, 21 Nov 2023 18:50:00 GMT
EXT:
LOCATION: http://192.168.0.1:49152/wps_device.xml
SERVER: Unspecified, UPnP/1.0, Unspecified
ST: urn:schemas-wifialliance-org:service:WFAWLANConfig:1
USN: uuid:00000000-0000-1000-0000-50c7bf396fa2::urn:schemas-wifialliance-org:service:WFAWLANConfig:1


  debug --> M-SEARCH found the following:

  debug --> M-SEARCH found the following:

  debug --> M-SEARCH found the following:

  debug --> M-SEARCH found the following:

UPnP is not available.

We are done, press enter

192.168.0.255 works as before.

rvk

  • Hero Member
  • *****
  • Posts: 6925
Re: [SOLVED] How to open UPnP port with synapse
« Reply #92 on: November 21, 2023, 08:00:04 pm »
LOCATION: http://192.168.0.1:49152/wps_device.xml
The program retrieves the xml on that location and checks the services.
One of them should contain WANIPConnection for uPnp enabled device.

My last modification I had put the counter to 300 just to test the delay.
Should work correctly now.
I also added the result of the xml from the retrieved location.

Might be too much debugging for a normal program but the writeln in debugproc could just be removed then.

Still need to find out how to access all the interfaces.
Problem might be with that, is it needs to be done after each other or you need to look at threading, and this was just to show the M-SEARCH mechanism without the need for more complex threading code.
« Last Edit: November 21, 2023, 08:03:03 pm by rvk »

Key-Real

  • Sr. Member
  • ****
  • Posts: 395
Re: [SOLVED] How to open UPnP port with synapse
« Reply #93 on: November 21, 2023, 08:25:12 pm »
with the new version of your lib it returns me:
"M-SEARCH nothing found yet"

rvk

  • Hero Member
  • *****
  • Posts: 6925
Re: [SOLVED] How to open UPnP port with synapse
« Reply #94 on: November 21, 2023, 08:28:50 pm »
with the new version of your lib it returns me:
"M-SEARCH nothing found yet"

Did you try 192.168.0.255 as address?
And 192.168.0.1 ?

Key-Real

  • Sr. Member
  • ****
  • Posts: 395
Re: [SOLVED] How to open UPnP port with synapse
« Reply #95 on: November 21, 2023, 08:35:43 pm »
UPnP:= TUPnP.Create('192.168.0.255', @debuglog);

gives me this:

Code: Pascal  [Select][+][-]
  1. M-SEARCH found the following (length 438 bytes):
  2. HTTP/1.1 200 OK
  3. CACHE-CONTROL: max-age=1800
  4. DATE: Tue, 21 Nov 2023 19:32:53 GMT
  5. EXT:
  6. LOCATION: http://192.168.0.1:49153/IGDdevicedesc_brlan0.xml
  7. OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
  8. 01-NLS: 2f4379a0-88a0-11ee-94ec-86845e9bdfd5
  9. SERVER: Linux/4.9.135-Prod_19.3, UPnP/1.0, Portable SDK for UPnP devices/1.6.22
  10. X-User-Agent: redsonic
  11. ST: upnp:rootdevice
  12. USN: uuid:ebf5a0a0-1dd1-11b2-a90f-021018951e6c::upnp:rootdevice
  13.  
  14.  
  15. M-SEARCH result:
  16. <?xml version="1.0"?>
  17. <root xmlns="urn:schemas-upnp-org:device-1-0">
  18. <specVersion>
  19. <major>1</major>
  20. <minor>0</minor>
  21. </specVersion>
  22. <device>
  23. <deviceType>urn:schemas-upnp-org:device:InternetGatewayDevice:1</deviceType>
  24. <friendlyName>CGA6444VF</friendlyName>
  25. <manufacturer>Technicolor</manufacturer>
  26. <manufacturerURL>http://www.technicolor.com/</manufacturerURL>
  27. <modelDescription>Docsis 3.1 Gateway</modelDescription>
  28. <modelName>CGA6444VF</modelName>
  29. <modelNumber>1.0</modelNumber>
  30. <modelURL>http://www.technicolor.com</modelURL>
  31. <serialNumber></serialNumber>
  32. <UDN>uuid:ebf5a0a0-1dd1-11b2-a90f-021018951e6c</UDN>
  33. <UPC>CGA6444VF</UPC>
  34. <serviceList>
  35. <service>
  36. <serviceType>urn:schemas-upnp-org:service:Layer3Forwarding:1</serviceType>
  37. <serviceId>urn:upnp-org:serviceId:L3Forwarding1</serviceId>
  38. <SCPDURL>/Layer3ForwardingSCPD.xml</SCPDURL>
  39. <controlURL>/upnp/control/Layer3Forwarding</controlURL>
  40. <eventSubURL>/upnp/event/Layer3Forwarding</eventSubURL>
  41. </service>
  42. </serviceList>
  43. <deviceList>
  44. <device>
  45. <deviceType>urn:schemas-upnp-org:device:WANDevice:1</deviceType>
  46. <friendlyName>WANDevice:1</friendlyName>
  47. <manufacturer>Technicolor</manufacturer>
  48. <manufacturerURL>http://www.technicolor.com/</manufacturerURL>
  49. <modelDescription>Docsis 3.1 Gateway</modelDescription>
  50. <modelName>CGA6444VF</modelName>
  51. <modelNumber>1.0</modelNumber>
  52. <modelURL>http://www.technicolor.com</modelURL>
  53. <serialNumber></serialNumber>
  54. <UDN>uuid:ebf5a0a0-1dd1-11b2-a92f-021018951e6c</UDN>
  55. <UPC>CGA6444VF</UPC>
  56. <serviceList>
  57. <service>
  58. <serviceType>urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1</serviceType>
  59. <serviceId>urn:upnp-org:serviceId:WANCommonIFC1</serviceId>
  60. <SCPDURL>/WANCommonInterfaceConfigSCPD.xml</SCPDURL>
  61. <controlURL>/upnp/control/WANCommonInterfaceConfig0</controlURL>
  62. <eventSubURL>/upnp/event/WANCommonInterfaceConfig0</eventSubURL>
  63. </service>
  64. </serviceList>
  65. <deviceList>
  66.     <device>
  67.         <deviceType>urn:schemas-upnp-org:device:WANConnectionDevice:1</deviceType>
  68.         <friendlyName>WANConnectionDevice:1</friendlyName>
  69.         <manufacturer>Technicolor</manufacturer>
  70.         <manufacturerURL>http://www.technicolor.com/</manufacturerURL>
  71.         <modelDescription>Docsis 3.1 Gateway</modelDescription>
  72.         <modelName>CGA6444VF</modelName>
  73.         <modelNumber>1.0</modelNumber>
  74.         <modelURL>http://www.technicolor.com</modelURL>
  75.         <serialNumber></serialNumber>
  76.         <UDN>uuid:ebf5a0a0-1dd1-11b2-a93f-021018951e6c</UDN>
  77.         <UPC>CGA6444VF</UPC>
  78.         <serviceList>
  79.        <service>
  80.            <serviceType>urn:schemas-upnp-org:service:WANIPConnection:1</serviceType>
  81.            <serviceId>urn:upnp-org:serviceId:WANIPConn1</serviceId>
  82.            <SCPDURL>/WANIPConnectionServiceSCPD.xml</SCPDURL>
  83.            <controlURL>/upnp/control/WANIPConnection0</controlURL>
  84.            <eventSubURL>/upnp/event/WANIPConnection0</eventSubURL>
  85.        </service>
  86.         </serviceList>
  87.     </device>
  88. </deviceList>
  89. </device>
  90. </deviceList>
  91. <presentationURL>http://192.168.0.1/</presentationURL></device>
  92. </root>
  93.  
  94. UPnP device is available at http://192.168.0.1:49153/upnp/control/WANIPConnection0
  95. Internal IP: 192.168.56.1
  96. External IP: 31.18.189.13
  97. Status: Connected
  98. Last error: ERROR_NONE
  99. Uptime router: 0 days 0 hours 0 minutes and 0 seconds
  100. Error SetPortMapping
  101. ResultCode: 500
  102. <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  103. <s:Body>
  104. <s:Fault>
  105. <faultcode>s:Client</faultcode>
  106. <faultstring>UPnPError</faultstring>
  107. <detail>
  108. <UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
  109. <errorCode>402</errorCode>
  110. <errorDescription>PAL_UPNP_SOAP_E_INVALID_ARGS</errorDescription>
  111. </UPnPError>
  112. </detail>
  113. </s:Fault>
  114. </s:Body>
  115. </s:Envelope>
  116.  
  117. Error SetPortMapping
  118. ResultCode: 500
  119. <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  120. <s:Body>
  121. <s:Fault>
  122. <faultcode>s:Client</faultcode>
  123. <faultstring>UPnPError</faultstring>
  124. <detail>
  125. <UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
  126. <errorCode>402</errorCode>
  127. <errorDescription>PAL_UPNP_SOAP_E_INVALID_ARGS</errorDescription>
  128. </UPnPError>
  129. </detail>
  130. </s:Fault>
  131. </s:Body>
  132. </s:Envelope>

rvk

  • Hero Member
  • *****
  • Posts: 6925
Re: [SOLVED] How to open UPnP port with synapse
« Reply #96 on: November 21, 2023, 08:40:41 pm »
UPnP:= TUPnP.Create('192.168.0.255', @debuglog);
Ok. That one finds the router but gives you errors on setting the port forwarding.

What did you pass to UPnP.SetPortMapping() ??

The router gives PAL_UPNP_SOAP_E_INVALID_ARGS back on those arguments.


Key-Real

  • Sr. Member
  • ****
  • Posts: 395
Re: [SOLVED] How to open UPnP port with synapse
« Reply #97 on: November 21, 2023, 08:41:53 pm »
Code: Pascal  [Select][+][-]
  1. procedure setupUPnP;
  2. var
  3.   Status : string;
  4.   LastError : string;
  5.   Uptime : integer;
  6.  
  7.   aDialog : TtuiDialogMessageBox;
  8.  
  9.   error : boolean;
  10.  
  11. begin
  12.  
  13.         upnpinstalled:= false;
  14.         error:= false;
  15.  
  16.         log('Setuping UPnP...');
  17.  
  18.   UPnP:= TUPnP.Create('192.168.0.255', @debuglog);
  19.  
  20.   try
  21.  
  22.     if UPnP.IsUPnPAvailable then begin
  23.       log('UPnP device is available at ' + UPnP.ControlURL);
  24.  
  25.       UPnP.GetStatusInfo(Status, LastError, Uptime);
  26.  
  27.       log('Internal IP: ' + UPnP.InternalIP);
  28.       log('External IP: ' + UPnP.ExternalIP);
  29.       log('Status: ' + Status);
  30.       log('Last error: ' + LastError);
  31.       log('Uptime router: ' + format('%d days %d hours %d minutes and %d seconds', [Uptime div 86400, (Uptime div 3600) mod 24, (Uptime div 60) mod 60, Uptime mod 60]));
  32.      
  33.  
  34.      
  35.       if UPnP.SetPortMapping(UPnP.InternalIP, ServerPORT, ServerPORT, 'TCP', 'FlyTracker') then begin
  36.         if UPnP.GetSpecificPortMapping(ServerPORT, 'TCP').InternalClient = UPnP.InternalIP then
  37.           log('SetPortMapping OK')
  38.         else begin
  39.           log('SetPortMapping reports OK but Port does not seem to be forwarded');
  40.           error:= true;
  41.         end;
  42.  
  43.         RefreshAndPrintPortMappings;
  44.  
  45.         upnpinstalled:=true;
  46.       end else begin
  47.  
  48.         log('Error SetPortMapping' + LineEnding + 'ResultCode: ' + UPNP.LastResultCode.ToString + LineEnding + UPnP.LastResponse);
  49.         error:= true;
  50.  
  51.       end;
  52.  
  53.  
  54.       if UPnP.SetPortMapping(UPnP.InternalIP, ServerPORT, ServerPORT, 'UDP', 'FlyTracker') then begin
  55.        
  56.         if UPnP.GetSpecificPortMapping(ServerPORT, 'UDP').InternalClient = UPnP.InternalIP then
  57.           log('SetPortMapping OK')
  58.         else begin
  59.           log('SetPortMapping reports OK but Port does not seem to be forwarded');
  60.           error:= true;
  61.         end;
  62.  
  63.         RefreshAndPrintPortMappings;
  64.  
  65.         upnpinstalled:=true;
  66.  
  67.       end else begin
  68.  
  69.         log('Error SetPortMapping' + LineEnding + 'ResultCode: ' + UPNP.LastResultCode.ToString + LineEnding + UPnP.LastResponse);
  70.         error:= true;
  71.  
  72.       end;
  73.  
  74.     end else error:= true;
  75.    
  76.   finally
  77.        
  78.   end;
  79.  
  80.         if error then begin
  81.                 log('UPnP Error!');
  82.     if currentMode = modeTracker then aDialog:= TtuiDialogMessageBox.Create(@aDialog, TrackerTUI, 'UPnP is not available');
  83.     if currentMode = modeInstrumentEditor then aDialog:= TtuiDialogMessageBox.Create(@aDialog, InstrumentEditorTUI, 'UPnP is not available');
  84.   end;
  85.  
  86. end;
  87.  

rvk

  • Hero Member
  • *****
  • Posts: 6925
Re: [SOLVED] How to open UPnP port with synapse
« Reply #98 on: November 21, 2023, 08:51:45 pm »
What happens if you put the RefreshAndPrintPortMappings above the SetPortMapping?
How many ports are forwarded?

PAL_UPNP_SOAP_E_INVALID_ARGS seems to indicate that there are too many.
https://github.com/miniupnp/miniupnp/issues/92

And what did you put into ServerPORT?
Is that port available?

Can you port forward with win32-miniupnpc-2.1?

Key-Real

  • Sr. Member
  • ****
  • Posts: 395
Re: [SOLVED] How to open UPnP port with synapse
« Reply #99 on: November 21, 2023, 08:59:02 pm »
ServerPort is 1234

Code: Pascal  [Select][+][-]
  1. procedure RefreshAndPrintPortMappings;
  2. var
  3.     s : string;
  4.     i : integer;
  5.  
  6. begin
  7.  
  8.   if not UPnP.RefreshPortMapping then
  9.       log('Error RefreshPortMapping' + LineEnding + 'ResultCode: ' + UPNP.LastResultCode.ToString + LineEnding + UPnP.LastResponse);
  10.  
  11.   if Length(UPnP.PortMappings) > 0 then begin
  12.  
  13.       log('Portmappings:');
  14.       for i:= 0 to Length(UPnP.PortMappings) - 1 do begin
  15.        
  16.         with UPnP.PortMappings[i] do
  17.           S:= Format('%d %s %d->%s:%d %s %d s', [i, Protocol, ExternalPort, InternalClient, InternalPort, Description, LeaseDuration]);
  18.                 log(S);
  19.  
  20.       end;
  21.  
  22.   end else
  23.       log('No portmappings');
  24.  
  25. end;
  26.  


RefreshAndPrintPortMappings;
before
if UPnP.SetPortMapping(UPnP.InternalIP, ServerPORT, ServerPORT, 'TCP', 'FlyTracker') then begin ....

tells me:

'No portmappings'

rvk

  • Hero Member
  • *****
  • Posts: 6925
Re: [SOLVED] How to open UPnP port with synapse
« Reply #100 on: November 21, 2023, 09:03:15 pm »
ServerPort is 1234
Does this work with miniupnpc ?

win32-miniupnpc-2.1 -a 192.168.56.1 1234 1234 TCP

I do find that local internal IP for your PC also strange 192.168.56.1 ??
If your router is 192.168.0.1 I think that's a wrong internal IP.

Key-Real

  • Sr. Member
  • ****
  • Posts: 395
Re: [SOLVED] How to open UPnP port with synapse
« Reply #101 on: November 21, 2023, 09:04:27 pm »
$ ./upnpc-shared.exe -a 192.168.0.5 1234 1234 TCP
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
ExternalIPAddress = 31.18.189.13
InternalIP:Port = 192.168.0.5:1234
external 31.18.189.13:1234 TCP is redirected to internal 192.168.0.5:1234 (duration=0)

rvk

  • Hero Member
  • *****
  • Posts: 6925
Re: [SOLVED] How to open UPnP port with synapse
« Reply #102 on: November 21, 2023, 09:06:56 pm »
Local LAN ip address : 192.168.0.5

I do find that local internal IP for your PC also strange 192.168.56.1 ??
It's detected from your HOSTNAME.

If your router is 192.168.0.1 I think that's a wrong internal IP.

Could you change the UPnP.InternalIP in that call for SetPortMapping to your correct internal IP.

I think you have a 'weird' internal network (with 255.255.255.255 mapping and internet interfaces).

What does this give you?
ping %USERDOMAIN% -4


Edit:
I use this code to get the internal IP.
Code: Pascal  [Select][+][-]
  1. function TUPnP.GetInternalIP: string;
  2. var
  3.   HostName: AnsiString;
  4.   HostEntry: PHostEnt;
  5. begin
  6.   Result := '';
  7.   HostName := '';
  8.   SetLength(HostName, 255);
  9.   if GetHostName(PAnsiChar(HostName), Length(HostName)) = 0 then
  10.   begin
  11.     SetLength(HostName, StrLen(PAnsiChar(HostName)));
  12.     HostEntry := GetHostByName(PAnsiChar(HostName));
  13.     if Assigned(HostEntry) then
  14.       Result := StrPas(inet_ntoa(PInAddr(HostEntry^.h_addr_list^)^));
  15.   end;
  16. end;

Maybe that detection is wrong.

Key-Real

  • Sr. Member
  • ****
  • Posts: 395
Re: [SOLVED] How to open UPnP port with synapse
« Reply #103 on: November 21, 2023, 09:26:24 pm »

Code: Pascal  [Select][+][-]
  1. if UPnP.SetPortMapping('192.168.0.5', ServerPORT, ServerPORT, 'TCP', 'FlyTracker') then begin

gives me:

Code: Pascal  [Select][+][-]
  1. Connecting through UPnP....
  2. Setuping UPnP...
  3. M-SEARCH found the following (length 438 bytes):
  4. HTTP/1.1 200 OK
  5. CACHE-CONTROL: max-age=1800
  6. DATE: Tue, 21 Nov 2023 20:09:18 GMT
  7. EXT:
  8. LOCATION: http://192.168.0.1:49153/IGDdevicedesc_brlan0.xml
  9. OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
  10. 01-NLS: 7916dd96-88a6-11ee-855f-ea9443b3f8d1
  11. SERVER: Linux/4.9.135-Prod_19.3, UPnP/1.0, Portable SDK for UPnP devices/1.6.22
  12. X-User-Agent: redsonic
  13. ST: upnp:rootdevice
  14. USN: uuid:ebf5a0a0-1dd1-11b2-a90f-021018951e6c::upnp:rootdevice
  15.  
  16.  
  17. M-SEARCH result:
  18. <?xml version="1.0"?>
  19. <root xmlns="urn:schemas-upnp-org:device-1-0">
  20. <specVersion>
  21. <major>1</major>
  22. <minor>0</minor>
  23. </specVersion>
  24. <device>
  25. <deviceType>urn:schemas-upnp-org:device:InternetGatewayDevice:1</deviceType>
  26. <friendlyName>CGA6444VF</friendlyName>
  27. <manufacturer>Technicolor</manufacturer>
  28. <manufacturerURL>http://www.technicolor.com/</manufacturerURL>
  29. <modelDescription>Docsis 3.1 Gateway</modelDescription>
  30. <modelName>CGA6444VF</modelName>
  31. <modelNumber>1.0</modelNumber>
  32. <modelURL>http://www.technicolor.com</modelURL>
  33. <serialNumber></serialNumber>
  34. <UDN>uuid:ebf5a0a0-1dd1-11b2-a90f-021018951e6c</UDN>
  35. <UPC>CGA6444VF</UPC>
  36. <serviceList>
  37. <service>
  38. <serviceType>urn:schemas-upnp-org:service:Layer3Forwarding:1</serviceType>
  39. <serviceId>urn:upnp-org:serviceId:L3Forwarding1</serviceId>
  40. <SCPDURL>/Layer3ForwardingSCPD.xml</SCPDURL>
  41. <controlURL>/upnp/control/Layer3Forwarding</controlURL>
  42. <eventSubURL>/upnp/event/Layer3Forwarding</eventSubURL>
  43. </service>
  44. </serviceList>
  45. <deviceList>
  46. <device>
  47. <deviceType>urn:schemas-upnp-org:device:WANDevice:1</deviceType>
  48. <friendlyName>WANDevice:1</friendlyName>
  49. <manufacturer>Technicolor</manufacturer>
  50. <manufacturerURL>http://www.technicolor.com/</manufacturerURL>
  51. <modelDescription>Docsis 3.1 Gateway</modelDescription>
  52. <modelName>CGA6444VF</modelName>
  53. <modelNumber>1.0</modelNumber>
  54. <modelURL>http://www.technicolor.com</modelURL>
  55. <serialNumber></serialNumber>
  56. <UDN>uuid:ebf5a0a0-1dd1-11b2-a92f-021018951e6c</UDN>
  57. <UPC>CGA6444VF</UPC>
  58. <serviceList>
  59. <service>
  60. <serviceType>urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1</serviceType>
  61. <serviceId>urn:upnp-org:serviceId:WANCommonIFC1</serviceId>
  62. <SCPDURL>/WANCommonInterfaceConfigSCPD.xml</SCPDURL>
  63. <controlURL>/upnp/control/WANCommonInterfaceConfig0</controlURL>
  64. <eventSubURL>/upnp/event/WANCommonInterfaceConfig0</eventSubURL>
  65. </service>
  66. </serviceList>
  67. <deviceList>
  68.     <device>
  69.         <deviceType>urn:schemas-upnp-org:device:WANConnectionDevice:1</deviceType>
  70.         <friendlyName>WANConnectionDevice:1</friendlyName>
  71.         <manufacturer>Technicolor</manufacturer>
  72.         <manufacturerURL>http://www.technicolor.com/</manufacturerURL>
  73.         <modelDescription>Docsis 3.1 Gateway</modelDescription>
  74.         <modelName>CGA6444VF</modelName>
  75.         <modelNumber>1.0</modelNumber>
  76.         <modelURL>http://www.technicolor.com</modelURL>
  77.         <serialNumber></serialNumber>
  78.         <UDN>uuid:ebf5a0a0-1dd1-11b2-a93f-021018951e6c</UDN>
  79.         <UPC>CGA6444VF</UPC>
  80.         <serviceList>
  81.        <service>
  82.            <serviceType>urn:schemas-upnp-org:service:WANIPConnection:1</serviceType>
  83.            <serviceId>urn:upnp-org:serviceId:WANIPConn1</serviceId>
  84.            <SCPDURL>/WANIPConnectionServiceSCPD.xml</SCPDURL>
  85.            <controlURL>/upnp/control/WANIPConnection0</controlURL>
  86.            <eventSubURL>/upnp/event/WANIPConnection0</eventSubURL>
  87.        </service>
  88.         </serviceList>
  89.     </device>
  90. </deviceList>
  91. </device>
  92. </deviceList>
  93. <presentationURL>http://192.168.0.1/</presentationURL></device>
  94. </root>
  95.  
  96. UPnP device is available at http://192.168.0.1:49153/upnp/control/WANIPConnection0
  97. Internal IP: 192.168.56.1
  98. External IP: 31.18.189.13
  99. Status: Connected
  100. Last error: ERROR_NONE
  101. Uptime router: 0 days 0 hours 0 minutes and 0 seconds
  102. No portmappings
  103. Opening Port...
  104. SetPortMapping reports OK but Port does not seem to be forwarded
  105. Portmappings:
  106. 0 TCP 1234->192.168.0.5:1234 FlyTracker 0 s
  107. SetPortMapping reports OK but Port does not seem to be forwarded
  108. Portmappings:
  109. 0 TCP 1234->192.168.0.5:1234 FlyTracker 0 s
  110. 1 UDP 1234->192.168.0.5:1234 FlyTracker 0 s
  111. UPnP Error!
  112.  

the new function TUPnP.GetInternalIP: string;
gives me still the wrong ip.

the ping tells me : can't find %USERDOMAIN%

rvk

  • Hero Member
  • *****
  • Posts: 6925
Re: [SOLVED] How to open UPnP port with synapse
« Reply #104 on: November 21, 2023, 09:29:32 pm »
Code: Pascal  [Select][+][-]
  1. if UPnP.SetPortMapping('192.168.0.5', ServerPORT, ServerPORT, 'TCP', 'FlyTracker') then begin

{.......}

SetPortMapping reports OK but Port does not seem to be forwarded
Portmappings:
0 TCP 1234->192.168.0.5:1234 FlyTracker 0 s
SetPortMapping reports OK but Port does not seem to be forwarded
Portmappings:
0 TCP 1234->192.168.0.5:1234 FlyTracker 0 s
1 UDP 1234->192.168.0.5:1234 FlyTracker 0 s
UPnP Error!
[/code]
You need to remove the current 1234 you did with minupnpc.
Otherwise it doesn't work. You can't add a portforward which already exists.

the new function TUPnP.GetInternalIP: string;
gives me still the wrong ip.

the ping tells me : can't find %USERDOMAIN%
Can you do the command "set" and see which environment variable contains your computername.

End result would be "ping yourcomputername -4" to see what IP you get.
This should be 192.168.0.5. If it gives you 192.168.56.1 it's the same problem as the GetHostByName in FPC.

 

TinyPortal © 2005-2018