URL command to start Flow in Node-Red

Hello everyone,
I have this Node-Red flow and I want to start it with URL. How can I do it? I try this ULR:

Thank you

Giammarco





I’ve been looking at this and trying to work out what the URL is doing or why you are using it?
Are you looking for a Node-RED dashboard interface and a button that will start and stop your daq?

The websocket interface is still behind the authentication server that EPIC uses, so I suspect that’s some of the issue there.

We have an acquisition software for logging our operation sensors and I want understad how it is working. For example if I push ā€œPLC Stop Acquisitionā€, the software sends the command ā€œset_daq_stopā€ to node-red but if I send ā€œhttps://192.168.12.33/node-red/set_daq_stopā€ it doesn’t work. Probably into this software there is a routine for EPIC authentication, it is my supposition. I want to understand if we can interface with this node-red project with another software.

Thank You

Change this debug here:

Looks like you have it set for msg.payload.
Change it like this:

That should better tell you whats going on.

Hi Beno,
Whenever I try to make that API call from Postman, we get a 200 Response but the body is just HTML code that’s basically login prompt:

I’ve tried passing in Basic Auth Credentials but it makes no difference.

I added that debug output to the flow but it appears as it’s never even getting to it because the debug log never shows anything.

Any ideas?

Can you go back and undo what ever changes you made that broke it?
It was working…

If you can go back to when it was working, and just change the debug level to full, you should see what Node-RED is seeing (not sure what Postman is going to show or how it might help).

I’ve never had it working for myself. I don’t have the SMAPE software that they use to initialize/make these calls. I’m working off a new Opto Groov controller that was sent to us by SMAPE in order to try an integrate it into our own software. I haven’t made any changes to what was given to me besides adding the debug output to the Main Handler.

I have to admit I am still a little hazy as to what the question and task is…
Here is my summary:

@laboratorio.elettric has it working, but wants to understand how it works and if some other software can be interfaced with Node-RED.

@BBousman does not have the software, but wants to use Postman to do the same calls and try and get it working.

I think if I can just boil down what is the common question between both it would be this:
How does the ā€˜http in’ node work on EPIC?

Let me run some tests on that node here and see what I can find.

Correct, I’m working with @laboratorio.elettric to integrate the Opto Groov into our Software. Our software would need to be able to hit this HTTP In node so that’s why I’m trying to get it to work via Postman first in order to be able to code it once I figure out the correct path.

Ok, thanks for the clarification.
I think I have something working for you.

The core issue is that the default HTTP In node uses the default Node-RED port of 1880.
Since we (EPIC) grab that incoming port and wrap it in our groov Manage authentication server, you cant really use it for your own use.

We (Opto22) are not the only ones to have this issue so some years back someone made an HTTP In node that allows you to set a different port number.
Add this node to your pallet: node-red-contrib-http-custom-port

Once that is installed, you will need to pick a port number that is higher than 1024 and not being used by any other service, for this example, I picked port 5005.
Next, you need to open the groov Manage firewall port for that port.

After you click Ok to add the rule, don’t forget to click ā€˜Save’.

Now go back to your Node-RED editor.
Here is my sample flow to get you started in testing this:

Import it: [{"id":"b0e58d561a178d2d","type":"node-red-contrib-http-custom-port","z":"1f5fad0db201833e","name":"","url":"/test","method":"get","upload":true,"swaggerDoc":"","port":"5005","x":310,"y":620,"wires":[["59e1ede2e6da9fb0","500bcf5db325f188"]]},{"id":"59e1ede2e6da9fb0","type":"debug","z":"1f5fad0db201833e","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":640,"y":580,"wires":[]},{"id":"500bcf5db325f188","type":"template","z":"1f5fad0db201833e","name":"","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Devs page</title>\n</head>\n\n<body>\n <h1>Hello, OptoForums</h1>\n</body>\n\n</html>","output":"str","x":520,"y":660,"wires":[["355f5b64cf4f01db"]]},{"id":"355f5b64cf4f01db","type":"http response","z":"1f5fad0db201833e","name":"webpage","statusCode":"","headers":{},"x":720,"y":660,"wires":[]}]

Now hit the IP address of your EPIC with port 5005 and the path of page you add, in my case it is /test.
Like this:

You should see the web page come back.

Lets know if that gets you up and running.

Yeah, had to make a few modifications to the node (i.e. In order to pass in the payload value, it needed to be a POST and not a GET) but once I did that I was able to get it to accept the value so I’m not sure how @laboratorio.elettric has it working with the SMAPE software but I can at least get it to work now so thank you for the help!

2 Likes