LoRa GPS receiver problem :o

Hi.
First of all im pretty new at this so please bear with me.

So Im trying to get gps coordinates from a neo 6m gps to Arduino Uno to LoRa xl1278-smt, and sent to another LoRa xl1278-smt connected to a Arduino Nano.

I confirmed getting gps signals, and transimmer is sending packet, receiver is receiving packets, but all i get is Long 0. 0 deg and Lat 0.0 deg readings. Why? I dont get it, if it sends it should send the received gps signals right? Im also encoding the nmea to latitude/longitude before sending. Havent tried without yet.

Cheers :slight_smile:

Transmitter code:
//Code for Transmitter (Sender)

#include <SPI.h>
#include <LoRa.h>
#include <TinyGPS++.h>
#include <SoftwareSerial.h>

static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 9600;

//Create a TinyGPS++ object
TinyGPSPlus gps;

SoftwareSerial ss(RXPin, TXPin);

void setup() {

//Start Arduino hardware serial port at 9600 baud
Serial.begin(9600);
//Start the software serial port at the GPS
ss.begin(GPSBaud);
while (!Serial);
Serial.println("LoRa Sender");
if (!LoRa.begin(433E6)) {
Serial.println("Starting LoRa failed!");
while (1);
}

LoRa.setTxPower(20);
}

void loop() {

//This sketch displays information every time a new
//sentence is correctly encoded.
while (ss.available() >0){
gps.encode(ss.read());
if(gps.location.isUpdated()){
Serial.print("Latitude= "); Serial.print(gps.location.lat(), 6);
Serial.print(" Longitude= "); Serial.println(gps.location.lng(), 6);
}

//If valid location begin transmitting values.
//Setup made ready for 16*2 LCD screen
LoRa.beginPacket();
LoRa.print("Latitude= "); LoRa.print(gps.location.lat(), 6);
LoRa.print(" Longitude= "); LoRa.print(gps.location.lng(), 6);
Serial.println("Sent via LoRa");
LoRa.endPacket();
delay(1000);
}
}

Receiver code:

#include <SPI.h>
#include <LoRa.h>

void setup() {
//Start serial for debugging
Serial.begin(9600);
while (!Serial);

Serial.println("LoRa Receiver");

//Set LoRa frequency and operation reply
if (!LoRa.begin(433E6)) {
Serial.println("Starting LoRa failed!");
while (1);
}
}

void loop() {
//Try to parse packet
int packetSize = LoRa.parsePacket();
//If packet received
if(packetSize) {
Serial.print("Received packet '");

//Read packet
while (LoRa.available()) {
Serial.print((char)LoRa.read());

}
}

}

You check to see if tinygps has a fix and if so print position to Serial. But then, whether it has or not you send to LoRa.

Does serial show good data eventually ? How many packets go to LoRa beforehand?

Thank you for replying :slight_smile:

Transmitter is replying "Sent via LoRa". And if i add RSSI code at receiver the signal is -21 .

I guess there should be some limiter on data sendt to, and via LoRa, but I dont know how to do that.

Also I dont know how many packets that goes to LoRa, since gps is received all the time.

Thanks again.

Maybe try something simpler. Just send hello or some such, with a delay afterwards. See what the receiver gets. Currently, your transmitter is defective.

If your interested, I can point you at a LoRa library that has working examples that are specifically designed to read a GPS and transmit the GPS location information over LoRa to a remote LoRa receiver.

The remote receiver code, included in the library, can display the received location on the Serial Monitor and\or an OLED display.

This LoRa library also contains very basic programs that test if the LoRa device is connected correctly on the SPI bus.

wildbill: I did try that some days ago with good result, but I`ll try again in case something is messed up now.

srnet: Please do! I have been trying some different libraries and also combining, but this is as close I could get.
I`m not locked to this specific code. Thanks!

Also, that delay is really going to mess things up. Get rid of it. Eventually, you may want to use millis to throttle the sending, but I think that delay may be enough to stop your code working at all.

So i tested the communication with the "hello" , it works. And yes that delay was already removed. :slight_smile:

Serial receiver is also printing horizontally " Latitude= 0.000000 Longitude= 0.000000" endlessly.

I`ll try to send raw nmea, see if that gets trough.

rustinpeace:
srnet: Please do! I have been trying some different libraries and also combining, but this is as close I could get.
I`m not locked to this specific code. Thanks!

See here;

\Examples\Hardware_Checks has several programs for testing GPS

\Examples\SX127x_Examples\Tracker has several GPS\LoRa tracker applications.

srnet: Wow thanks this seems to be exactly what I`ve spend weeks looking for!

I got some reading and testing to do now. Thank you so much!! Are you Stuart? If so, That satellite was legendary :smiley: :smiley:

I`ll put the code and connections out here eventually if its to someones interest. Cheers!

Yes, Stuart I am.

The code for the high altitude balloon tracker thats there, has the routines to put the GPS, Ublox or Quectel into high altitude balloon mode.

Otherwise the plain tracker transmitters will do you fine, they do work.

I am working on a method of having the receiver remotely wake up the tracker to request a fix, this should save substantial amounts of power. At the moment the tracker runs the GPS all the time and current consumption is circa 25mA.

srnet:
Yes, Stuart I am.

The code for the high altitude balloon tracker thats there, has the routines to put the GPS, Ublox or Quectel into high altitude balloon mode.

Otherwise the plain tracker transmitters will do you fine, they do work.

I am working on a method of having the receiver remotely wake up the tracker to request a fix, this should save substantial amounts of power. At the moment the tracker runs the GPS all the time and current consumption is circa 25mA.

So I tried out the hardware checks, basic test and the tracker. They all work! Had to resolder a d10o pinout as discovered during the test, so that probably messed with my previous code also. But yours is way better anyway!

What can I say, thank you so much! There sure is a lot interesting stuff you got there.

I plan to make some sort of autonomous craft that may be controlled somehow by LoRa starting preprogrammed operations trough either relay, or IR maybe. That would also be able to enter sleep/charge mode somehow.
So definitely going to check out your remote control and relay library. And also would be interesting to figure out the wake up feature yes.

Also, would this tracker work with a Arduino Pro mini?

Thank you so much for your expertise! That was really helpful :slight_smile:

The examples, apart from those in the ESP32 or STM32 folders, will run on a 3.3V 8Mhz Arduuino Pro Mini.

There is an exception, the examples that include SD logging, they probably need an ATmega1284.

Okay good to know.

To what altitude are you able to track a balloon using LoRa, if I may ask? e.g the 1278.

High altitude balloons, the latex type go to 30km+ altitude, the foil party balloons to 10km.

If your near to the balloon at launch and following it, then it may get no more than 100km away, tracking them at that distance is easy peasy at UHF.

Current record for tracking a high altitude balloon via LoRa is 832km @ 868Mhz and 89km @ 2.4Ghz.

If your using an SX1278 @ 434Mhz, then you should get more or less the same distance as at 868Mhz, since although the free space loss @434Mhz is less than @868Mhz, the allowed ERP (in a lot of places) is 10dBm @ 434Mhz and 14dBm @868Mhz. Swings and roundabouts really.

Also remember that the LoRa devices can be persuaded to send data as FSK RTTY, which you can decode with a cheap SDR and PC, similar distances to LoRa.

Really interesting, what one can achieve with LoRa. I`ll definately look into high altitude balloon tracking ect.

Thank you for sharing, really appreciate it! Im pretty shure I`ll post other issues about LoRa/tracking, still being a newbie at this.

Cheers!