Foscam Forum • View topic - Showing Secure Methods Using PHP To Display Your IP Cameras

Important Message from Foscam Digital Technologies Regarding US Sales & Service

Foscam.US (aka Foscam Digital Technologies and now Amcrest Technologies) is an independent United States based distributor of "Foscam" branded products. We have been offering telephone support, US local warranty and building the Foscam brand in the US for the past 7 years. Based on our experiences with Foscam and feedback from end users we have launched our own new and improved line of wireless IP cameras and security systems under the Amcrest brand. Working in partnership with the second largest security camera manufacturer in the world, Amcrest was founded with a deep commitment to end-user privacy and security, highly reliable software and hardware as well a seamless and intuitive user experience. For more information, please visit www.Amcrest.com

If you are having trouble with your Foscam cameras, we sincerely apologize for this inconvenience and would love to help. For technical support, response to inquiries and for obtaining replacements for any Foscam IP Cameras or NVR products, please reach out to tech@foscam.com or call 1-844-344-1113.

If you are interested in exchanging your Foscam camera for an Amcrest camera, we can offer you a massive loyalty discount, even if you are out of warranty. Please send an email to support@amcrest.com, sales@amcrest.com or call 1-888-212-7538

If you are subscribed to Foscam Cloud (www.foscamcloud.com), please contact cloud@foscam.us for support.

If you currently use the manufacturer's cloud service (www.myfoscam.com or linked in any way to www.foscam.com), you will need to contact them directly for support, at www.myfoscam.com.


Showing Secure Methods Using PHP To Display Your IP Cameras

General discussion regarding Foscam IP Cameras

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby TheUberOverLord » Fri Mar 21, 2014 5:14 pm

Minglarn wrote:Great info Don! But, I still have issuies get access logs from my Synology NAS so I did a small add to your script..

I've put these lines to SecureImageDisplayLogin.php script:

Code: Select all
//Write to log, date and IP
$file = 'log.txt';
$ipaddress = $_SERVER["REMOTE_ADDR"];
$today = date("Y-m-d H:i:s") . "," . $_SERVER["REMOTE_ADDR"] . "\r\n";
$current = file_get_contents($file);
file_put_contents($file, $today, FILE_APPEND | LOCK_EX);


It works and logs date and IP to file "log.txt", a simple and fast addon to your script.

What do you think? Is it OK or should I add some more code or delete some?

Note: I really suck when it comes to PHP .. :oops:

No looks good. If it works for you that's what's important.

I would assume that your Synology NAS has a standard access log somewhere. Which should include as much information as possible for more details if you needed it such as any referer information. Example:

http://superuser.com/questions/600780/log-of-access-to-synology-ds213

The below output is from a typical standard Web Server Access Log that shows the detailed access log information which is normally by default already and automatically collected and present from any access or attempted access to SecureImageDisplayLogin.php, SecureImageDisplay.htm and SecureImageDisplay.php:

Code: Select all
67.188.159.137 - - [21/Mar/2014:18:03:03 -0400] "GET /foscam/SecureImageDisplayLogin.php HTTP/1.1" 200 636 "http://foscam.us/forum/showing-secure-methods-using-php-to-display-your-ip-cameras-t8721.html" "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"

67.188.159.137 - - [21/Mar/2014:18:03:50 -0400] "GET /foscam/SecureImageDisplay.htm HTTP/1.1" 200 1491 "http://foscam.us/forum/showing-secure-methods-using-php-to-display-your-ip-cameras-t8721.html" "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"

67.187.159.137 - - [21/Mar/2014:18:03:54 -0400] "GET /foscam/SecureImageDisplay.php?t=139543936949 HTTP/1.1" 200 0 "http://107.170.59.150/foscam/SecureImageDisplay.htm" "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"

Of course you will now need to either manually delete your custom log data from time to time or automate that process somehow.

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby RICHARDSD » Mon May 26, 2014 6:01 am

It's a really secure method. Thank you very much for all your help. Your support has been excellent.
RICHARDSD
 
Posts: 16
Joined: Thu Jan 23, 2014 2:05 am

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby TheUberOverLord » Mon May 26, 2014 8:36 am

RICHARDSD wrote:It's a really secure method. Thank you very much for all your help. Your support has been excellent.

Thanks for the kind words.

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby TheUberOverLord » Thu May 29, 2014 2:12 am

This is now included in the bundle. Any camera owner can easily get and use All My Foscam IP Camera Examples Bundled Together With One Hour Of One-On-One Support To Implement Them Click Here!

If you don't already have a website or a web server to host things like this or to store your IP Cameras Snapshot images and/or videos via FTP. All the examples here are hosted by DigitalOcean which I have found to have great prices and support. No domain name is required and you get your own unique IP Address and it's your Web Server, NOT shared!
Click for more details

Added Totally Secure Foscam IP Camera Display and Control Support. Even when using HTTP not just HTTPS.

Prior to this release. Only Totally Secure Display was supported using HTTP or HTTPS not IP Camera Controls.

All Foscam IP Camera Models can be configured for the size display of your choice. For demonstration purposes. A width of 640 pixels is being used while keeping the aspect ratio for height. But you can configure any default size and use the Interfaces infinite zoom as needed.

Here is an example of a FI9826W using the actual default Snapshot resolution of 1280x720 instead of 640. The FI9826W is capable of default 1280x960 resolution but this one is at 1280x720:

http://107.170.59.150/foscam/SecureImag ... ontrol.htm

You can also access the camera using HTTPS even if the camera is not using HTTPS for remote access. Access can be combined with your own unique login using the User Id and Password of your choice not connected with any User Id and/or Password for the camera itself. The optional logon can be used using HTTP or HTTPS. Try it here.

Note: The HTTPS examples are using a self-signed SSL certificate so you will see a warning when using the HTTPS links.

User Id: admin
Password: admin

HTTP:

http://107.170.59.150/foscam/SecureImageDisplayControlLogin.php

HTTPS:

https://107.170.59.150/foscam/SecureImageDisplayControlLogin.php

You can directly access the camera without the Logon using HTTPS as well:

https://107.170.59.150/foscam/SecureImageDisplayControl.htm

Foscam H.264 based IP Cameras Models FI9826W and FI9828W now support using both the cameras actual zoom lens as well as the Interfaces Infinite zoom ability. They can also be used together.

All these options are configurable and can be enabled/disabled individually.

Simply click on any of the Foscam IP Camera Models below to try a live demonstration for any of the IP Camera models using these same totally secure methods at a 640 width resolution ("Which is configurable"):

There is a Two Minute Limit For Demonstration Purposes
ImageImageImageImageImageImageImageImageImageImage

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby maddbomber83 » Thu May 29, 2014 9:54 am

Oh wow, thank you for the update. This will work awesome for making my home web server's page to control our camera be more secure.

Looking forward to the code release.
maddbomber83
 
Posts: 12
Joined: Mon May 05, 2014 5:45 pm

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby TheUberOverLord » Thu May 29, 2014 10:42 am

maddbomber83 wrote:Oh wow, thank you for the update. This will work awesome for making my home web server's page to control our camera be more secure.

Looking forward to the code release.

You are very welcome.

This version is only available in the bundle that includes all examples and also includes a maximum of one hour of one-on-one support:

http://107.170.59.150/paypal/

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby simonhi99 » Wed Jun 04, 2014 6:27 am

A little help please.

I have my web server running via a raspberry pi and have copied all the files to a folder under \var\www

I am using a FI9805E camera set up on port 80 which I can connect to via my local browser.

I have set the camera url in the php file

$ipcam_url = "http://192.168.0.210:80/CGIProxy.fcgi?cmd=snapPicture2&usr=*****&pwd=*****&cnt=".microtime(true);

When I browse to SecureImageDisplay.php on the pi I get the following error messages:

Your web server does NOT allow the IP Cameras port to be opened using php GD methods.
Your web server allows the IP Cameras port to be opened using php Curl methods.

Double check that your IP Camera is online and that the syntax in $ipcam_url is correct. If it is?
Then your web server, is not allowing your IP Cameras port to be opened as an Outbound Port by both php Curl and php GD methods.

If you use a web Hosting Service then you need to make a request that your Hosting Service
allows you to access the Outbound Port for your IP Camera using both php Curl and php GD methods.

If your Hosting Service refuses this request?
Then to use this php script. You will need to change your IP Cameras port to be port 80.
Please also change your IP Cameras port forwarding setup to use port 80 as well.

Some info on what settings to check would be useful please.

Cheers,
S
simonhi99
 
Posts: 3
Joined: Wed Jun 04, 2014 6:17 am

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby TheUberOverLord » Wed Jun 04, 2014 7:37 am

simonhi99 wrote:A little help please.

I have my web server running via a raspberry pi and have copied all the files to a folder under \var\www

I am using a FI9805E camera set up on port 80 which I can connect to via my local browser.

I have set the camera url in the php file

$ipcam_url = "http://192.168.0.210:80/CGIProxy.fcgi?cmd=snapPicture2&usr=*****&pwd=*****&cnt=".microtime(true);

When I browse to SecureImageDisplay.php on the pi I get the following error messages:

Your web server does NOT allow the IP Cameras port to be opened using php GD methods.

Your web server allows the IP Cameras port to be opened using php Curl methods.

Double check that your IP Camera is online and that the syntax in $ipcam_url is correct. If it is?
Then your web server, is not allowing your IP Cameras port to be opened as an Outbound Port by both php Curl and php GD methods.

If you use a web Hosting Service then you need to make a request that your Hosting Service allows you to access the Outbound Port for your IP Camera using both php Curl and php GD methods.

If your Hosting Service refuses this request?
Then to use this php script. You will need to change your IP Cameras port to be port 80.
Please also change your IP Cameras port forwarding setup to use port 80 as well.

Some info on what settings to check would be useful please.

Cheers,
S

PHP is missing GD routines or outbound port 80 is not approved ("Is currently being blocked from using PHP GD methods"). So PHP GD methods need to be installed and/or outbound port 80 needs to be unblocked to use PHP GD methods.

If you are using a hosting service then you need to ask them to check these things. If you run your own server then you need to check/add them yourself:

1. Are PHP GD methods installed?
2. Is outbound port 80 authorized to use PHP GD methods?

Note: PHP curl methods show as allowed for outbound port 80. If your hosting company refuses to unblock PHP GD methods for outbound port 80. You can use the Interface but not with any image resizing or custom text in images. Worse case you could switch hosting companies.

Here is a hosting company, that does NOT block anything. Is cost effective and is NOT shared. It's your own web server, with your own IP Address. It does NOT require having a domain name to use as well. The examples shown here are run there as well:

Click for more details

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby simonhi99 » Wed Jun 04, 2014 10:17 am

Thanks,

I am not using a hosting service, have got apache2 web server running on a raspberry pi. I need to go and check my configuration.

Cheers,
S
simonhi99
 
Posts: 3
Joined: Wed Jun 04, 2014 6:17 am

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby maddbomber83 » Wed Jun 04, 2014 10:59 am

simonhi99 wrote:Thanks,

I am not using a hosting service, have got apache2 web server running on a raspberry pi. I need to go and check my configuration.

Cheers,
S


When I set mine up I had to separately install curl and GD modules for light httpd. They added themselves to the appropriate ini file and I was up and running.


Uber;
Do you know of a good way for the camera to transmit to a single location and then have all other locations get their feed from there? We have several locations in the house accessing the camera feed, and I image that the camera is sending a unique stream / duplication of effort for every listening device.
maddbomber83
 
Posts: 12
Joined: Mon May 05, 2014 5:45 pm

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest