Page 1 of 1

ESPEasy don't send data to Domoticz

Posted: 23 Feb 2023, 19:45
by xhunter
Hello, I have a problem sending data from espeasy to domoticz (ver. 20231). Esp has version "Build: ESP_Easy_mega_20221224_normal_ESP8266_4M1M Dec 24 202"

In the esp log I get the message:

Code: Select all

EVENT: http#myweb.ddns.net=401
4132864: HTTP : C001 myweb.ddns.net GET... failed HTTP code: 401
When I manually want to enter data into the sensor via www, it's ok:

Code: Select all

http://myweb.ddns.net:8080/json.htm?username=admin=&password=***encodedpassword**&type=command&param=udevice&idx=44&nvalue=0&svalue=4
Here is screenshot from ESP

Image

Where could be the problem?

Re: ESPEasy don't send data to Domoticz

Posted: 23 Feb 2023, 19:57
by Ath
Your dns configuration is most likely not correct, what do you have set on the Config page in the WiFi IP Settings section?

Re: ESPEasy don't send data to Domoticz

Posted: 23 Feb 2023, 20:07
by xhunter
Here is my config Image

When I enter the domoticz ip address in the hostname it doesn't work either

Re: ESPEasy don't send data to Domoticz

Posted: 23 Feb 2023, 20:53
by Ath
Doesn't your router provide a local dns? That's most likely quicker to respond than the external 8.8.8.8 Google dns.
Is the Domoticz server in a different lan segment? Or even external from your network? The 401 error code indicates it's not allowed to be accessed from the ESP, so it's a networking issue, probably not an ESPEasy issue.

Re: ESPEasy don't send data to Domoticz

Posted: 23 Feb 2023, 21:04
by xhunter
I changed the dns address to the default gateway ip. Domoticz is on the same network as ESP. I set the domoticz address as ip address and not hostname and it still doesn't work.

Re: ESPEasy don't send data to Domoticz

Posted: 23 Feb 2023, 21:21
by Ath
Have you re-checked the password for the Domoticz admin account? It needs the actual password in the Controller settings. After saving it will be replaced by a dummy in the page, to avoid it being scraped from the browser.
Does it contain some specific special characters?, as that could cause issues, though I haven't seen any reports of that recently.

You can also test the url you sent from the browser using the SendToHTTP command from the Tools page, but it probably needs to be split in 3 parts for that: The IP-address (no http:// prefix!), the port and the rest of the url, like:

Code: Select all

SendToHTTP,192.168.100.???,8080,/json.htm?username=admin=&password=***encodedpassword**&type=command&param=udevice&idx=44&nvalue=0&svalue=4
Fill in the 4th byte of the Domoticz IP address instead of the ???

Re: ESPEasy don't send data to Domoticz

Posted: 23 Feb 2023, 21:43
by TD-er
When possible, do not address internal devices via your public address.
By making it public, you need to add port forwarding and makes your network vulnarable for attacks.

Also not all routers accept forwarding from internal nodes.
Thus when possible, use internal IP, like Ton already suggested.

Another thing that might go wrong here is the authentication.
Does the URL you try to reach work when you open it from your own browser? (assuming it is in the same subnet)
If so, please check whether the browser does redirect to https:// instead of http://

Maybe the authentication needs a syntax like http://username:password@hostname:portname/....