Hi,
Short version of the problem:
I am sending a URL to an http request node to control my air conditioning, but node red returns, "Error: socket hang up". I know the URL is valid, because when pasted into a browser, it works (e.g. aircon powers on) and returns a valid json message with acknowledgement. Furthermore, the request does successfully execute the command from node red (e.g. aircon powers on), but node red returns the hang up error.
Longer version of the problem, with more detail, at the end of this post.
What I have discovered so far
I researched as far as I can, and found a discussion on stackoverflow, indicating that the hang up error occurs when a 'connection end event' is not sent to end the request, or if there is no timely response from the server.
Here's the link to the discussion: https://stackoverflow.com/questions/16995184/nodejs-what-does-socket-hang-up-actually-mean
What can I do?
I don't know what to do from here; it appears that either:
- node red is not sending a connection end event
or
- node red does not receive a timely response
Can anyone advise how I can proceed?
Long version of the problem:
I have created a flow for controlling my air conditioning which is connected my home network (via WiFi), and accepts json commands. (I learnt the commands by proxying my iphone to my PC using Fiddler).
If I paste one of the aircon commands into my web browser, the command is executed successfully (e.g. aircon turns on), and an acknowledgement is returned to the browser, for example:
When pasted into a browser window, this:
http://192.168.99.99:2025/setAircon?json={"ac1":{"info":{"state":"on","countDownToOn":"0","countDownToOff":"0"}}}
Returns this...
{"request":"setAircon","ack":true}
However, if I paste exactly the same URL into an http request node, the command executes on the aircon, but the following error is displayed as an error by the http request node:
Error: socket hang up