telit / arduino-tlt-library

GNU Lesser General Public License v2.1
3 stars 1 forks source link

GNSS Example not working #3

Closed rchancey closed 2 years ago

rchancey commented 2 years ago

@fabiopi-tlt Sorry to add a second issue but the GNSS example is not working either. I paste the results below.. it is not getting a position. Could this be related to the SMS issue we are having?

Telit Test AT GNSS command ME310 ON AT Command AT

VALID$GPSCFG: 1,1,1,1 OK OK OK $GPSACP: ,,,,,0,,,,, $GPSACP: ,,,,,0,,,,, $GPSACP: ,,,,,0,,,,, $GPSACP: ,,,,,0,,,,, $GPSACP: ,,,,,0,,,,, $GPSACP: ,,,,,0,,,,, $GPSACP: ,,,,,0,,,,, $GPSACP: ,,,,,0,,,,, $GPSACP: ,,,,,0,,,,, $GPSACP: ,,,,,0,,,,, $GPSACP: ,,,,,0,,,,, $GPSACP: ,,,,,0,,,,,

fabiopi-tlt commented 2 years ago

hello, this example is not from this repository, but from this one: https://github.com/telit/arduino-me310-library. In any case, the sketch output shows what the AT command is reporting, and it is likely that the device is not getting a fix. are you in a open sky condition?

This library provides a dedicated class for GNSS: https://github.com/telit/arduino-tlt-library/blob/main/src/TLTGNSS.cpp

it is used in this project https://github.com/telit/arduino-charlie-elderly-monitor-sample And a sketch to use it could be as below:

#include <TLTMDM.h>

ME310* _me310 = new ME310();

/*When NMEA_DEBUG is false Unsolicited NMEA is disabled*/
/*NMEA is true*/
TLTGNSS gnss(_me310, true);

void setup()
{
  memset(accel_setting, 0, sizeof(struct bma400_sensor_conf));

  Serial.begin(115200);
  _me310->begin(115200);
  delay(1000);
  _me310->powerOn();
  delay(5000);
  Serial.print("Initializing GNSS");
  while(!gnss.setGNSSConfiguration())
  {
    Serial.print(".");
  }
  Serial.println(" is completed successfully");
}

void loop()
{
    GNSSInfo gnssInfo = gnss.getGNSSData();
   /*gnssInfo fields will have latitude, longitude and the other details in string format*/
}
rchancey commented 2 years ago

I am in my house and not in open air. I intend to use the Arduino MKR GPS shield because last I checked the GNSS is not very accurate... but I think getting GNSS to work is a key step to prove the board is working. The sketch you share is not complete but I will try to make it work. Support has contacted me and asked me to send some additional commands. Perhaps an issue with board is preventing this from working as well?

rchancey commented 2 years ago

By changing the AT#FWSWITCH=1 for Verizon.. I was able to get results from the GNSS. accuracy sucks.. but at least getting data now.. Support is still helping why I had to set this to 1.

I get this result: OK $GPSACP: ,,,,,0,,,,, $GPSACP: ,,,,,1,,,,, $GPSACP: 162458.000,3032.8168N,09751.3496W,1.2,321.3,3,0.0,0.0,0.0,131021,05 $GPSACP: 162511.000,3032.8180N,09751.3487W,1.2,328.0,2,0.0,0.0,0.0,131021,05 $GPSACP: 162524.000,3032.8178N,09751.3493W,1.2,326.3,3,0.0,0.0,0.0,131021,05 $GPSACP: 162537.000,3032.8177N,09751.3490W,1.2,327.0,3,0.0,0.0,0.0,131021,05 $GPSACP: 162550.000,3032.8172N,09751.3489W,1.2,328.5,3,0.0,0.0,0.0,131021,04 $GPSACP: 162603.000,3032.8171N,09751.3485W,1.2,329.9,3,0.0,0.0,0.0,131021,05 $GPSACP: 162616.000,3032.8169N,09751.3483W,1.2,330.7,3,0.0,0.0,0.0,131021,04 $GPSACP: 162629.000,3032.8168N,09751.3481W,1.3,330.9,2,0.0,0.0,0.0,131021,04 $GPSACP: 162642.000,3032.8167N,09751.3480W,1.2,331.2,3,0.0,0.0,0.0,131021,04 $GPSACP: 162655.000,3032.8164N,09751.3479W,1.3,331.6,2,0.0,0.0,0.0,131021,05

rchancey commented 2 years ago

@fabiopi-tlt I was able to get your example working.. but the coordinates are not right somehow. Do I need to do some sort of conversion?

I am getting : 3032.8155N 09751.3500W when I should be getting something like : 30.5469437, -97.8557968

seems 2 decimals off somehow?

here is my sketch:

include

include

define USER_PB 6 / SAMD21 PIN nr. 7 /

define USER_LD 7 / SAMD21 PIN nr. 21 /

define DEBUG 0

ME310 *_me310 = new ME310();

/When NMEA_DEBUG is false Unsolicited NMEA is disabled/ /NMEA is true/ TLTGNSS gnss(_me310, true); void setup() {

Serial.begin(115200); _me310->begin(115200); delay(1000); _me310->powerOn(); delay(5000); Serial.print("Initializing GNSS"); while (!gnss.setGNSSConfiguration()) { Serial.print("."); } Serial.println(" is completed successfully"); }

void loop() {

Serial.println("Getting GNSS Data!"); GNSSInfo gnssInfo = gnss.getGNSSData(); Serial.print(gnssInfo.latitude.c_str()); Serial.print(","); Serial.println(gnssInfo.longitude.c_str());

Serial.println("long"+gnssInfo.longitude); Serial.println("alt"+gnssInfo.altitude); Serial.println("fix"+gnssInfo.fix); Serial.println("utc"+gnssInfo.utc); Serial.println("Ready for another run!"); delay(10000); }

fabiopi-tlt commented 2 years ago

@rchancey that format is NMEA, straight from the sentences. It is actually where you expected if you convert them (for example: http://www.hiddenvision.co.uk/ez/?nmea_lat=3032.8155N+&nmea_lon=09751.3500W ).

We pushed a new TLT library version which includes a TLTGNSS example, providing also the output in decimal and DMS formats

rchancey commented 2 years ago

This is fantastic and the new example is awesome. Thank you @fabiopi-tlt !