Page 1 of 1

Error parsing http request address - more details needed

Posted: Monday 13 December 2021 17:44
by skarembel
Hello!

Is there any way to view the exact calls Domoticz is receiving? Logs display only vague message like "Error: Error parsing http request address: <IP>"

I'm trying to send the data from ESP8266 via API using the request as below:

Code: Select all

http://<domoticzIP>:8080/json.htm?username=<hashedUsername>&password=<hashedPwd>&type=command&param=udevice&idx=1&nvalue=0&svalue=8;8
It's not successful, I get following error in logs:
Error: Error parsing http request address: <myNetworkPublicIP>
At the same time the same call from my PC (in the same network as ESP8226) succeeds, sensor data gets updated:
Status: Incoming connection from: <myNetworkPublicIP>
Domoticz is running on an external server, accessible from the internet. Both devices (ESP and PC) are in the same local network.
Domoticz Version: 2021.1 (build 13872) running in Docker container.

My suspicion is that the call from ESP is somehow malformed when sent, that's why I want to see more detailed logs.
Or maybe there's a different problem? Any ideas welcome!

Re: Error parsing http request address - more details needed

Posted: Monday 13 December 2021 21:09
by waltervl
I believe that is a known issue with ESPEasy. some scrambling up by &para string

But it should be fixed: https://github.com/letscontrolit/ESPEasy/issues/2660

Re: Error parsing http request address - more details needed

Posted: Wednesday 15 December 2021 22:36
by skarembel
Thanks for the reply. Actually I'm not using ESP Easy here, I'm writing my own code in Arduino IDE.

Anyway, I found the reason of my problem- I had an old piece of code for sending HTTP requests, but I started using much newer version of the library. It compiled properly, but the requests were not correct (not sure though what was wrong with them).

Still, would be nice to have a possibility to have a more detailed log in Domoticz to be able to debug easier.

Re: Error parsing http request address - more details needed

Posted: Friday 14 January 2022 12:51
by Soulwax62
Hello @skarembel

I happened to have exactly the same problem as you.

I plugged an esp8266 on my arduino to send sensor data to domoticz through API.
I have no problem doing it from whatever request sender (navigator, postman...).

When i try to do it from the ESP8266 command interface.
Domoticz logs me the exact same message as your example :

2022-01-14 12:26:35.045 Error: Error parsing http request address: ::ffff:192.168.1.45

where the local ip address for my current esp8266 is the 45.
I didn't open domoticz from the outside which excludes any external intervention.

When i type myself the commands
AT
OK
AT+CWMODE=1
OK
AT+CWJAP="fakeSSID","fakePasswordKey"
OK
AT+CIPMUX=1
OK
AT+CIPSTART=0,"TCP","fakeDomoticzIP",fakeDomoticzPort
OK
AT+CIPSEND=0,63
OK
>GET /json.htm?type=command&param=udevice&idx=fakeDomoticIdx&nvalue=807

Recv 63 bytes

SEND OK

IPD,0,162:HTTP/1.1 400 Bad Request
Content-Length: 89
Content-Type: text/html

<html><head><title>Bad Request</title></head><body><h1>400 Bad Request</h1></body></html>0,

CLOSED

I assume the request get sent by the ESP8266 is malformed to the eyes of domoticz or maybe lacks some headers.



Can you perhaps indicate which solution you found to see if i can find a parallel solution for myself?
Or maybe anyone knows how to counter this issue?

I can add that i previously managed to send data with an ESP8266 alone without arduino by using their libraries and their post function.

Thank you very much
Soulwax