4 bytes to float conversion: different results on 2 different ESP8266 boards

Hello,

I was using ESP-12S module to read a dust sensor and got it to work.
The data comes in four bytes which I convert to float like this:

float PM1_0u_float = *( (float*) PM1_0u );

The result is typically around 6, like 6.23.

When I switched to ESP8266MOD (AI-thinker) I was surprised that the same code doesn't work anymore. With this board the results are around 12000, like 12120.87.

I also tries to do the conversion using union, but still the same problem.

union TEMP {
  float f;
  byte b[4];
};

TEMP temp;

for (int cnt = 0; cnt < 4; cnt++) { 
    tempor.b[cnt] = PM1_0u[3 - cnt];
  }
  PM1_0u_float = tempor.f;

What is going on here?
How can I fix it to work with ESP8266MOD also?

Thanks,
Tipo

union TEMP {
  float f;
  byte b[4];
};

TEMP temp;

for (int cnt = 0; cnt < 4; cnt++) {
    tempor.b[cnt] = PM1_0u[3 - cnt];
  }
  PM1_0u_float = tempor.f;

Neat snippet, it's got a bug. Why do you make a TEMP named temp and then fill bytes in an undeclared TEMP named tempor? That won't even compile.

Why not fill the float with bytes from the sensor as they arrive? They do arrive in high to low byte order?[/code]

wrong wiring? you get same random values?

Never mind. The problem was in supply voltage.
Thanks!