Help with http request


#1

1) Give a description of the problem
I am trying to control my AV receiver with an http request. Using Putty in Raw mode, I can get the correct response to the request “version”

Putty%20Response

Putty%20Capture

My Russound uses RIO (Russound I/O). The RIO Command Set is available as ASCII text via TCP/IP.
I have tried several options within webore and cannot get it to work.

2) What is the expected behaviour?
Correct response from my Russound with a webcore http request.

3) What is happening/not happening?
(PUT YOUR INFO HERE)

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full


#2

It looks like you are trying to use HTTP to make a raw TCP call. That isn’t going to happen.

I don’t think SmartThings can even do raw TCP calls, at least not with responses anyway.


#3

Clearly I do not understand the difference between HTTP and TCP. I was hoping to use webcore and the RIO protocol to control my Russound. Foiled again Batman…


#4

Maybe you can use a bridge… a pi maybe or a 24/7 computer that can run python.


#5

Please pardon my limited understanding of this topic.
My AV controller (Russound) offers an ASCII IP interface using the Russound RIO protocol via IP or RS232. As I understand it, ASCII commands can be sent to the unit. The RIO Command Set is available as ASCII text via IP (using port 9621). A typical command would be

EVENT C[1].Z[3]!ZoneOn

Essentially meaning that on controller 1, zone 3, turn on.

Can I just use a GET or POST to send the EVENT C[1].Z[3]!ZoneOn command to my device?


#6

Can you get a URL that works in a browser? e.g 192.168.0.15:9621/version I’m not sure your device would support this, but if it did, you can then just use that as the whole request on a get request.


#7

OK, I am stumbling through the dark here. I have tried several examples in my browser (http://192.168.0.39:9621\version\r). Nothing is working. If I use Putty these work perfectly:

event c[1].z[1]!zoneon
version

The RIO Command Set is available as ASCII text via IP (using port 9621) and RS232 interfaces.

RIO commands are made up of ASCII characters except for the terminating characters.

All RIO commands must be terminated with a (0x0D hex)


#8

The problem remains that you need to communicate using the RIO protocol over TCP, that is to say you need to send requests and receive responses in a particular format. In webCoRE you only have access to make web requests which use the HTTP protocol over TCP, which uses different request and response formats.

webCoRE, and indeed SmartThings, doesn’t offer the features you need.


#9

Thanks @orangebucket. So I presume that Putty uses the TCP protocol and that is why it works?


#10

That is how I see it, yes.


#11

I looked at @eibyer’s suggestion above with Python, but I am still confused. Telnet and Raw commands work through Putty. Any suggestion as to which direction I should take to be able to issue commands to my AV receiver from webcore on Hubitat? Currently I am using a RPi with a SmartThings node proxy connected to my Russound with a RS232 cable.The SmartThings app is written in Groovy and the developer has vanished. I would like to run everything locally through my Hubitat. Sorry, I certainly do not understand most of this. I am just trying to piece this together. I greatly appreciate any assistance here.


#12

To send http requests to a device/server, that device must be running a web server service, which will respond to those requests. It appears your russound does not run a webserver.

The putty connection is a “permanent” connection to the russound, which you can then type in commands, much like typing into a computer terminal session.

Webcore would need functionality to create the initial connection (connecting with putty) then sending commands over the connection (typing commands into the putty session)

I think the only way to make this work is to write a script on the RPI to open a connection and send the command. I’m not sure how exactly to do this. I’ve used node.js on the RPI, this allows you to write code which listens on the defined port, webcore can then call the ip:port with a get request to activate the code on the RPI


#13

I should have mentioned that I do have node.js running on the RPi as well. I followed the “cookbook” instructions that the app author put together. I can access my AV receiver with webcore. And it works, most of the time. But I know that ST groovy is going away and I wanted to get a jump on making this work before that happens and cripples my house AV system. The new controller/amplifier (that works with Alexa) is $3,000. But it still uses the TCP protocol for communication and I suspect I would have the same webcore problem with it. I am hoping that I can use a proxy on the Hubitat that someone has already written that I might be able to modify to fit my needs.


Web request with variable in the url
#14

I know that my understanding of this is very limited. But how hard can it be to use GET or POST in webcore with plain text data with a device? Frustrating…


#15

My understanding is limited too. I don’t think this is doable via a get/put request. What you are looking for is a method to create a tcp/ip connection to a device and then pass data. This may need login credentials for some devices/services. Also, you may need the option to keep the connection open or just handle a one of connect/command/close situation. If the connection remains open, how do you establish/re-establish etc?

I agree this would be useful functionality, there are probably many devices out there that have this sort of interface.

I wonder if this would be a webcore enhancement, or something to be written in a device handler or smart app?