Seeduino lora with Gps no library that works with gps

Arduino, Seeeduino Serials and mutants. Share your problems and experence on arduino compatible board such as seeeduino/stalker, etc.

Moderators: violet, jessie

Post Reply
elpis30
Pre-kindergarten
Pre-kindergarten
Posts: 5
Joined: Tue Apr 17, 2018 3:47 am

Seeduino lora with Gps no library that works with gps

Post by elpis30 » Tue May 15, 2018 4:03 am

Hi could anyone recoment a library that works with Seeeduino lora gps , i have tested tiny gps ++ but with some libary it works and i get wrong location ANY IDEAS ?

bill.yu
Elementary-1
Elementary-1
Posts: 105
Joined: Mon Apr 02, 2018 11:05 am

Re: Seeduino lora with Gps no library that works with gps

Post by bill.yu » Tue Jun 05, 2018 2:19 pm

Hi Dear customer, we have one example to extract the gps data. but it has one bug that it seems acquire data at beginning and the data is not updated when we are moving. thanks.

4.2 Lat and Lng

Thanks for Todd Krein for sharing the example in Github. Please download the TinyGPS++ library and then copy below code to Seeeduino Lorawan.


#define USE_GPS 1

#include "LoRaWan.h"

#ifdef USE_GPS
#include "TinyGPS++.h"
TinyGPSPlus gps;
#endif


void setup(void)
{

char c;
#ifdef USE_GPS
bool locked;
#endif

SerialUSB.begin(115200);
while(!SerialUSB);

lora.init();
lora.setDeviceReset();

#ifdef USE_GPS
Serial.begin(9600); // open the GPS
locked = false;

// For S&G, let's get the GPS fix now, before we start running arbitary
// delays for the LoRa section

while (!gps.location.isValid()) {
while (Serial.available() > 0) {
if (gps.encode(c=Serial.read())) {
displayInfo();
if (gps.location.isValid()) {
// locked = true;
break;
}
}
// SerialUSB.print(c);
}

// if (locked)
// break;

if (millis() > 15000 && gps.charsProcessed() < 10)
{
SerialUSB.println(F("No GPS detected: check wiring."));
SerialUSB.println(gps.charsProcessed());
while(true);
}
else if (millis() > 20000) {
SerialUSB.println(F("Not able to get a fix in alloted time."));
break;
}
}
#endif
}


void loop(void)
{
displayInfo();
delay(1000);
}

void displayInfo()
{
SerialUSB.print(F("Location: "));
if (gps.location.isValid())
{
SerialUSB.print(gps.location.lat(), 6);
SerialUSB.print(F(","));
SerialUSB.print(gps.location.lng(), 6);
}
else
{
SerialUSB.print(F("INVALID"));
}

SerialUSB.print(F(" Date/Time: "));
if (gps.date.isValid())
{
SerialUSB.print(gps.date.month());
SerialUSB.print(F("/"));
SerialUSB.print(gps.date.day());
SerialUSB.print(F("/"));
SerialUSB.print(gps.date.year());
}
else
{
SerialUSB.print(F("INVALID"));
}

SerialUSB.print(F(" "));
if (gps.time.isValid())
{
if (gps.time.hour() < 10) SerialUSB.print(F("0"));
SerialUSB.print(gps.time.hour());
SerialUSB.print(F(":"));
if (gps.time.minute() < 10) SerialUSB.print(F("0"));
SerialUSB.print(gps.time.minute());
SerialUSB.print(F(":"));
if (gps.time.second() < 10) SerialUSB.print(F("0"));
SerialUSB.print(gps.time.second());
SerialUSB.print(F("."));
if (gps.time.centisecond() < 10) SerialUSB.print(F("0"));
SerialUSB.print(gps.time.centisecond());
}
else
{
SerialUSB.print(F("INVALID"));
}

SerialUSB.println();
}


Seeed techsupport team

Bill

lutzstachmann
Pre-kindergarten
Pre-kindergarten
Posts: 2
Joined: Mon Jun 11, 2018 4:23 pm

Re: Seeduino lora with Gps no library that works with gps

Post by lutzstachmann » Mon Jun 11, 2018 4:28 pm

Hey guys,

i also work with the seeeduino loraWan w/gps and i also try to get the Lat/Lng. I walked through the wiki and examples and tried the example of Todd Krein. But all i get in the SM is this:

Code: Select all

Location: INVALID  Date/Time: 1/6/2080 00:00:15.79
Location: INVALID  Date/Time: 1/6/2080 00:00:16.79
Location: INVALID  Date/Time: 1/6/2080 00:00:16.79
Location: INVALID  Date/Time: 1/6/2080 00:00:16.79
Location: INVALID  Date/Time: 1/6/2080 00:00:16.79
Location: INVALID  Date/Time: 1/6/2080 00:00:16.79
Location: INVALID  Date/Time: 1/6/2080 00:00:16.79
Location: INVALID  Date/Time: 1/6/2080 00:00:17.79
Location: INVALID  Date/Time: 1/6/2080 00:00:17.79
Location: INVALID  Date/Time: 1/6/2080 00:00:17.79
Location: INVALID  Date/Time: 1/6/2080 00:00:17.79
Location: INVALID  Date/Time: 1/6/2080 00:00:17.79
Location: INVALID  Date/Time: 1/6/2080 00:00:17.79
Not able to get a fix in alloted time.
Location: INVALID  Date/Time: 1/6/2080 00:00:17.79
Location: INVALID  Date/Time: 1/6/2080 00:00:17.79
so, where is the problem?

hong.jiang
Staff
Staff
Posts: 198
Joined: Tue Apr 17, 2018 11:03 am

Re: Seeduino lora with Gps no library that works with gps

Post by hong.jiang » Fri Jun 15, 2018 1:13 pm

Dear Customer:
I have got your question.The wiki and the examples of Todd Krein have been checked,I don't find any problem.If you want get gps information from Seeeduino LoRaWAN module, may not receive GPS signals indoors,and you should take it outdoor open space.
Best Wishes!

pauld
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Thu Jul 12, 2018 9:47 pm

Re: Seeduino lora with Gps no library that works with gps

Post by pauld » Thu Jul 12, 2018 9:49 pm

So I'm not sure what others have encountered, but I've tried this with and without an external antenna, and I have the exact same results. I get back a time result from the GPS in that test sketch, but never get a location returned. Since I'm getting time, I'm assuming that it's talking to the GPS hardware properly, but the device is sitting in a clear open area for hours and never able to get a position fix.

hong.jiang
Staff
Staff
Posts: 198
Joined: Tue Apr 17, 2018 11:03 am

Re: Seeduino lora with Gps no library that works with gps

Post by hong.jiang » Fri Jul 13, 2018 9:23 am

Hi,
I submitted the issue to Todd and he is not checked yet. please refer to below link.

https://github.com/toddkrein/OTAA-LoRaW ... d/issues/1

Seeed techsupport team
Bill

Post Reply