Console and Core

This has seriously not been my month with Particle stuff…

I’m using an old spark core. The only code is just to take the arguments from a function and then publish them.

I’m getting null from my arguments I enter in the console.

Does the console not work with the Core for some reason?

void setup() {
Particle.function("SetLiters", setLiters);
}

void loop() {

}

int setLiters(String args){
   
   Particle.publish("Test", args);
    
    return 1;
}

When I run the function it calls the event, but the data is null. Am I missing something dumb?

Update- apparently it’s not just the Console. when I call it from the CLI it still shows null. hrmm

What device OS version are you targeting?
Try adding Serial.printlnf("<%s>", (const char*)args); and see if you even get the data into the function as expected.
It’s also always advisable (and with newer versions compulsory) to state the scope of your event
e.g.

  Particle.publish("test", args, PRIVATE);