Lora Module DRF1278 Arduino with Raspberry Pi

Hello guys, i need a little help here. Im new to LoRa technology. im using LoRa DRF1278DM.

I want to make a IoT device with LoRa as its communication system, but I found an error on my device node, the Arduino Pro Mini 3.3V.
My gateway device is raspberry pi 3 model B+.
Header messages received by the device node have an incorrect return value. this is some part of my code on the device node

void radio_listening() {
  DEBUG_PRINTLN("radio listening...");
  char Message[14];
  char *pM = Message;
  memset(pM, 0, sizeof(pM));
  // Waiting instruction from gateway
  digitalWrite(pin_enable, LOW);
  while (serial_radio.available() < 10);
  for (int i = 0; i < 14; i++) {
    *(pM+i) = (serial_radio.read() & 0xFF) ;
    Serial.print(*(pM+i)&0xFF,HEX); Serial.print("-");
  for( int j = 0; j < 14;  ++j )
   *(pM+j) = (char)0; 

when parsing_header the message received has a return value of “unknown header”

#define MSG_HEADER          "GMLEWS"
#define MSG_HEADER_LEN      (sizeof(MSG_HEADER)-1)
void parsing_header(char *pMessage) {
  char *pS=pMessage;
  if(strncmp(pS, "GMLEWS",MSG_HEADER_LEN) == 0){
    if (get_checksum(pS,MSG_CMD_LEN-1)==*(pS+MSG_CMD_LEN-1)) {
      DEBUG_PRINTLN("Checksum OK");
    } else {
      DEBUG_PRINTLN("Checksum NG");
  } else {
    DEBUG_PRINTLN("unknown header");

char get_checksum(char *pS, int len) {
  char checksum = 0;
  for (int i=0;i< len; i++) {
    checksum += *(pS+i);
  checksum = -(checksum % 256) & 0xFF;
  return checksum;

Here’s the output

radio listening...
unknown header

I have tried several ways by converting these bytes but i dont have any idea. the data received is still wrong. please help, thank you so much. i’ll appriciated it

Very difficult to see whats going on, you just posted a small fragment of code where you think the problem might be.

So this is a pure guess as my crystal ball is away for repair, maybe your mixing software serial and hardware serial (prints to serial monitor) at the same time ?

That can most certainly lead to problems, missed characters on the software serial input, corrupted prints to serial monitor etc.

The NeoSWserial library is far more stable in this type of application.