How to call a function from Linux Terminal?


I have this arm-based mini linux computer similar to a raspberry pi but not a raspberry pi.

It doesn’t have a web browser since it is all command line. But it is connected to the internet and I can ssh into its terminal.

How can I call a function on my photon using just the linux command line?

There are so many different ways with different apis to control the photon I am confused on what will work here.

I did some research and I found that maybe CURL? can accomplish this? Is there anything else I could use on a linux command line?

How would I do this? I am just trying to run a function.


There’s an example of using curl to call a function in the section “Call a Function” in the Cloud API reference.

Another possibility, if you can install node.js and some other dependencies, is to use the Command Line Interface (CLI). It does many other useful things, but “particle call” will call a function.

I see. Thanks. I’ll have to check if it has curl then. I don’t think I’ll be able to install Node on it though. It is a very specific linux distro.

is it also possible with wget?

Function calls are made via a POST request and curl should be available on Linux and not need node.

There exists ARM builds of nodejs which can likely get you going much faster in the long run. This solution depends on it being at least debian based.