MKRWAN 1300 data hits gateway, but info not forwarded to the device's application data

Hello all,

This is my first LoRa project, and I’m very confused as to why my project is not working correctly.
Project Overview:

  • Arduino MKRWAN 1300 End Node using LoRa.h library
  • TTN Outdoor Gateway in next room
  • I’m getting my GPS position and sending it to the TTN network via LoRa.print commands
  • I’m sending my device address via LoRa.write commands (converting the address to decimal)
  • Frame Counter Checks disabled
  • Frame Counter Width = 16 bit

The outdoor gateway consistently sees my message, and the DevAddr is my address that the device’s settings show. The issue is that the TTN Gateway Traffic console sees this, but not the device’s application data. I assume this is the ABP method, but I am not sure that

Tx portion of code:

 LoRa.write(128); // Hex 80 - seemed to be the header I needed
 LoRa.write(#); // placeholder for real address
 LoRa.write(#); // placeholder for real address
 LoRa.write(2); // no change
 LoRa.write(38); // no change
// Frame info
LoRa.write(0);
LoRa.write(counter); // fcount
LoRa.write(0); // fcount
// Frame Port
LoRa.write(1); // was 2
LoRa.print(MSG); // message is my string of data, the TTN Gateway sees this and decodes correctly
LoRa.print(counter);
LoRa.endPacket();

When I simulate the uplink with a payload from the gateway, it sends it to the device, and shows my correct GPS coordinates.

Anyone have any insight why my device is not getting the payload? Thanks in advance.

This isn’t valid code. You’ve basically taken a bare LoRa example, and tried to DIY LoRaWAN on top of it, but missed the majority of the key pieces, so while it’s seen as a raw packet, it’s rejected as quite invalid protocol traffic.

Don’t try to write your own LoRaWAN implementation, at least not until you’ve gained some experience with a working one and come to understand how complicated it really is.

You need to find an actual LoRaWAN example for your board.

This is for LoRa to LoRa - you should be including MKRWAN.h

See MKRWAN - Arduino Reference for the official tutorial / getting started.