Page 2 of 2

Re: help needed with httpd plugin

PostPosted: Thu Jan 12, 2023 2:09 pm
by marcel langelaan
browsing the domoticz support blog gives me this information:

since I use a username and pasword for my domestics set up I'm unable to get the camera working in my dummy switch
testing in webbrowser does work and disabling the pw protection of Domoticz also works.
Anny tips?

http://IP:port/json.htm?type=command&pa ... itchcmd=On
http://PW:USN@IP:port/json.htm?type=com ... itchcmd=On
http://192.168.7.216:port/json.htm?user ... itchcmd=On

When I try to connected without credentials: http://192.168.1.50:5555/setvar?doorbell=on, I get a login screen (attached). But also a log in Indigodomo.
When I use the same url (without password) with the Foscam VD1, I don't. get any info in the logfile, which for me is strange.
Or its really necessary to use the json.htm part (as above).

Just try to provide information to get a step further ;)

Re: help needed with httpd plugin

PostPosted: Thu Jan 12, 2023 2:14 pm
by marcel langelaan
Hi

Thx for your effort, yes its wifi, but I can connect it to the fixed network, which gives the same result (with only a switch port) in between.
Communication (video stream and also Foscam's app results in a message) => so its not really related to the network.

See attached: someone at Domoticz has also something like this: https://www.domoticz.com/forum/viewtopi ... 19#p290619
as explained in my previous email, it seems that the command is not processed by the foscam camera (although foscam has confirmed that every url was fine).

This is wat Domoticz is using:
http://IP:port/json.htm?type=command&pa ... itchcmd=On
http://PW:USN@IP:port/json.htm?type=com ... itchcmd=On
http://192.168.7.216:port/json.htm?user ... itchcmd=On

Re: help needed with httpd plugin

PostPosted: Thu Jan 12, 2023 2:15 pm
by FlyingDiver
Try removing the username and password from the URL, and blank out those fields in the device config,

Re: help needed with httpd plugin

PostPosted: Thu Jan 12, 2023 2:23 pm
by marcel langelaan
your adviced followed:
Url with browser => reply with login screen and log-file from httpd
from out the foscam => no log-file from httpd

It seems that the url used is not accepted by the foscam camera and maybe something as json (see above) needs to be used......no clue but only difference I see.

Re: help needed with httpd plugin

PostPosted: Thu Jan 12, 2023 2:24 pm
by FlyingDiver
Please don't use a browser for testing. There's no useful information there. Use Terminal and the "curl -v" command.

Re: help needed with httpd plugin

PostPosted: Thu Jan 12, 2023 2:29 pm
by marcel langelaan
Thx, that helps:

curl -v "http://192.168.1.50:5555/setvar?doorbell=on
dquote>

No log-file and no reaction => same as foscam camera

Re: help needed with httpd plugin

PostPosted: Thu Jan 12, 2023 2:29 pm
by FlyingDiver
marcel langelaan wrote:
Thx, that helps:

curl -v "http://192.168.1.50:5555/setvar?doorbell=on
dquote>

No log-file and no reaction => same as foscam camera


No trailing double quote?

Re: help needed with httpd plugin

PostPosted: Thu Jan 12, 2023 2:35 pm
by marcel langelaan
Sorry:

~ % curl -v "http://192.168.1.50:5555/setvar?doorbell=on"
* Trying 192.168.1.50:5555...
* Connected to 192.168.1.50 (192.168.1.50) port 5555 (#0)
> GET /setvar?doorbell=on HTTP/1.1
> Host: 192.168.1.50:5555
> User-Agent: curl/7.85.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
* HTTP 1.0, assume close after body
< HTTP/1.0 401 Unauthorized
< Server: BaseHTTP/0.3 Python/2.7.18
< Date: Thu, 12 Jan 2023 20:33:59 GMT
< WWW-Authenticate: Digest realm="HTTPd Plugin", nonce="8002755b88e24e09534574c054bcd7e0", algorithm="MD5", qop="auth" Basic realm="HTTPd Plugin"
< Content-type: text/html
<
* Closing connection 0

logfile: HTTPd 2 Debug MyRequestHandler: GET to port 5555 from 192.168.1.141:65360 for /setvar?doorbell=on
HTTPd 2 Debug MyRequestHandler: Request has no Authorization header:
HTTPd 2 Debug {'host': '192.168.1.50:5555', 'accept': '*/*', 'user-agent': 'curl/7.85.0'}

Re: help needed with httpd plugin

PostPosted: Thu Jan 12, 2023 2:36 pm
by FlyingDiver
It's saying unauthorized. Did you clear the username and password fields in the Indigo device as instructed?

Re: help needed with httpd plugin

PostPosted: Thu Jan 12, 2023 2:40 pm
by marcel langelaan
Hereby the results without username/password:

Terminal:
curl -v "http://192.168.1.50:5555/setvar?doorbell=on"
* Trying 192.168.1.50:5555...
* Connected to 192.168.1.50 (192.168.1.50) port 5555 (#0)
> GET /setvar?doorbell=on HTTP/1.1
> Host: 192.168.1.50:5555
> User-Agent: curl/7.85.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: BaseHTTP/0.3 Python/2.7.18
< Date: Thu, 12 Jan 2023 20:38:43 GMT
< WWW-Authenticate: Digest realm="HTTPd Plugin", nonce="94982ca4f7165c501c118b8bdfa03a22", algorithm="MD5", qop="auth" Basic realm="HTTPd Plugin"
< Content-type: text/html


logfile http:
HTTPd 2 Debug MyRequestHandler: GET to port 5555 from 192.168.1.141:65382 for /setvar?doorbell=on
HTTPd 2 Debug MyRequestHandler: No password specified in device configuration, skipping authentication
HTTPd 2 Debug webhook 5555: MyRequestHandler: updating device
HTTPd 2 Debug webhook 5555: MyRequestHandler: saved_states = {u'doorbell': u'on'}
HTTPd 2 Debug webhook 5555: MyRequestHandler: new_states = {'doorbell': 'on'}
HTTPd 2 Debug webhook 5555: getDeviceStateList, base state_list = States : (list)
HTTPd 2 Debug webhook 5555: getDeviceStateList, adding String state doorbell, value on
HTTPd 2 Debug webhook 5555: getDeviceStateList, adding String state http2_timestamp, value 01/12/23 21:38:43
HTTPd 2 Debug webhook 5555: getDeviceStateList, final state_list = States : (list)
Item : (dict)
Disabled : false (bool)
Key : doorbell (string)
StateLabel : doorbell (string)
TriggerLabel : doorbell (string)
Type : 150 (integer)
Item : (dict)
Disabled : false (bool)
Key : doorbell (string)
StateLabel : doorbell (string)
TriggerLabel : doorbell (string)
Type : 150 (integer)
Item : (dict)
Disabled : false (bool)
Key : http2_timestamp (string)
StateLabel : http2_timestamp (string)
TriggerLabel : http2_timestamp (string)
Type : 150 (integer)
Trigger 1 test trigger for doorbell
HTTPd 2 Debug webhook 5555: didDeviceCommPropertyChange no changes
HTTPd 2 Debug webhook 5555: didDeviceCommPropertyChange no changes

put the url also in the foscam => no response (log-file)

Re: help needed with httpd plugin

PostPosted: Thu Jan 12, 2023 2:42 pm
by FlyingDiver
Clearly the plugin is working correctly. I'm not sure how I can help figuring out what the Foscam's problem is. Have you tried using any of the other services they suggested for the webhook?

Re: help needed with httpd plugin

PostPosted: Thu Jan 12, 2023 2:45 pm
by marcel langelaan
Yes you have helped me the foscam is working => reboot was not working, removed the power and now the url without username;password is working.

Re: help needed with httpd plugin

PostPosted: Thu Jan 12, 2023 2:50 pm
by marcel langelaan
This means that all foscam camera's (depending on the type of camera) can trigger Indigodomo by motion detection etc. This means also that it's possible to collect a snapshot on the moment a trigger (in my case the doorbell push bottom) will be hit.

See attachement. This is really great.

Re: help needed with httpd plugin

PostPosted: Thu Jan 12, 2023 2:55 pm
by FlyingDiver
Interesting that their config page shows an example using a username and password, but it doesn't seem to work. Or maybe that power cycle was needed for that change as well.

Re: help needed with httpd plugin

PostPosted: Thu Jan 12, 2023 3:08 pm
by marcel langelaan
again thx for your support, without your patience and knowledge I was sill swimming around.