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

Code for integrating Blynk with Board : Mega +WiFi R3 Atmega2560+NodeMCU ESP8266 32Mb Memory USB-TTL CH340G Compatible For Arduino Mega

Hi, there

I have bought this board.
I have success with understanding of DIP switches. But, I am failing to integrate Blynk with this board:

I am not able to understand at all which code I have to upload to Mega, or the ESP8266, what example to choose for which Module, and which Board to choose - the WeMos Pro R1 or the Arduino Mega 2560.

Its been like this for the past 24 hours :cold_sweat: and seriously, I am not able to understand what I shall do.

Please help me out with this one. I know I am asking for a lot but your help is sincerely appreciated.

UPDATE; I have some success
I got the ESP connected to Blynk, an extra DIP was turned on.
The code was

/*************************************************************
  Download latest Blynk library here:
    https://github.com/blynkkk/blynk-library/releases/latest

  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: http://www.blynk.cc
    Sketch generator:           http://examples.blynk.cc
    Blynk community:            http://community.blynk.cc
    Follow us:                  http://www.fb.com/blynkapp
                                http://twitter.com/blynk_app

  Blynk library is licensed under MIT license
  This example code is in public domain.

 *************************************************************
  This example runs directly on ESP8266 chip.

  Note: This requires ESP8266 support package:
    https://github.com/esp8266/Arduino

  Please be sure to select the right ESP8266 module
  in the Tools -> Board menu!

  Change WiFi ssid, pass, and Blynk auth token to run :)
  Feel free to apply it to any other example. It's simple!
 *************************************************************/

/* Comment this out to disable prints and save space */
#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[] = "AuthToken";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "NetworkSSID";
char pass[] = "Password";

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

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

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

Now, I want to ask how do I connect the ESP8266 to the onboard Atmega2650. I want to take data from soil sensors from Atmega2650 and use the data to make a few conditions that I have figured out.,
I just want to know what do I write on code so that mega connects with ESP and I am able to send notifications on mobile phone.

FINAL UPDATE: I have figured out the DIP Switches and the Code.
See in the Thread to see the Code.
This is the configuration for DIP Switches

I think you’ll find that you’re supposed to be running the default factory “AT” firmware on the ESP and a regular Arduino + ESP simple shield sketch on the Arduino.

If you search the forum you’ll find some info on similar boards, and how to re-flash the ESP with AT firmware.

Pete.

Hi Pete,
Thanks for your sincere help. I highly appreciate it.

Yes, you are completely true, Pete. The problem was with DIP Switches. The DIP Switches are complex but one figured out, it is the best board.

I am uploading my code which works for integration with DIP Board Connection.

After that, you can close it!

/*************************************************************
  Download latest Blynk library here:
    https://github.com/blynkkk/blynk-library/releases/latest

  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: http://www.blynk.cc
    Sketch generator:           http://examples.blynk.cc
    Blynk community:            http://community.blynk.cc
    Follow us:                  http://www.fb.com/blynkapp
                                http://twitter.com/blynk_app

  Blynk library is licensed under MIT license
  This example code is in public domain.

 *************************************************************
  WARNING!
    It's very tricky to get it working. Please read this article:
    http://help.blynk.cc/hardware-and-libraries/arduino/esp8266-with-at-firmware

  You’ll need:
   - Blynk App (download from AppStore or Google Play)
   - Arduino Mega 2560 board
   - Decide how to connect to Blynk
     (USB, Ethernet, Wi-Fi, Bluetooth, ...)

  There is a bunch of great example sketches included to show you how to get
  started. Think of them as LEGO bricks  and combine them as you wish.
  For example, take the Ethernet Shield sketch and combine it with the
  Servo example, or choose a USB sketch and add a code from SendData
  example.
 *************************************************************/

/* Uploads on SWITCHES ON - 3,4 
WORKS ON SWITCHES ON : 1, 2*/
//it works

#define BLYNK_PRINT Serial


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

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "AuthToken";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "NetworkName";
char pass[] = "Password";

// 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 115200

ESP8266 wifi(&EspSerial);

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

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

  Blynk.begin(auth, wifi, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, wifi, ssid, pass, "blynk-cloud.com", 80);
  //Blynk.begin(auth, 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!
}

This code is for communicating between ESP8266 (ESP-01) and Atmega2650

Hmmm, it’s certainly not on my Christmas wish list and if Santa delivered one I wouldn’t be happy!

Pete.

1 Like

Well, each child has wishes different from each other and I have got mine! What do you want? :wink::wink: anyways, Happy Christmas to each of my friend on Blynk Community and you PETE!!!:tada::confetti_ball:

Here are my thoughts on which type of board I’d like Santa to bring…

For me, the main issues with the board you are using are:

  • Lack of OTA support
  • Physical size
  • Lack of memory (although not as much of an issue when OTA isn’t an option)
  • Lack of processing power
  • High cost

Merry Christmas!

Pete.