Kindly help requested by using my ip camera as motion sensor

Moderator: leecollings

BaliBiker
Posts: 11
Joined: Saturday 30 January 2016 16:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Kindly help requested by using my ip camera as motion sensor

Post by BaliBiker »

As this is my first post I would like to introduce myself shortly.
I'm Jeroen, I'm from the Netherlands and using Domoticz with great pleasure. So many thanks to all developers. You all did and do a great job!

I'm trying to get my ip camera working as motion detection as described in the Wiki "1.4 Using your camera as motion sensor".
I can't get this working and as I'm a starter I don't even know were to look. So I hope some of you can help me through.

I followed the wiki.
- I added my camera (Foscam FI9805W) to Domoticz. It shows a proper picture. So I believe the ImageURL I inserd is correct.
- I installed the motion package as expland in the wiki
- I set up a dummy motion-sensor in Domoticz
- I can switch the dummy sensor by "http://192.168.178.21:8080/json.htm?typ ... tchcmd=Off"
- In the file /etc/motion/motion.conf I added at the end
on_event_start /usr/bin/curl -s "http://192.168.178.21:8080/json.htm?typ ... itchcmd=On"
on_event_end /usr/bin/curl -s "http://192.168.178.21:8080/json.htm?typ ... tchcmd=Off"
- In the file /etc/motion/motion.conf I also added the same ImageURL as I added to Domoticz. I placed it under 'Capture device options'

As the dummy sensor doesn't react om any movement in front of my ip camera I'm sure I miss something.
Anyone an idea?
Gabe
Posts: 44
Joined: Wednesday 17 February 2016 21:34
Target OS: -
Domoticz version:
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by Gabe »

Hi everybody,

I have exactly the same problem like BaliBiker. Has anybody a idea?

Thx
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by nayr »

it dont think it works like that, your foscam is doing the motion detection and it has to make the call to Domoticz... motion would have to process your stream and detect motion through its own software algorithms, and there is no way your RPi has the power to do that.

Ive implemented this functionality for Dahua's and here in a few hours Hikvisions too.. personally I'd suggest you get real security cameras instead of those shitty consumer webcams, you have no idea what your missing.

viewtopic.php?f=38&t=10604&p=75502#p75502
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by Egregius »

A Pi2 is perfectly capable of running the motion mmal stuff. At least with the camera connected directly. I have 2 of them operational.
Try searching a IP camera with 5 MP resolution? Good luck with that.
I wouldn't run this on the same Pi as Domoticz, get a dedicated one for the motion stuff.
Gabe
Posts: 44
Joined: Wednesday 17 February 2016 21:34
Target OS: -
Domoticz version:
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by Gabe »

hI Nayr,

Thx for info. i just look in your topic and you speak that maybe also Foscam work with it?!?

Is there a chance to find out how?

tHx
Gabe
Posts: 44
Joined: Wednesday 17 February 2016 21:34
Target OS: -
Domoticz version:
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by Gabe »

Hi everybody,

so it looks that I can now connect to the camera thourgh motion, but now I get follow log:

motion: [1] libjpeg decompression failure on first frame - giving up!

Do anyone has a idea, how I can fix it?

Thanks
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by nayr »

is it outputting a mjpeg stream or a x264?
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
Gabe
Posts: 44
Joined: Wednesday 17 February 2016 21:34
Target OS: -
Domoticz version:
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by Gabe »

Mjpeg stream

Thxs
sundberg84
Posts: 52
Joined: Sunday 17 May 2015 11:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Sweden
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by sundberg84 »

I have the same setup as you but not the last line:
- In the file /etc/motion/motion.conf I also added the same ImageURL as I added to Domoticz. I placed it under 'Capture device options'
You might have problems with privileges or authorisation. I need to add the user and password as well to json command in motion.conf or it wont work.
Controller: Domoticz (Raspberry PI)
Gateways: MySensors (Ethernet W5100), RFLink
Gabe
Posts: 44
Joined: Wednesday 17 February 2016 21:34
Target OS: -
Domoticz version:
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by Gabe »

Hi Sundberg84,

which camera you have also the Foscam 9805W?

If yes how you get Mjpeg stream?

Which http command you use in the motion.conf?

thanks
IDANIT
Posts: 73
Joined: Saturday 07 November 2015 10:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Poland
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by IDANIT »

I have the same problem. Everything works as it should, except for motion detection. No issues with Video streaming, taking pictures or voice communication. With MotionEye, motion detection works like charm, so it is not a problem with RPi power.

Domoticz V2.4739
Android Phone with "IP Webcam" software

motin.conf

Code: Select all

daemon on

ffmpeg_video_codec mpeg4

width 1280
height 720

on_event_start /usr/bin/curl -s "http://192.168.1.242:8088/json.htm?type=command&param=switchlight&idx=87&switchcmd=On"

on_event_end /usr/bin/curl -s "http://192.168.1.242:8088/json.htm?type=command&param=switchlight&idx=87&switchcmd=Off"

What we do wrong?
Gabe
Posts: 44
Joined: Wednesday 17 February 2016 21:34
Target OS: -
Domoticz version:
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by Gabe »

Hi Idanit,

you have check the logs of Motion and Domoticz?

Is there any error? Domotizc camera function for me also well only Motion not...
IDANIT
Posts: 73
Joined: Saturday 07 November 2015 10:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Poland
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by IDANIT »

Gabe wrote: you have check the logs of Motion and Domoticz?
I'm not an expert when it comes to Domoticz/Linux
Could you be more specific. When I check logs in Domoticz, (web page) I have no errors. But where I should look for Motion logs?
Gabe
Posts: 44
Joined: Wednesday 17 February 2016 21:34
Target OS: -
Domoticz version:
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by Gabe »

Iam also new as I have Domoticz only since one week, but try help as far as I can ;)

If you start Motion with sudo /etc/init.d/motion start which result you get?
Gabe
Posts: 44
Joined: Wednesday 17 February 2016 21:34
Target OS: -
Domoticz version:
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by Gabe »

pls aslo check the /var/log/Messages. I think there must be something in
IDANIT
Posts: 73
Joined: Saturday 07 November 2015 10:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Poland
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by IDANIT »

logs looks fine "motion daemon running" :oops: but it's not.
Gabe
Posts: 44
Joined: Wednesday 17 February 2016 21:34
Target OS: -
Domoticz version:
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by Gabe »

also noting indicatet in the Messages log???
IDANIT
Posts: 73
Joined: Saturday 07 November 2015 10:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Poland
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by IDANIT »

Gabe wrote:also noting indicatet in the Messages log???
cant find it.
It can be assumed that as in so many cases, this option does not work, it means that in Domoticz Motion Detection does not work at all.
viewtopic.php?f=35&t=922
Gabe
Posts: 44
Joined: Wednesday 17 February 2016 21:34
Target OS: -
Domoticz version:
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by Gabe »

could be I get it also finally not function...

I do it now through a Switch where I put motion on and off, rest will be done from the camera itself...
marmachine
Posts: 128
Joined: Saturday 26 March 2016 10:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Location: Netherlands
Contact:

Re: Kindly help requested by using my ip camera as motion sensor

Post by marmachine »

Hi Guys,

Im fairly new to Domoticz and Raspberry in the first place.
I seem to run into similar issues with my Foscam FI9900P; i have it successfully set up in Domoticz, but can't get it to work as a motionsensor which was basically my intention because i would like to send notification on motion.

Anyway, here's what i found, when looking for (didn't know where to find) motion logging;

If you are running motion in daemon mode, the output is logged to:
/var/log/messages (shows the activity of motion, but not generally any error messages, in my case this is empty)
/var/log/syslog (you will generally find the error messages here)

So now syslog gives me some direction;
Mar 26 06:27:20 raspberrypi motion: [1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
Mar 26 06:27:20 raspberrypi motion: [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input -1
Mar 26 06:27:20 raspberrypi motion: [1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0:

Although i have tested my on_event_start and on_event_end commands, i am pretty sure there still is something wrong in /etc/motion/motion.conf

Will look further into this, but any hints could be helpfull... again, i'm new to all this!

Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests