Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2017-11-24 04:57:48

chandc
Member
Registered: 2016-08-03
Posts: 14

Trigger HTTP2 function block via REST API

Hi Rex Team,


I would like to send a command via HTTP / HTTPS to the Rex REST API that triggers an HTTP2 function block to send a POST.  Could you provide me an example of the formatting for such a  command that triggers the HTTP2 function block?

http://host:pot/api/resource?query


How would I specify the particular HTTP2 block that I would like to trigger and the trigger command itself?

Thanks in advance!

Chand

Offline

#2 2017-11-24 14:06:00

tomáš čechura
Administrator
Registered: 2016-02-22
Posts: 371

Re: Trigger HTTP2 function block via REST API

Hi Chand,

do I understand it correctly that you are not able (for some reason) to make directly HTTP POST request and you want to use combination of HTTP GET and REX to achieve it? What is the reason?

It isn't possible to trigger HTTP2 function block using HTTP GET command. Is it possible for you to use e.g. Python script and perform HTTP POST request? Can you describe your setup more to details so I will have more information to give you the right advice?

Regards, Tomas

Offline

#3 2017-11-24 20:12:20

chandc
Member
Registered: 2016-08-03
Posts: 14

Re: Trigger HTTP2 function block via REST API

Hi Tomas,

I have several Arduino feather huzzah boards performing various functions within my control system, each receiving command from Rex via the HTTP2 block.  A this point I would like to configure an html link / button on my Grafana dashboard to send a command that triggers the http2 block to send a POST to one of those boards.  Becasue Rex supports basic authentication , I was hoping to allow the command, which may originate from outside my local network, to be received by Rex, rather than the individual Arduino board.  Additionally I would like all control commands to originate from Rex rather than them being  submitted directly to each sub-system from outside the control system.

Thanks for the assistance Tomas!

Offline

#4 2017-11-30 17:05:18

tomáš čechura
Administrator
Registered: 2016-02-22
Posts: 371

Re: Trigger HTTP2 function block via REST API

Hi Chand,

now I see your point. Thank you for clarification. For now there is no direct way how to trigger something inside REX using html link query.
It should be possible to use node.red as middleman. It can handle http query parameters (see: https://cookbook.nodered.org/http/handl … parameters) and also perform HTTP POST request to REX Control System.

Let me ask you a question: is there any specific reason why not to use capabilities of RexHMI for your project? Does Grafana provides you something additional which is missing in our solution? Just asking about your needs which can lead to the improvement of our product.

Cheers, Tomas

Offline

#5 2017-12-05 18:57:57

chandc
Member
Registered: 2016-08-03
Posts: 14

Re: Trigger HTTP2 function block via REST API

Hi Tomas,

Thank you for the Node Red suggestion.

I am currently in a prototyping phase;however, am also preparing to have others test the system.  As such I would like to keep close to Grafana's look without expending a large amount of time trying to make buttons etc in Inscape have the quality / look of Grafana.  Basically it is a time constraint.

Thank you,

Chand

Offline

#6 2017-12-12 09:35:40

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: Trigger HTTP2 function block via REST API

Dear Chand,
thanks for your response. Improving the look of our HMI components is on our todo list, but our resources are limited. Hope the Node-RED workaround solves your needs.

Kind regards,
Jaroslav

Offline

Board footer

Powered by FluxBB