Rule engine about particle.function node

@rickkas7

Hi,

I’m intend to call an exposed particle function named “selection” and registered in Photon code.

int selection (String command) {
  int retVal = command.toInt();
  if (1 <= retVal && retVal <= 3) 
    Serial1.println( retVal);
  else 
    retVal = -1;

  return retVal;
} 

The device’s code registers the function and everything works fine when I testing it from particle console. The return values 1,2 3 are obtained.

The exposed function is expecting to receive 3 different string arguments : RF1-RF2-RF3.

On Rule engine I’m using drop down node and connect it to a function node called " Get argument"

Next a function node to set up the msg.argument value

Next that function is hooked up to a Particle.function node named “Ref”

From particle console I’m verifying that “selection” get called .
Also from the debug tab, from Rule engine, it can be seen that the function get called from the cloud( Rule engine), cause -1 is the value returned as payload.

I should received printed out on the terminal the numbers 1, 2 and 3 when the selection of RF1, RF2 and RF3 are chosen respectively, but does not happen.
Can I get some help on that?

If you need further info please let me know.

Thank you very much.

A post was merged into an existing topic: Particle.function node - Rule engine