BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Wemos d1 mini code question

wemos d1 mini code question.

I do blynk -> wifi <- wemos d1 mini -> rx, tx <- Arduino Uno project.

The wemos d1 mini wifi works well in blynk.

  • blynk -> button D4 -> wemos d1 mini LED ON / OFF

However, RX and TX with Arduino Uno will get an esp is not responding error message.

Here is the code I applied to Arduino Uno:

#define BLYNK_PRINT Serial

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

char auth [] = "c02a0e9055bc414ea9f191acf4596ee4";

char ssid [] = "sozipum";
char pass [] = "alalakaj";

#include <SoftwareSerial.h>
SoftwareSerial EspSerial (2, 3); // RX, TX

#define ESP8266_BAUD 9600
ESP8266 wifi (& EspSerial);

void setup ()
{
 Serial.begin (9600);
 delay (10);

 EspSerial.begin (ESP8266_BAUD);

 delay (10);
 Blynk.begin (auth, wifi, ssid, pass);
}
void loop ()
{
 Blynk.run ();
}

The code applied to wemos d1 mini is as follows.

#define BLYNK_PRINT Serial

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth [] = "c02a0e9055bc414ea9f191acf4596ee4";

char ssid [] = "sozipum";
char pass [] = "alalakaj";

void setup ()
{

  Serial.begin (9600);

  Blynk.begin (auth, ssid, pass);
}

void loop ()
{
  Blynk.run ();
}

I wonder if the code applied to wemos d1 mini is accurate.
The reason is that the wemos d1 mini received a signal from blynk. And again the wemos d1 mini should send a signal to Arduino Uno with RX, TX line, but there is no such code.
Is the code applied to wemos d1 mini correct?
If not, please help me add some code.

You don’t have any lines of code in your Wemos sketch that is sending data to the serial pins of the Wemos. You’d normally do that with a Serial.print statement.
However, as your Wemos boots itwill also send data to the serial UART, and Blynk will send debug information to the serial UART as well.
Rather than spending time explaining how to overcome this issue at this point, it would be better if you explained exactly what you’re trying to achieve with your project.
What is the role of the Arduino in this setup. Why are you using a Wemos and an Arduino, why not just the Wemos?

Pete.

I controlled the wemos d1 mini D4pin LED with Blynk’s signal.
And I want to control the 13 pin LED of Arduino Uno with Blynk’s signal.
Blynk Devices is set to Arduino Uno (wi-fi). The button is also set to D13.
Wemos d1 mini RX <-> TX Aduino Uno connection
Wemos d1 mini TX <-> RX Aduino Uno connection

It looks like this:

 ___ __ __
/ _) / / _ _____ / / __

/ _ / / // / _ \ / '_ /
/ ____ / _ / \ _, / _ // _ / _ / \ _
/ ___ / v0.5.4 on Arduino Uno

[609] Connecting to sozipum
[1623] ESP is not responding

I’m still none the wiser about what your project is about and why you’re using the Arduino at all.

Pete.

@JJong if you just want to flash an LED then forget the Arduino and just work with the might WeMos.

My project
Press the Blynk D13 button.
The Wemos d1 mini receives a signal from Blynk.
Wemos d1 mini sends a signal to Arduino Uno.
Arduino Uno receives a signal from Wemos d1 mini.
The built-in LED on the Arduino Uno turns on.
This is my project.
So I wonder if the code I wrote is correct.
If I’m wrong, let me know what to fix.

Later motor control and switch inputs are added.
So the Wemos pin is not enough.
So, I need to know if the signal is getting caught.

@jjong as you are new to this I would use the WeMos for internet connection and then wire up the Arduino to the WeMos.

First, I fixed your post to properly show formatted code…

Blynk%20-%20FTFC

The way you are doing it now is incorrect… the Blynk code should only run on the Wemos, which then controls the Arduino (via Serial or i2c) which is what your hardware is connected too.