Transferring FLOAT data via HC12

You seem to be using the size of the float datatype (aka 4) as some sort synchronisation marker.
Unfortunately, the value 4 can also appear as part of the representation of the floating point numbers you're trying to send.
That could go wrong for you.

The solution clue is in the above quoted text.

We need a frame synchronizing marker, and it must be beyond the ASCII set (at least beyond of 0 - 9, A - F, and a - f) of characters/digits. That means, we have to send the data (of any nature) from TX-side to RX-side frame-by-frame (Intel-Hex Frame) using asynchronous protocol. I have used the character : (0x3A) as an indicator for the beginning of a transmission frame.

The following setup and codes are sending any number of data bytes (I have tested by sending 5-byte floating numbers) from TX to RX using HC-12 Long Range Wireless Radio Communication Module.

Features:
1. : is the frame synchronizer
2. TX-side HC-12 is soft UART driven device.
3. RX-side HC-12 is hard UART driven device
4. CHKSUM is calculated and send from TX-side; but, it has not been recomputed and validadted at the RX-side.
5. A dummy location (0x0010) has been keyed in the Frame as a buffer loaction for the storgae of received data.
2xHC-12 Setup:

Data Frames Sent:

Received Data Frames and Reconstructed Original Data:

TX Code:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // HC-12 TX Pin, HC-12 RX Pin
float x = 121.50;      //base number for transmission
float deltaX = 1.50;  //base number will be increased by 1.50

byte frameArray[10];  //Frame length is 10-byte including 4-byte for a floating point number
byte dataArray[4];      //space to hold 4-byte codes of the floating point nuber

void setup() 
{
  Serial.begin(9600);             // Hard Serial port to computer
  mySerial.begin(9600);        // Soft Serial port to HC12

}

void loop() 
{  
  for (int n=0; n<5; n++)     //send only 5 floating point numbers: 121.50, 123.00, 124.50, ...
  {
    buildFrame();                  //construct 10-byte wide Intel-Hex Frame: : 04 1000 00 nnnnnnnn XX
    sendFrame();                  //send ASCII for each digit of Intel-hex frame except : which goes as 3A
    x += deltaX;                  //increase the base number by 1.50
  }
  HERE: goto HERE;             //after transmission stay HERE for ever
}

//------------------------------------------------------------------------------------------------------
void sendFrame()                //conver digit to ASCII and write to HC-12 for transmission
{
   mySerial.write(frameArray[0]);        //always send the synchronizer marker (:) as binary code
   Serial.print((char)frameArray[0]);    //show the character on Hard Serial Monitor
  
  for(int i = 1; i<10; i++)
  {
    byte x = frameArray[i];
//    Serial.print(frameArray[i]);
    byte x1 = x;
    x1 = x1>>4;
    if (x1 <=9)
    {
      x1 = x1+0x30;             
      mySerial.write(x1);      //transmit: 0x30 - 0x39 for 0 - 9 for the 1st digit of a byte
       Serial.write(x1);
       //HERE: goto HERE;
    }
    else
    {
      mySerial.write(x1+0x37);  //transmit: 0x41 - 0x46 for A - F for the 1st digit of a byte
       Serial.write(x1+0x37);
    }
  //--------------------------------
    x = frameArray[i];
    x = x & 0x0F;
    if (x <=9)
    {
      x = x+0x30;
      mySerial.write(x);      //transmit: 0x30 - 0x39 for 0 - 9 for the 2nd digit of a byte
       Serial.write(x);
    }
    else
    {
      mySerial.write(x+0x37);    //transmit: 0x41 - 0x46 for 0=A - F for the 2nd digit of a byte
       Serial.write(x+0x37);
    }
    
  } 
  Serial.println();    //enter new line 
}

//-----------------------------------------------------------------------------------------------------------------
void buildFrame()
{
  byte *ptr = (byte*) &x;    //declaration of pointer variable for the binary32 formatted value of a flp number

  frameArray[0] = 0x3A;   //: statrt of a frame
  
  frameArray[1] = 04;       //number of information byte = number of bytes for a floating point number
  
  frameArray[2] = 0x10;   //lower byte of the buffer address: 0x0010
  frameArray[3] = 0x00;   //upper byte of the buffer address: 0x0010
  
  frameArray[4] = 0x00;   //code to mark end-of-file (0x01 indicates EOF) when sending data from file
  //-------------------
  
  for (int i=5, j=0; i<9, j<4; i++, j++)  //saving 4-byte binary32 vale for a flp number
  {
    dataArray[j] = *ptr;
    frameArray[i] =  dataArray[j];
    ptr++;
  }

  frameArray[9] = chkSum();         //creating normal sum based CHKSUM for error control
 
}

byte chkSum()  //CHKSUM algorithm: all all bytes of a frame except :; discard carry; take 2's Complement
{
  byte sum=0;
  for (int k = 0; k<9 ; k++)
  {
    sum += frameArray[k]; 
  }
  sum =~sum;
  sum++;
  return sum;
}

RX Codes:

//#include <SoftwareSerial.h>      //Hard UART Module

bool flag = false;          //Frame synchronizer has not come
byte frameArray[19];
byte x, y, y1;
int i=0;
int j =0;

union
{
  byte myData[4];  //lower-most array elemnet contains lower-most byte
  float z;
  unsigned long p;
} floatNumber;

void setup() 
{
  Serial.begin(9600);             // Serial port to computer
}

void loop() 
{
  if (i == 19) //complete frame is received
  {
    buildAndShowFloatNumber();  //nuumber in: z, p, and myData[] of union{}
    i=0;
    flag = false;
    i=0;
    j=0;
  }

}

void buildAndShowFloatNumber()
{
    //cli();
   Serial.println();//write(frameArray[18]);
   // HERE: goto HERE;

   for(i=9, j=0; i<17, j<4; i++, j++)
   {
      y = frameArray[i];
      if (y < 0x41)
      {
        y = y & 0x0F;
        y = y << 4;
      }
      else
      {
        y = y - 0x37;
        y = y << 4;
      }
     // Serial.println(y, HEX);
      //-------------------
      i = i+1;//i++;
      y1 = frameArray[i];
      if (y1 <0x41)
      {
        y1 = y1 & 0x0F;
        
      }
      else
      {
        y1 = y1 - 0x37;
       
      }
   //   Serial.println(y1, HEX);
      //------------------------
      y = y|y1;
    //  Serial.println(y, HEX);
      floatNumber.myData[j] = y;
   }

 //  Serial.print(floatNumber.myData[3], HEX);
 Serial.print(floatNumber.z, 2);
 Serial.println();
}


void serialEvent()
{
   if (flag == true)
   {
    while (Serial.available()) 
      {        // If HC-12 has data
        x = Serial.read();
        Serial.write(x);     // Send the data to Serial monitor
        frameArray[i] = x;    //save in array
        i++; 
      }
   }

   else
   {
    byte s = Serial.read();
    if ( s != 0x3A)
    {
      flag = false;
    }
    else
    {
      if( s == 0x3A)
      {
        Serial.write(s);
        flag = true;
        i++;
      }
    }
    
  }
}