HomeGenie Forum

General Category => Troubleshooting and Support => Topic started by: mellery on January 10, 2016, 08:04:40 PM

Title: View Raspberry Pi 2 USB camera
Post by: mellery on January 10, 2016, 08:04:40 PM
I have a usb camera connected to my raspberry pi 2, I can view its output on /dev/video0 from the command line. 

Under HomeGenie settings > camera input I have /dev/video0 | 320x240 | 1 and the camera enabled, there's a camera icon on the top of the page next to a zwave icon (it is dimmer)

I'd like to add my camera display to the dashboard but can't figure out how, what do I do next?

Thanks

edit - it's a raspi 2
Title: Re: View Raspberry Pi USB camera
Post by: saue0 on January 11, 2016, 02:12:55 AM
Same problem with PS3 EYE.

Here is my log file 2016-01-10 19:56:45.9743 Debug Enabling Interface Media.CameraInput
2016-01-10 19:56:45.9987 Error System.DllNotFoundException: CameraCaptureV4L.so
  at (wrapper managed-to-native) MIG.Interfaces.Media.CameraInput/CameraCaptureV4LInterop:OpenCameraStream (string,uint,uint,uint)
  at MIG.Interfaces.Media.CameraInput.Connect () [0x00000] in <filename unknown>:0
  at MIG.MigService.EnableInterface (System.String domain) [0x00000] in <filename unknown>:0
  at MIG.MigService.StartService () [0x00000] in <filename unknown>:0
Title: Re: View Raspberry Pi 2 USB camera
Post by: mellery on January 11, 2016, 02:49:37 AM
I see the same error in my logs, is there something I should add to my path, or symlink somewhere?

pi@raspberrypi:/usr/local/bin/homegenie $ locate CameraCaptureV4L.so
/usr/local/bin/homegenie/lib/mig/libCameraCaptureV4L.so
/usr/local/bin/homegenie/lib/mig/v4l/debian64_libCameraCaptureV4L.so
/usr/local/bin/homegenie/lib/mig/v4l/debian64_libCameraCaptureV4L.so.gd3
/usr/local/bin/homegenie/lib/mig/v4l/raspbian_libCameraCaptureV4L.so
Title: Re: View Raspberry Pi 2 USB camera
Post by: petediscrete on January 11, 2016, 09:45:34 AM
Have you activated the Generic IP program in the Programs section. You then configure the IP Program widget and add it to your dashboard to view it's output.
Title: Re: View Raspberry Pi 2 USB camera
Post by: mellery on January 11, 2016, 12:04:02 PM
It's a usb camera connected to the pi, not a remote device, do I have to set up a webcam server on the pi and then connect to that?  Or can I connect directly to /dev/video0?
Title: Re: View Raspberry Pi 2 USB camera
Post by: saue0 on January 12, 2016, 03:30:33 AM
I Added this to the /etc/init.d/homegenie

PATH=/usr/local/bin/homegenie/lib/mig

and now the error is for : CameraCaptureV4L.so
2016-01-11 21:15:21.5602 Info WebServiceGateway   192.168.0.28   HTTP   GET   200 /api/MIGService.Interfaces/Media.CameraInput/IsEnabled.Set/1// [CLOSED AFTER 0,006 seconds]
  at MIG.Gateways.WebServiceGateway.OnPreProcessRequest (MIG.MigClientRequest request) [0x00000] in <filename unknown>:0
  at MIG.MigService.Gateway_PreProcessRequest (System.Object sender, MIG.ProcessRequestEventArgs args) [0x00000] in <filename unknown>:0
  at MIG.MigService.EnableInterface (System.String domain) [0x00000] in <filename unknown>:0
  at MIG.Interfaces.Media.CameraInput.Connect () [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) MIG.Interfaces.Media.CameraInput/CameraCaptureV4LInterop:OpenCameraStream (string,uint,uint,uint)
  at MIG.Gateways.WebServiceGateway.Worker (System.Object state) [0x00000] in <filename unknown>:0 System.DllNotFoundException: CameraCaptureV4L.so
Title: Re: View Raspberry Pi 2 USB camera
Post by: saue0 on January 12, 2016, 04:30:56 AM
I try reversing my change, and now I always get CameraCaptureV4L.so missing
not libCameraCaptureV4L.so
Title: Re: View Raspberry Pi 2 USB camera
Post by: saue0 on January 12, 2016, 05:31:01 AM
did a complete reinstall from scratsh. no trace of CameraCaptureV4L.so
But found /usr/local/bin/homegenie/lib/mig/v4l/raspbian_libCameraCaptureV4L.so
and /usr/local/bin/homegenie/lib/mig/libCameraCaptureV4L.so, witch are identical.

What is missing ?
Title: Re: View Raspberry Pi 2 USB camera
Post by: mellery on January 17, 2016, 01:25:17 PM
anyone have any ideas or need more info from me?   Thanks
Title: Re: View Raspberry Pi 2 USB camera
Post by: saue0 on January 19, 2016, 01:17:16 AM
I inally use an external app call webcam..... yes webcam....   
it create a jpg every 2 sec in a web dirctory. ans then i use the IP cam widget to get the image.

It will be great to be able tu use the real module.
Title: Re: View Raspberry Pi 2 USB camera
Post by: mellery on January 24, 2016, 05:23:08 PM
I installed motion on the raspi and can view it in a web browser and it works, but when I use that url as the address in homegenie it just says "connecting to camera" forever, I've also tried http://127.0.0.1:8081/image.jpg, (http://127.0.0.1:8081/image.jpg,) but that doesn't work either.
Title: Re: View Raspberry Pi 2 USB camera
Post by: petediscrete on January 25, 2016, 01:59:41 AM
Try http://yourcameraipaddress:portnumber/snapshot.cgi (http://yourcameraipaddress:portnumber/snapshot.cgi) in the in the generic ip camera widget and the username and password below in the relevant boxes if they apply for your camera.
Title: Re: View Raspberry Pi 2 USB camera
Post by: saue0 on February 17, 2016, 06:55:01 PM
Made it work perfectly with Motion.

The image is from a CGI offered by the motion developper that i had to compile.
   Name : nph-mjgrab

The motion detection is done by calling a script in motion.conf
  # Command to be executed when an event starts. (default: none)
  # An event starts at first motion detected after a period of no motion defined by event_gap
  on_event_start /Home-Automation/OnEventStart.sh

The sh command is
  curl http://localhost:8080/api/Media.IpCamera/1/Camera.MotionDetected (http://localhost:8080/api/Media.IpCamera/1/Camera.MotionDetected)