Jump to content

Successful Logitech C270 Webcam + motion installation


makama80

Recommended Posts

This post is to share my successful webcam installation with Armbian and one of my SBC’s (orange pi plus).

 

I’ve used a Logitech C270 which can be purchased from eBay for roughly 20 Euros. Also el-cheapo shops like lightinthebox sell the C270. Benefit of such a cam is that you now have a cable from your SBC to your cam which makes (physical) cam installation easier IMHO. Also IMHO the C270 is a better camera than the famous GC2035, but it is also more expensive. Price / 'bang for the buck' ratio is more or less the same for both camera’s if you ask me. You get what you pay for.

 

Enough talk now: the installation

 

All I did was a fresh Armbian desktop v5.20 installation. The Armbian desktop version makes file editing easier, but is not mandatory. Nano / vim etc. can do this job via SSH as well. Performed the usual ‘apt update’ and ‘apt upgrade’ + reboot after installation. Then after restart ‘apt install xrdp tightvncserver motion’. xrdp and tightvncserver enable remote desktop. This is not needed for camera operation, but makes life easier… you can now access your Armbian installation with the Microsoft remote desktop protocol. The C270 camera works right out of the box and is auto-detected by Armbian. Also the needed modules are loaded automatically (use the lsusb and lsmod commands to see it).

 

Now edit /etc/motion/motion.conf with your favourite editor. 

 

Highest resolution I could get from the C270 camera is 1280x960. (search for ‘width’ and ‘height’) and adapt accordingly.

 

Find ‘stream_localhost’ and turn it off. Otherwise you won’t be able to http-stream to other computers.

 

Change ‘target_dir’ to anything you like, but preferably a folder outside of your armbian board with more storage capacity. Movies are rather large and may fill up your sd card or EMMC quickly. Make sure motion has writing privileges in the folder you choose.

 

Then (very important!) edit /etc/default/motion and set “start_motion_demon†to “yesâ€. Otherwise the daemon won’t start. 

 

Now a ‘sudo service motion restart’ should start motion. A ‘sudo service motion status’ might provide more info about issues.

Then the magical moment: direct your browser to http://your_armbian_board_address:8081 and it should provide the stream of your camera. When movement is detected, avi files are stored in the folder you’ve entered in motion.conf.

 

Further you can tweak some settings from /etc/motion/motion.conf according you your needs. I have disabled ‘output_pictures’ because I am not interested in a JPG file along with a movie file. The default motion detection threshold of 1500 works fine for me (recording backyard).

 

Every time you change something in /etc/motion/motion.conf you have to issue a ‘sudo service motion restart’ to load the new parameters. Always keep a copy of a working motion.conf file; this is helpful in case of mistakes / typos etc.

 

 

 

 

Good luck!

Link to comment
Share on other sites

It's good to know that motion works almost out of the box with Armbian. Back in time i was tried to do something similar with motion in OpenWrt and one IP camera, but not very successful (hard to configure, low framerate and res). But those Pi-s are more powerful than mips routers.

Link to comment
Share on other sites

I hope the screenshot helps you out.

 

Please refer to the screenshot. Note that this shows load during a http livestream to one of my computers (not recording, only streaming) and my opi+ is in a closed acrylic case without a fan (which I am going to install after this post). So the temperature is somewhat elevated.

 

CPU load is quite acceptable I guess... Off course during recording it's much higher, but the OPI+ is capable of handling recording also quite wel...

 

 

post-1540-0-79154800-1482832363_thumb.jpg

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines