ESP8266 cannot handle struct
The issue is that Arduino boards (8 bit ones at least), an int is 16 bits, where as the ESP's (8266 and 32) and possibly other non-arduino hardware, an int is 32bits

The safest way to declare structs in any case is to use variable types with known sizes, in your case, for signed 16bit ints

struct data {
  int16_t id;
  int16_t pin;
  int16_t value1;
  int16_t value2;
} myData;


or for unsigned 16bit ints

struct data {
  uint16_t id;
  uint16_t pin;
  uint16_t value1;
  uint16_t value2;
} myData;


Note: there's also short int which I believe is "guaranteed" to be 16bit (and "long int" is always 32 bit) - but having the bit size in the declaration is a far better (future proof) solution