Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
  • 1
  • 8
  • 9
  • 10(current)
  • 11
  • 12
  • 15
Release Foscam HD - Video feed with camera controls, and motion/sound detection preview
(2014-12-06, 10:17)freddy12 Wrote:
(2014-12-04, 23:22)Leopold Wrote: I just tried it out with a Y-cam camera and it worked. Settings are stored in ~/.xbmc/userdata/addon_data/script.ipcam/settings.xml. Mine is

Code:
<settings>
    <setting id="debug" value="0" />
    <setting id="url" value="rtsp://user:password@camera/live_mpeg4.sdp" />
</settings>

any chance you could merge the latest fastforward trick into the multi camera git, also when i try to install that i get a dependencie not met

I tested the fastforward thing and got inconsistent results. Sometimes it made no difference at all. I'll try it again when I get a chance. The multiple_cameras branch was something I started to work on a while ago but it's not up to date with master. This commit fixed the dependency problem.
Leopold's Repository: Home of LibreELEC Dev Updater ...
Reply
(2014-12-09, 06:28)Leopold Wrote:
(2014-12-06, 10:17)freddy12 Wrote:
(2014-12-04, 23:22)Leopold Wrote: I just tried it out with a Y-cam camera and it worked. Settings are stored in ~/.xbmc/userdata/addon_data/script.ipcam/settings.xml. Mine is

Code:
<settings>
    <setting id="debug" value="0" />
    <setting id="url" value="rtsp://user:password@camera/live_mpeg4.sdp" />
</settings>

any chance you could merge the latest fastforward trick into the multi camera git, also when i try to install that i get a dependencie not met

I tested the fastforward thing and got inconsistent results. Sometimes it made no difference at all. I'll try it again when I get a chance. The multiple_cameras branch was something I started to work on a while ago but it's not up to date with master. This commit fixed the dependency problem.
thanks that fixed the dependency thing i tried to fix it myself but didnt know to change the request line, is their a way to run 2 foscam hd add ons on the same kodi system? could set one to bottom corner and other to a different one
Reply
I am not getting preview / alarm is not triggering.When I click the script it opens full screen and shows the camera.

Under alarm it is set to Motion and sound
sensitivity high, trigger 1 sec

I just enabled logging but don't see where it is saving them

I am on Kodi (14.0) plugin versoin .21


Hummmm when I rt click and do info on the addon (in programs) Status says disabled...


IF I click disable enable I get a short 'script error" pop up
Reply
(2015-02-01, 04:21)dna3e8 Wrote: I am not getting preview / alarm is not triggering.When I click the script it opens full screen and shows the camera.

Under alarm it is set to Motion and sound
sensitivity high, trigger 1 sec

I just enabled logging but don't see where it is saving them

I am on Kodi (14.0) plugin versoin .21



Hummmm when I rt click and do info on the addon (in programs) Status says disabled...


IF I click disable enable I get a short 'script error" pop up
Camera is FI981w V2

seams to crash when Alarm is triggered

http://xbmclogs.com/show.php?id=410566
Reply
(2015-02-01, 04:41)dna3e8 Wrote:
(2015-02-01, 04:21)dna3e8 Wrote: I am not getting preview / alarm is not triggering.When I click the script it opens full screen and shows the camera.

Under alarm it is set to Motion and sound
sensitivity high, trigger 1 sec

I just enabled logging but don't see where it is saving them

I am on Kodi (14.0) plugin versoin .21



Hummmm when I rt click and do info on the addon (in programs) Status says disabled...


IF I click disable enable I get a short 'script error" pop up
Camera is FI981w V2

seams to crash when Alarm is triggered

http://xbmclogs.com/show.php?id=410566
What firmware version is installed? Can you post a debug log?
Leopold's Repository: Home of LibreELEC Dev Updater ...
Reply
(2015-02-04, 00:46)Leopold Wrote:
(2015-02-01, 04:41)dna3e8 Wrote:
(2015-02-01, 04:21)dna3e8 Wrote: I am not getting preview / alarm is not triggering.When I click the script it opens full screen and shows the camera.

Under alarm it is set to Motion and sound
sensitivity high, trigger 1 sec

I just enabled logging but don't see where it is saving them

I am on Kodi (14.0) plugin versoin .21



Hummmm when I rt click and do info on the addon (in programs) Status says disabled...


IF I click disable enable I get a short 'script error" pop up
Camera is FI981w V2

seams to crash when Alarm is triggered

http://xbmclogs.com/show.php?id=410566
What firmware version is installed? Can you post a debug log?

System firmware: 1.4.1.6
Application firmware 2.11.2.8

http://xbmclogs.com/show.php?id=414261
Reply
Same 'Username required\n' debug error on motion alert with a FI9831P - exception thrown with error including debug entry below:

System version 1.4.1.10 / Application firmware 2.11.1.118

Running Openelec Kodi 14.1 on ARM7

20:14:12 T:1815651392 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.ValueError'>
Error Contents: invalid literal for int() with base 10: 'Username required\n'
Traceback (most recent call last):
File "/storage/.kodi/addons/script.foscam/service.py", line 167, in <module>
Main()
File "/storage/.kodi/addons/script.foscam/service.py", line 33, in __init__
self.alarm_check()
File "/storage/.kodi/addons/script.foscam/service.py", line 162, in alarm_check
self.duration_shown = preview.start()
File "/storage/.kodi/addons/script.foscam/resources/lib/gui.py", line 103, in start
duration = self.extract_mjpeg.start()
File "/storage/.kodi/addons/script.foscam/resources/lib/utils.py", line 171, in start
frame = get_mjpeg_frame(self.stream)
File "/storage/.kodi/addons/script.foscam/resources/lib/utils.py", line 142, in get_mjpeg_frame
bytes = int(content_length.split(':')[-1])
ValueError: invalid literal for int() with base 10: 'Username required\n'
-->End of Python script error report<--


My settings.xml

<settings>
<setting id="check_interval" value="5" />
<setting id="debug" value="0" />
<setting id="host" value="192.168.1.18" />
<setting id="mjpeg" value="false" />
<setting id="motion_enable" value="true" />
<setting id="motion_sensitivity" value="0" />
<setting id="motion_trigger_interval" value="5" />
<setting id="password" value="REMOVED MY ACTUAL PASSWORD" />
<setting id="port" value="88" />
<setting id="preview_duration" value="10" />
<setting id="preview_position" value="Bottom right" />
<setting id="preview_scaling" value="1.000000" />
<setting id="sound_enable" value="false" />
<setting id="sound_sensitivity" value="1" />
<setting id="sound_trigger_interval" value="15" />
<setting id="username" value="admin" />
</settings>

Cheers!
Reply
Two changes fixed the motion detection pop up for my FI9831P camera.

1) Change in addons/script.foscam/resources/lib/utils.py
Alter the get_mjpeg_frame function to look like this. Seems sometimes the headers aren't consistent, or the previous frame doesnt end in a carriage return meaning you need a different number of readlines frame to frame. My change will keep reading the stream till it finds the content length header its looking for.

def get_mjpeg_frame(stream):
try:
content_length = stream.readline()
while not "Content-Length" in content_length:
content_length = stream.readline()
bytes = int(content_length.split(':')[-1])
stream.readline()
return stream.read(bytes)
except requests.RequestException as e:
utils.log_error(str(e))
return None


2) Change alter addons/script.foscam/resources/lib/foscam.py
Alter self._stream_url_fmt line to look like this. The url had to be changed as my camera is very particular about the ordering of the get parameters, username had to come first thus the 'Username required' error. Also the username/pass is passed as get parameters as below not as basic http creds.


self._stream_url_fmt = "http://{0}:{1}/cgi-bin/CGIStream.cgi?usr={2}&pwd={3}&cmd={{cmd}}".format(host,
port,
user,
password)
Reply
patch files?
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
Yea will try and attach them later today and add a branch/pull request to GitHub
Reply
(2015-02-13, 11:39)quixers Wrote: Yea will try and attach them later today and add a branch/pull request to GitHub

Howd ya go. Get it done? Looking forward to the changes
Reply
Download this, rename it script.foscamFix.zip

https://github.com/peteakalad/script.fos...master.zip

To install, uninstall the existing version then install my patched one..

1) Go to settings -> add-ons -> Program add-ons -> Foscam HD -> uninstall -> Yes

2) Go to settings -> add-ons -> Install from zip file -> select the downloaded file above 'script.foscamFix.zip'
Reply
Its flickers a bit but think thats normal?
Reply
(2015-02-13, 00:44)quixers Wrote: Two changes fixed the motion detection pop up for my FI9831P camera.

1) Change in addons/script.foscam/resources/lib/utils.py
Alter the get_mjpeg_frame function to look like this. Seems sometimes the headers aren't consistent, or the previous frame doesnt end in a carriage return meaning you need a different number of readlines frame to frame. My change will keep reading the stream till it finds the content length header its looking for.

def get_mjpeg_frame(stream):
try:
content_length = stream.readline()
while not "Content-Length" in content_length:
content_length = stream.readline()
bytes = int(content_length.split(':')[-1])
stream.readline()
return stream.read(bytes)
except requests.RequestException as e:
utils.log_error(str(e))
return None


2) Change alter addons/script.foscam/resources/lib/foscam.py
Alter self._stream_url_fmt line to look like this. The url had to be changed as my camera is very particular about the ordering of the get parameters, username had to come first thus the 'Username required' error. Also the username/pass is passed as get parameters as below not as basic http creds.


self._stream_url_fmt = "http://{0}:{1}/cgi-bin/CGIStream.cgi?usr={2}&pwd={3}&cmd={{cmd}}".format(host,
port,
user,
password)
OK It seems the 9831 behaves a bit differently to the 9821. I'll make these changes.
Leopold's Repository: Home of LibreELEC Dev Updater ...
Reply
(2015-02-15, 16:36)quixers Wrote: Its flickers a bit but think thats normal?
Yes it's an XBMC/Kodi issue that I have seen reported elsewhere. I was testing some changes that worked around the problem but there were some other issues introduced that I didn't completely resolve. I've recently moved and I don't currently have a camera set up, but when I get a chance I'll dust off those changes and try to fix it properly.
Leopold's Repository: Home of LibreELEC Dev Updater ...
Reply
  • 1
  • 8
  • 9
  • 10(current)
  • 11
  • 12
  • 15

Logout Mark Read Team Forum Stats Members Help
Foscam HD - Video feed with camera controls, and motion/sound detection preview1