Jump to content

Network Resource Help Request


wrj0

Recommended Posts

Posted

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.

post-889-140474162188_thumb.jpg

Posted

I think you need to take the password out of the body and place it in an authentication header instead.

 

-Xathros

Posted

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!

Posted
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

Posted

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.

Posted

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

Posted

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.

Posted

Excellent. Thanks for posting back with your results.

 

-Xathros

Guest
This topic is now closed to further replies.

×
×
  • Create New...