I was having lots of issues with Blynk, getting mostly “Your Particle Photon is not in network” messages. I think I stumbled on something that (so far) seems to help. Maybe this will help someone else, or at least anyone new to this like I am.
I was positive the Photon was working properly and was connected to my network (I’m not sure what network the warning refers to), I had the most current Blynk software from Particle in my sketch and from the Play Store on my phone, I tried logging off/on, I removed/reloaded the Blynk app on my phone, and I regenerated Blynk auth tokens and ensured I was using the new one in my sketch. Nada.
Trying to figure things out, I made a very simple program with one parameter; temperature readings from a TMP36 sensor. My troubleshooting sketch is below. The problem seemed to be in having too long of a delay in my code. I sped up the delay in my code from 60s to 5s and then set my Blynk “Reading Frequency” to match. It seems to have solved the problem. I hope this helps someone else avoid the frustration I was having.
#include “blynk/blynk.h”
char auth[] = “d75cbwouldntyouliketoknow5a68aa61”;
const int pipePin = A1;
int pipef;
void setup()
{
Blynk.begin(auth);
pinMode(A1, INPUT);
}
void loop()
{
Blynk.run();
pipef = ((((((analogRead(pipePin) * (3.3/4095)) 1000.0) - 500)/10)(9.0/5.0)) + 32.0);//convert it to F
Blynk.virtualWrite(V1, pipef);
delay (5000);//was originally set to 60000
}