I took a break from this project a few weeks, last I tested, I could only send packets just under 1 km with line of sight. I am wondering if I need to set Tx power for each instance in the following loop or if there is something wrong with how I am having the antenna connected or position.
//Tx code to follow
#include <heltec.h>
#include <Wire.h>
//other stuff
//setup()
void loop() {
Heltec.display->clear();
if (logic) {
LoRa.setTxPower(14,RF_PACONFIG_PASELECT_PABOOST);
if (logic) {
LoRa.beginPacket();
LoRa.print(packetVar0);
LoRa.endPacket();
delay(3200);
} else if (logic) {
LoRa.beginPacket();
LoRa.print(packetVar1);
LoRa.endPacket();
delay(3000);
} else {
LoRa.beginPacket();
LoRa.print(packetVar2);
LoRa.endPacket();
delay(3000);
}
}
}
// Rx code to follow
setup(){}
void Mayne(){
int derp0 = LoRa.parsePacket();
if (derp0) {
while (LoRa.available()) {
packet = LoRa.read();
// do stuff with packet
} else {
// do other stuff
}