Multi-Camera Motion EyeOS System ?

3,048 views
Skip to first unread message

Mike

unread,
Jan 22, 2018, 5:34:30 AM1/22/18
to motioneye

Hello,


  I am considering setting up a basic home security system and want to make sure my concept is workable before i rush out and start buying a bunch of parts only later to find I made some bad assumptions.


  I have seen a few posts about using Motion EyeOS for a single camera feed web accessible. However what I was thinking of doing is a little bit more / different.


  My thought is to use several Raspberry Pi Zero W cameras like this from Adafruit -

https://www.adafruit.com/product/3414  to place around my home to monitor areas of concern. Then I would use a Raspberry Pi 3 as the main web host to provide access to all the camera feeds. I anticipate having a minimum of four cameras to start and it could grow to about eight cameras later on as all the bugs are ironed out.


  For video storage I plan to NFS mount my home NAS to the Pi 3 . 


  I have already created a simple time-lapse system that takes pictures one per minute and then writes them to my NAS thru NFS. My test system is loosely based on this great project on Adafruit - https://learn.adafruit.com/raspberry-pi-wearable-time-lapse-camera?view=all  (my camera is fixed - not mobile and just looks out our back window) however the directory I write the images to is the NFS mounted directory not to the SD card.



  The questions that are coming to mind are these:

- Should I use the same Motion EyeOS on the Pi Zero W that I use on the Pi 3? 

          Which Motion EyeOS release would I use on the Pi Zero W? 

  Or would I set up the Pi Zero W camera systems differently?  Diff OS ?


- Is it possible to set up NFS mounts on the Pi 3 running the Motion EyeOS?


- Is there an upper limit to the number of cameras Motion EyeOS on a Pi 3 can handle?



  I know this is just the tip of the iceberg so to speak. Any other inputs / things I should consider before tackling this project?



  Initially, I would just like the multiple Pi Zero W Cameras to feed to a Pi 3 for a consolidated web view that can access all the feeds. Eventually I would like to be able to trigger additional actions from the Pi 3’s GPIO pins. Such as turning on lights, setting off alarms, sending text messages, etc.



Cheers,

  Mike

Message has been deleted

Ben

unread,
Jan 23, 2018, 12:18:55 AM1/23/18
to motioneye
You can use the rPi3 to monitor several network cameras. That might be your best bet if you are really wanting to use the Pi zeros. This method will not allow you to use motion or the motioneyeOS capabilities (if I remember correctly)

If I wanted to build a home security system with 8 cameras, then I would use two rPi3s and connect 4 USB webcams to each. This might cause some power issues depending on the cameras you would use. I would also run a direct ethernet cable to each device if possible. The motion notifications that motioneyeOS can do on rPi3 are very helpful. If you add 8 wifi devices for Pi zero you are also going to want a high end router to handle all of the internet usage.

Mike

unread,
Jan 23, 2018, 5:47:12 AM1/23/18
to motioneye
My main reason for considering the Pi Zero W's was how I was considering placing the camera modules and the cable runs required to connect the cameras to a Pi 3.

For example on my garage I wanted to place 4 cameras. One would point at the driveway and then three more covering the sides and back. This would be a slight distance away from the Pi 3 running as the web host. My main concern being potentially long USB runs. Since the USB spec states a max run of about 5 meters, most of the cable runs would right at or exceed this length. 

However, a wifi shot would not be a problem and running a power line to supply a few Pi Zeros would also not be a problem.

You bring up another thing to consider - if I run with the Pi Zero camera modules running motionEyeOS and set them up as additional cameras on the Pi 3 web host, from what you are saying the Pi 3 would not be able to do the motion detection / notification from those cameras? So does motionEyeOS only handle motion detection / notification from directly connected (e.g., USB) cameras?

Your recommendation to use multiple Pi 3s to monitor different cameras is a good idea. I may have to explore that one a bit more as well.

Thanks for the response, I may just have to set up a small test bed to check out more potential issues I will run into.

Mike

Calin Crisan

unread,
Jan 23, 2018, 6:08:26 AM1/23/18
to motioneye
Hi Mike,

motionEyeOS can do the motion detection and will offer all of its goodies for both locally connected and network cameras, provided that you add them as... well, local or network cameras. Your Pi Zeros, assuming they will run motionEyeOS on Fast Network Camera mode, won't be able to do that locally, but you don't want or need that. You want your Pi3 to do it for you and it will.

Regarding the connection wires, I strongly recommend using Ethernet cables between your Pi3 and your actual Pi units with camera attached. I know you can't have that (easily) with Pi Zero, but it may be worth investing in other models that have an Ethernet port or even buy a Pi Zero ethernet adapter. Wireless connectivity is a valid solution but is highly discouraged when it comes to video streaming, given that it will basically pollute your 2.4GHz spectrum. Keep in mind that it's video streaming, which is basically equivalent to 4 clients continuously downloading or uploading via WiFi. Alternatively, you could reduce the framerate or resolution so much that the traffic is insignificant. Or you could configure a separate WiFi router (running on a separate channel) just for your cameras.

Alex Visan

unread,
Jun 16, 2018, 3:50:40 AM6/16/18
to motioneye
Calin,

I've had a real tough time getting more than 2 cameras to work with a Raspberry Pi 3 B+. I think the USB bus is fully saturated even at the lowest possible setting. Using usbtop, I determined that my USB cameras run nominally around 15Mbps. While USB 2.0 (which is still on the Pi3 for some reason) has 480 Mbps theoretical, I seem to only be able to pull around 35 Mbps max when using 4 cameras. This of course drops the performance of each camera to fit within that ~35 Mbps window....

I've tried these commands, no luck:
sudo rmmod uvcvideo
sudo modprobe uvcvideo nodrop=1 timeout=5000 quirks=0x80

Also tested with no Ethernet connection (found out USB bus and NIC shares the same chip.

Please let me know if there is something I'm missing, plan on testing with the latest Odroid because it has USB 3.0 and decent specs.

jakeb...@gmail.com

unread,
Jun 17, 2018, 2:49:00 PM6/17/18
to motioneye
Just my two cents:

  • RPi Zeros work fantastic as Fast Network Camera's but with a lot of cameras (more than two) I would forget about them. They are great for the awkward locations where it is difficult to run ethernet but not a long term solution in my opinion. This does push up the cost unfortunately. From my experience perfect but expensive solution is RPi 3 with POE. (official board not available to order yet but other brand available) Second Best is RPi 2 but then you have ethernet & power cables.
  • You selected the new version (8MP) of the RPi camera, personally I find the images on the old (5MP) camera better. I'm not really sure why. Also there is no night vision with the RPi cameras, the same camera is available with IR cut filter though from other vendors.
  • The RPi 3 doesn't seem to be up to the job of being the "server"/"NVR" of a lot of cameras, This is something I'm trying to get an answer on but finding it impossible. Odroid-C2 or XU4 may be a better option here, I have no idea if more cores equal better performance with MotionEyeOS or even MotionEye

Alex Visan

unread,
Jun 23, 2018, 1:27:32 AM6/23/18
to motioneye
Got an Odroid UX4 in and ran the same tests. This time I can't get more than 1 camera showing at a time....quite peculiar. I've installed the MotionEyeOS for UX4 as well as Ubuntu 16 and 18 for UX4 configurations. I come up with the same issue : /

I've tried editing the /etc/modules hack
https://raspberrypi.stackexchange.com/questions/27737/unable-to-open-video-device-and-grey-screen

Unfortunately all the info I'm finding online doesn't mention the Odroid. Different configurations I've tried led to one camera working, the rest grayed out. I even unplugged the working one and immediately a non working camera come online :( I boiled it down to 2 and pasted the logs below.

I find it very hard to believe this system won't work, I'm using as vanilla configuration as possible, all my cameras show up corrected.

Anything I should try?

```
root@odroid:/home/odroid# v4l2-ctl --list-devices
decoder ():
    /dev/video6
    /dev/video7

USB 2.0 Camera (usb-xhci-hcd.2.auto-1.1):
    /dev/video2

USB 2.0 Camera (usb-xhci-hcd.2.auto-1.2):
    /dev/video0
```

```
root@odroid:/home/odroid# cat /var/log/motion.log
[501056] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motioneye/motion.conf
[501056] [NTC] [ALL] config_thread: Processing config file thread-2.conf
[501056] [NTC] [ALL] config_thread: Processing config file thread-3.conf
[501056] [ALR] [ALL] conf_cmdparse: Unknown config option "webcontrol_parms"
[501056] [NTC] [ALL] motion_startup: Motion 3.2.12+git20140228 Started with SDL support
[501056] [NTC] [ALL] motion_startup: Logging to syslog
[501056] [NTC] [ALL] motion_startup: Using default log type (ALL)
[501056] [NTC] [ALL] motion_startup: Using log type (ALL) log level (WRN)
[2] [WRN] [VID] v4l2_select_input: Device doesn't support VIDIOC_G_STD
[1] [WRN] [VID] v4l2_select_input: Device doesn't support VIDIOC_G_STD
[1] [ERR] [VID] v4l2_set_mmap: Error starting stream. VIDIOC_STREAMON: No space left on device
[1] [ERR] [ALL] motion_init: Error capturing first image
[1] [ERR] [ALL] motion_loop: Video device fatal error - Closing video device
[1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[1] [ERR] [VID] v4l2_select_input: Error selecting input 0 VIDIOC_S_INPUT: Device or resource busy
[1] [ERR] [ALL] motion_loop: Video device fatal error - Closing video device
[1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[1] [ERR] [VID] v4l2_select_input: Error selecting input 0 VIDIOC_S_INPUT: Device or resource busy
[1] [ERR] [ALL] motion_loop: Video device fatal error - Closing video device
[1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video1: No such file or directory
[1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video1: No such file or directory
[2] [ERR] [VID] v4l2_next: VIDIOC_QBUF: No such device
[2] [ERR] [ALL] motion_loop: Video device fatal error - Closing video device
[1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video1: No such file or directory
[2] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[2] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0: No such file or directory
[1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video1: No such file or directory
[2] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[2] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0: No such file or directory
[1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video1: No such file or directory
[2] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[2] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0: No such file or directory
[1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video1: No such file or directory
[2] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[2] [WRN] [VID] v4l2_select_input: Device doesn't support VIDIOC_G_STD
[1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video1: No such file or directory
[1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video1: No such file or directory
[2] [ERR] [VID] v4l2_next: VIDIOC_QBUF: No such device
[2] [ERR] [ALL] motion_loop: Video device fatal error - Closing video device
[2] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[2] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0: No such file or directory
[1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video1: No such file or directory
[2] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[2] [WRN] [VID] v4l2_select_input: Device doesn't support VIDIOC_G_STD
[1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video1: No such file or directory
[1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
[1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video1: No such file or directory
```

dmesg
```
[  104.943979] [c2] 6:3:1: cannot get freq at ep 0x84
[  125.288083] [c1] usb 3-1.1: new high-speed USB device number 7 using xhci-hcd
[  125.390864] [c1] uvcvideo: Found UVC 1.00 device USB 2.0 Camera (05a3:9310)
[  125.404451] [c1] input: USB 2.0 Camera as /devices/usb.1/12000000.dwc3/xhci-hcd.2.auto/usb3/3-1/3-1.1/3-1.1:1.0/input/input5
[  125.423195] [c1] 7:3:1: cannot get freq at ep 0x84
[  139.437615] [c1] usb 3-1.2: USB disconnect, device number 6
[  139.439633] [c5] uvcvideo: Failed to resubmit video URB (-19).
[  149.598141] [c1] usb 3-1.2: new high-speed USB device number 8 using xhci-hcd
[  149.678776] [c1] uvcvideo: Found UVC 1.00 device USB 2.0 Camera (05a3:9310)
[  149.692150] [c1] input: USB 2.0 Camera as /devices/usb.1/12000000.dwc3/xhci-hcd.2.auto/usb3/3-1/3-1.2/3-1.2:1.0/input/input6
[  149.711174] [c1] 8:3:1: cannot get freq at ep 0x84
```
Reply all
Reply to author
Forward
0 new messages