Interfacing Arduino Due with a D1 mini wemos

Hi all,
I'm working on a data collection system which would send data to a remote server.
because of huge volume of code, I have to use Due version of Arduino. And because of network interface shortage, I have to use Wifi for communication.
But how can I use wemos and communicate with it in Due coding?
I found in the web that I can use Due TX and RX of serial interface and connect it to wemos, but i did it and no response i got from wemos, let alone the data communication!

My simple code is this:

#include <Adafruit_ESP8266.h>
#define ESP_RST         4

void setup()
{
  Serial.begin(57600);  while (!Serial); Serial.println("Start...");
  Serial1.begin(9600); // Soft serial connection to ESP8266 
  
  Adafruit_ESP8266 wifi(&Serial1, &Serial , ESP_RST);
  wifi.setBootMarker(F("Version:0.9.2.4]\r\n\r\nready"));
  Serial.println(F("Adafruit ESP8266 Demo"));

  Serial.print(F("Hard reset..."));
  if(!wifi.hardReset()) {
    Serial.println(F("no response from module."));
    for(;;);
  }
  Serial.println(F("OK."));
}

void loop()
{
}

It sends something to serial forever and none of "no response from module" nor "OK" is shown!

Flash memory of Due: 512KB
Flash memory of D1 mini: 4,096KB

Why do you need the Due?

1 Like

Very good hint!
I will check my code and specially needed RAM, I guess i can use wemos instead of Due. Only one issue I have to check is necessary pins for sensors.
However, if I face hardware pin shortage on wemos, and I get forced to use Due, is there any way to connect wemos to Due for network communication?

Arduino Due: 96KB RAM
D1 mini: 160KB RAM

This is not truly a fair way to compare the RAM of both boards. The D1 mini does not truly have 160KB available for use by your sketch.

But for a data collection system, either board will have more than sufficient RAM.

Correct. Clearly, D1 mini has only a few pins compared to Due. But it is easier to add more pins than it is to add more RAM or Flash, or to add WiFi capability. Please post a list of the pin requirements for your data collection system and the forum can suggest the best and easiest ways to achieve this.

1 Like

There are many ways for doing that. But take note, that in any case you will need to write a custom code for both boards to make them able to communicate each other.
In the thread above you are shown a single code. For which board it is? Whats about the code for another arduino?

https://github.com/JAndrassy/WiFiEspAT#getting-started

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.