hello and sorry for my english.
I have an ESP8266 Node MCU 12E and 8 channel relay. This is controlled by Blynk and works very well. When I reset the ESP, all relays are always turned on. But these should be turned off when restarting and only start when I turn them on. I use D1, D2, D4, D5, D6, D7, D9 and D10.
What can I do that when starting the ESP are always all relays off? Request for help. Thanks
PS: everything is running on a local server
You can’t have all relays off at start , due to Nodemcu pin state at start.
Only GPIO 4 and 5 are Low at start
Probably the closest you’ll get is a digitalwrite in setup.
I have solved my problem. In the sketch I had to set pinmode and digitalpin to HIGH and it works. Many thanks
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "XXXXXXXXXXXXXXX";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "XXXXXXXX";
char pass[] = "XXXXXXX";
void setup()
{
pinMode(D1, OUTPUT);
digitalWrite(D1, HIGH);
pinMode(D2, OUTPUT);
digitalWrite(D2, HIGH);
pinMode(D4, OUTPUT);
digitalWrite(D4, HIGH);
pinMode(D5, OUTPUT);
digitalWrite(D5, HIGH);
pinMode(D6, OUTPUT);
digitalWrite(D6, HIGH);
pinMode(D7, OUTPUT);
digitalWrite(D7, HIGH);
pinMode(D9, OUTPUT);
digitalWrite(D9, HIGH);
pinMode(D10, OUTPUT);
digitalWrite(D10, HIGH);
// Debug console
Serial.begin(9600);
//Blynk.begin(auth, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
Blynk.begin(auth, ssid, pass, IPAddress(192,168,0,19), 8080);
}
void loop()
{
Blynk.run();
}