help needed with httpd plugin

Posted on
Thu Jan 12, 2023 2:09 pm
marcel langelaan offline
Posts: 65
Joined: May 12, 2017

Re: help needed with httpd plugin

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 ;)

Posted on
Thu Jan 12, 2023 2:14 pm
marcel langelaan offline
Posts: 65
Joined: May 12, 2017

Re: help needed with httpd plugin

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

Posted on
Thu Jan 12, 2023 2:15 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: help needed with httpd plugin

Try removing the username and password from the URL, and blank out those fields in the device config,

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Jan 12, 2023 2:23 pm
marcel langelaan offline
Posts: 65
Joined: May 12, 2017

Re: help needed with httpd plugin

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.

Posted on
Thu Jan 12, 2023 2:24 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: help needed with httpd plugin

Please don't use a browser for testing. There's no useful information there. Use Terminal and the "curl -v" command.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Jan 12, 2023 2:29 pm
marcel langelaan offline
Posts: 65
Joined: May 12, 2017

Re: help needed with httpd plugin

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

Posted on
Thu Jan 12, 2023 2:29 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: help needed with httpd plugin

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?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Jan 12, 2023 2:35 pm
marcel langelaan offline
Posts: 65
Joined: May 12, 2017

Re: help needed with httpd plugin

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'}

Posted on
Thu Jan 12, 2023 2:36 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: help needed with httpd plugin

It's saying unauthorized. Did you clear the username and password fields in the Indigo device as instructed?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Jan 12, 2023 2:40 pm
marcel langelaan offline
Posts: 65
Joined: May 12, 2017

Re: help needed with httpd plugin

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)

Posted on
Thu Jan 12, 2023 2:42 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: help needed with httpd plugin

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?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Jan 12, 2023 2:45 pm
marcel langelaan offline
Posts: 65
Joined: May 12, 2017

Re: help needed with httpd plugin

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.

Posted on
Thu Jan 12, 2023 2:50 pm
marcel langelaan offline
Posts: 65
Joined: May 12, 2017

Re: help needed with httpd plugin

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.
Attachments
foscam triggers.png
foscam triggers.png (172.75 KiB) Viewed 2130 times

Posted on
Thu Jan 12, 2023 2:55 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: help needed with httpd plugin

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.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Jan 12, 2023 3:08 pm
marcel langelaan offline
Posts: 65
Joined: May 12, 2017

Re: help needed with httpd plugin

again thx for your support, without your patience and knowledge I was sill swimming around.

Who is online

Users browsing this forum: No registered users and 7 guests