Jump to content

HTTP GET to "touch" CGI program (HELP?)


o2bnme

Recommended Posts

Hello.

 

I am trying to utilize my Network Module for my ISY994i PRO for the first time. I am using Firmware 4.2.4 right now.

 

The cgi I want to call requires a user name and password. I have no idea if I have everything correct, but testing it does not work. The test returns a 404 error (Network Module Rule 2:404).

 

+ I am using the HTTP GET {hostname} {port} /cgi-bin/admin/setvi?vi0=1

+ I created an authorization entry to store the user name and password

 

post-423-0-82049800-1430946879_thumb.jpg

 

I am very new to this. Anyone have any helpful advice?

 

Thanks,

 

Bill

 

Link to comment

404 means 'not found'.

 

What does

http://username:password@192.168.1.42/cgi-bin/admin/set?vi0=1
return when called from a browser? (Substitute the correct username and password - and the smiley is : p without the space....).

 

Oh, you may want to change those as well. The base64 encoding is easily reversed - you have effectively published your username and password in your screenshot.

 

 

Sent from my iPad using Tapatalk

Link to comment

It doesn't actually return anything in the browser window. It ends up flipping a switch on a webcam that manually triggers an event. The event sends me an email every minute until I send http://username:password@192.168.1.42:8042/cgi-bin/admin/set?vi0=0. The webcam webpage shows a change successfully as well.

 

When I use the ISY994 to do the http://username:password@192.168.1.42:8042/cgi-bin/admin/set?vi0=1, I get no emails and the webcam webpage does not show the switch has been flipped.

 

Thanks,

 

Bill

Link to comment

Oh, you may want to change those as well. The base64 encoding is easily reversed - you have effectively published your username and password in your screenshot.

 

 

Ha. I thought about that after I did it. But it is a temporary userid, password. Also, it would require you find my house and log into my wifi. :-) I'm banking on that being a little difficult to accomplish before I delete the temp UID. 

Link to comment

Here's the firebug output I capture when I initiate the manual trigger using the webcam webpage. I added all this to my Network Resources entry and still get a 404.

 

Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Encoding gzip, deflate

Accept-Language en-US,en;q=0.5

Authorization Basic asdfasdfasdf1234asdf

Connection keep-alive

Cookie activatedmode=digital; viewsizemode=100; 4x3=false Host 192.168.1.42:8042

If-Modified-Since 0

Referer http://192.168.1.42:8042/

User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0

Link to comment

Is encode URL checked? 

 

Also, this part doesn't look quite right to me: /set?vi0=1 and you show: /setvi?vi0=1 in a different post.

 

-Xathros

Link to comment

Good eye. 

 

/cgi-bin/admin/setvi?vi0=1

 

That's what I have in the request. I copy/pasted what MWareman had in his post without checking its accuracy.

 

I have tried with and without the encode URL checked. Both gave me a Rule 2:404 message.

Link to comment

I think I see the problem.  This cam seems to require the ISY to support auth cookies per this from your firebug output:

 

Cookie activatedmode=digital; viewsizemode=100; 4x3=false Host 192.168.1.42:8042

 

ISY does not support this. You may need a middleman to deal with this issue.  Beats me why it errors with a 404 however.  I would think this should be an auth failure instead.

 

-Xathros

Link to comment

Cookie activatedmode=digital; viewsizemode=100; 4x3=false Host 192.168.1.42:8042

 

ISY does not support this. You may need a middleman to deal with this issue.  Beats me why it errors with a 404 however.  I would think this should be an auth failure instead.

 

 

Thanks for you trying to help me with this.

 

I removed the Cookie entry, but it still gives me the same error message.

 

Bill

Link to comment

Because the cam is expecting the cookie and the ISY is not providing it.  Try this to prove:

 

Delete cookies and disable cookies in the browser then retest connecting to the cam from the browser.  It should fail in the same way.

 

-Xathros

Link to comment

Good eye.

 

/cgi-bin/admin/setvi?vi0=1

 

That's what I have in the request. I copy/pasted what MWareman had in his post without checking its accuracy.

 

I have tried with and without the encode URL checked. Both gave me a Rule 2:404 message.

Sorry! I was typing on my cell phone...

Link to comment

I'm out at a conference this week - so it's difficult to keep up....

 

Just to confirm:

 

http://username:password@192.168.1.42:8042/cgi-bin/admin/setvi?vi0=0
and
http://username:password@192.168.1.42:8042/cgi-bin/admin/setvi?vi0=1
 
(from the screenshot) works in the browser?

 

Or does this work in the browser:

http://username:password@192.168.1.42:8042/cgi-bin/admin/set?vi0=0
and
http://username:password@192.168.1.42:8042/cgi-bin/admin/set?vi0=1
 
Michael.
Link to comment

Sorry @02bnme, I'm mostly out of ideas. 404 is the error code returned by your camera - it's just being relayed to you by the ISY. It basically means that your server (the camera) cannot find the resource being requested (/cgi-bin/admin/setvi in this case). If it works from a browser but not the ISY then things like host header may come into play - but I don't see that issue here. 

 

Firebug seems to be reporting that the browser is making an HTTP/1.0 request (without a Host: header) - but your ISY network resource is sending a HTTP/1.1 request (with a Host: header as HTTP/1.1 requires). It might be just that simple - but I'm not sure how to change that on ISY's end.

 

I wonder if you can craft a working command line with wget (so you can granularly play with the various options and headers) and experiment to find out what works.. 

Link to comment

Hi Michel.

 

Sorry. I wasn't available when you reached out. My email on your forum is very old and I don't recall my password. Thankfully Google remembers my password for me, so I can log in. But I do not have the ability to get forum notifications sent to my real email unless you help me change my profile behind the scenes.

 

Do you have time tonight?

 

Bill

Link to comment

Thanks Michel.

 

Here's the working request information...

 

GET /cgi-bin/admin/setvi.cgi?vi0=1 HTTP/1.1

Host: 192.168.1.42:8042

User-Agent: Mozilla/4.0

Connection: Close

Content-Type: application/x-www-form-urlencoded

Authorization Basic asdfasdfasdf1234asdf

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...