I’m trying to register a cloud function. Despite returning true, Particle.function() isn’t actually registering my cloud function - the function list is empty! I’m trying it out with a pretty simple scenario:
void setup() {
Serial.begin(115200);
while(!Serial.available()) Particle.process();
Serial.printf("Booting.\n");
// Configure the transmitter IC.
Max7060::Options xmit_options;
xmit_options.attenuation = 0;
xmit_options.tuning_cap = 15;
xmit.init(xmit_options);
// Configure the remote control bit-banger.
Liftmaster::Options remote_options;
remote.setOptions(remote_options);
// Set up the status pin from the charger IC.
pinMode(D1, INPUT_PULLUP);
// Configure the LED
pinMode(D7, OUTPUT);
// Enable listening to the pushbutton.
pinMode(button, INPUT_PULLUP);
// Register our RPC with the Particle cloud service.
Particle.function("test", test);
Serial.printf("Booted.\n");
}
I’ve got a pretty simple test function with a definitely-less-than-twelve-characters name:
int test(String command) {
return 0;
}
Here’s what I get when I query the device:
{
<blah blah blah>
"variables": {},
"functions": [],
"cc3000_patch_version": "wl0: Nov 7 2014 16:03:45 version 5.90.230.12 FWID 01-559ee6e8"
}
My other - more complicated - app works fine. Surely I’m overlooking something simple, but I have no idea what it might be.