Skip to main content
PKuo.1
Associate
December 1, 2020
Question

Teseo-liv3f after standby mode, no GPS signal anymore

  • December 1, 2020
  • 8 replies
  • 3661 views

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!

    This topic has been closed for replies.

    8 replies

    Technical Moderator
    December 1, 2020

    Hi

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

    No there is no way to trigger a SW wake up... the system is sleeping for the programmed interval (no command is accepted from UART).

    While you can toggle the HW wake-up pin to asynchronous wake up the module.

    After wakeup the system has to be working as normal.

    Regards

    Francesco

    PKuo.1
    PKuo.1Author
    Associate
    December 1, 2020

    Hi Francesco,

    Thank you for your quick reply. However, may I ask you other questions?

    Firstly, this is for turning GPS into  Enable Periodic Mode. I tried to mimic the command on the software manual to set to Enable Periodic Mode

    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. Do i miss something that is necessary to make it work?

    Secondly, I have question about suspend GPS engine. According to the software manual, I can use the command "$PSTMGPSSUSPEND" to suspend the GPS engine. And I just want to ask that when I suspend the GPS engine, will the power consumption be lower than regular situation, which is keeping pulling data from satellites?

    Thank you again!

    Technical Moderator
    December 1, 2020

    Hi

    > 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. Do i miss something that is necessary to make it work?

    To enter in periodic Standby the system has to be in steady-state this means all the following condition has to be true;

    • almanac downloaded
    • ephemeris downloaded
    • get FIX

    The first time these conditions need 12 minutes (time required to download the whole almanac... almanac are valid for 6 months) after that the system will enter in periodic standby.... Leave it running ;)

    > Secondly, I have question about suspend GPS engine. According to the software manual, I can use the command "$PSTMGPSSUSPEND" to suspend the GPS engine. And I just want to ask that when I suspend the GPS engine, will the power consumption be lower than regular situation, which is keeping pulling data from satellites?

    With $PSTMGPSSUSPEND you turn-off the RF part... but most of the system is still runing. You will save much more power with PSTMFORCESTANDBY or $PSTMLOWPOWERONOFF.

    With both the commands you can wakeup the system using the WakeUp pin (from low to high)

    Regards

    Francesco

    PKuo.1
    PKuo.1Author
    Associate
    December 1, 2020

    Hi,

    >To enter in periodic Standby the system has to be in steady-state this means all the following condition has to be true;

    • almanac downloaded
    • ephemeris downloaded
    • get FIX

    The first time these conditions need 12 minutes (time required to download the whole almanac... almanac are valid for 6 months) after that the system will enter in periodic standby.... Leave it running ;)

    I do not understand this. Sorry for that. Does this mean I can not use only single command

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

    to turn the GPS in to periodic mode? I need to do other things in order to turn into power save mode?

    >With $PSTMGPSSUSPEND you turn-off the RF part... but most of the system is still runing. You will save much more power with PSTMFORCESTANDBY or $PSTMLOWPOWERONOFF.

    With both the commands you can wakeup the system using the WakeUp pin (from low to high)

    for this, do you mean that no matter which one I use PSTMFORCESTANDBY or $PSTMLOWPOWERONOFF. The only way that I want to wake up the system to normal mode is to use HW pin to wake them up?

    for the &PSTMFORCESTANDBY command. I try to use the following code

    sendCommand((char*)"$PSTMFORCESTANDBY,00020");
    digitalWrite(PA5, HIGH);
    delay(5000);
    digitalWrite(PA5, LOW);

    And this does not mean that I use the HW pin to wake up right?

    My goal is that I want to update the GPS information every 5 minutes in software way. So my guess is that I may use this command to do it.

    "$PSTMLOWPOWERONOFF,1,0,0,0,0,0,0,3,100,0,1,1,15,180");

    However, there is no difference with the normal mode. Do I need to do some settings in advance to make it work?

    Technical Moderator
    December 1, 2020

    Hi

    >  Does this mean I can not use only single command

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

    No this doesn't

    You can use only this message as it is.

    but at the moment more probably your module is still downloading the almanac.

    Due to that the command seems not working.... because the conditions are still not-taken.

    When all the condition will be taken the command will begin really working moving the system in standby.

    Hope this helps

    Regards

    Francesco

    PKuo.1
    PKuo.1Author
    Associate
    December 1, 2020

    Hi, sorry for keeping asking stupid question. Since I can use this line of code

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

    But I need to satisfy the 3 conditions first:

    • almanac downloaded
    • ephemeris downloaded
    • get FIX

    What should I do in order to reach the first two conditions? Is there any commands or instruction in the software manual?

    Thank you!

    Technical Moderator
    December 1, 2020

    Hi

    > What should I do in order to reach the first two conditions? Is there any commands or instruction in the software manual?

    You should not do anything.

    Both the operation are continuously done by the system but the first download (from zero) needs ~12 minutes.... this interval is due to the satellites data speed.... it's not related to the module.

    Leave it running under open-sky

    Regards

    Francesco

    PKuo.1
    PKuo.1Author
    Associate
    December 1, 2020

    HI,

    > You should not do anything.

    Both the operation are continuously done by the system but the first download (from zero) needs ~12 minutes.... this interval is due to the satellites data speed.... it's not related to the module.

     Leave it running under open-sky

    So, you mean that After I upload the code to the GNSS1A1 board or Teseo-Liv3f chip. I just put it under the sky and after I get the fix, I need to wait around 15 min to let it down satellites data. And after that, it will automatically turn into periodic mode?

    if it really enter to periodic mode, can I observe the difference on the serial monitor?

    And since I use the Arduino IDE, I should use this line of code in the setup (void) or loop(void)

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

    And If I upload the other code to the chip/board, and I need to wait for about 15 minutes to download the data to enter the low power mode again?

    Thank you.

    Technical Moderator
    December 1, 2020

    > And after that, it will automatically turn into periodic mode?

     Yes. confirmed.

    > if it really enter to periodic mode, can I observe the difference on the serial monitor?

    Yes. you will see time gap in the GPGNA or GPGLL message

    > I need to wait for about 15 minutes to download the data to enter the low power mode again?

    No you don't.... Alamanac (which is the one which needs so much time) are saved on flash step by step... therefore once downloaded they stay there....

    Regards

    Francesco

    PKuo.1
    PKuo.1Author
    Associate
    December 1, 2020

    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

    Technical Moderator
    December 1, 2020

    Hi

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

    Regards

    Francesco

    PKuo.1
    PKuo.1Author
    Associate
    December 1, 2020

    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

    PKuo.1
    PKuo.1Author
    Associate
    December 1, 2020
    //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