MKRWAN_v2 library, endPacket() returns -2

I have two MKRWAN 1300s I'm trying to get to communicate peer-to-peer.
I downloaded the MKRWAN_v2 library.
I flashed them both with MKRWANEWUpdate_standalone.
Both setup with no issues:

LoRaModem LoRa;
void setup() {
  pinMode(buzzer, OUTPUT);
  Serial.begin(9600);
  while(!Serial);
  if (!LoRa.begin(US915)) while (true);

My receiver loop looks like this:

  if (LoRa.available()) {
    while (LoRa.available()) Serial.write(LoRa.read());
  }

My sender loop looks like this:

  LoRa.beginPacket();
  LoRa.print("Hello!");
  err = LoRa.endPacket();
  Serial.print(err);

That's it. Serial communication works fine and I have a buzzer set up that I'm not even really using because I cut excess code to solve this issue.

err = LoRa.endPacket();

This line returns "-2". After reading the source code, it seems that this means there's an error in the library. I don't know what that error could be and I can't get the debugger working. I'm wondering if anyone has any insight into this issue.

Antenna Info: I'm using this antenna and this cable to the antenna. I recently purchased two standard Arduino antennas in an attempt to solve this issue but they haven't arrived.

Distance Info: The Arduinos are basically right next to each other on my desk.

Power Info: The issue is happening when the device is connected to a USB cable attached to my computer. It also happens when connected to a power source, which I determined by blinking the LED. I have a 5v/1.5a power supply connected to the Vin and Ground pins. I chose 1.5a because the MKRWAN1300 uses a decent amount of power. It is connected to the Vin and Ground pins as stated on the Arduino page for the MKRWAN 1300.

I have these three theories:

  1. I have misunderstood something within the library. Is a server of some kind required by default? Is peer-to-peer communication something that I need to set the modem for? I am only using the functions explicitly listed in the above code.

  2. Is there something about communication that I'm fundamentally misunderstanding? I have very little experience with this besides using RFM69 transceivers with 2 Raspberry Pis. All I had to do for that was follow the instructions and it worked like a charm.

  3. Is my hardware malfunctioning? How would I know?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.