External GPS on cold boot

I am having trouble with the GPS on a cold boot, it works fine if I reset the processor after a cold boot. My initialisation commands are

{“req”:“card.aux”,“mode”:“track”,“limit”:false,“gps”:true}
{“mode”:“track”,“rate”:9600,“gps”:true}
{“req”:“card.location.mode”,“mode”:“continuous”}
{“seconds”:60,“mode”:“continuous”,“threshold”:1}
{“req”:“hub.set”,“product”:“xxxxx”,“sn”:“xxxxx”,“mode”:“continuous”,“inbound”:3,“outbound”:3,“sync”:false}
{}
{“req”:“card.motion.mode”,“stop”:true,“seconds”:5,“sensitivity”:0}
{“stop”:true}

After a minute or so I get hub connected, but GPS stays on waiting to start

{“req”:“hub.status”}
{“connected”:true,“status”:“connected (session open) {connected}”}

{“req”:“card.location”}
{“stop”:true,“status”:“GPS waiting to start {gps-starting} {gps-active}”,“mode”:“continuous”}

I also get “stop”:true response member, which doesn’t seem to be in the documents? I have sent no other configuration to the notecard. At this point if I reset my processor (but not the notecard), I get connected responses from hub.status and the GPS starts working

{“req”:“card.location”}
{“status”:“GPS updated (156 sec, 47/48 dB SNR, 11/14 sats, HDOP 0.86) {gps-active} {gps-signal} {gps-sats} {gps}”,“mode”:“continuous”,“lat”:x,“lon”:x,“dop”:0.86,“time”:1712066023}

I’m thinking this has something to do with the fact the GPS can’t start until the modem connects, but I don’t know why it doesn’t start on its own, once it has. Is there something I should be doing to force the GPS to start on cold boot?

Thanks

Hey @spring,

This is funny timing because I’m working on a blog post on using external GPS :slight_smile:

I actually have a pretty similar scenario and haven’t hit this situation. Here’s my work-in-progress source in case you find anything useful in there WIP hyper aggressive asset tracker · GitHub.

The only obvious difference I notice is you should try switching to card.aux.serial for setting up the external GPS, as it’s now our preferred approach.

{
  "req": "card.aux.serial",
  "mode": "gps"
}

If that doesn’t work could I get some more information on the external GPS you’re using and how you have everything connected?

Thanks,
TJ

I changed to

{
  "req": "card.aux.serial",
  "mode": "gps"
}

and now it is working from cold boot. Thanks for your help.

1 Like

Hi, I found this thread looking if there’s a way to disable the motion trigger and thus constantly read the GPS from aux serial. My use case is to read the location every one second, accumulate a bit in a Raspberry Pi 2 W and then invoke the Notehub API to publish a note with the sequence of postions. Is it possible to keep the serial aux reading constant?

Hey @hcabral,

A couple of questions:

Why do you want to disable the motion trigger? If Notecard’s accelerometer hasn’t triggered, its GPS location should always be the same.

Why use the Notehub API instead of using your Notecard to transmit data? With an external GPS you can place your Notecard in continuous GPS mode, and in continuous mode every Note you add gets tagged with the latest location from the external GPS.

Thanks,

TJ

Hi @tjvantoll,

My use case is regatta racing tracking, so I need 1Hz (at least), and I accumulate the positions in batches of 10 to minimally optimize the communication with Notehub. During my initial research, I found that it’s not possible to do so with the internal GPS and communications running at the same time, hence the external GPS route.

I use Python to add some logic and extra calculations before sending Notes to Notehub. Energy consumption is not an issue at first.

The accelerometer should be constantly in moving especially on a boat, so it should work fine, but ideally I would like to guarantee that it won’t disable the communication with the GPX in aux/serial.

I don’t use the accelerometer to detect movement, I have that disabled. I have the external GPS in constant mode and poll the location from the note card using card.location. You can then do what you need to do to those locations in the RPi and add them as a note for syncing to Notehub.

You can keep communication on constantly or in periodic while running the external GPS constantly. It will use more power, but I’m guessing you have plenty if you are using the boats power?

Hi @spring,

I will start will 10000mAh and it should last 6 - 8h (more than enough). How did you disable the accelerometer? When I tried, the GPS connected via Aux/Serial to the Notecard X is immediately shut down. I couldn’t wake it unless I triggered movement on the board.

My application is exactly like that, it polls card.location every 1-2 seconds. My GPS in the Notecard is setup to location.mode periodic with 1 second frequency as well.

Thanks,
Henrique

I think you want to change the location mode to continuous and motion to stop.

Turn off motion
{
“req”, “card.motion.mode”,
“stop”, true
}

Set GPS to continuous
{
“req”, “card.location.mode”,
“mode”, “continuous”,
“threshold”, 0
}

At least that is what I’m doing, not sure threshold is required here or if it’s just a hangover from a previous setup.

We cannot run both the Hub and GPS in continuous modes. We get this:

{"err": "cannot simultaneously use continuous card.location.mode and hub.set modes"}

As seen here: Diagnosing GPS Issues - IoT Connectivity at Blues

That was my first bump. So I need the Hub in continuous mode for semi-immediate communication, while reading the GPS location from RPi.

You can put both in continuous mode if you use an external GPS and configure your Notecard appropriately. See Continuous Asset Tracking with External GPS and Immediate Location Sync for an example.

TJ

Hi @tjvantoll, I missed this detail, will give it a try, thanks!