Weirdly, I have to resurrect this thread.
I had to totally reset one of the cameras, and since then the wget script to grab the image from the camera has stopped working.
Here's what I know:
IP address of the reset camera, and the user name/pwd are the same as they were.
The wget command works at the command line.
The second half of the script, which converts the large image from the camera into a smaller image that IndigoWebServer can serve, still works.
I can reach the camera from the Indigo box, and have re-authorized the camera's self signed certificate.
What's not working is the wget. BUT the script does NOT return any errors. It just isn't working to grab a new image. the second half works to convert any existing image.
Here's the script:
- Code: Select all
from PIL import Image
import math
import subprocess
import time
pic_destination = "/Library/Application Support/Perceptive Automation/Indigo 7.3/IndigoWebServer/public/FOO/FYBig.jpg"
get_image = subprocess.Popen("wget --user NAME --password BOGUS --no-check-certificate 192.168.0.66/cgi-bin/currentpic.cgi -O /Library/Application Support/Perceptive Automation/Indigo 7.3/IndigoWebServer/public/FOO/FYBig.jpg", shell=True)
get_image.wait
Image.open(pic_destination)
time.sleep(2)
saved_pic = Image.open(pic_destination)
#width, height = saved_pic.size
#width = width*.59
#height = height*.59
#saved_pic.resize((int(math.floor(width)), int(math.floor(height))), Image.ANTIALIAS)
saved_pic.save("/Library/Application Support/Perceptive Automation/Indigo 7.3/IndigoWebServer/public/FOO/FY.jpg", optimize=True)
I have 2 other versions of this script running without problems on nearly identical cameras. When I run
- Code: Select all
wget --user NAME --password BOGUS --no-check-certificate 192.168.0.66/cgi-bin/currentpic.cgi
at the command line, I get current pic.cgi in my documents root folder.
So is there some sort of python environment issue where it for some reason is still not trusting the connection, even though the bash does? Here's what the command line returns:
- Code: Select all
Indigo:~ name$ wget --user NAME --password PWD --no-check-certificate 192.168.0.66/cgi-bin/currentpic.cgi
--2019-06-25 11:12:27-- http://192.168.0.66/cgi-bin/currentpic.cgi
Connecting to 192.168.0.66:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authentication selected: Basic realm="all", charset="UTF-8"
Reusing existing connection to 192.168.0.66:80.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://192.168.0.66/cgi-bin/currentpic.cgi [following]
--2019-06-25 11:12:27-- https://192.168.0.66/cgi-bin/currentpic.cgi
Connecting to 192.168.0.66:443... connected.
WARNING: cannot verify 192.168.0.66's certificate, issued by ‘emailAddress=...,CN=...,OU=...,O=...,L=Munich,ST=Bavaria,C=DE’:
Self-signed certificate encountered.
WARNING: certificate common name ‘...’ doesn't match requested host name ‘192.168.0.66’.
HTTP request sent, awaiting response... 200 OK
Length: 117879 (115K) [image/jpeg]
Saving to: ‘currentpic.cgi.1’
currentpic.cgi.1 100%[===================>] 115.12K 163KB/s in 0.7s
2019-06-25 11:12:28 (163 KB/s) - ‘currentpic.cgi.1’ saved [117879/117879]
I'm going to try deleting the stored certificate. In the mean time, thanks for any help.