I’ve been successful controlling my Amcrest camera and getting data from it using the same techniques described above. I.e., set up port forwarding in my router and use an external address in my web request along with user:pw & port number in an (unencrypted) HTTP request.
However, I’d rather 1) use HTTPS, or 2) preferably, keep the communications on the LAN.
I couldn’t get the first option (HTTPS) to work because the camera is using a self-signed certificate and ST complains that it can’t be authenticated. Any ideas how to resolve this issue?
But, as I said, I’d prefer to keep the communications between ST/webCoRE and the camera on my local LAN. If I change the web request to use the LAN IP address for the camera instead of the external address, and drop the port number (since the default port of 80 is correct), it doesn’t work. By logging $httpStatusCode I see the result is 408, which is a timeout.
So, with everything else the same, why does a local address not work if an external address does?
Details:
External web request:
http://:@<external_address>:<external_port>/cgi-bin/…
Internal web request:
http://:@<internal_address>/cgi-bin/…
For the first, the log shows:
Sending external web request to: <external_address>:<external_port>/cgi-bin/…
And $httpStatusCode is 200.
For the second, the log shows:
Sending internal web request to: :@<internal_address>/cgi-bin/…
And $httpStatusCode is 408.
Of course, both forms work from Chrome or Postman. What is webCoRE doing differently between external and internal addresses that would cause the internal address form of the web request to not work?