Attxer
1
Hey guys,
as my first project I wanted to trigger a function with IFTT, but nothing happens
.
I hope you can help me.
void setup() {
Particle.function("status",statusToggle);
}
void loop() {
}
int statusToggle(String command)
{
if(command.equals("on")) {
system("monitor_on.sh");
return 1;
}
else if (command.equals("off")) {
system("monitor_off.sh");
return 0;
}
else {
return -1;
}
Try blinking an LED first? How are you checking that “it is not working”?
Attxer
3
Thnx for responding!!
The scripts are working all right on their own, but when disconnecting/connecting to the wifi the scripts aren’t activated.
Moors7
4
Do they work when you call the function manually?
You can use the Console, CLI, app, or my page to test that easily.
1 Like
Attxer
5
I found my mistake!!!
The path in system()
was too unaccurate.