cancel
Showing results for 
Search instead for 
Did you mean: 

Teseo-liv3f after standby mode, no GPS signal anymore

PKuo.1
Associate II

I am doing a GPS tracking project. I want to turn the GPS into standby mode or Enable Periodic Mode. I am doing the code in the Arduino IDE

For standby mode

I use the following code to set the GPS into standby mode.

MicroNMEA::sendSentence(gps,"$PSTMFORCESTANDBY,00010");

Can I use any code to wake the GPS up in software way?

I try the following code:

MicroNMEA::sendSentence(gps,"$PSTMFORCESTANDBY,00010");

delay(5000);

MicroNMEA::sendSentence(gps, "$PSTMSRR");

However, the GPS received no signal anymore.

For Enable Periodic Mode

I used the code

MicroNMEA::sendSentence(gps, "$PSTMLOWPOWERONOFF,1,0,0,0,0,0,0,3,100,0,1,1,15,180");

But this makes no any change while reading the output from serial monitor.

Can anyone help give me a hint?

Thank you!

17 REPLIES 17
PKuo.1
Associate II

Hi,

I try to set the code in the setup and wait for almost one hour, but it seems that still not turn into periodic mode according to the GPGGA timestamp?

MicroNMEA::sendSentence(gps,"$PSTMLOWPOWERONOFF,1,0,0,0,0,0,0,3,30,2,1,1,15,180");

0693W000006EAMUQA4.jpg

Hi

When you send the command did you get '$PSTMLOWPOWERON,...' answer from the module?

Regards

Francesco

initially, I put this line of code in the setup loop, and I think I did not see the '$PSTMLOWPOWERON,.. from the serial monitor. But now, I put the code in the loop, so it will launch the code every loop and I can see the '$PSTMLOWPOWERON,.. right now. It is correct? Thank you

0693W000006EAmDQAW.jpg

Hi

You should raise the command just once. (not continuously in loop)

> initially, I put this line of code in the setup loop, and I think I did not see the '$PSTMLOWPOWERON

As first step you should check the system is already up-and-running before you send the low-power-command (do you seen NMEA message before you send the command?)

Regards

Francesco

Hi,

Here is the code

//MicroNMEA library structures
char nmeaBuffer[100];
MicroNMEA nmea(nmeaBuffer, sizeof(nmeaBuffer));
 
bool ledState = LOW;
volatile bool ppsTriggered = false;
 
void ppsHandler(void);
 
 
void ppsHandler(void)
{
  ppsTriggered = true;
}
 
 
void gpsHardwareReset()
{
   // Empty input buffer
   while (gps.available())
      gps.read();
 
   //reset the device
   digitalWrite(RESET_PIN, LOW);
   delay(50);
   digitalWrite(RESET_PIN, HIGH);
 
   //wait for reset to apply
   delay(2000);
 
}
 
void setup(void)
{
   console.begin(115200); // console
   gps.begin(9600); // gps
 
   pinMode(LED_BUILTIN, OUTPUT);
   digitalWrite(LED_BUILTIN, ledState);
 
   //Start the module
   pinMode(RESET_PIN, OUTPUT);
   digitalWrite(RESET_PIN, HIGH);
   console.println("Resetting GPS module ...");
   gpsHardwareReset();
   console.println("... done");
 
   // Change the echoing messages to the ones recognized by the MicroNMEA library
   MicroNMEA::sendSentence(gps, "$PSTMSETPAR,1201,0x00000042");
   MicroNMEA::sendSentence(gps, "$PSTMSAVEPAR");
 
   //Reset the device so that the changes could take plaace
   MicroNMEA::sendSentence(gps, "$PSTMSRR");
 
   delay(4000);
 
   //clear serial buffer
   while (gps.available())
      gps.read();
 
   pinMode(6, INPUT);
   attachInterrupt(digitalPinToInterrupt(6), ppsHandler, RISING);
   MicroNMEA::sendSentence(gps,"$PSTMLOWPOWERONOFF,1,0,0,0,0,0,0,3,30,2,1,1,15,180");

should I move the LOWPOWERONOFF to the very beginning? Thank you

and for the message read from the serial monitor after the code is just uploaded 0693W000006EB2UQAW.jpg 

Do I miss something?

PKuo.1
Associate II
//NOTE: for compatibility with the Arduino Due some additional cabling needs to be performed:
//      pin D8 should be connected to pin D18 and pin D2 should be connected to pin D19
 
#include <MicroNMEA.h>
 
//Define Serial1 for STM32 Nucleo boards
#ifdef ARDUINO_ARCH_STM32
HardwareSerial Serial1(PA10, PA9);
#endif
 
#define RESET_PIN 7
 
// Refer to serial devices by use
HardwareSerial& console = Serial;
HardwareSerial& gps = Serial1;
 
//MicroNMEA library structures
char nmeaBuffer[100];
MicroNMEA nmea(nmeaBuffer, sizeof(nmeaBuffer));
 
bool ledState = LOW;
volatile bool ppsTriggered = false;
 
void ppsHandler(void);
 
 
void ppsHandler(void)
{
  ppsTriggered = true;
}
 
 
void gpsHardwareReset()
{
   // Empty input buffer
   while (gps.available())
      gps.read();
 
   //reset the device
   digitalWrite(RESET_PIN, LOW);
   delay(50);
   digitalWrite(RESET_PIN, HIGH);
 
   //wait for reset to apply
   delay(2000);
 
}
 
void setup(void)
{
   console.begin(115200); // console
   gps.begin(9600); // gps
 
   pinMode(LED_BUILTIN, OUTPUT);
   digitalWrite(LED_BUILTIN, ledState);
 
   //Start the module
   pinMode(RESET_PIN, OUTPUT);
   digitalWrite(RESET_PIN, HIGH);
   console.println("Resetting GPS module ...");
   gpsHardwareReset();
   console.println("... done");
   
 
   // Change the echoing messages to the ones recognized by the MicroNMEA library
   Serial.println("11111111111111");
   MicroNMEA::sendSentence(gps, "$PSTMSETPAR,1201,0x00000042");
   Serial.println("22222222222222");
   MicroNMEA::sendSentence(gps, "$PSTMSAVEPAR");
   
   delay(2000);
   Serial.println("33333333333333333");
   MicroNMEA::sendSentence(gps,"$PSTMLOWPOWERONOFF,1,0,0,0,0,0,0,3,30,2,1,1,15,180");
   //Reset the device so that the changes could take plaace
   Serial.println("44444444444444444");
   MicroNMEA::sendSentence(gps, "$PSTMSRR");
   Serial.println("55555555555555555");
   MicroNMEA::sendSentence(gps,"$PSTMLOWPOWERONOFF,1,0,0,0,0,0,0,3,30,2,1,1,15,180");
   
 
   delay(4000);
 
   //clear serial buffer
   while (gps.available())
      gps.read();
 
   pinMode(6, INPUT);
   attachInterrupt(digitalPinToInterrupt(6), ppsHandler, RISING);
   //MicroNMEA::sendSentence(gps,"$PSTMLOWPOWERONOFF,1,0,0,0,0,0,0,3,30,2,1,1,15,180");
}
int i = 0;
void loop(void)

0693W000006EBCUQA4.jpg 

Hi, according to my code, I think I send the command "$PSTMLOWPOWERONOFF. However, I do not see the '$PSTMLOWPOWERON,...' answer from the serial monitor...

Thank you

> should I move the LOWPOWERONOFF to the very beginning? Thank you

Yes you should

Moreover I don't know which is the initial pins condition but in standard condition Wakeup-Pin has to be Low

If in Arduino they are high for any reason the system will never enter in standby (or it's better say... it enters and immediately woken-up).

Regards

Francesco