Closed whmoorejr closed 5 years ago
Try just the plain vanilla pip command. Not sure why that calls for pip2.6. It was written a long time ago.
Cool.. now for step 2. "no matching distribution found for twisted==15.4.0
is indigo still on python 2.6? can I go with a newer version of twisted?
Wow. I really need to update that. Try version 16.2.0.
I think I'll probably bundle it into the plugin just to avoid this issue. I did that with Twilio.
That would be helpful for folks like me that freak out a little when messing around in terminal.... this is where I'm at now:
WHM-Server:~ williammoore$ sudo pip install twisted==16.2.0 Password: The directory '/Users/williammoore/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/Users/williammoore/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Collecting twisted==16.2.0 Could not fetch URL https://pypi.python.org/simple/twisted/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping Could not find a version that satisfies the requirement twisted==16.2.0 (from versions: ) No matching distribution found for twisted==16.2.0 WHM-Server:~ williammoore$
What version of MacOS are you running?
10.10.5 (Yosemite) on an 2012 Mac mini
Then you can forget ever running pip. The servers now require a newer version of TLS which you won't get until High Sierra or later. Which also breaks a number of other plugins.
I'll take a look at bundling the libraries with the plugins, but a quick test on my development system failed miserably. Not sure what it's going to take to make it work.
Ok. I may also experiment with your UDP Listener Plugin. Security Camera NVRs have a "Alarm Center" function which broadcasts something over a specified port. It utilizes what DVR/NVR manufactures refer to as the "Alarm Center Protocol". But I can't find documentation on that anywhere online. When I run into weirdness with that, I'll probably reach out to you on that thread. In the meantime, I'll finish installing the SMTP plugin so I'll get a update notification in Indigo if you are able to get it functioning with the library bundling.
Have you looked at the Security Camera plugin? If that's a standard ONVIF camera, it should work with it.
Yep. But Amcrest (what I'm slowly replacing my Foscam cameras with) now uses digest authentication which isn't part of the plugin. I had a hell of a time figuring out the script just to get snapshots for some other actions & triggers.
import requests from requests.auth import HTTPDigestAuth r = requests.get('http://192.168.1.141:8141/cgi-bin/snapshot.cgi?', auth=HTTPDigestAuth('myusername', 'mypassword')) r.raise_for_status()
with open('/Users/williammoore/Desktop/IPCamRotate/R.jpg', 'wb') as image_file: image_file.write(r.content)
Working on it.... Got some error messages at first. Changed the port config, changed logging to debug and restarted the plugin. No errors, but not working. Restarting indigo server now. (sometimes needed after installing a new plugin)
Make sure you have 2.0.1. 2.0.0 was broken. It only worked if the email sender was the same machine. Which is how I was testing it. :(
Nothing negative in the log... but nothing is happening....
SMTPd set to 1027
Fake SMTP server set to 1024
To test, I have my NVR email config page up and I'm toggling between test emails on 1024 (Fake SMTP Server) and 1027 (Plugin).
my 1024 tests are going through... but my 1027 tests fail with no blips on the log.
for the SMTP server address, I'm using indigo's IP: 192.168.1.10
In a terminal window, try:
nc 192.168.1.10 1027
Then ctl-d to exit.
reply was: 220 WHM-Server.local Python SMTP proxy version 0.2
Then it's connecting to the plugin ok. So the camera isn't sending email properly.
Or at least it's not sending what the plugin is expecting.
Success-ish....
From an older Foscam camera, it worked. From a NVR or from a newer Amcrest camera, did not work.
Unfortunately, the working cameras are the ones I'm phasing out.
Is it possible the newer cameras are set up to require SSL or some authentication?
Selecting "None" is an option for Authentication.... something I have to do to make it work with the FakeSMTP application. (which will work when I change the port on the camera email setting back to 1024)
But I don't even get anything negative in the log file to copy/past to you.
If you want to give me your email... I can change my camera to use my google SMTP and send you a test email to see if that shows anything weird (like a pre-formatted character string) or something that might be gumming it up.
Some additional weirdness on my end. I can add gmail and send a test message from the NVR to myself (email to email, no plugin stuff).
From the newer cameras with the same gmail settings I get the same "test email failed" notice I get with the plugin. But, when I do an internal email with the FakeSMTP, the email works and the message goes through.
sometimes technology annoys me.
It's got to be an SMTP handshaking problem, so having it send me an email won't do any good.
The fact that it fails with Gmail is telling.
This is an Amcrest? What firmware version? I have an Amcrest with 2.520.AC00.18.R, Build Date: 2017-06-29 on it. I just tried setting up the email sender on it, and it fails connecting to Gmail as well.
The FakeSMTP application has an "SMTP Log" tab. Copy the contents from that for ONE successful email and post it here.
Tried the "update firmware" to resolve the email thing from the amorist forum... no luck there. Using 2.460.AC01.0.R, build: 2018-06-26
11:57:44 PM - SMTP connection from 192.168.1.101/192.168.1.101, new connection count: 1
11:57:44 PM - Server: 220 192.168.1.10 ESMTP SubEthaSMTP null
11:57:44 PM - Client: EHLO localhost
11:57:44 PM - Server: 250-192.168.1.10
250-8BITMIME
250-AUTH LOGIN
250 Ok
11:57:44 PM - Client: AUTH LOGIN
11:57:44 PM - Server: 334 VXNlcm5hbWU6
11:57:44 PM - Server: 334 UGFzc3dvcmQ6
11:57:44 PM - Server: 235 Authentication successful.
11:57:44 PM - Client: MAIL From: <>
11:57:44 PM - Server: 250 Ok
11:57:44 PM - Client: RCPT To: bill.moore.jr@gmail.com
11:57:44 PM - Server: 250 Ok
11:57:44 PM - Client: DATA
11:57:44 PM - Server: 354 End data with
That was a working one from an NVR.
Working one from the amcrest camera:
12:02:46 AM - SMTP connection from 192.168.1.141/192.168.1.141, new connection count: 1
12:02:46 AM - Server: 220 192.168.1.10 ESMTP SubEthaSMTP null
12:02:46 AM - Client: EHLO localhost
12:02:46 AM - Server: 250-192.168.1.10
250-8BITMIME
250-AUTH LOGIN
250 Ok
12:02:46 AM - Client: AUTH LOGIN
12:02:46 AM - Server: 334 VXNlcm5hbWU6
12:02:46 AM - Server: 334 UGFzc3dvcmQ6
12:02:46 AM - Server: 235 Authentication successful.
12:02:46 AM - Client: MAIL FROM: bill.moore.jr@gmail.com
12:02:46 AM - Server: 250 Ok
12:02:46 AM - Client: RCPT TO: bill.moore.jr@gmail.com
12:02:46 AM - Server: 250 Ok
12:02:46 AM - Client: RCPT TO: whm.indigo@gmail.com
12:02:46 AM - Server: 250 Ok
12:02:46 AM - Client: DATA
12:02:46 AM - Server: 354 End data with
I figured out the problem. The Amcrest is insisting on logging into the SMTP server, even when Authentication is set to None or the username/password fields are blank. Well, actually, it says failed but doesn't even try when the fields are blank.
The original plugin did authentication. But the stripped down one I wrote yesterday does not. And adding authentication, or even stubs to handle the client requests, is not simple.
Well, not as bad as I thought.
This version works with my Amcrest camera:
https://github.com/FlyingDiver/Indigo-SMTPd/releases/tag/2.0.2
Outstanding. I have it working on my end now. I am getting a response from old Foscam, new Amcrest and the Amcrest NVR. I kinda wish I had some more stuff to play with.
As soon as I matched the username and password on the plugin config to the email settings... presto.
I really love this.... I was dreading having another device or system (like blue iris or sighthound) to waste computing power on half-ass video analytics when the cameras are already doing the work themselves.
The only thing I currently use it for is my Cummins standby generator. One of these days I'll write a full plugin to control the darn thing.
Release version is 2.0.3.
Short Story: WHM-Server:~ williammoore$ sudo easy_install-2.6 pip Searching for pip Reading http://pypi.python.org/simple/pip/ Couldn't find index page for 'pip' (maybe misspelled?) Scanning index of all packages (this may take a while) Reading http://pypi.python.org/simple/ No local packages or download links found for pip error: Could not find suitable distribution for Requirement.parse('pip')
Long Story: I'm sorry that I keep bugging you on different plugins... first twillio, then pushover, now this....
So... I've been trying to figure out a way to get instant notifications from network devices that have email notification capabilities (security cameras, DVRs, NVRs). I know I can use another gmail account and better email... but there is a lag that's no good for using camera motion to trigger a light.
So, I tried using a FakeSMTP [http://nilhcem.com/FakeSMTP/index.html] . That worked. Emails sent from my NVR on that port were picked up by that SMTP program and put in a folder.... but I couldn't get indigo to do anything with that and I got errors when I tried to incorporate better email with it.