Blynk + Cloud Functions Not Registering

Has anyone else seen issues with registering Particle cloud functions while running the Blynk library?

I thought at first it was 1.3.0-rc.1. I downgraded to 1.2.1 and was still having the same issue. After completely removing the Blynk library it went away. Here’s a code snippet:

void setup() {

  // Serial for debugging
  Serial.begin();

  // Put initialization like pinMode and begin functions here.
  Blynk.begin(auth);

  // Subscribe to temperature events
  Mesh.subscribe("temperature",tempHandler);

  // Register function
  bool success = Particle.function("rgb", rgbFunction);
  if( !success ) {
    Serial.println("unable to register");
  } else {
    Serial.println("registered!");
  }

}

// loop() runs over and over again, as quickly as it can execute.
void loop() {
  // The core of your code will likely live here.
  Blynk.run();

}

I’m still getting a registered! response but it doesn’t show in the Console. Low use edge case but I figure I’d put it out there for other people with the same issue.

What if you put the registration of the funtion before Blynk.begin(auth)?
Blynk.begin() may take too much time so the registration window may have closed by the time when you get to the Particle.function() call.

1 Like

Looks like that did it. Thanks @ScruffR

1 Like