Articles Hierarchy

Articles Home » RPI » RPI CAM as WIFI SEC IP CAM


for some time i was working on building a new house and moving in,
but now i got the idea to use a old RPI camera project here
my RPI1 and the camera module could be installed as a additional wifi security web cam ( instead of rotting in some box )

-1- use a other SD and start a new JESSIE system setup
the system was still working but i want to do a new setup,
using 2016-09-23-raspbian-jessie.img burn to 8GB sandisk SD
add some custom installations to have my working environment
and fix IP of RPI 1 for eth ...101 and wifi ...201.
as later the camera only work via wifi and never use HDMI.
and it is a old RPI1 so i better free memory by the boot options.

after sudo raspi-config // boot option B1 /

over 100MB less used RAM.

-2- install newer version of camera software from here
and RPI forum here
//new JESSIE
git clone
cd RPi_Cam_Web_Interface
chmod u+x
./ install

find web code in: /var/www/html/

p.s. a click on the video gives you full screen / and click back.

-3- build it in a camera housing

when i buy the camera system for the house
( 4 * AHD 2M camera + recorder ( 1TB ) for 340euro incl. installation)
i got a additional alu camera housing for 10euro.

and a small change in
change "mycam" to "gate_cam"
and run installer ./ again
_ 3 configure
__ | 2 upgrade

and some security changes in
and run again
_ 3 configure
__ │3 apache_security
__ │4 apache_port
now must call in browser
and answer user xxx password xxxx. // and remember in browser
i understand from manual that for motion would need now add changes??

now with fix IP and port ( not 80 ) the router can do a port forward to allow remote access

using browser and ? who am i ? sites or a look in the router can tell you your current public IP
and with that your camera could be called from anywhere by
but that IP could change, mostly on a daily basis, depending on your ISP. ( internet service provider )
here a "DYN DNS service" can help:
in your server ( camera ) need a scheduler to run a update program:
( also many router now allow that function )
that program checks on the actual remote IP ( by using this or any of that services ) and
sends it to the DYN DNS service to store it as your actual IP.
there now that IP is mapped to your subdomain so your camera can be called by

i play with that several times, some i got running, but after a year they changed to paid service,,,
so i build my own dyn dns service.
on a (free) web space what allows php... and free sub domains
for the RPI i make a
- sub domain
OR a
-- sub directory
so the call would be
my php tools in there allow 3 different functions:
-1- call
gives back the redirect to current stored remote IP ( and port )
-2- call IP ( by the scheduled update service of your server option)
just sends back your current remote ip
-3- call update ( by the scheduled update service of your server or manually from browser)
and the current remote ip is stored for use by -1-

so you need to adjust the port in the camera code, the router and the myowndyndns server file
here the setting for your own dyn dns webserver (subdomain): code
as soon you run the update -3- ( in a browser ) successful your camera is working from remote by:

still better do the scheduled update service from RPI:
make a
# Update the public IP on server.
## Place this script in the cron's job directory /etc/cron.d and assign the proper permissions
## and owner
## sudo chmod 500 /etc/cron.d/
## sudo chown root:root /etc/cron.d/
## Add to /etc/crontab to execute on reboot and every 10 minutes
## Edit /etc/crontab and append these two lines:
## @reboot root /etc/cron.d/ >/dev/null
## */10 * * * * root /etc/cron.d/ >/dev/null
#Use your own values
wget -q --read-timeout=0.0 --waitretry=5 --tries=400 --output-document /dev/null $UPDATE_URL

sudo nano /etc/cron.d/
sudo chmod 500 /etc/cron.d/
sudo chown root:root /etc/cron.d/

/etc/cron.d/myCAMcronjob#@reboot root /etc/cron.d/ >/dev/null
*/11 * * * * root /etc/cron.d/ >/dev/null

sudo nano /etc/cron.d/myCAMcronjob
sudo chown root:root /etc/cron.d/myCAMcronjob

for years i now have a free account at, not bad
just for this i get a add account making
but the way for subdomains is different, instead of making me
it gives me
you can set it temporary to your own IP by calling
pls, this all works only if your port is 4321 in your camera ( or server ) and router .

some error i see: