Foscam Plugin - control/capture Foscam ip camera

I am just another humble hobbyist building plugins for fun. My plugins largely evolve from a desire to integrate devices in my home that have some form of web interface or api (webcams, a/v receivers, etc). I welcome your feedback, suggestions and challenges :)
virgahyatt
Posts: 132
Joined: Sat Jan 11, 2014 12:50 am

Re: Foscam Plugin - control/capture Foscam ip camera

Post by virgahyatt »

Just FYI, I was able to use this plugin to control my Insteon IP camera 75790 without any trouble. I haven't fully tested it yet but from what I can tell the cgi paths match what foscam uses.
User avatar
Unklmarty
Posts: 59
Joined: Fri Jun 30, 2006 1:48 pm
Location: NJ
Contact:

Re: Foscam Plugin - control/capture Foscam ip camera

Post by Unklmarty »

Problem using Foscam plugin to send snapshots.

All software is on same box:
MAC IO 10.9.1
Indigo: 6.0.10
Security Spy 3.1.3
Cynical SecuritySpy Plugin 1.6.1
Foscam Plugin 1.0.2

I have created SS and Foscam devices and checked that the plugins are correctly configured.
When exciting the trigger I get the following message:
Foscam Controller Error Error in plugin execution ExecuteAction:

See end of Event Log.

Any ideas?
Marty


Event log: (I've added the ????)

Feb 2, 2014, 1:25:32 PM
Starting Indigo Server version 6.0.10
Loading attachments
"device target attachment.scpt" script loaded
"group target attachment.scpt" script loaded
"growl attachment.scpt" script loaded
"iTunes attachment.scpt" script loaded
"scenes attachment.scpt" script loaded
"time stamp attachment.scpt" script loaded
Loading plugin "Action Collection 1.4.5"
Starting plugin "Action Collection 1.4.5" (pid 428)
Loading interface "INSTEON Commands 2.0.4"
Starting interface "INSTEON Commands 2.0.4" (pid 429)
Loading plugin "Announcer 1.1.6"
Starting plugin "Announcer 1.1.6" (pid 430)
Loading plugin "Cynical SecuritySpy 1.6.1"
Starting plugin "Cynical SecuritySpy 1.6.1" (pid 431)
Loading plugin "Foscam Controller 1.0.2"
Starting plugin "Foscam Controller 1.0.2" (pid 432)
Loading plugin "Backup 1.00"
Starting plugin "Backup 1.00" (pid 433)
Loading plugin "NOAA Weather 1.1.0"
Starting plugin "NOAA Weather 1.1.0" (pid 434)
Found disabled interface "Z-Wave 1.0.187"
Found disabled plugin "Airfoil 1.1.4"
Found disabled plugin "DIRECTV DVR Control 1.0.0"
Found disabled plugin "EasyDAQ Relay Card 1.1.4"
Found disabled plugin "Growl 1.1.1"
Found disabled plugin "iCal Alarm Processor 1.1.0"
Found disabled plugin "iTunes 1.1.4"
Found disabled plugin "SQL Logger 1.1.6"
Found disabled plugin "Timers and Pesters 1.1.3"
Found disabled plugin "Vera Bridge 1.0.5"
Found disabled interface "Virtual Devices 1.0.11"
Found disabled plugin "WeatherSnoop 2.0.1"
Bonjour registered "Indigo - 33mr 6.0.10.indidb"
Indigo Cocoa client connected
Started plugin "Backup 1.00"
Backup Starting Backup, saving to ~/Documents/IndigoBackup
Backup archive filename /????/????/Documents/IndigoBackup/Indigo_Backup_02_02_2014__13_25_33.zip
Backup save path /library/Application Support/Perceptive Automation/Indigo 6
Cynical SecuritySpy API version 1.15
Started interface "INSTEON Commands 2.0.4"
Started plugin "Action Collection 1.4.5"
Started plugin "NOAA Weather 1.1.0"
Started plugin "Cynical SecuritySpy 1.6.1"
Cynical SecuritySpy mapping device "SSpy MR Front Door" 1120033567(camera)
Cynical SecuritySpy SSpy MR Front Door starting
Cynical SecuritySpy mapping device "SSpy Server" 216251738(server)
Cynical SecuritySpy SSpy Server starting
Cynical SecuritySpy mapping device "SSpy MR Front HD" 1549148742(camera)
Cynical SecuritySpy SSpy MR Front HD starting
Cynical SecuritySpy mapping device "SSpy MR Mud room" 1266063879(camera)
Cynical SecuritySpy SSpy MR Mud room starting
Cynical SecuritySpy mapping event "Motion activated email from Front door camera" 1119829864(cameramotion)
Cynical SecuritySpy Motion activated email from Front door camera starting
Cynical SecuritySpy plugin starting asyn operation
Cynical SecuritySpy SSpy Server is now ready
Cynical SecuritySpy SSpy MR Front Door host device SSpy Server now available
Cynical SecuritySpy SSpy MR Front Door is now active
Cynical SecuritySpy SSpy MR Front HD host device SSpy Server now available
Cynical SecuritySpy SSpy MR Front HD is now active
Cynical SecuritySpy SSpy MR Mud room host device SSpy Server now available
Cynical SecuritySpy SSpy MR Mud room is now active
Cynical SecuritySpy event tap active
Started plugin "Foscam Controller 1.0.2"
Foscam Controller Debug startup called
Started plugin "Foscam Controller 1.0.2"
Foscam Controller Debug startup called
Started plugin "Announcer 1.1.6"
WebServer client connected
WebServer started on port ???? -- digest authentication enabled
Backup Backup Finished.

Feb 2, 2014, 1:25:36 PM
Emails on POP server mail.verizon.net will be scanned every 1 minutes

Feb 2, 2014, 1:25:37 PM
Connected to PowerLinc 2413U interface on port usbserial-A4016MXF
PowerLinc address 1E.DC.EF, firmware version 9.11

Feb 2, 2014, 1:25:54 PM
Trigger Motion activated email from Front door camera
Foscam Controller Debug snap called
Foscam Controller Debug url xmitted: http://192.168.1.35:????/snapshot.cgi?user=????&pwd=????
Announcer Announcing message "Motion Detected at the Front door".

Feb 2, 2014, 1:30:15 PM
Foscam Controller Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 242, in snap
File "plugin.py", line 260, in sendViaEmail
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/smtplib.py", line 244, in __init__
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/smtplib.py", line 311, in connect
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/smtplib.py", line 355, in getreply
<class 'smtplib.SMTPServerDisconnected'>: Connection unexpectedly closed
robertgerman
Posts: 42
Joined: Sat Dec 14, 2013 5:44 am
Location: Vaxjo, Sweden

Re: Foscam Plugin for Indigo

Post by robertgerman »

Thanks for a great plug-in! Any plans on adding the newer foscam models with hd-capturing?

Rob
bmcgowan13
Posts: 67
Joined: Sun Jan 13, 2013 11:35 am

Re: Foscam Plugin - control/capture Foscam ip camera

Post by bmcgowan13 »

virgahyatt wrote:Just FYI, I was able to use this plugin to control my Insteon IP camera 75790 without any trouble. I haven't fully tested it yet but from what I can tell the cgi paths match what foscam uses.


What do you use for the hostname? I am trying to get my Insteon IP cameras connected but they all fail. Is the host name the same as the web address (http://192.168.0.41:25110) and do you use the generic password (admin) with generic password (blank).

I'd love to be able to use my motion detector to trigger captures but I'm stumbling...
bmcgowan13
Posts: 67
Joined: Sun Jan 13, 2013 11:35 am

Re: Foscam Plugin - control/capture Foscam ip camera

Post by bmcgowan13 »

I get this error message from all three of my INSTEON/FOSCAM cameras. Am I missing something obvious? I'd love to be able to use the motion sensor to trigger some video.

Trigger CAM Garage Snapshot
Foscam Controller Debug snap called
Foscam Controller Debug url xmitted: http://192.168.0.51:25XXX/snapshot.cgi? ... 3&pwd=XXXX
Foscam Controller Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 242, in snap
File "plugin.py", line 256, in sendViaEmail
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/email/mime/image.py", line 43, in __init__
<type 'exceptions.TypeError'>: Could not guess image MIME subtype
fim32
Posts: 2
Joined: Sat Mar 01, 2014 6:52 pm

Re: Foscam Plugin - control/capture Foscam ip camera

Post by fim32 »

i submitted a pull request... to get around this error i forced the mime type to "jpeg", for better or worse.

i don't know if this helps any but the nerdliest, but here's the patch:
---
Contents/Server Plugin/plugin.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Contents/Server Plugin/plugin.py b/Contents/Server Plugin/plugin.py
index 8048e9c..c9ba39c 100644
--- a/Contents/Server Plugin/plugin.py
+++ b/Contents/Server Plugin/plugin.py
@@ -253,7 +253,7 @@ class Plugin(indigo.PluginBase):
# Open the files in binary mode. Let the MIMEImage class automatically
# guess the specific image type.
fp = open('/tmp/snap.jpg', 'rb')
- img = MIMEImage(fp.read())
+ img = MIMEImage(fp.read(), "jpeg")
fp.close()
msg.attach(img)

--
User avatar
Unklmarty
Posts: 59
Joined: Fri Jun 30, 2006 1:48 pm
Location: NJ
Contact:

Re: Foscam Plugin - control/capture Foscam ip camera

Post by Unklmarty »

(i don't know if this helps any but the nerdliest, but here's the patch:)

It sure would help except.....ummmm.. just where and how do I apply the patch?
Ankleshanker
Posts: 9
Joined: Fri Jul 12, 2013 10:32 am

Re: Foscam Plugin - control/capture Foscam ip camera

Post by Ankleshanker »

I'm getting ready to purchase a Foscam. The allure of HD images and improved quality of the 9000 series is tempting, but the Indigo compatibility of the 8000 series (thanks to your plugin) trumps it. Do you plan to update your plugin to support the 9000 series in the near future?

Thank you for your time and effort on this plug in,
pantalones
Posts: 87
Joined: Thu Mar 29, 2012 10:17 pm

Re: Foscam Plugin - control/capture Foscam ip camera

Post by pantalones »

@ankleshanker

i say this as the owner of four foscam cameras, two panasonics, and one y-cam

do not buy foscams. they have the worst customer support on the planet, unstable inconsistent products, and most of all, faulty hardware. it seems to be a shell company for a completely disorganized system of developers in China (nothing against china, that's not the issue). What happens is they release some buggy garbage, customers complain, and then it may or may not get fixed. In two cases now instead of fixing the problem for users (e.g., cameras disconnecting, rebooting, not saving images), they've released a "v2" of the camera (six months later, not a reasonable product cycle) and left the v1 owners hanging.

My foscams are only items of regret at this point. I'm replacing them all.

If you're still unsure, go look at the foscam boards. They are filled with furious customers.
wasmitschmidt
Posts: 19
Joined: Wed Feb 26, 2014 7:43 am

Re: Foscam Plugin - control/capture Foscam ip camera

Post by wasmitschmidt »

Hello,
I just try this cool plugin.
But when I try to send an snapshot via mail I receive this error:

Code: Select all

  Foscam Controller Error         Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 242, in snap
  File "plugin.py", line 248, in sendViaEmail
<type 'exceptions.KeyError'>: key subject not found in dict


The URL for the snapshot works when I manually enter the URL in my browser.

Code: Select all

  Trigger                         HT - isMotion
  Foscam Controller Debug         snap called
  Foscam Controller Debug         url xmitted: http://10.0.1.19:8081/snapshot.cgi?user=USER&pwd=PASSWORD


Any idea what is wrong in my setup?
wasmitschmidt
Posts: 19
Joined: Wed Feb 26, 2014 7:43 am

Re: Foscam Plugin - control/capture Foscam ip camera

Post by wasmitschmidt »

wasmitschmidt wrote:Any idea what is wrong in my setup?


OMG, a typical stupid user error...

I didn't enter subject and recipient in the cam action template!

Now everything work very fine :-)
richo
Posts: 158
Joined: Tue Nov 25, 2014 3:54 am
Location: Pomorskie, Poland

Re: Foscam Plugin - control/capture Foscam ip camera

Post by richo »

Have setup SMTP in Indigo and notifications from Indigo work however can't send snapshots from the plugin. Get the following message:

Traceback (most recent call last):
File "plugin.py", line 242, in snap
File "plugin.py", line 264, in sendViaEmail
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/smtplib.py", line 596, in login
<class 'smtplib.SMTPAuthenticationError'>: (535, '5.7.8 Username and Password not accepted. Learn more at\n5.7.8 http://support.google.com/mail/bin/answ ... swer=14257 e7sm1087474wjx.31 - gsmtp')
Ryszard
flg8r96
Posts: 3
Joined: Sun Dec 09, 2012 11:22 am

Re: Foscam Plugin - control/capture Foscam ip camera

Post by flg8r96 »

I just downloaded the v1.0.0 version of the foscam plugin and wasn't able to email a snaphot from my foscam. After reviewing the event log it was clear that there was an extra forward slash after my camera's IP address that was messing things up and preventing indigo from grabbing a snapshot from the cam. See error below:

Foscam Controller Debug url xmitted: http://192.168.1.76//snapshot.cgi?user=admin&pwd=admin

After looking at the source code for this plugin I notice that 1.0.0 had a bug in plugin.py on line 233 ... it had an extra forward slash before 'snapshot.cgi' as show below:

esp = self.xmitToCamera('/snapshot.cgi', {}, dev)

The good news is v1.0.3 doesn't have the extra slash. However, after upgrading to that plugin I'm getting the same error. I've restarted the plugin, I've restarted the indigo server ... no luck.

Any advice would be much appreciated.

Thanks,

M
cdeggz
Posts: 33
Joined: Sun Nov 30, 2014 9:13 pm

Re: Foscam Plugin - control/capture Foscam ip camera

Post by cdeggz »

I'm loving the plugin! Having this on my garage door control page is great.

That said, is is possible to get the video feed, not just images? Right now I'm doing 1-second image refresh using a fetch image URL, but would prefer to imbed the video feed.
MarcoGT
Posts: 1106
Joined: Thu Sep 11, 2014 1:06 pm
Location: Germany

Re: Foscam Plugin - control/capture Foscam ip camera

Post by MarcoGT »

Is there a plan to support HD cameras?
Post Reply

Return to “thechad.io”