SoftwareSerial not working

I am trying to establish a wired one way communication between two Arduinos.
I decided to use SoftwareSerial because that lets me choose the pins for the communications.
I also use SoftEasyTransfer to send struct.
Transmitter code:

#include <SoftEasyTransfer.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11);

//create object
SoftEasyTransfer ET;

struct SEND_DATA_STRUCTURE {
  float temp = 22.22;
  float hum=88.88;
} myData;

//give a name to the group of data
SEND_DATA_STRUCTURE mydata;

void setup() {
  mySerial.begin(9600);
  Serial.flush();
  //start the library, pass in the data details and the name of the serial port.
  ET.begin(details(mydata), &mySerial);
}
void loop() {
  //send the data
  ET.sendData();
  delay(100);
}

Receiver code:

#include <SoftEasyTransfer.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11);

//create object
SoftEasyTransfer ET;

struct RECEIVE_DATA_STRUCTURE {
  float temp;
  float hum;
} myData;

//give a name to the group of data
RECEIVE_DATA_STRUCTURE mydata;

void setup() {
  Serial.begin(115200);
  Serial.flush();
  mySerial.begin(9600);
  mySerial.flush();
  //start the library, pass in the data details and the name of the serial port.
  ET.begin(details(mydata), &mySerial);

}
void loop() {
  //check and see if a data packet has come in.
  if (ET.receiveData()) {
    Serial.print("Temperature: ");
    Serial.println(myData.temp);
    Serial.print("Humidity: ");
    Serial.println(mydata.hum);
  }
  delay(100);
}

So I connect Pin10 on both Arduinos and Pin11.
After the data was received the receiver should print the data. But nothing is being printed which for me indicates there is no incoming data.
I tried to swap the pins, connecting Pin10 on one arduino to Pin11 on the other and vice versa. In this case “Temperature” and “Humidity” is printed but for values 0.00 printed.

Why the code does not work?

Libraries can be downloaded from this link.

Update:
With the swapped connection I receive half of the data.
Temperature is still showing 0.00 while humidity is 88.88.

Transmitter:

  Serial.flush();

You never use Serial.begin() in the transmitter, so why do you flush it? Note: .flush() really does nothing useful. It is extraordinarily rare to see that in any program.

That easy transfer seems like a very old library. 2011 is almost the dark ages of Arduino programming. It should still work but I'm suspicious that its detection of the Arduino version number may not still be valid.

Receiver:

  delay(100);

Remove this from the receiver. It's only going to make you miss data.

But you got part of the message, so something is working. That's a great clue that will help discover what isn't working. Maybe try changing the values in the sender? Make it send millis()/100 or something.

I have no experience of the SoftEasyTransfer library.

It is not clear how you have connected your Arduinos. It should be Tx to Rx and Rx to Tx and GND to GND

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

...R

I have deleted delay(100); in the receiver. Most of data is still missing. I tried added other variables and only hum goes through.

Connection used when only some of the data gets through is like you said (Tx to Rx and Rx to Tx and GND to GND).

Also I need a way to send several floats, ints and char arrays. Is there any other way without using SoftEasyTransfer library.

Very weird that only one item goes through. What happens if you send humidity first?

I would try sending readable characters, like 'h' 'e' 'l' 'l' 'o' and then printing that within the easytransfer library to check what it really got.

notfreeusername:
Also I need a way to send several floats, ints and char arrays. Is there any other way without using SoftEasyTransfer library.

The examples in my link should get you started in the right way.

...R