Jason1
October 8, 2021, 4:50am
1
Hi. I am trying to turn ON and OFF an LED using the Blynk app. I had created a template and virtual pins using blynk.cloud webpage. However whenever I try to find my ESP 8266 in the Blynk app, a message is shown “Device offline”. Below is my coding. Hope someone could kindly assist me with this issue. Thanks in advance.
Code:
# define BLYNK_TEMPLATE_ID = " "
# define BLYNK_DEVICE_NAME = " "
# define BLYNK_AUTH_TOKEN = " "
# include <BlynkSimpleEsp8266.h>
char ssid[] = "";
char pass[] = "";
BLYNK_WRITE (V0)
{
int pinValue = param.asInt ();
digitalWrite (15,pinValue);
}
void setup()
{
pinMode (15,OUTPUT);
Serial.begin (9600);
delay (100);
}
void loop()
{
Blynk.run();
}
John93
October 8, 2021, 4:55am
2
Hey there.
Edit your post and add triple backticks at the beginning and the end of your sketch please, triple backticks look like this ```.
John93
October 8, 2021, 5:00am
4
Make sure to fill the template ID and device name and auth token and delete the delay from the setup
Jason1
October 8, 2021, 5:01am
5
Yes, i did. I just removed it in this post
John93
October 8, 2021, 5:03am
6
Now go to the app, add a widget and assign it to the datastream
Jason1
October 8, 2021, 5:11am
8
after that I tried to ‘add device’. still my device is not found
John93
October 8, 2021, 5:12am
9
Just make sure the template ID and auth token are correct.
Jason1
October 8, 2021, 5:14am
10
they are correct because I directly copied it from the blynk.cloud webpage under Device info
John93
October 8, 2021, 5:17am
11
void setup()
{
// Debug console
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
pinMode (15,OUTPUT);
}
Jason1
October 8, 2021, 5:34am
12
tried it. still it shows device offline
John93
October 8, 2021, 5:36am
15
Try a different pin please
Jason1
October 8, 2021, 5:37am
16
ok, but is device connection related to pin connection?
What does your serial monitor show when you boot-up your NodeMCU?
Pete.
1 Like
Jason1
October 8, 2021, 9:55am
19
thank you everyone. The issue has been solved. The issue was with the UART cable that I used to connect from my PC to the NodeMCU. I have changed it, now it works fine…