Device offline on Blynk app

Hi all, I am using Arduino IDE along with the Blynk app. I am creating an IoT product where i refer from this Website. I have done uploaded the coding and there is no error mentioned. But the device on the blynk device is still “offline”. Can someone help me? I am using product as mentioned on the website above which is Maker UNO, Cytron ESP8266 WiFi Shield, IR Line Tracking Module and Male to Female Jumper Wire.

Code:

#define BLYNK_TEMPLATE_ID "TMPL6QMottIQq"
#define BLYNK_TEMPLATE_NAME "Mailbox Notification"
#define BLYNK_DEVICE_NAME "Arduino Uno Maker"
#define BLYNK_AUTH_TOKEN "FQSNjozKYoaaVGpTGYTvQWCjm0vPW-mQ"
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = BLYNK_AUTH_TOKEN;
char deviceName[] = "Arduino Uno Maker";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Galaxy Tab A85739";
char pass[] = "qwertyuiop";
// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1
// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX
// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600
ESP8266 wifi (&EspSerial);
int sensorPin = 7;   // Input pin for the IR sensor
int count = 0;       // Mail counter
String stringOne = "You got ";
String stringTwo;
String stringThree = " new mail.";
String message;
boolean prevState = false;
void setup()
{
  // Debug console
  Serial.begin(9600);
  delay(10);
  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);
  Blynk.begin(BLYNK_AUTH_TOKEN, wifi, ssid, pass);
}
void loop()
{
  Blynk.run();
  int  state = digitalRead(sensorPin);
  if ( state == LOW && prevState == true)
  {
    count++;
    stringTwo = count;
    message = stringOne + stringTwo + stringThree;
    Blynk.logEvent(message);
  }
  prevState = state;
}
BLYNK_WRITE(V1)
{
  count = 0;
}```

please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly. Triple backticks look like this: ```

1 Like

Is your phone set-up to provide a 5GHz to 2.4GHz WiFi hotspot?

Have you tried with a domestic 2.4GHz network?

Are you sure that your WiFi shield is configured to work at this baud rate?

Is there any reason why you’re using prehistoric hardware like the Uno for this project?

Pete.

Yes, I have tried but still same.

Yes, I am sure.

No, there isn’t any reason. Is the hardware one of the reason the device can’t be changed to Online status?

The IR sensors works well as I can see the blink light, but the Device on Blynk console and Blynk app on mobile phone is still offline. I have set the Auth Token accordingly along with the SSID and password but still it remains offline.

Dis you copy/paste these three lines of firmware configuration, or type them manually?

What does your serial monitor show?

It’s always a good idea to use an IoT capable device when building an IoT project, and the Uno isn’t IoT capable unless you ass a clunky WiFi shield and AT communication between the Uno and the shield.

How will this project be powered?

Pete.

I copy/paste it.

It doesnt show anything.

Oh okay. I do have ESP8266 WiFi shield on the Uno. Does it count?

For now, by using powerbank.

I had adding new template and deleting template same as device many times to check the device status, but still it shows the same status, offline. Is there any other reason? I have followed this tutorial video .

That’s a problem you need to fix. The serial output will probably tell you why it’s not connecting.

The Uno doesn’t have native IoT connectivity. Adding an ESP8266 as a AT WiFi modem is the clunkiest approach to IoT connectivity possible.

But that as not the question I asked. how will the finished project be powered? I suspect you underestimate how much power the Uno, WiFi shield and IR sensor actually draw.
The best mailbox notification projects are ones based around an ESP32 in deep-sleep mode using a mechanical switch attached to a GPIO to wake-up the board and send a notification. This setup uses a fraction of the power of your hardware in always-on mode.

That video is designed for Blynk Legacy. The process for Blynk IoT is quite different, as you will already have discovered to get this far.

That won’t achieve anything. Your issue is most likely to do with the way that your WiFi shield is configured.

Pete.

Hi, I just fix the problem. here is the output:

It is already connect and device already shows Online status on Blynk console. Thanks!

but, there is still no notification on my Blynk app mobile phone. But the serial monitors shows how IR sensor detect the movement.

You’ve probably not configured the event correctly in the web console, and the syntax you’re using here…

is incorrect.
You should probably read this…

Pete.

okay thanks!!

this helps a lot! my problem solved now.

1 Like