Has anyone successfully gotten the motion package to run on the Yun? http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideGettingItRunning#Command_Line_Options
There is a post here indicating someone got it to work but I can't duplicate the success. https://www.open-electronics.org/an-arduino-yun-security-guard/
Two example issues. First, snapshots motion takes are garbled, a bit like a jigsaw puzzle. Secondly, if I set it up to support streaming to remote browsers it crashes on start up (looks like it can't determine the IP address correctly). Having motion on a Yun would be awesome but I'm at a loss how to troubleshoot these issues.
http://forum.arduino.cc/index.php?topic=222919.msg1617800#msg1617800
The heart of system is software motion which does exist at linino, but unfortunately up stream OS openwrt broken the support ffmpeg at motion. wait Arduino TRE is best bet ( or compile motion yourself). The motion will alert you via text message or web service of image or video which allow you view via internet.
Thanks for the pointer. Solutions such as a PIR or a mat won't work for what I'm trying to do.
Is your comment implying that if I build motions on a Yun rather than installing from opkg it will work?
Cross build ipk and clear opkg cache and force install since new Yun image has it. (but unfortunately up stream OS openwrt broken the support ffmpeg at motion I guess people get it work modify source).
Did you test motion from new Yun image?
I am using it on a brand new Yun that I installed the update on (before install motion and other packages). I'm not sure I understand your instructions but will try to research what they mean.
By the way it looks like the version of motion opkg installed is 20110826-051001-2. Not sure how to interpret that though.
waiting comment from software team next morning?
roadfun:
By the way it looks like the version of motion opkg installed is 20110826-051001-2. Not sure how to interpret that though.
Just checked the Makefile: it's the version motion's developers packed on August 26th, 2011. Latest is from 2012 http://www.lavrsen.dk/sources/motion-daily/
This isn't hard to compile. I am currently wrassling with getting the latest OpenWrt-yun tree to compile so I compiled against the old tree. The binary seems to run fine on the latest image though. If anyone wants to try it there is a copy at:
Here is the conf file that works fairly well with my Logitech Orbit Sphere
https://www.dropbox.com/s/kki9i55n21b36al/motion-dist.conf
There several things that don't work but this will detect motion and save a jpg of it to /tmp.
Things that do work:
Streaming something to port 8081
Many of the controls on port 8080
Problems:
Streamed image is close to unidentifiable
Pan/Tilt control doesn't work
The executable above can be run by copying it and the conf file to /root on the Yun and executing:
root@Arduino:~# /root/motion -c /root/motion-dist.conf
This was compiled by untarring the source next to the OpenWrt-Yun tree and running:
STAGING_DIR=<path to tree>/staging_dir
export STAGING_DIR
CFLAGS=-I<path to tree>/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include
export CFLAGS
LDFLAGS=-L<path to tree>/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib
export LDFLAGs
CC=<path to tree>/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-uclibc-gcc
export CC
./configure --without-optimizecpu --without-sdl --without-mysql --without-pgsql --without-sqlite3 --host=mips-openwrt-linux-uclibc --without-ffmpeg
mkdir <path to tree>/staging_dir/usr/include/linux
cp <path to tree>/build_dir/target-mips_r2_uClibc-0.9.33.2/fswebcam-20110717/videodev.h <path to tree>/staging_dir/usr/include/linux
make
I'll try to put together an install-able package when I get the current image built.
Thanks NoblePeeper. When you say the streamed image is "unidentifiable" I assume you mean that although the motion you built is running it isn't really usable yet because the image that is streamed isn't clear (at least not if you want to do streaming).
Yes, the streamed image is very strange, mostly black and blue but the shapes are close.
To one of your original issues, the "jigsaw" effect, I had jpg's that would fit that description at first. The conf file I posted has daemon off and setup on so you get lots of debug messages. I was seeing
[1] [NTC] [VID] v4l2_set_pix_format: Config palette index 0 (S910) doesn't work.
[1] [NTC] [VID] v4l2_set_pix_format: Supported palettes:
[1] [NTC] [VID] v4l2_set_pix_format: (0) MJPG (MJPEG)
[1] [NTC] [VID] v4l2_set_pix_format: 0 - MJPEG (compressed : 1) (0x47504a4d)
[1] [NTC] [VID] v4l2_set_pix_format: (1) YUYV (YUV 4:2:2 (YUYV))
[1] [NTC] [VID] v4l2_set_pix_format: 1 - YUV 4:2:2 (YUYV) (compressed : 0) (0x56595559)
[1] [NTC] [VID] v4l2_set_pix_format Selected palette YUYV
[1] [NTC] [VID] v4l2_do_set_pix_format: Testing palette YUYV (320x240)
[1] [WRN] [VID] v4l2_do_set_pix_format: Adjusting resolution from 320x240 to 1024x576.
[1] [NTC] [VID] v4l2_do_set_pix_format: Using palette YUYV (1024x576) bytesperlines 2048 sizeimage 1179648 colorspace 00000008
when I found the correct palette (for me 8 was the magic number) the jpgs were a lot better, then I used the control interface on port 8080 to adjust brightness, contrast, etc to get to a "good" image. The palette is set down around line 70 in the conf file.
Motion can be really cranky until you get the setup right!
Just one last point, motion performs about the same on my desktop as the Yun, it has always given me fits.
On the Yun I suspect there may be a problem with the UVC driver. fswebcam also reports errors and sometimes outputs jumbled images.
It is hard to say where the problems originate, I would think that being able to get a good jpg would mean a mjpg stream would be there too.
If all you are after is streaming this thread got me there. Guide to Setup Streaming Web Cam on the Yun - Arduino Yún - Arduino Forum
Motion has been a pet project for me getting ffmpeg is next. I think openwrt core people concentrate on router applications. This embedded system stuff isn't a itch they want to scratch.
Motion has some impressive capabilities but some cameras don't play well with it.
I have streaming working fairly well with mjpeg_streamer. There is some glitchiness but it is pretty good, and seems stable. I've had it streaming for days.
I'd like to be able to detect motion in the image and start recording or taking snapshots, which is why I've been tinkering with motion. It seems like motion tries to do too much. Unfortunately I don't have the hours it would take to create something purpose-built to what I want.
Motion does have many capabilities which leads to complexity.
My objective is a backporch cam to feed a website with the activity at the hummingbird feeder and dog food bowls. Maybe you can put my hours to use if I get there, makes it seem more worthwhile if someone else finds value
Slightly different application than yours but the software needed would be the same. Please do keep me/us posted! Given how many posts I see about projects like this I don't think your effort would go to waste.