SerialTransfer Library not working between Wemos D1 Mini and Arduino Mega 2560

To moderator, this is not a duplicate post. My other post was about getting any serial transfers to work and having solved that issue, this is specifically about the Powerbroker SerialTransfer library.

I am not getting any data transfer from the Wemos to the Mega. I haven't tried sending from Mega to Wemos yet.
I downloaded the library from GitHub. It mentions the following sentence but nothing about UARTTransfer which I'm using so I am assuming it should work with the Wemos. I have tried to reduce the example program down to as simple as possible, just sending a single character value. myTransfer.available() is never triggered on the Mega 2560.

SPITransfer.h and it's associated features are not supported for the Arduino Nano 33 BLE or DUE and other boards.

When not using the SerialTransfer library, I can send data from the Wemos and it arrives on the Mega.

//Sending from the Wemos D1 mini:

#include <SoftwareSerial.h>
#include "SerialTransfer.h"

SoftwareSerial s(D6,D5,false);
SerialTransfer myTransfer;

char ch;

void setup()
{
  Serial.begin(9600);
  s.begin(9600);
  myTransfer.begin(s);
  ch = 'H';
}

void loop()
{
  Serial.println("Sending...");
  myTransfer.sendDatum(ch);
  delay(5000);
}
//Recieving on Arduino Mega 2560
#include "SerialTransfer.h"

SerialTransfer myTransfer;

char ch;

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

void loop()
{
  if(myTransfer.available())
  {
    myTransfer.rxObj(ch);
    Serial.print("ch = ");
    Serial.println(ch);
  }
}

Shucks I cannot find my long distance glasses to see what you have. If you do not have the TXs connected to the RXs please do that. If that does not fix it please post a schematic showing how it is wired and also links to "Technical" information on any hardware devices would also help. You state: "I am not getting any data transfer from the Wemos to the Mega. I haven't tried sending from Mega to Wemos yet."

Well shucks, how about reading my post where it says "When not using the SerialTransfer library, I can send data from the Wemos and it arrives on the Mega."
I guess that means I have the Tx and Rx hooked up correctly.

Are you using Serial1 or Serial3? That would be a problem.

At first I was trying Serial1. Then I changed to Serial3. It wasn't working on Serial1 and after fixing what you pointed out, it's still not working on Serial1 or Serial3.
I've swapped out most of the hardware and wires without any change - no data recieved and the myTransfer.available() never gets triggered on the reciever. I feel strongly the problem is in the library code.

I guess my options are to find an alternative to the SerialTransfer library or debug it myself. I tried using the debugger on the 2.0 IDE beta version and it didn't work then. It actually made the IDE wonky and slow afterwards. It might be working now in the stable release. The documentation says it compatible with all SAMD boards. I honestly don't know whether the Wemos D1 Mini is SAMD or not. I assume the Mega 2560 is but the debugging probably needs to be done on the Wemos.

//Recieving on Arduino Mega 2560
#include "SerialTransfer.h"

SerialTransfer myTransfer;

char ch;

void setup()
{
  Serial.begin(9600);
  Serial3.begin(9600);
  myTransfer.begin(Serial3);
}

void loop()
{
  if(myTransfer.available())
  {
    myTransfer.rxObj(ch);
    Serial.print("ch = ");
    Serial.println(ch);
  }
}

Neither the Wemos nor the Mega are SAMD processors.

Then why use the library? You already had it working so just use that code. There is this as well: Serial Input Basics - updated

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