wrj0 Posted December 26, 2013 Posted December 26, 2013 I’m having trouble implementing a Network Resource based on a curl command and would appreciate some help. With curl installed, the following works from a command line, immediately returning an appropriate response from the (InControl Pro) application on port 1178: curl -X PUT -H "Content-Type:application/json;charset=utf-8" -d "{\"password\":\"\"}" http://192.168.3.105:1178/zwave/getScenes But, my attempts to translate the above into an ISY Network Resource fail, returning “Error: Request Failed,†and “N/A†in the ISY Resource Response window. Error Log shows: [TCP-Conn] -1/-140002, Net Module Rule: 116 Bumping the Timeout to 9000 returns the same result. I’ve tried various permutations of PUT, POST, modes, Encode URL, {} and "", all with the same result. Suggestions on what to try next will be greatly appreciated. Thanks.
Xathros Posted December 26, 2013 Posted December 26, 2013 I think you need to take the password out of the body and place it in an authentication header instead. -Xathros
wrj0 Posted December 26, 2013 Author Posted December 26, 2013 Thanks, Xanthos. I've tried that but can't seem to properly omit the username when entering the PW in the Authorization header. I'll keep poking at it for a while. Appreciate your input!
Xathros Posted December 26, 2013 Posted December 26, 2013 Thanks, Xanthos.I've tried that but can't seem to properly omit the username when entering the PW in the Authorization header. I'll keep poking at it for a while. Appreciate your input! Can the other end be configured to require a username? Then you could pass both user and pass in the auth header. -Xathros
Michel Kohanim Posted December 27, 2013 Posted December 27, 2013 Hi wrj0, According to: http://wiki.universal-devices.com/index ... r_Messages -140002 = HTTP_CLIENT_CONNECTION_TIMED_OUT . This means that ISY is not even getting to the HTTP protocol part since it cannot even connect to the given IP/Port. Is the machine which you run curl on the same network as ISY? With kind regards, Michel
wrj0 Posted December 27, 2013 Author Posted December 27, 2013 Thanks, Michel. Yes, it is indeed on the same subnet. Other ISY Network Resources access other applications on that PC just fine, e.g, WCLink.
Michel Kohanim Posted December 27, 2013 Posted December 27, 2013 Hello wrj0, Is rule 116 the one you are working with. Again, the error code means that ISY could not make a TCP socket connection and therefore I suspect networking issues. That's unless rule 116 is something else. With kind regards, Michel
wrj0 Posted December 27, 2013 Author Posted December 27, 2013 As you suspected, Michel, Network Resource ID=116 is the one I'm trying to get to mimic the curl command. Thanks for your reply and suggestion to look further at network issues. I'll keep poking at it. Thanks. edit: Michel, I subsequently found that the curl command works only if run from the same PC that is running the application that I am trying to control. If the same curl command is run from another PC on the same subnet, it returns: curl: (7) Failed to connect to 192.168.3.105 port 1178: Timed out So, you nailed the problem. Think I'll sleep on this one and try again tomorrow. Thanks again for your advice and assistance. edit again: It turns out this was was a Windows Firewall issue on the PC running the application being controlled. Enabling a firewall rule to open port 1178 allows the curl command to return the desired response from any device on the local network, including the ISY's Network Resource. The body for the rule that is now working is: {"password":""} Thanks Michel and Xanthros for your input. I'd still be banging my head without the benefit of your comments.
Xathros Posted December 27, 2013 Posted December 27, 2013 Excellent. Thanks for posting back with your results. -Xathros
Recommended Posts