Outils pour utilisateurs

Outils du site


issue97:labolinux_-_ip_camera

Ceci est une ancienne révision du document !


My father recently bought chickens and I thought it would be nice to have an Internet camera out there to keep an eye on them. Nice idea, but how can it be done when these Wi-Fi enabled cameras are out of Wi-Fi range? I can’t run a giant network cable through the garden.

The answer is powerline adapters. I was highly sceptical of them at first, but I have to admit that they do work, and surprisingly well.

DISCLAIMER: I’ll have to be a bit vague in this article as there are many different types of powerline adapters and they all work differently. Same with IP cameras and routers.

POWERLINE

The idea behind the powerline adapter is this: you buy a pair of power outlet plugs which have network sockets on them and several flashing indicator lights. You plug your first one into the wall and have its network socket wired to your internet router. Your second plug goes wherever you need a network point. In a chicken coop, in my case.

TIP: when pairing the plugs together, do it in the same room as it will save you a lot of legwork.

Most come with encryption built in that you can enable. This is handy if your power source is shared with other residents. This is not something I’ve tested, but to enable it I think it requires the manufacturer’s software, which I found was Windows only and wouldn’t run in Wine.

You can add more plugs to your powerline network, but try to keep them all the same type. Otherwise, you’re asking for incompatibility and nightmares.

IP CAMERAS

IP (Internet Protocol) cameras come in many shapes, sizes and prices. There are two major manufacturers: Wansview and Foscam.

Yes, they’re cheap makes with only 640-pixel wide images, but I don’t want an expensive camera in a chicken coop.

The good thing about these cameras is that they pan and tilt. In other words: you can move them by remote control. Most come with infrared LEDs on the front which will allow night vision, too. The back of the camera has an ethernet port, Wi-Fi antenna, power socket, and usually several connections for sound and alarms (if required). All we really need here are the power and ethernet ports.

So, you’ve got your powerline adapter plugged in where you want it. Plug your network cable from the powerline to the camera, then power on the camera. This is important as I find that powering on the camera first, then plugging in the network cable, doesn’t always work for getting an IP address. Give the camera at least one or two minutes before writing it off, as mine takes at least a minute to boot up and go through its up/down, left/right test sequence.

IP ADDRESS

Most IP cameras come with a sticker on the underside of it. This gives you the default admin password (for initial setup), a dynamic DNS url, and (sometimes) a default IP address. My one didn’t come with an IP address on the sticker, so I’ve no idea what it’s IP address is so I’ll need to find it. You can, sometimes, get it using the dynamic DNS URL, but they’re quite often in China, incredibly slow, and not exactly trustworthy. So, I’d recommend not using it and setting up a faster dynamic URL, but we’ll come to that later.

Again, I have to be a bit vague here as all routers are different. I’m using a BT HomeHub 4 (in the UK) so your router will no doubt be different. But, either way, you log in to your router and head to the DHCP table page (if there is one) or to a visual list of attached devices. In there you’ll see the device and its IP address.

In my case, it was a device I didn’t recognise, and I knew that my main powerline was in LAN2 (on my router), so I knew right away that was the camera. It won’t always have an easily recognisable name!

To test things I entered the IP address (192.168.0.2 in this case) into my browser. This should let you log into the camera with the default details which you can, of course, change.

Success!

So, I can access the IP camera over the network. First thing I did, which isn’t a necessity, is to head back into my router and tell the router that I want that device to have the same IP address every time. With that saved I know that my camera will always be 192.168.0.2.

By default the IP cameras use port 80 which is the default internet port – that needs to be changed. In the camera settings will be a place to edit the IP address and/or port number. I’ve changed mine to port 82.

I also changed the password for the admin account, and added a guest operator account. This means I can give people the guest login to let them view, but not edit, the camera.

If you plan on having more than one camera online, then each one needs to use a different port number.

So, now that the port is changed, you need to tag that onto the URL. My login now is http://192.168.0.2:82. The colon 82 forces it to use port 82.

Thus far we can log in to the camera on the network, but what about from outside of the network? We need a dynamic DNS for that.

DYNAMIC DNS

If you’re like me, then your IP address will change each time to reconnect to the internet. Most routers have a setting for dynamic DNS which will let your router ping its new IP address to a provider who will associate that IP address with an easy-to-remember URL.

There are many different free dynamic DNS providers out there, but I use DTDNS.com as this is what’s compatible with my router. You’ll need to log into your router and go to the dynamic DNS page to see what it will/won’t accept.

Whichever service you want to use, create an account with them and sign in. Under hostnames you’ll choose a name and one of their URLs. I chose, funnily enough, chickens, then one of their URLs.

Head back again to the router page for dynamic DNS and give it your username and password for your hostname.

Now, when I reconnect to the internet my router will give DTDNS my new IP address and I can use my URL to log into my camera.

But wait. Typing in the dynamic DNS URL doesn’t load the camera!

PORT FORWARDING

When you enter your dynamic DNS URL, you’d expect to log into your camera. But no. Why? Because the URL is using port 80 by default. We need to add a colon and your camera’s port number (eg: :82), but first we need to tell the router what to do when we enter that URL.

Somewhere in your router will be a page for port forwarding. It may come under firewall. What we’re going to do is first create a label, or name, for each camera. So I add a new application (as my router calls it). For protocol I keep it at ‘any,’ and I enter 82 for port range, 82 for translate to, and save it. Now I choose my application again (ie: the camera) which is associated with port 82 and link it to the device (the camera).

Yes, it’s a bit confusing at first, but the router needs to know where to send things. When our DNS URL comes in, the router has no idea where to send that port 82 data. We’re telling it here to send that port 82 data to the camera. Now, when I enter my DTDNS URL with the :82 at the end I go straight to my camera.

MOBILE APPS

There are many different apps you can use for viewing IP cameras, but for Android I use tinyCAM Monitor (which is free).

I add a new camera and give it the relevant settings such as make, model, DNS URL, port number, and my guest login.

Not in the screenshot shown here, but at the top of that screen is a check to see if the camera is detected, found, and online. If it says it’s all OK, then you’re good to go. Go back and choose your camera from the list, sit back, and watch the show.

They may be only chickens, but they’re far more interesting than most of the current TV shows.

CONCLUSION

Obviously, you can take this further with several cameras throughout your house or property. You can, if you wish, add microphones to your cameras and listen to what your camera is hearing. Some cameras even allow speakers to be added to let you use it as an intercom device of sorts. Even alarms can be wired into some cameras.

The main star of the show is the powerline adapters. Without them there’d be no camera in the chicken coop. A testament to their power is that the coop is quite a distance from the house (ie: long power cable) and the powerline adapter itself is plugged into a four-way extension cable. This is normally a no-no, but it’s a necessary evil as there’s only one socket in the coop area.

I was a powerline sceptic, but now I’m a believer!

Footnote from Mike Kennedy (FCM proofreader): I’ve used powerline adapters at various customer sites - usually very successfully. However, sometimes they didn’t work, or worked poorly. On investigation, the cause was usually a faulty PSU (power supply) in some other device, typically in a very cheap desktop PC, photocopier, printer, etc. So, if the powerline devices are problematic, try switching off most/all other devices, until the troublesome one(s) are identified. Then, perhaps the PSU is actually faulty (though, seemingly still “working”), or perhaps it’s of very poor quality - and it should be repaired/replaced].

issue97/labolinux_-_ip_camera.1433413284.txt.gz · Dernière modification : 2015/06/04 12:21 de d52fr