I have a couple of the IP3M-HX2s, after upgrading to the march firmware getting a JPEG snapshot via the HTTP GET mechanism doesn't seem to work reliably anymore. I have code (on Windows) that does the HTTP request and using Wireshark there is a difference in how the camera responds to the credentials between the two firmware versions. I can provide more details if this is an appropriate level of detail for this forum - but hoping someone is programming to these cameras and has seen this.
Thanks,
Nick.
Access to http://<ipaddress>/cgi-bin/snapshot.cgi?1
Re: Access to http://<ipaddress>/cgi-bin/snapshot.cgi?1
I have the same issue. I have created my own webpage that displays snapshots from all my cameras and like you I get an auth prompt now.
IP2M-841
-
- Posts: 22
- Joined: Wed Jan 11, 2017 12:32 am
Re: Access to http://<ipaddress>/cgi-bin/snapshot.cgi?1
Ditto. They fucked it up in the latest firmware update.
Re: Access to http://<ipaddress>/cgi-bin/snapshot.cgi?1
Yeah, authentication in the cgi api is screwed up in the latest. It's responding to basic auth with a digest auth prompt response.
Re: Access to http://<ipaddress>/cgi-bin/snapshot.cgi?1
Just leaving a note to say I am affected by this issue.
Re: Access to http://<ipaddress>/cgi-bin/snapshot.cgi?1
I wish they would have mentioned this in the release notes. I wouldn't have upgraded as I rely on the snapshot.cgi to interface to my home automation system.
-
- Posts: 5
- Joined: Sun Jun 25, 2017 6:54 pm
Re: Access to http://<ipaddress>/cgi-bin/snapshot.cgi?1
Here is some code to get around this in PHP or JavaScript: https://pastebin.com/mb0M3yVM
Re: Access to http://<ipaddress>/cgi-bin/snapshot.cgi?1
Can you post a full example of using that PHP or JavaScript code? I am using a RasberryPi as my host.
IP2M-841
Re: Access to http://<ipaddress>/cgi-bin/snapshot.cgi?1
@mfarley281, thanks for the code...it's a great starting point!mfarley281 wrote:Here is some code to get around this in PHP or JavaScript: https://pastebin.com/mb0M3yVM
You are referring to a variable called "$boundary" near the end of the php code. But it's not initialized anywhere.
Also, your php code only returns status code 401 (exception caught at line 34):
root@server:~# php amcrest.php
* Hostname was NOT found in DNS cache
* Trying 192.168.2.203...
* Connected to 192.168.2.203 (192.168.2.203) port 8083 (#0)
* Server auth using Digest with user 'admin'
> GET /cgi-bin/snapshot.cgi HTTP/1.1
Host: 192.168.2.203:8083
Accept: */*
< HTTP/1.1 401 Unauthorized
< WWW-Authenticate: Basic realm="Device_CGI"
< CONNECTION: close
< CONTENT-LENGTH: 0
<
* Closing connection 0
PHP Fatal error: Uncaught exception 'Exception' with message 'exception 'Exception' with message 'Response with Status Code [401].' in /root/amcrest.php:34
Stack trace:
#0 {main}' in /root/amcrest.php:38
Stack trace:
#0 {main}
thrown in /root/amcrest.php on line 38
Re: Access to http://<ipaddress>/cgi-bin/snapshot.cgi?1
As a quick update, I have made the following changes to your script:
I set boundary as follows:
$boundary = "\xffd9";
and I commented out the line that seems to enabled digest auth:
// CURLOPT_HTTPAUTH => CURLAUTH_DIGEST
Now the script works perfectly for me and my IP2M-850!!
I set boundary as follows:
$boundary = "\xffd9";
and I commented out the line that seems to enabled digest auth:
// CURLOPT_HTTPAUTH => CURLAUTH_DIGEST
Now the script works perfectly for me and my IP2M-850!!