Skip to main content
Visitor II
March 13, 2023
Question

Why did my LoRaWAN app only sends empty data?

  • March 13, 2023
  • 0 replies
  • 1406 views

I'm trying to send some GNSS data using LoRaWAN, but my gateway only receives a blank string. Pretty sure the AppData.Buffer values are right since it prints the right thing on my console.

0693W00000aIlZXQA0.pngAs you can see my gateway didn't receive any payload.

0693W00000aIlHRQA0.pngHere's my SendTxData part

 ReceiveGNSSData();
 
 hdop = (uint8_t)(GNSSParser_Data.gpgga_data.acc * 10);
 
	hour = (uint8_t)(GNSSParser_Data.gpgga_data.utc.hh);
	minute = (uint8_t)(GNSSParser_Data.gpgga_data.utc.mm);
	second = (uint8_t)(GNSSParser_Data.gpgga_data.utc.ss);
	sats = (uint8_t)(GNSSParser_Data.gpgga_data.sats);
	altitude = (int16_t)(GNSSParser_Data.gpgga_data.xyz.alt * 10);
 
 
 AppData.Buffer[i++] = AppLedStateOn;
 AppData.Buffer[i++] = (uint8_t)(hour & 0xFF);
 AppData.Buffer[i++] = (uint8_t)(minute & 0xFF);
 AppData.Buffer[i++] = (uint8_t)(second & 0xFF);
 AppData.Buffer[i++] = (uint8_t)(sats & 0xFF);
 // AppData.Buffer[i++] = (uint8_t)((altitude >> 16) & 0xFF); ga perlu soalnya datanya cuma 16 bit jadi cukup shift 8
 AppData.Buffer[i++] = (uint8_t)((altitude >> 8) & 0xFF);
 AppData.Buffer[i++] = (uint8_t)(altitude & 0xFF);
 
 AppData.BufferSize = i;
 
 APP_LOG(TS_OFF, VLEVEL_L,
 "Send on port LORAWAN_USER_APP_PORT (%d): \r\n"
 "Led : %s\r\n"
 "UTC : %d:%d:%d\r\n"
 "Sats : %d\r\n"
 "Alt : %d.%d m\r\n",
 LORAWAN_USER_APP_PORT,
 AppData.Buffer[0] == SET ? "ON" : "OFF", // Led state
 AppData.Buffer[1], AppData.Buffer[2], AppData.Buffer[3], // UTC
 AppData.Buffer[4], // Satellites
 (AppData.Buffer[5] << 8 | AppData.Buffer[6]) / 10, // Altitude 1
 (AppData.Buffer[5] << 8 | AppData.Buffer[6]) % 10); // Altitude 2

I also attached the full lora_app if needed. Thank you.

    This topic has been closed for replies.