Blynk crashing Particle Photon

I ran across a new and discouraging behavior while attempting to use Blynk with a Particle Photon on a project I was developing at home. I’ve used Blynk with Particle devices many times in the past without issue - including for a couple of days last week when I was first playing with this new idea. But then over the last weekend, everything stopped working, and I started to get this “crashing” behavior.

After spending some time trying to isolate the issue and boing back and forth with different versions of Device OS on the Photon, I have a very repeatable process to make it fail. The failing/crashing symptoms are:

  • Photon disconnects from WiFi
  • Cyan status LED switches to slow dark blue Listening Mode blinking
  • Then status LED transitions to rapid dark blue blinking pattern
  • WiFi credentials are erased, and I need to go through the WiFi setup process again AND re-flash the program with a safe program (Tinker) that does not start Blynk. Otherwise, the process will just repeat itself.

Here’s a video of the setup and steps that cause the crash: https://youtu.be/flr_34Bg4Fk

Some additional info:

  • Hardware: Particle Photon
  • Photon Device OS Version: 0.7.0
  • Blynk Library: 0.5.4
  • Blynk Server (Not local)

The code is from the Getting Started code builder on Blynk.cc:

    /* Comment this out to disable prints and save space */
    #define BLYNK_DEBUG
    #define BLYNK_PRINT Serial

    #include <blynk.h>

    // You should get Auth Token in the Blynk App.
    // Go to the Project Settings (nut icon).
    char auth[] = "[REMOVED FOR POST]";

    void setup()
    {
      // Debug console
      Serial.begin(9600);

      delay(5000); // Allow board to settle
      Blynk.begin(auth);
    }

    void loop()
    {
      Blynk.run();
      // You can inject your own code or combine it with other sketches.
      // Check other examples on how to communicate with Blynk. Remember
      // to avoid delay() function!
    }

Any thoughts or ideas are welcome!

Thanks!
Jason

@jasonpecor, I ran your code but with DeviceOS 0.8.0-rc12. I also added SerialLogHandler logHandler(LOG_LEVEL_ALL); and SYSTEM_THREAD(ENABLE). With the latest RC release, I cannot duplicate the odd blinking pattern you had with 0.7.0. However, the Photon was going offline and, after a period of flashing cyan, flashing orange and more flashing cyan, it comes back online.

I then left the Photon in Safe mode to reprogram it with threading disabled. This was this morning and I only got back to it at 5pm or so. Now, everything is working and not going offline. I wonder if the issue was related to the Blynk servers?

3 Likes

Thanks for the update and for going through all the motions to help me out. I start by just trying it again with 0.7.0 in case there was something going on with Blynk. And then I’ll upgrade my Photon to 0.8.0-rc12 and give it a whirl.

The failure symptoms seem unlikely to be Blynk server related, though, IMO. If it were just disconnecting, that would be one thing. But to force the Photon into an un-documented failure mode where the WiFi credentials seem to get erased seems like something running amok locally. But, admittedly, I don’t really understand what all is happening under the covers.

I’ll give it a try and report back.

OH - BTW, when I try this code with my Electron, it also disconnects but then alternates rapid blinking dark blue then red status LED.

Thanks again for the suggestion.

WOO-HOO!!! That was the ticket!

Well, the DeviceOS 0.8.0-rc12 upgrade, that is. I tried with 0.7.0 first, and it still did not work, but 0.8.0-rc12 does. And not only does my simple program work, but the original app I was working on is now functional, as well.

Thank you @peekay123 for the legwork and recommendation!

Now to try that trick with the Electron.

Also - in the absence of a working Blynk solution, I did create a serviceable app with Ubidots. I am a big fan of the Ubidots platform, as well, but I find Blynk more friendly for pure mobile applications.

Thanks again!
Jason

1 Like