# Sending Sensor Data Over WiFi

**URL:** <https://community.sparkfun.com/t/sending-sensor-data-over-wifi/46643>\
**Category:** Wifi\
**Created:** [December 16, 2023, 2:51am UTC](https://community.sparkfun.com/t/sending-sensor-data-over-wifi/46643 "2023-12-16T02:51:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaulS15](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/pauls15/32/7860_2.png) [@PaulS15](https://community.sparkfun.com/u/PaulS15)\
**Post date:** [December 16, 2023, 2:51am UTC](https://community.sparkfun.com/t/sending-sensor-data-over-wifi/46643/1 "2023-12-16T02:51:27Z")

</div>

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

```auto
// 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

```auto
// 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”.

---

<div class="post-metadata">

**Author:** ![PaulS15](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/pauls15/32/7860_2.png) [@PaulS15](https://community.sparkfun.com/u/PaulS15)\
**Post date:** [December 16, 2023, 9:54pm UTC](https://community.sparkfun.com/t/sending-sensor-data-over-wifi/46643/2 "2023-12-16T21:54:20Z")

</div>

Ah, I found the answer in

[https://github.com/espressif/arduino-esp32/issues/6029](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”.
