Introduction: Raspberry Pi: Completely Wireless IP Camera. Solar Battery Pack, WiFi, Logitech Camera, Raspbian

Picture of Raspberry Pi: Completely Wireless IP Camera. Solar Battery Pack, WiFi, Logitech Camera, Raspbian

This is one of the first projects I did with my Raspberry Pi. I wanted to see if I could make a completely wireless web cam and set it to stream over the internet. Below are the steps and items I used.

All items except for the Raspberry Pi were purchased from

Raspberry Pi Model B 512MB RAM
5000mAh Solar Powered External Battery Dual USB For iPad/Mobile Phone/Tablet PC
802.11n/g/b 150Mbps Mini USB WiFi Wireless Adapter Network LAN Card w/Antenna
Raspberry Pi Case Raspi Enclosure Box with GPIO Access and Logo (optional)
Logitech QuickCam for Notebooks Deluxe Laptop Webcam (Other web cams may work)

The first thing you want to do is get the Raspian Wheezy Image from here. Once you install it and boot up, you’ll come to a configuration screen.

Go to Expand_Rootfs to allow the operating system to use the entire SD card.

Go to SSH and Enable it. This will allow you to remotely shell into the OS to make configuration changes and get updates.

Save changes and reboot the Raspberry Pi.

Once booted up, you will want to download updates.
sudo apt-get update
This can take sometime to complete.

sudo apt-get upgrade
Type Y for yes and wait for the updates to download and install.

Next we want to setup the WiFi adapter. Shutdown the RPi with “sudo shutdown now” and plug in your WiFi adapter.

When booted up login and then type: sudo nano /etc/network/interfaces
We want to give the Raspberry Pi a static IP address so that we can access it remotely. Below is an example of my configuration. Yours may vary. I set the Ethernet port and the WiFi to the same IP address so that I can access it from the same IP even if it is connected via Ethernet or WiFi.

auto lo
iface lo inet loopback
iface eth0 inet static

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
wpa-ssid “yourSSID”
wpa-psk “yourPASSPHRASE”

Save your changes using Ctrl-O and shutdown the device.
Unplug the Ethernet cable.

You should see your static IP on the verbose screen “My IP address is”

Verify that you are connected to the internet by typing: sudo ping -c 3

From this point on, I do the rest of the setup through SSH and PuTTy on a Windows machine.

Log into your RPi via PuTTy using the Pi’s static IP address.

Plug in your webcam.

Next we need to install the “motion” service. This is a package that contains everything you need to stream your cam over the internet and view it from any browser.

sudo apt-get install motion

Once the installation has completed we need to start the service.

sudo services motion start

If your web cam has a light on it, you should see it light up.

Now lets configure the motion software.

sudo nano /etc/motion/motion.conf

In here there are a few basic changes that you need to perform:

Daemon = OFF to ON
webcam_localhost = ON to OFF
webcam_port = desired port number or 8088
control_port = desired port number or 8089
To ensure that the motion service will actually start as a daemon we need to change another configuration setting, so enter the following:
sudo nano /etc/default/motion

Then change the value “start_motion_daemon=no” to “yes”

sudo service motion restart

You can now open up a browser from another computer on the same network and go to: to view your web cam.

You can remotely control the web cam settings by going to

Power off the RPi, hook up the battery pack and turn it on. You should now only have the WiFi adapter and web cam plugged into the usb ports. Try viewing the cam from a web browser and walk around your house or even outside.

You will need to enable port forwarding on your home broadband router to the Raspberry PI on port 8088, that will mean you can access the web cam from anywhere in the world. You can also sign up with a service like


richardnml (author)2017-05-16

have you updated this design?

AdrieSentosa (author)2016-03-15

sudo modprobe bcm2835-v4l2

hope this code help someone to access the camera

LudgerB (author)2016-03-04

Habe meinen PI3 nach dieser Anleitung installiert. Wenn ich motion im Terminal starte werden auch Bilder der Kamera als jpg abgelegt.
Wenn ich allerdings über die IP zugreifen will erhalte ich keinen Zugriff. Selbst lokal funktioniert es nicht. http://localhost:8080 führt zu der Fehlemeldung :
Die Webseite auf http://localhost:8080/ ist möglicherweise unereichbar, die genaue Fehlermeldung war

Verbindung ist gescheitert. Verbindungsaufbau abgelehnt.

Sie könnte vorübergehend nicht erreichbar sein oder zu einer anderen Adresse umgezogen sei.

Von einem PC im gleichen Netz kommt auch keine Verbindung zustande. Der PI ist jedoch errrecibar. sftp - Verbindung funktioniert.

Hat jemand eine Idee ?

MathewB14 (author)2016-02-25

Hi there.
I'm looking at setting up a cheap video streamer so when people are like sick/away from school that can still do the school. I would like it to be as cheap as possible.
Could you do it for under $30 - I don't mind outdated devices as log as I can view on the Internet and has sound too.

MasonP6 (author)2016-01-18

Anyone know if I can make this with a raspberry pi 0? (When they come back for sale)

CédricV2 (author)2015-07-08

Instead of motion you can also use, it's also open-source and a lot more user friendly to install and configure. You can find more information on the website.

jpayton (author)2015-03-28

I would use an old smart phone. The android IP Camera app works great. I have three of them set up. I want to do something like this so I can mount one on a tree for a better view of the front of our house. I have a home server running xeoma that allowes motion sensing, managment, and access to all the cameras.

lspicer (author)jpayton2015-03-29

I do the same as you, only I use Ispy software to access my phones camera's. You could add as many camera's as your computer or server can handle. The link is it works only on Windows machines 32 and 64 bit. The best thing about this software is you can use any type of camera. IP, Network, Local, etc.

jpayton (author)lspicer2015-03-29

ISpy is windows only. Otherwise I like it. Xeoma allowed me to trigger a plugin on my media center to have my security camera pop up when motion is detected.

lspicer (author)jpayton2015-03-29

I will have to check that out. Thank you.

JamesW18 (author)2015-03-21

I like what you've suggested. I would like to build your project just for the sake of doing and learning. I would like to build your project with various differences. Such as, (1) I don't want it motion activated, basically always on so to speak like a security camera. (2) I will use the RPI "B" with the Pi Camera.

This is my idea, I want to place the pi w/camera inside a waterproof container near my pond about 100 yds from my deck. While on my deck, I would like to wake the Pi similar to wake on lan, login to the Pi, turn on the camera, view for however long the battery will support and then shutdown. Please if you can, point me in the correct direction. I'm not a noob and not a skilled tech person.

rjwarpath (author)JamesW182015-03-22

Id suggest something like It has all of the features that you mentioned. Configurable via web browser.

JamesW18 (author)rjwarpath2015-03-24

Thanks for the suggestion. I appreciate your time.

catslover32 (author)2013-10-20

Worked, but then dropped after a few seconds when looked at in firefox.

aoiivier (author)2013-10-15

Hey Ryan,
I sent you a private message. Old friend hoping to catch up!

rjwarpath (author)2013-09-02

This project is not a substitute for network security cameras. This is just a simple project that you can do with your Raspberry Pi.

If you are looking for a cheap security camera solution, I would suggest investing in a few wireless network cameras. Each camera has its own IP address and web interface. You can even view multiple cameras through one web interface. There are also several apps available for Android and iOS for viewing the cameras.

You can connect the Raspberry Pi to a HDTV to view the cameras. Simply enable the desktop manager or (startx), then open a web browser and go to your network cameras web interface. You can also do the same thing with an old computer, instead of using a RaspPi connected to an always on monitor.

NFAZ10 (author)2013-08-18

I set up all the software got the IP and port working remotely. The realized that the RPi camera module is not supported. How can I enable this to work with motion

shrutin111 (author)2013-07-25

I am planning to do something similar to this for my project.But I have to use the WAT-902H3 Supreme camera for video capture. I will have to use an adapter for video input. Can you explain me the hardware setup for your project...that might help me in my project.

synaps3 (author)2013-07-16

Awesome build. Planning on using this for people i know on a farm that need it badly. thanks!
just wanted to know if there is a way of viewing more that one system at a time, say if you have 4 raspberry pi's around?

rjwarpath (author)synaps32013-07-16

Yes. Kinda of messy, but.... You can view more then one cam at a time with a custom html page. Lets say you have 4 Raspberrypi's....
Create a html web page with 4 iframes. Each iframe source will point to one of the raspberrypi webcam url's ( You will need to set each RaspPi to different IP addresses and port numbers. Port forward the IP's and Port numbers in order to acess the cams over the internet.

Web page example code.
Create a single html page (mycams.htm) and add the following to get started.

iframe src="" style="width:400px; height:400px; border:none; float:left;
iframe src="" style="width:400px; height:400px; border:none;float:right;
iframe src="" style="width:400px; height:400px; border:none; float:left;
iframe src="" style="width:400px; height:400px; border:none; float:right;

I can not figure out to add html code in the comment with out it disappearing. You can google search iframes or visit

You can also purchase Wireless WiFi IP Network Cameras from Amazon/Ebay. They can do a lot more then the RaspPi such as remote control, pan, tilt, record, audio. A good model is Foscam Indoor Wireless WIFI IP Network Camera Pan/Tilt Security Webcam

raind33r (author)2013-07-06

Wow that's cool.
Slightly OT.
Advice needed.
I'd like to do something similar.
Have the Pi hooked up to a HD cam to record squash games. Must be able to stream to a TV nearby (probably via wifi to 2nd Pi connected to TV) Must be able to start recording to Flash drive at user's discretion - maybe remote control?

rjwarpath (author)raind33r2013-07-06

Hmm. This sounds complicated. You may be better off using wireless video transmitters. I have seen them on amazon for less then $30. I believe they are low voltage, so you could rig up a battery pack to the one on the camera. The one on the TV could be plugged into a wall outlet.
If you were to try this using raspberrypi's:
You would need to configure one to be a wireless access point. The other would then connect to the access point to create a small wireless network.
The one on the TV side would then need to grab the video via the web, maybe with wget commands?
Starting and Stopping the recording without a keyboard and command line, you could use physical buttons connected to the gpio pins of the raspberrypi's.
I have not seen anyone doing this. It would be an interesting project to try.

peyot (author)2013-06-19

much better way of making static ip is to manage it on the router-side. it makes all stuff easier for the later time, if you decide to change something, or simply if you'll reformat your RPi's sdcard. I assume, that leaving io/wlan settings untouched will do the magic?

stew81 (author)2013-04-18

One detail that was causing me an issue (sudo: services: command not found) was the semantics of singular "service" vs plural service'S'. In the steps it had been written as services. After getting stuck with "command not found", I was w/o any ideas on how to fix it. So I took a guess and tried typing service. It worked!

I don't if anyone else has run into that, but I thought it might help to mention it. Great post though! Thanks rjwarpath.

mushroom glue (author)2013-03-23

I've just tried this, and I got an error (Exit motion, cannot create process id file (pid file) /var/run/motion/ no such file or directory) when I run it. I'm using a 256 meg raspi, and it's conecting over ethernet using my PC as a gateway. I've tried pulling up the webpage with my IP instead of the current one, and it won't load. Any ideas?
Thanks in advance.

garciam44 (author)mushroom glue2013-04-17

Run "sudo nano /etc/motion/motion.conf" to access motion config file

Try changing process id file to "process_id_file /home/[username]/motion/"

The username should be "pi" or "default"

- hope this fixes your problem

mushroom glue (author)garciam442013-04-18

Thanks. I'd got this working, but I'm getting very low quality video through. It's breaking up a lot, and turning green. I haven't poked at it for a bit, but seeing as the actual images were fairly high definition, is it possible to knock back the definition and get a more stable stream?

bugsy_malone 666 (author)2013-01-22

Quite cool, How long have you tested the Pi on that battery pack for continuously? I am still learning with my Pi and building a small rig that has a couple of wifi/bluetooth adaptors and wanted to size up a power pack as a UPS for it to run for several hours.

The battery pack runs for about 5hrs with just the webcam and wifi adapter. The solar cells will keep the battery charged up to 50%. I suppose it would require more solar cells to charge the battery to full capacity. It works pretty well for what it is.

About This Instructable




More by rjwarpath:Raspberry Pi: Completely Wireless IP Camera. Solar Battery Pack, WiFi, Logitech Camera, RaspbianInstall Windows7 on to a Acer Netbook from a USB Flash DriveAutomatically Shut down and Power up your computer
Add instructable to: