user65978: Can anyone help me connecting arduino mega to D1 Wemos Mini serially? Please let me know most efficient and easy steps to setup a communication.
Using that following tutorial: 
https://engineeringprojectshub.com/serial-communication-between-nodemcu-and-arduino/amp/
Following is the circuit diagram: 
https://i.stack.imgur.com/oOKwL.png

user61572: Apart from ensuring you're wiring TX -> RX and connecting all grounds, you can use SerialTransfer.h to automatically packetize and parse your data for inter-Arduino communication without the headace. The library is installable through the Arduino IDE and includes many examples.
Here are the library's features:

This library:

can be downloaded via the Arduino IDE's Libraries Manager (search "SerialTransfer.h")
works with "software-serial" libraries
is non blocking
uses packet delimiters
uses consistent overhead byte stuffing
uses CRC-8 (Polynomial 0x9B with lookup table)
allows the use of dynamically sized packets (packets can have payload lengths anywhere from 1 to 254 bytes)
can transfer bytes, ints, floats, and even structs!!


Example TX Arduino Sketch:
#include "SerialTransfer.h"

SerialTransfer myTransfer;

void setup()
{
  Serial.begin(115200);
  Serial1.begin(115200);
  myTransfer.begin(Serial1);
}

void loop()
{
  char buff[] = "hi";

  myTransfer.txObj(buff, sizeof(buff));
  myTransfer.sendData(sizeof(buff));
  delay(100);
}

Example RX Arduino Sketch:
#include "SerialTransfer.h"

SerialTransfer myTransfer;

void setup()
{
  Serial.begin(115200);
  Serial1.begin(115200);
  myTransfer.begin(Serial1);
}

void loop()
{
  if(myTransfer.available())
  {
    char buff[40];
    
    myTransfer.rxObj(buff, sizeof(buff));
    
    Serial.println("New Data: ");
    Serial.write(buff, sizeof(buff));
    Serial.println();
  }
  else if(myTransfer.status < 0)
  {
    Serial.print("ERROR: ");

    if(myTransfer.status == -1)
      Serial.println(F("CRC_ERROR"));
    else if(myTransfer.status == -2)
      Serial.println(F("PAYLOAD_ERROR"));
    else if(myTransfer.status == -3)
      Serial.println(F("STOP_BYTE_ERROR"));
  }
}


65978: <p>Can anyone help me connecting arduino mega to D1 Wemos Mini serially? Please let me know most efficient and easy steps to setup a communication.</p>

<p>Using that following tutorial: </p>

<p><a href="https://engineeringprojectshub.com/serial-communication-between-nodemcu-and-arduino/amp/" rel="nofollow noreferrer">https://engineeringprojectshub.com/serial-communication-between-nodemcu-and-arduino/amp/</a></p>

<p>Following is the circuit diagram: 
<a href="https://i.stack.imgur.com/oOKwL.png" rel="nofollow noreferrer">https://i.stack.imgur.com/oOKwL.png</a></p>
 61572: <p>Apart from ensuring you're wiring TX -> RX and connecting all grounds, you can use <a href="https://github.com/PowerBroker2/SerialTransfer" rel="nofollow noreferrer">SerialTransfer.h</a> to automatically packetize and parse your data for inter-Arduino communication without the headace. The library is installable through the Arduino IDE and includes many examples.</p>

<p>Here are the library's features:</p>

<blockquote>
  <p>This library:</p>
  
  <ul>
  <li>can be downloaded via the Arduino IDE's Libraries Manager (search "SerialTransfer.h")</li>
  <li>works with "software-serial" libraries</li>
  <li>is non blocking</li>
  <li>uses packet delimiters</li>
  <li>uses consistent overhead byte stuffing</li>
  <li>uses CRC-8 (Polynomial 0x9B with lookup table)</li>
  <li>allows the use of dynamically sized packets (packets can have payload lengths anywhere from 1 to 254 bytes)</li>
  <li>can transfer bytes, ints, floats, and even structs!!</li>
  </ul>
</blockquote>

<p>Example TX Arduino Sketch:</p>

<pre><code>#include "SerialTransfer.h"

SerialTransfer myTransfer;

void setup()
{
  Serial.begin(115200);
  Serial1.begin(115200);
  myTransfer.begin(Serial1);
}

void loop()
{
  char buff[] = "hi";

  myTransfer.txObj(buff, sizeof(buff));
  myTransfer.sendData(sizeof(buff));
  delay(100);
}
</code></pre>

<p>Example RX Arduino Sketch:</p>

<pre><code>#include "SerialTransfer.h"

SerialTransfer myTransfer;

void setup()
{
  Serial.begin(115200);
  Serial1.begin(115200);
  myTransfer.begin(Serial1);
}

void loop()
{
  if(myTransfer.available())
  {
    char buff[40];
    
    myTransfer.rxObj(buff, sizeof(buff));
    
    Serial.println("New Data: ");
    Serial.write(buff, sizeof(buff));
    Serial.println();
  }
  else if(myTransfer.status &lt; 0)
  {
    Serial.print("ERROR: ");

    if(myTransfer.status == -1)
      Serial.println(F("CRC_ERROR"));
    else if(myTransfer.status == -2)
      Serial.println(F("PAYLOAD_ERROR"));
    else if(myTransfer.status == -3)
      Serial.println(F("STOP_BYTE_ERROR"));
  }
}
</code></pre>
