more G-Labs products

Author Topic: View Raspberry Pi 2 USB camera  (Read 2580 times)

January 10, 2016, 08:04:40 PM
Read 2580 times

mellery

  • *
  • Information
  • Newbie
  • Posts: 6
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
« Last Edit: January 11, 2016, 02:17:52 AM by mellery »

January 11, 2016, 02:12:55 AM
Reply #1

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
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

January 11, 2016, 02:49:37 AM
Reply #2

mellery

  • *
  • Information
  • Newbie
  • Posts: 6
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

January 11, 2016, 09:45:34 AM
Reply #3

petediscrete

  • ****
  • Information
  • Sr. Member
  • Posts: 220
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.

January 11, 2016, 12:04:02 PM
Reply #4

mellery

  • *
  • Information
  • Newbie
  • Posts: 6
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?

January 12, 2016, 03:30:33 AM
Reply #5

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
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

January 12, 2016, 04:30:56 AM
Reply #6

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
I try reversing my change, and now I always get CameraCaptureV4L.so missing
not libCameraCaptureV4L.so

January 12, 2016, 05:31:01 AM
Reply #7

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
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 ?

January 17, 2016, 01:25:17 PM
Reply #8

mellery

  • *
  • Information
  • Newbie
  • Posts: 6
anyone have any ideas or need more info from me?   Thanks

January 19, 2016, 01:17:16 AM
Reply #9

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
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.

January 24, 2016, 05:23:08 PM
Reply #10

mellery

  • *
  • Information
  • Newbie
  • Posts: 6
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, but that doesn't work either.

January 25, 2016, 01:59:41 AM
Reply #11

petediscrete

  • ****
  • Information
  • Sr. Member
  • Posts: 220
Try 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.

February 17, 2016, 06:55:01 PM
Reply #12

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
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