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.

1 Like

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!

Hi @tjvantoll,

Yes, it worked. However, does the GPS in continuous mode have a fixed reading/updating rate of 5 seconds and cannot be modified?

hcabral,

You can always use an external GPS and use that data.

Regards

Rob Oudendijk

Hi @robouden - I am, the external GPS (Adafruit Breakout) is connected to my Notecarrier X using the serial connection. My RPi 2 W is connected to the X also using serial, so my setup is “deferring” the GPS management to the Notecarrier/Notecard.

If needed, I can try to connect the GPS to a second serial connection on my Pi 2 W (disabling bluetooth, if I’m not mistaken), but I wish I could continue my setup with this. Makes sense?

Cheers,
Henrique Cabral

2 Likes

hcabral,

Yes, makes sense.

Regards

Rob Oudendijk

However, does the GPS in continuous mode have a fixed reading/updating rate of 5 seconds and cannot be modified?

Interesting. I don’t think we’ve had anyone need that frequent of updates before :slight_smile:

After a quick glance through the source I’m not seeing anything obvious that would restrict the update rate on Notecard’s side, but I might be missing something.

The Adafruit Breakout looks like it should default to doing 1Hz updates, so you should be able to get an updated location every second or so. I have that breakout so I’ll try to recreate your scenario later this afternoon to see what happens.

TJ

Hi @tjvantoll,

Yeah, I stumbled upon Notecard while searching for an LTE/GPS solution for a project that I have. I quickly realized here and here that it wouldn’t work out of the box for me. So I bought the Adafruit Breakout, because 1-2Hz is more than enough.

I liked the ease of use and pricing of events is ok-ish for now, and the Routes solution is pretty good and exactly what I need (filter, publish). My plan is to continue with Notecard for the LTE part for now. =)

I’m back at using the Notecarrier-Pi with mu RPi 2W with I2C (the clock-stretching doesn’t seem to be an issue) and the Adafruit GPS modules using my UART serial directly. I had to parse the NMEA expressions, but that’s OK, at least I will also have velocity and bearing out of the box.

Cheers,
Henrique

Gotcha, good to know the background.

And I was able to recreate the issue you’re having today exactly. With my Adafruit Breakout connected I was spamming {"req":"card.location"} and I was getting updates every 5–6 seconds.

I’ll do some asking around tomorrow and see if I can get some ideas on why that’s happening, even if it’s only for my own curiosity.

TJ

Nice, @tjvantoll!

I’m happy with my setup now, with the GPS hooked to the Pi directly. I won’t need to calculate speed and bearing in runtime, and 1Hz for now is more than enough. I will continue to follow these threads as I plan to continue using Notehub for comms/backend.

Cheers,
Henrique

2 Likes