Sorry, my mistake.
The hardware is as follows:
esp12 controlling a relay via the virtual button.
The relay connects in parallel with the wall mounted push switch which opens and closes the gate. So either wall mounted push switch or blynk virtual button (ledPin5) can open and close the gate.
The code is as follows
indent preformatted text by 4 spaces
Code for button
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] =âxxxxxxxxxxxxxxxxxxxxxxxxâ;
int ledPin4=4; // assign widget LED to tie with gpio pin 4
int ledPin5=5; // assign widget LED to tie with gpio pin 5
// ======================================================
void setup()
{
Serial.begin(115200);
Blynk.begin(auth, âxxxxxxxxxxxxxâ, âxxxxxxxxxxxxxxxxxxxxxâ);
pinMode (ledPin4,OUTPUT); // assign ledPin4 as output
pinMode (ledPin5,OUTPUT); // assign ledPin5 as output
}
void loop()
{
Blynk.run();
int led4value = digitalRead (ledPin4); // note digitalRead used although this is output pin.
if (led4value==HIGH){ // if value is HIGH, turn ON virtual LED 4
Blynk.virtualWrite (ledPin4,HIGH); // note syntax is Blynk.virtualWrite
}
else {
Blynk.virtualWrite (ledPin4,LOW);
}
int led5value = digitalRead (ledPin5); // note digitalRead used although this is output pin.
if (led5value==HIGH){ // if value is HIGH, turn ON virtual LED 5
Blynk.virtualWrite (ledPin5,HIGH); // note syntax is Blynk.virtualWrite
}
else {
Blynk.virtualWrite (ledPin5,LOW);
}
Note ledPin4 is not used at all.
Recent changes I made:
- Updated to IOS9.3.2 on iphone 6s
- Updated to blynk v2.3
Symptoms:
- Gate does not open/close when I push virtual button but itâs ok when I push the wall mounted switch. This symptom happens a lot after software upgrade.
- Occasionally, gate only open/close after a long delay of approx 10 secs. This symptom is not frequent though. Most of the time, there is no response.
Prior to software upgrade, it was working fine.
Thanks