Node Red HTTP Post

Has anyone tried to create a flow in Node Red with their Spark core? The http post connects to my device but returns a value of -1. I am using the following url.

Node Red Flow and result

Is analogread a `Spark.variable()?

I think he must have Tinker loaded on the core. That command should work OK with Tinker.

Yes, I’m using a HTTP Request GET command and a variable on the spark core to detect motion.

It works well for me.

Hi @tinkerMike,

I think the problem you’re running into is ‘analogread’ is a spark.function, so it’s expecting a http POST request, and I’m guessing that http request is a GET.


1 Like

@lightx - Have you tried a function where you pass the pin number? I can get the variable returned and that might be good enough for now but I was hoping to have a function to call.

There are both POST and GET Methods on the HTTP Request Node

HTTP Request Node

For the GET method, I successfully accessed a variable:

For the POST method, I unsuccessfully tried to access the Tinker app function:

@tinkerMike - the only way I found to work was to use exec since I couldn’t figure out how to pass arguments in the http request. Ive used something along the lines of

curl "" -d "args=on"

I was able to do it without using the exec block, see this flow:

1 Like