Arduino uno/mega esp8266 wifi shield and blynk

Hello! I am building a new house and i have arduino mega with 36 relays controlling the house form bluetooth with my smartphone but i decided to upgrade it and i want to control the house from the internet so i perchased esp8266 and arduino uno separately to try the new module to see how it works.
So lets hop to the problem i am trying to connect arduino to blynk with esp8266 as wifi shild but i get the same error every time. ESP8266 responds to AT commands and i can coonect it to my internet successfully i also have changed the baud rate to 9600 so it can comunicate with the arduino i have installed the latest librarys and used the code from blynk example fiiling all my information. So if the esp can connect to my internet and responds to AT commands it is working and it is wired properly so the problem has to be with my code

#define BLYNK_TEMPLATE_ID "TMPL4baeWAra"
#define BLYNK_TEMPLATE_NAME "IOT HOME"
#define BLYNK_AUTH_TOKEN "**********************"
#define BLYNK_DEBUG
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial


#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>



char ssid[] = "Anchevi";

char pass[] = "7203074460";


// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1

// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600

ESP8266 wifi(&EspSerial);

void setup()
{
  // Debug console
  Serial.begin(9600);

  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(BLYNK_AUTH_TOKEN, wifi, ssid, pass);
  // You can also specify server:
 // Blynk.begin(BLYNK_AUTH_TOKEN, wifi, ssid, pass, "blynk.cloud", 80);
  //Blynk.begin(BLYNK_AUTH_TOKEN, wifi, ssid, pass, IPAddress(192,168,1,100), 8080);
}

void loop()
{
  Blynk.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}

Thats the error i am getting i have tryied with 3 different brand new esp8266 and still the same rasalt and i am fighting with this error 3 months
sorry for my English it is not my first language :no_mouth:


    17:33:36.510 ->     ___  __          __
17:33:36.510 ->    / _ )/ /_ _____  / /__
17:33:36.510 ->   / _  / / // / _ \/  '_/
17:33:36.510 ->  /____/_/\_, /_//_/_/\_\
17:33:36.510 ->         /___/ v1.2.0 on Arduino Uno
17:33:36.510 -> 
17:33:36.510 ->  #StandWithUkraine    https://bit.ly/swua
17:33:36.510 -> 
17:33:36.510 -> 
17:33:37.023 -> [521] Connecting to Anchevi
17:33:38.046 -> [1536] ESP is not responding

Please replace your screenshots with the serial monitor text, formatted with triple backticks in the same way as your code.

Iā€™d also suggest that you read thisā€¦

And I would of course suggest that you throw your Uno, Mega and ESP-01 in the bin and use a proper IoT device and maybe a port expander such as thisā€¦

Pete.

Hello Pete i have allready hooked up all the house to a mega with relays so it is too late for me to change to other IoT device and also i looked the first article and did everything you said flashing, setting baud rate 9600, crossing rx tx and librarys and still i get the same error thanks for replying but this doesnt help me at all

How have you configured the ESP-01 to work at 9600 baud?

Pete.

yes i used this line of code also my esp is 01s if this matters

AT+UART_DEF=9600,8,1,0,0

Iā€™d be interested to know more about how you used this ā€œline of codeā€ and the hardware setup you used to achieve this, along with the response you received from the device - but not until you stop ignoring my request for you to replace your screenshot in your original post.

Pete.

1 Like

screenshot replaced

Pete.

Sorry Pete but this feels more like blackmail rather than a place to find some help i will find other way to solve my problem this is not a friendly place :x:

There is no alternative Blynk forum, I think you never get help, maybe you can ask ChatGPT :joy:

1 Like

100%
It writes code for you. But there is a small caveat. The code does not compile :joy::joy:.

It has lots n lots of errors. Especially when the code needs to have some libraries. It includes random libraries that donā€™t even exists.

For basic blink led sketch its helpful.(very basic code writing)

By the time user solves all the compilation errors. That person will be half dead. So good luckšŸ˜‚

2 Likes

I guess some people donā€™t like to follow the forum rules. Personally, I donā€™t want to donate my time to those people.

Pete.

1 Like

It is not any form of blackmail at all, if your code is not correctly posted it makes it more difficult for people to help you. There is a saying ā€œthe art of getting a good answer is asking a good questionā€ which in part requires you to provide clear code examples. I presume you are trying to use AT commands between your ESP device and the Mega. Personally I would look at the PJON library, PJON will run on the ESP device and the Mega to provide a single wire (+Gnd) serial link that doesnā€™t use the serial pins. The ESP would receive Blynk commands and then send a relay control command via PJON to the Mega. Since you mention relays I presume you are only requiring On / Off commands.
I do use this method myself with great sucess in a situation where there is no WiFi and in conditions of high humidity, so the Uno or Mega can be in a sealed box remote from the ESP device. I use CAT5e cable to link the ESP-Mega sending power as well as the control signal. PJON is very well documented and has a good user group.