Hello friends,
I have a problem and I don’t know how to solve it, or why what happens to me is happening, so I thank everyone who can help me.
I tried a sketch, with boards bought in stores, ESP8266, like NodeMcu and other well-known brands, it worked well, but for my project, I had several boards assembled, using the ESP8266 f chip and mounting the chip on a board to meet my need, the board works well for example on Arduino Cloud, an IoT platform, and it also loads all the codes well, when choosing the board from the list in the arduino IDE, I choose ESP8266 nodemcu, today I tried to upload my sketch on the platform here from Blynk, and although load the sketch normally, the ESP doesn’t show up online, I tried the same sketch with mounted boards and it works as expected, online, but with the stand alone board that I made using the chip, it doesn’t show up online.
What could be happening? Can anyone help me find out.
I put here the sketch, and a photo of my board.
Thanks in advance to everyone.
Greetings from Brazil.
// Fill-in information from your Blynk Template here
#define BLYNK_TEMPLATE_ID "xxxx!
#define BLYNK_DEVICE_NAME "xxxx"
#define BLYNK_AUTH_TOKEN "xxxx"
#define BLYNK_FIRMWARE_VERSION "1.0.1"
#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG
//#define APP_DEBUG
// Uncomment your board, or configure a custom board in Settings.h
//#define USE_SPARKFUN_BLYNK_BOARD
#define USE_NODE_MCU_BOARD
//#define USE_WITTY_CLOUD_BOARD
// define the GPIO connected with Relays and switches
#define RelayPin1 4 //D1
#define RelayPin2 2 //D2
#define RelayPin3 13 //D5
#define RelayPin4 12 //D6
#define SwitchPin1 10 //SD3
#define SwitchPin2 D3 //D3
#define SwitchPin3 13 //D7
#define SwitchPin4 3 //RX
#define wifiLed 16 //D0
//Change the virtual pins according the rooms
#define VPIN_BUTTON_1 V1
#define VPIN_BUTTON_2 V2
#define VPIN_BUTTON_3 V3
#define VPIN_BUTTON_4 V4
// Relay State
bool toggleState_1 = LOW; //Define integer to remember the toggle state for relay 1
bool toggleState_2 = LOW; //Define integer to remember the toggle state for relay 2
bool toggleState_3 = LOW; //Define integer to remember the toggle state for relay 3
bool toggleState_4 = LOW; //Define integer to remember the toggle state for relay 4
// Switch State
bool SwitchState_1 = LOW;
bool SwitchState_2 = LOW;
bool SwitchState_3 = LOW;
bool SwitchState_4 = LOW;
#include "BlynkEdgent.h"
BLYNK_CONNECTED() {
// Request the latest state from the server
Blynk.syncVirtual(VPIN_BUTTON_1);
Blynk.syncVirtual(VPIN_BUTTON_2);
Blynk.syncVirtual(VPIN_BUTTON_3);
Blynk.syncVirtual(VPIN_BUTTON_4);
}
// When App button is pushed - switch the state
BLYNK_WRITE(VPIN_BUTTON_1) {
toggleState_1 = param.asInt();
if(toggleState_1 == 1){
digitalWrite(RelayPin1, LOW);
}
else {
digitalWrite(RelayPin1, HIGH);
}
}
BLYNK_WRITE(VPIN_BUTTON_2) {
toggleState_2 = param.asInt();
if(toggleState_2 == 1){
digitalWrite(RelayPin2, LOW);
}
else {
digitalWrite(RelayPin2, HIGH);
}
}
BLYNK_WRITE(VPIN_BUTTON_3) {
toggleState_3 = param.asInt();
if(toggleState_3 == 1){
digitalWrite(RelayPin3, LOW);
}
else {
digitalWrite(RelayPin3, HIGH);
}
}
BLYNK_WRITE(VPIN_BUTTON_4) {
toggleState_4 = param.asInt();
if(toggleState_4 == 1){
digitalWrite(RelayPin4, LOW);
}
else {
digitalWrite(RelayPin4, HIGH);
}
}
void setup()
{
Serial.begin(115200);
delay(100);
pinMode(RelayPin1, OUTPUT);
pinMode(RelayPin2, OUTPUT);
pinMode(RelayPin3, OUTPUT);
pinMode(RelayPin4, OUTPUT);
pinMode(wifiLed, OUTPUT);
pinMode(SwitchPin1, INPUT_PULLUP);
pinMode(SwitchPin2, INPUT_PULLUP);
pinMode(SwitchPin3, INPUT_PULLUP);
pinMode(SwitchPin4, INPUT_PULLUP);
//During Starting all Relays should TURN OFF
digitalWrite(RelayPin1, HIGH);
digitalWrite(RelayPin2, HIGH);
digitalWrite(RelayPin3, HIGH);
digitalWrite(RelayPin4, HIGH);
digitalWrite(wifiLed, HIGH);
BlynkEdgent.begin();
Blynk.virtualWrite(VPIN_BUTTON_1, toggleState_1);
Blynk.virtualWrite(VPIN_BUTTON_2, toggleState_2);
Blynk.virtualWrite(VPIN_BUTTON_3, toggleState_3);
Blynk.virtualWrite(VPIN_BUTTON_4, toggleState_4);
}
void loop() {
BlynkEdgent.run();
manual_control(); //Manual Switch Control
}
Thanks Pete, I already corrected it, I take the opportunity to put an image of the serial monitor when I reset the ESP8266 after loading the sketch