I made a simple Blynk program, but the connection to my internet is not great. sometimes he is losing connection, but it doesn’t reconnect to my wifi.
how do I intergrade a reconnect function to the wifi?
I hope you can help me with this.
Thank you for your help!
(im using a Wemos d1 mini)
#define BLYNK_TEMPLATE_ID "XXXX"
#define BLYNK_DEVICE_NAME "XXXXX"
#define BLYNK_AUTH_TOKEN "XXXXXXXXX"
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = BLYNK_AUTH_TOKEN;
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "XXXXXXX";
char pass[] = "XXXXXXX";
int Open = 13;
int Dicht = 12;
BLYNK_WRITE(V0) {
int pinvalue = param.asInt ();
digitalWrite(Open,pinvalue);
}
BLYNK_WRITE(V1) {
int pinvalue = param.asInt ();
digitalWrite(Dicht,pinvalue);
}
void setup()
{
Serial.begin(115200);
delay(100);
pinMode(Open,OUTPUT);
pinMode(Dicht,OUTPUT);
Blynk.begin(auth, ssid, pass);
}
void loop() {
Blynk.run();
}
Im sorry, I Should mensioned that. There are 2 relays on it. It is for opening and closing a gate 2 times a day. Hé only has to check its connection every 5 minutes or so.