Page 1 of 1

OTGW monitor displays Bad Request messages

Posted: Mon Jan 01, 2024 10:20 am
by wimvandermaaten
For example, when entering the command GW=1, the OT monitor gives the answer: HTTP/1.1 400 Bad Request
What is going on here?

Re: OTGW monitor displays Bad Request messages

Posted: Mon Jan 01, 2024 11:17 am
by hvxl
Works for me (webserver configured for http on port 1480):

Via: http://localhost:1480/configure.html, Miscellaneous tab:

Code: Select all

10:12:30.614655	Command (via websocket): GW=1
10:12:30.640845	GW: 1
Using: `wget -qO- http://localhost:1480/command?GW=1`

Code: Select all

10:12:37.559266	Command (via web API from ::1:58020): GW=1
10:12:37.584049	GW: 1
Or with curl:

Code: Select all

curl -v http://localhost:1480/command?GW=1
*   Trying 127.0.0.1:1480...
* Connected to localhost (127.0.0.1) port 1480 (#0)
> GET /command?GW=1 HTTP/1.1
> Host: localhost:1480
> User-Agent: curl/8.0.1
> Accept: */*
> 
< HTTP/1.1 200
< content-type: text/plain
< content-length: 5
< 
* Connection #0 to host localhost left intact
GW: 1

Re: OTGW monitor displays Bad Request messages

Posted: Mon Jan 01, 2024 6:48 pm
by wimvandermaaten
Doesn't work for me (with the web server on port 80)

None of the three proposed codes, entered via the Miscellaneous tab, work properly. Each time the command GW=1 gives the following response:
HTTP/1.1 400 Bad Request

For example:

Re: OTGW monitor displays Bad Request messages

Posted: Tue Jan 02, 2024 12:14 am
by hvxl
Ah, so it's not OTmonitor that gives the answer "HTTP/1.1 400 Bad Request". OTmonitor only reports that whatever it is connected to produced "HTTP/1.1 400 Bad Request". So it seems that you are not connected to the serial data port of the OTGW.

From a previous post I understand you have an OTGW with a Wemos module running the OTGW-firmware by rvdbreemen. With that configuration you need to connect OTmonitor to port 25238 at the IP address of the Wemos. My guess is you connected to port 80 instead.

Re: OTGW monitor displays Bad Request messages

Posted: Tue Jan 02, 2024 5:11 am
by wimvandermaaten
Ja. Ik geloof dat nu alles werkt. Bedankt.

Translation:
Yes, I think everything works now. Thanks.