Sending Sensor Data Over WiFi

I have been unable to get this tutorial to work, and there’s something I’m confused about.

The code compiles and runs. With the transmitting Thing Plus attached in the serial window I do see the environmental data, but I get “error sending the data”. When I reset the Thing Plus I see “E (154) ESPNOW: Peer interface is invalid. Failed to add peer”.

With the receiving Thing Plus attached I don’t get anything.

I have double-checked the MAC address. I don’t think that’s the problem. Just checked one more time. I really don’t think that’s the problem.

Any ideas?

The thing that confuses me is in the code in the tutorial. In the transmitter code we see

// Structure example to send data
// Must match the receiver structure
typedef struct struct_message {
  float a;
  float b;
  float c;
} struct_message;

In the receiver code we see

// Structure example to receive data
// Must match the sender structure
typedef struct struct_message {
    float a;
    float b;
    float c;
    float d;
} struct_message;

So the transmitter is sending a structure made of three floats, and the receiver is expecting a structure made of four floats. That’s not what I think of as a “match”.

Ah, I found the answer in

https://github.com/espressif/arduino-esp32/issues/6029

There’s an additional line now needed for the peer registration.

I still do not understand though how two different data structures are said to “match”.