Thursday, 18 October 2007

Turning your N800 into a webcam with motion

Here's an excellent application for the rubbish camera in the N800. It's called motion, and some equally excellent chappie called konfoo announced on Internet Tablet Talk that he has compiled it for the N800. Nice work, konfoo fellah!

Once it's running, point your N800 at anything you want to monitor, and you can check out what the N800 is seeing, updated every few seconds, from Firefox or a Mozilla based browser over the Internet. That's because it has a built in web server on port 8081
It works like this "out of the box", and by the looks of things you can configure it to save photos when there's motion detected, take video and so on.

If you want to give it a go, download it here onto your computer. Then here's the method I used to get it going.

1. Open the zip file, and copy motion and motion.conf on to your external card using a USB connection.

2. Start Xterm, become root, then create a directory called motion in your home user folder:

# cd /home/user
# mkdir motion

then copy the two files you put on your external card into this new directory:

cp /media/mmc1/motio* /home/user/motion

(the * is a wildcard, and will copy both motion and motion.conf (and anything else you have in that location which starts with motio))

3. To start motion, go to the motion folder and type motion:

# cd /home/user/motion
# ./motion

4. Now open firefox or mozilla and type in the local lan address of your N800. Check out the pictures!

5. If you want to access the images over the Internet, make sure your N800 always gets the same local IP address, and make sure your router has a fixed IP address or that you have signed up with dyndns (check out the VNC post from a while back in this blog if you need to find out what all this means). Then simply forward traffic on port 8081 to your N800's LAN address.

Now leave your N800 in the living room and spy on your little brother/the babysitter/your roommates/ your wife / whatever... In fact, don't do that. Point it at yourself and let the world see you. If you're lucky you'll catch me writing this blog for a few days at mfresh.plus.com:8081 Guess I am asking for my n800 to be hacked, but there we go.

14 comments:

Mustalinux said...

Nice! Got it working in no time.

Problem is, I am not sure why I will use this remotely. I haven't left home without the N800 since I bought it :)

Mustalinux said...

Nice! Got it working in no time.

Problem is, I am not sure why I will use this remotely. I haven't left home without the N800 since I bought it :)

LittleNibble said...

It doesn't run on my N800 upgraded to OS2008:

Nokia-N800-50-2:/home/user/motion# ./motion
[0] Processing thread 0 - config file motion.conf
[0] Unknown config option "ffmpeg_cap_new"
[0] Unknown config option "ffmpeg_cap_motion"
[0] Unknown config option "ffmpeg_timelapse"
[0] Unknown config option "ffmpeg_timelapse_mode"
[0] Unknown config option "ffmpeg_bps"
[0] Unknown config option "ffmpeg_variable_bitrate"
[0] Unknown config option "ffmpeg_video_codec"
[0] Unknown config option "ffmpeg_deinterlace"
[0] Unknown config option "movie_filename"
[0] Unknown config option "timelapse_filename"
[0] Unknown config option "sql_log_image"
[0] Unknown config option "sql_log_snapshot"
[0] Unknown config option "sql_log_mpeg"
[0] Unknown config option "sql_log_timelapse"
[0] Unknown config option "sql_query"
[0] Thread 1 is from motion.conf
[1] Thread started
[1] cap.driver: "omap24xxcam"
[1] cap.card: "omap24xxcam"
[1] cap.bus_info: ""
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] v4l2_select_input: name = "camera", type 0x00000002, status 00000000
[1] - CAMERA
[1] Supported palettes:
[1] 0: UYVY (YUYV (YUV 4:2:2), packed)
[1] 1: RGBP (RGB565, le)
[1] Test palette UYVY (320x240)
[1] Error setting pixel format.
[1] VIDIOC_S_FMT: Device or resource busy
[1] ioctl (VIDIOCGCAP): Invalid argument
[1] Capture error calling vid_start
[1] Thread finishing...
Nokia-N800-50-2:/home/user/motion#

joshuavidana said...

on the last step, it says permission denied...

joshuavidana said...

on the last step, it says permission denied...

joshuavidana said...

on the last step, it says permission denied...

Paul Rubens said...

Are you running as root?

Anonymous said...

permission denied
chmod 777 motion
./motion
starting...
but doesn't work on N810
Video device fatal error

Stephanie said...

Finally got this to work, yah!

I had to pop out the camera first, shut down the application that was launched automatically and then launch the program.

This is all on OS2008 as well.

BlueWolf said...

I'm getting a 404 error in the zip link :-(

Paul Rubens said...

Try the updated link in the posting now, which should be correct

dosanji said...

Paul, thanks for this guide but I couldn't get it to work. You say "Open the zip file" but the "download it here" link points to a deb file, which looks easier to install.

But I tried it, and I see "Start Motion" and "Stop Motion", but no indication that it's running. How do I proceed? Thanks.

Skye said...

Paul,

I tried running this on the N800, OS2008 Chinook, and I can get it to run -once-, but when it stops, any subsequent attempts to run it results in the normal scroll but the end is:

[1] v4l2_next: VIDIOC_DQBUF: Input/output error
[1] Resuming operation... this may be a N800 quirk
[1] v4l2_next: VIDIOC_QBUF: Invalid argument
[1] Video device fatal error - terminating camera thread
[1] Thread exiting
[1] Somebody stole the video device, lets hope we got his picture: Invalid argument
[0] Motion terminating

If I run a camera application, the camera works just fine. Stopping the program, and motion complains again until I reboot the tablet. Any ideas?

Paul Rubens said...

Hi Skye,

I'm afraid I don't really use my N800 much anymore, so I can't help. Maybe someone else who reads this blog can....

 
© Copyright 2007-2008