How to include credentials with SendToHTTP?
Posted: 18 Jul 2022, 22:25
I would like to send commands to my Dahua IP Cameras. The camera API requires credentials. For example, here is the command that applies a text overlay on the camera image (user is "admin" and password is "cam123X#"):
This command works correctly when it is entered as the URL in a browser.
Note: The "#" in the password has been replaced with %23 due to URL encoding requirements.
But I cannot get it to work with ESPEasy. I have a rule that sends the http command as follows:
Note: Changing the "#" in the password to %23 does not help.
Serial log shows this:
I've experimented with the http options in Tools->Advanced Rules Settings. No joy.
I'm running ESPEasy ESP_Easy_mega_20220616_normal_ESP8266_4M1M on a Wemos D1 mini. There are no plugins or controllers, just some rules to send the http command on a repeating timer. The camera and ESPEasy device are on the same subnet.
Looking for advice on getting it to work.
- Thomas
Code: Select all
http://admin:cam123X%23@192.168.1.240/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].CustomTitle[1].Text=DOOR%20IS%20LOCKED
Note: The "#" in the password has been replaced with %23 due to URL encoding requirements.
But I cannot get it to work with ESPEasy. I have a rule that sends the http command as follows:
Code: Select all
SendToHTTP,admin:cam123X#@192.168.1.240,80,/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].CustomTitle[1].Text=DOOR%20IS%20LOCKED
Serial log shows this:
Code: Select all
2025659 : Info : ACT : SendToHTTP,admin:cam123X#@192.168.1.240,80,/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].CustomTitle[1].Text=DOOR%20IS%20LOCKED
2029838 : Error : SendToHTTP connection failed
I'm running ESPEasy ESP_Easy_mega_20220616_normal_ESP8266_4M1M on a Wemos D1 mini. There are no plugins or controllers, just some rules to send the http command on a repeating timer. The camera and ESPEasy device are on the same subnet.
Looking for advice on getting it to work.
- Thomas