Notes on Using A TRENDNet IP Camera

I bought a TRENDNet TV-IP551W camera back in January from Newegg.  I was looking for something else, and the camera came up as a special for (IIRC) $14, with free shipping.  I have wanted to play with one for a while, so I bought it.  When it got here, configuring it was trivial.  I had a picture coming out of it in about three minutes flat.  I attached the camera to the outside of the house near an outlet that is tied to the outside lights; I use it to power holiday lights.  The camera only came on after dark, but it wasn’t being used operationally, so I didn’t sweat it.  Every once in a while I would connect to it remotely and see what was going on with the driveway.

The only issue here has to do with motion.  Any device (including my Android tablet and phone) could see a still picture grab, and refresh it manually.  BUT, you need either ActiveX support or Java to see motion video.  ActiveX means Windows.  I think I tried to get Java on my tablet, but gave up after a try because it didn’t matter at the time.

The camera has been hanging outside since, and worked.

Last weekend I decided to put it to operational use.  I moved it to a better location, and set it up to perform motion capture.

The first thing was the motion capture.  I tried using my Windows 7 laptop to define exactly where on the screen the motion capture areas were.  I pointed my W7 IE browser at the camera, selected Administration, then Configuration, and finally Motion Detection.  The camera wanted to download an ActiveX control.  No problem, but every time I tried, Windows would block installation of the control.  I set security essentially to off, still wouldn’t.  For the heck of it, I used Raegans computer (which is XP), it worked fine with the camera.  Hmph.  I left the motion sensitivity at the default of 90 (scale 1 to 100).

With motion capture set up, I went after email.  The camera will send you an email when it detects motion.The camera wants to know an SMTP server, so I pointed it at our upstream Cox SMTP server.  A test message went out just fine.   So far so good.

When the camera detects motion, it will capture the motion and upload the imagery.  Sounds cool.  It wants to upload the data to an FTP server.  Most people don’t have one of those, but I have several!  So I fired up Filezilla on Raegans computer, created a user name and password for the camera, and a folder to store the video.  Then I went back to the camera and plugged the information in, and send Ian out to trigger the camera.  I almost immediately saw activity on the ftp server, but no files uploaded.  Hmmm….

Much experimentation ensued.  I should have installed Ethereal (Wireshark) to her computer, but I played with settings fruitlessly for a while.  Finally, I did the user creation on the St. John’s server, then pointed the camera there.  Then I did a remote desktop to St. J, fired up Wireshark, and watched the packets flow in.

I had set the camera up to dump stuff to /home/drivewaycam.  On Wireshark, I could see the username and password (FTP sends in the clear), and then a CWD drivewaycam.   OK, now we were OK.  I stopped the camera, then created a subdirectory called drivewaycam (making tree /home/drivewaycam/drivewaycam), did a chown on the directory (chown drivewaycam:drivewaycam drivewaycam; type that fast!), and restarted the camera.

Wireshark now showed file transfer, and a check of the new directory showed jpgs.  So it was working.  I went off and did some other stuff for a while.

Right before I went to bed, I got my phone, and… there were well over 1,000 NEW messages from the camera!  To make the story short, it turns out the camera doesn’t send an email every time it decides to do a motion capture.  It also doesn’t upload a video.  It uploads 1-second images to the server, and sends an email message every time it does it!

I quickly went in a turned off the email feature.  I also turned the sensitivity down to 50%, which should reduce false triggers.

But… the camera has captured the mail and package delivery people, and Erin coming home from school.  So it is working.

I would like to get an email when motion is detected, and have sent off a feature request to TRENDNet.  I use the Unix/Linux standard ImageMagick convert tool to batchconvert each set of jpgs to an mpeg video; I will likely set that to be done in a cron job at some point.

I wonder if the camera could output IP video in H.264 or as an mpeg stream.  That could be read directly from Windows Media, VLC, or most any other open source tool.

Regardless, the IP camera is pretty darn cool.  I am going to get another one at some point, and I will likely make it a “see in the dark” camera.

Update:

As I have reviewed the captured images, I was seeing something amusing:  people or cars on my driveway would appear as if by magic!  The cars would be about halfway down the drive, and people about a quarter of the way down.  This was with the camera set to 50% sensitivity.  I changed that to 75%, and now I see things moving a lot farther away.  The obvious downside:  about twice as many images.  Glad I turned off the email notification.

I’ve had this camera uploading to the server I run for St. John’s for over a month.  I downloaded some image tools to check out, and settled on using the open source mplayer package, which has Linux and Windows versions.  So the process was to fire up my SSL and Secure FTP clients, point them at the St. John’s server, and do an mget -r to pull the individual image files to my laptop (this means pulling in roughly 500MB of stuff every day, so I’ve glad I’ve got a bitchin’ good network connection at home).  The camera stores the files by date, and hour.  So I would have a directory named 20140908 for 08 September, and then subdirectories like 0400 for the 4:00AM captures.

I wrote a batch file that works from the DOS prompt.  I manually CD into the day directory (20140908), then run the batch file.  It checks to see if there is directory for a particular hour, and if there is, it dives down there, and runs the mplayer mencoder tool against any JPEG files in that directory.  The mencoder combines those JPEGs to make an MPEG movie, which is a lot easier to review.  I have VLC on all my machines, and it plays the MPEG just fine.  Note, the Microsoft Media Player SHOULD also play these, but it can’t, and whines about it.  Curiously, the Microsoft Media Encoder plays the MPEGs just fine.  Mplayer, unsurprisingly, does fine as well.

An hour of captures typically produces a movie that runs from between 15 sec to 45 sec.  On a windy day, the number of files are higher as the trees in my yard move around a lot, which triggers the motion detection.  I can review the entire day in about five minutes, which isn’t too bad.  It’s kind of cool to occasionally see what are effectively are time lapses as shadows of trees above the driveway move as the sun moves.

The last thing I’ve done is to move the image capture to a local computer.  The images were being uploaded from the camera to St. John’s, then I was downloading them to my laptop.  That’s a long ways to go, and a lot of bandwidth.  I have an extra computer at the house that we don’t use; it has a wifi connection and it’s a Windows 7 box.  I cleaned all the stuff off that wasn’t needed anymore, and installed the free FileZilla ftp server on it.  I created the same user and password that the camera uses for the St. John’s server, and the same c:\drivewaycam\drivewaycam directories.  I got the computer on the house network, and set the router to always provide the same IP address to the computer.  So far, so good.  Next, I changed the ftp upload address from St. John’s to the computer in the house, sent Ian out to walk in front of the camera, and watched the images start rolling in.

I uploaded mplayer to the computer, and the enccoder.bat file, and ran them manually, worked fine.  The last thing to do was put RealVNC on the computer.  Then I shut it down, moved the computer to an out of the way location where it still had good wifi access, and powered it up again.  Now, it sits there and does nothing except capture images.  When I get home in the evening, at some point, I use my laptop to remote access the computer, and run the encoder.bat against the directory of the day, and then scan the images from my laptop.  It works really well.

I will likely upgrade the batch file  at some point and combine it with the Windows version of cron to have it scan for new files a couple times a day, and then automagically convert them to MPEGs, and maybe even email the MPEG to me after creation (each hourly MPEG is typically only a couple hundred K, not bad for emailing).

So this is working fine so far.  I am going to get a night vision version of the camera next.

I will say that while all of this ftp stuff was easy, it was easy for me, who has been doing this sort of IT work for literally decades.  I think it is too difficult for the average user.  The camera is a cool piece of technology, and seems to be essentially a Linux device with a camera input.  There is NO reason the camera should not be able to directly capture video from the camera.  Even if TrendNet wants to continue doing the JPEG capture, there is no reason to not do something like I do and run mencoder to convert the capture to an MPEG, and then upload that file (it would sure be faster to upload a single 200KB file instead of several hundred 200KB files), or even just email it.  I doubt that anyone who buys these cameras is sitting there watching it all the time, and the motion capture function is the best feature for determining when something happens, but generally after the fact.  I hope that the TrendNet people read the email I sent to them and thing about how their users need to use the camera.

Advertisements

One Response to “Notes on Using A TRENDNet IP Camera”

  1. Bill Says:

    Bill,

    Enjoyed your article about your TrendNet IP cam. I have been using their 3MP dome and bullet cameras for about a year now and for some reason the motion detection either stopped working or my ISP is stopping the emails. Weird thing is the test emails go through but not the attached email images.

    I’ve been lazy about setting up an FTP server but your article has inspired me to give it a go. I also would like the log files to post and as you know they only work to FTP or to a NAS device. At first I liked getting the images emailed to me but after thinking about it I guess it really isn’t that critical to see the images at the time the motion detection is tripped. I guess it would be cool to call the cops but as long as I have images of the crooks or maybe a license number I could still call the cops. Anyway, I have a feeling it will work better going to an FTP or NAS and just leave the email alert go without the image attachments. Have you tried ZoneMinder for Linux by any chance?

    Great article. Thanks
    Bill T. St. Louis, MO USA

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: