Not getting _track.qo notes after initial satellite fix

Hello all, hoping you can help me try to figure out an issue that is puzzling me.

I am running a notecard with the latest firmware (3.5.2) with a Raspberry Pi HAT on a Raspberry Pi 4. I am trying to do an asset tracking type project, so the setup is in my car. I would like to get GPS points every so often so you can see a history of where I went.

When I get the initial satellite fix, I get a track.qo note with the GPS location. However, after that, I never get a new track.qo note while my code is running. I’ve printed debugs and it looks like most of the time the GPS is inactive, even though I’m driving in a car. I’ve seen a couple instances (in the minority) where the gps is active but there is no note sent. I also don’t see any velocity data in the track.qo notes that I do receive.

Any suggestions on how to get GPS points on a regular basis? I’ve tried setting the mode to both continuous and periodic, neither gets me consistent track.qo notes. Could there be an issue with the accelerometer where it isn’t detecting motion? Any help would be appreciated, I think I’ve exhausted all my debugging routes.

thanks,
Justin

Hi @jlutzwpi and welcome to the Blues Wireless community!

It would help to see how you have configured the Notecard to report its location. Can you paste in the series of commands you used (presumably card.location.mode and card.location.track API requests)? We can take a look and see what should be happening.

Also, it sounds like you are getting a GPS fix at least once, but I just want to verify you have an antenna on the GPS u.fl connector on the Notecard and that it has good visibility to the southern sky.

Thanks,
Rob

Thanks for the quick reply @RobLauer ! I’m using the Python API, so below are the commands:

req = {"req": "hub.set"}
req["product"] = productUID
req["mode"] = "periodic"
req["outbound"] = 30
req["inbound"] = 60
print(json.dumps(req))
rsp = card.Transaction(req)
print(rsp)
#GPS
req = {"req": "card.location.mode"}
req["mode"] = "periodic"
req["seconds"] = 10
print(json.dumps(req))
rsp = card.Transaction(req)
print(rsp)
#heartbeat
req = {"req": "card.location.track"}
req["start"] = True
req["sync"] = True
print(json.dumps(req))
rsp = card.Transaction(req)
print(rsp)

I also tried card.location.mode as continuous with similar results. I am using the Molex 213353 that came with my WB notecard. (I also have an older Notecard that is NB, but I was having a harder time connecting to the network).

The setup is in my car, taped to my dashboard, so I drove south for a while to have southern exposure through the windshield. Each time I test my program, it seems to make that initial satellite fix relatively quickly (< 5 min), so I feel I have good connectivity there. The notecard should at least make an attempt the get a fix due to the motion of the car correct?

I also added the Blues Support team as a member to my project (“Pi Project”).

Thanks!
Justin

I’m a little rusty with my asset tracking configs, but here are some thoughts:

  1. I assume you also have an antenna on MAIN (and optionally DIV) to maintain a cell signal?
  2. Since your card.location.mode request is sampling data relatively frequently, you can drop the seconds arg and just use continuous mode. This is not battery-friendly though, just to be clear.
  3. I would drop the sync/true from card.location.track. If you think of what’s happening, you’re gathering location data every 10 seconds, then asking the Notecard to immediately switch from GPS to cellular to upload that Note. You should get more accurate location data if you wait the 30 minutes (in your hub.set/outbound arg).
  4. I would add a heartbeat to card.location.track as well.
  5. I don’t think the accelerometer is the issue, and this shouldn’t be necessary anyway, but you could try increasing the sensitivity with card.motion.mode/sensitivity.

In summary, here are my suggestions wrapped up:

req = {"req": "hub.set"}
req["product"] = productUID
req["mode"] = "periodic"
req["outbound"] = 30
req["inbound"] = 60
print(json.dumps(req))
rsp = card.Transaction(req)
print(rsp)
#GPS
req = {"req": "card.location.mode"}
req["mode"] = "continuous"
print(json.dumps(req))
rsp = card.Transaction(req)
print(rsp)
#heartbeat
req = {"req": "card.location.track"}
req["start"] = True
req["heartbeat"] = True
req["hours"] = 2
print(json.dumps(req))
rsp = card.Transaction(req)
print(rsp)
#increase sensitivity
req = {"req": "card.motion.mode"}
req["start"] = True
req["sensitivity"] = 2
print(json.dumps(req))
rsp = card.Transaction(req)
print(rsp)

Awesome thank you @RobLauer ! I will give it a try tomorrow morning and let you know how it goes!

Argh, no joy with the new configuration. I get the initial fix, and then no track.qo notes are sent out after that. You can even see in the Events history, that new cell towers are being pinged (going from Bedford to Lexington to Concord to Sudbury) but location never updates (stays in Bedford).

Any idea what is going on? Looking at my debug statements. It says gps-inactive most of the time, even though I am moving.

Thanks,
Justin

Do you happen to see any status messages in your debug statements that include “GPS search”? Something like this:

"status": "GPS search (19 sec, 41dB SNR, 5 sats) {gps-active}
                {gps-signal} {gps-sats}"

I’d like to know what’s happening between the 12:32 and 12:33 timestamp above. It’s as if you lose your GPS fix right away.

Rob

I was just outputting to the screen, so I don’t have the full debug, but I did another run and saved it to a file. The only time I find “gps-active” is when it’s searching for satellites. After I connect, I do not see it again.

These are the last 2 that I see:

{'status': 'GPS search (98 sec, 31/33 dB SNR, 0/6 sats, HDOP 0.00) {gps-active} {gps-signal} {gps-sats}', 'mode': 'continuous'}
{'status': 'GPS search (99 sec, 34/34 dB SNR, 0/6 sats, HDOP 0.00) {gps-active} {gps-signal} {gps-sats} {gps}', 'mode': 'continuous', 'lat': 42.43116064999999, 'lon': -71.40294315, 'dop': 2.2, 'time': 1671843716}

And in the old run, these are the gps-active messages I was seeing:

'status': 'GPS started {gps-active} {gps-active} {gps}', 'mode': 'continuous', 'lat': 42.4605978, 'lon': -71.27850445, 'dop': 1.8, 'time': 1671813124}
Found 1 bounding boxes (168 ms.)
	Justin (0.96): x=122 y=36 w=85 h=112
Getting frame at: 439.65 sec
{'status': 'GPS started {gps-active} {gps-active} {gps}', 'mode': 'continuous', 'lat': 42.4605978, 'lon': -71.27850445, 'dop': 1.8, 'time': 1671813124}
Found 2 bounding boxes (168 ms.)
	Justin (0.97): x=113 y=33 w=87 h=113
	seatbelt (0.69): x=199 y=132 w=22 h=43
Getting frame at: 440.35 sec
{'status': 'GPS started {gps-active} {gps-active} {gps}', 'mode': 'continuous', 'lat': 42.4605978, 'lon': -71.27850445, 'dop': 1.8, 'time': 1671813124}
Found 2 bounding boxes (168 ms.)
	Justin (0.97): x=121 y=34 w=87 h=114
	seatbelt (0.59): x=203 y=135 w=21 h=41

Nothing about searching at all. I’m really not sure what else I can do.

About my setup: I have a RPi 4 attached to a 7" monitor and the RPi HAT attached to the RPi 4. I don’t think there would be any interference from the monitor or anything. The Molex antenna (dual-band + GPS antenna that came with the notecard) has pretty good separation so I don’t think I would get any issues there. And on the dashboard it has clear view of the sky.

The 0/6 sats has me concerned that it’s not able to make a fix on any known satellites. My next step would be to place the device in the most open southern-facing spot possible - making sure the GPS antenna is securely connected and there is no possible interference.

Are you completely powering-down the Pi in between runs? If so, FYI the Notecard will lose any satellite data it has stored, so a cold start will require additional time to get a fix.

This thread may be helpful as well - including my next suggestion, which would be to get a GPS trace log. See the instructions here for initiating a trace, and note you’ll want to use this argument with your card.trace call: "trace":"+gpsmax".

We will figure this out!

@RobLauer thanks for getting back to me on Christmas Eve! I’ll do the trace log now, but I wanted to share more observations with you. It doesn’t look like I can share log files here, so I’ll put the snippets.

I do get the GPS updated log entry as you asked (this is from my home with a south facing window, and it got the lock in ~70 seconds, not bad from a cold start):

{'status': 'GPS search (70 sec, 30/32 dB SNR, 0/6 sats, HDOP 0.00) {gps-active} {gps-signal} {gps-sats}', 'mode': 'continuous'}
{'status': 'GPS search (71 sec, 29/32 dB SNR, 0/6 sats, HDOP 0.00) {gps-active} {gps-signal} {gps-sats} {gps}', 'mode': 'continuous', 'lat': 42.43101265000001, 'lon': -71.40287941666666, 'dop': 1.3, 'time': 1671908605}
Found 0 bounding boxes (242 ms.)
{'total': 1}
Note sent!
Getting frame at: 76.78 sec
{'status': 'GPS updated (72 sec, 29/32 dB SNR, 4/6 sats, HDOP 1.30) {gps-active} {gps-signal} {gps-sats} {gps}', 'mode': 'continuous', 'lat': 42.43101265000001, 'lon': -71.40287941666666, 'dop': 1.3, 'time': 1671908605}
Found 0 bounding boxes (168 ms.)
Getting frame at: 77.51 sec
{'status': 'GPS updated (72 sec, 29/32 dB SNR, 4/6 sats, HDOP 1.30) {gps-active} {gps-signal} {gps-sats} {gps}', 'mode': 'continuous', 'lat': 42.43101265000001, 'lon': -71.40287941666666, 'dop': 1.3, 'time': 1671908605}
Found 0 bounding boxes (186 ms.)
Getting frame at: 78.23 sec
{'status': 'GPS updated (72 sec, 29/32 dB SNR, 4/6 sats, HDOP 1.30) {gps-active} {gps-signal} {gps-sats} {gps}', 'mode': 'continuous', 'lat': 42.43101265000001, 'lon': -71.40287941666666, 'dop': 1.3, 'time': 1671908605}
Found 0 bounding boxes (199 ms.)
Getting frame at: 78.94 sec
{'status': 'GPS updated (72 sec, 29/32 dB SNR, 4/6 sats, HDOP 1.30) {gps-active} {gps-signal} {gps-sats} {gps}', 'mode': 'continuous', 'lat': 42.43101265000001, 'lon': -71.40287941666666, 'dop': 1.3, 'time': 1671908605}
Found 0 bounding boxes (173 ms.)
Getting frame at: 79.63 sec
{'status': 'GPS updated (72 sec, 29/32 dB SNR, 4/6 sats, HDOP 1.30) {gps-active} {gps-signal} {gps-sats} {gps}', 'mode': 'continuous', 'lat': 42.43101265000001, 'lon': -71.40287941666666, 'dop': 1.3, 'time': 1671908605}
Found 0 bounding boxes (169 ms.)
Getting frame at: 80.35 sec
{'status': 'GPS updated (72 sec, 29/32 dB SNR, 4/6 sats, HDOP 1.30) {gps-active} {gps-signal} {gps-sats} {gps}', 'mode': 'continuous', 'lat': 42.43101265000001, 'lon': -71.40287941666666, 'dop': 1.3, 'time': 1671908605}
Found 0 bounding boxes (169 ms.)
Getting frame at: 81.07 sec
{'status': 'GPS updated (72 sec, 29/32 dB SNR, 4/6 sats, HDOP 1.30) {gps-active} {gps-signal} {gps-sats} {gps}', 'mode': 'continuous', 'lat': 42.43101265000001, 'lon': -71.40287941666666, 'dop': 1.3, 'time': 1671908605}
Found 0 bounding boxes (169 ms.)
Getting frame at: 81.80 sec
{'status': 'GPS updated (72 sec, 29/32 dB SNR, 4/6 sats, HDOP 1.30) {gps-active} {gps-signal} {gps-sats} {gps}', 'mode': 'continuous', 'lat': 42.43101265000001, 'lon': -71.40287941666666, 'dop': 1.3, 'time': 1671908605}
Found 0 bounding boxes (204 ms.)
Getting frame at: 82.51 sec
{'status': 'GPS updated (72 sec, 29/32 dB SNR, 4/6 sats, HDOP 1.30) {gps-active} {gps-signal} {gps-sats} {gps}', 'mode': 'continuous', 'lat': 42.43101265000001, 'lon': -71.40287941666666, 'dop': 1.3, 'time': 1671908605}
Found 0 bounding boxes (191 ms.)
Getting frame at: 83.21 sec
{'status': 'GPS updated (72 sec, 29/32 dB SNR, 4/6 sats, HDOP 1.30) {gps-active} {gps-signal} {gps-sats} {gps}', 'mode': 'continuous', 'lat': 42.43101265000001, 'lon': -71.40287941666666, 'dop': 1.3, 'time': 1671908605}
Found 0 bounding boxes (168 ms.)
Getting frame at: 83.90 sec
{'status': 'GPS updated (72 sec, 29/32 dB SNR, 4/6 sats, HDOP 1.30) {gps-active} {gps-signal} {gps-sats} {gps}', 'mode': 'continuous', 'lat': 42.43101265000001, 'lon': -71.40287941666666, 'dop': 1.3, 'time': 1671908605}
Found 0 bounding boxes (169 ms.)
Getting frame at: 84.63 sec
{'status': 'GPS updated (72 sec, 29/32 dB SNR, 4/6 sats, HDOP 1.30) {gps-active} {gps-signal} {gps-sats} {gps}', 'mode': 'continuous', 'lat': 42.43101265000001, 'lon': -71.40287941666666, 'dop': 1.3, 'time': 1671908605}
Found 0 bounding boxes (169 ms.)
Getting frame at: 85.35 sec
{'status': 'GPS inactive {gps-inactive} {gps}', 'mode': 'continuous', 'lat': 42.43101265000001, 'lon': -71.40287941666666, 'dop': 1.3, 'time': 1671908605}
Found 0 bounding boxes (171 ms.)
Getting frame at: 86.05 sec

It then says GPS inactive for a bit. When the GPS turns back on, it’s almost if at it is starting from a cold start (0/0 satellites), and it looks like it times out and goes inactive again. I’m guessing that’s why I’m not getting updated position data. Excerpt below:

{'status': 'GPS inactive {gps-inactive} {gps}', 'mode': 'continuous', 'lat': 42.430910366666666, 'lon': -71.40302851666667, 'dop': 1.3, 'time': 1671909004}
Found 0 bounding boxes (180 ms.)
Getting frame at: 71.45 sec
{'status': 'GPS inactive {gps-inactive} {gps}', 'mode': 'continuous', 'lat': 42.430910366666666, 'lon': -71.40302851666667, 'dop': 1.3, 'time': 1671909004}
Found 0 bounding boxes (199 ms.)
Getting frame at: 72.14 sec
{'status': 'GPS started {gps-active} {gps-active} {gps}', 'mode': 'continuous', 'lat': 42.430910366666666, 'lon': -71.40302851666667, 'dop': 1.3, 'time': 1671909004}
Found 0 bounding boxes (168 ms.)
Getting frame at: 72.81 sec
{'status': 'GPS started {gps-active} {gps-active} {gps}', 'mode': 'continuous', 'lat': 42.430910366666666, 'lon': -71.40302851666667, 'dop': 1.3, 'time': 1671909004}
Found 0 bounding boxes (168 ms.)
Getting frame at: 73.52 sec
{'status': 'GPS started {gps-active} {gps-active} {gps}', 'mode': 'continuous', 'lat': 42.430910366666666, 'lon': -71.40302851666667, 'dop': 1.3, 'time': 1671909004}
Found 0 bounding boxes (168 ms.)
Getting frame at: 74.21 sec
{'status': 'GPS started {gps-active} {gps-active} {gps}', 'mode': 'continuous', 'lat': 42.430910366666666, 'lon': -71.40302851666667, 'dop': 1.3, 'time': 1671909004}
Found 0 bounding boxes (189 ms.)
Getting frame at: 74.92 sec
{'status': 'GPS started {gps-active} {gps-active} {gps}', 'mode': 'continuous', 'lat': 42.430910366666666, 'lon': -71.40302851666667, 'dop': 1.3, 'time': 1671909004}
Found 0 bounding boxes (198 ms.)
Getting frame at: 75.61 sec
{'status': 'GPS started {gps-active} {gps-active} {gps}', 'mode': 'continuous', 'lat': 42.430910366666666, 'lon': -71.40302851666667, 'dop': 1.3, 'time': 1671909004}
Found 0 bounding boxes (168 ms.)
Getting frame at: 76.28 sec
{'status': 'GPS search (4 sec, 0/0 dB SNR, 0/0 sats, HDOP 0.00) {gps-active} {gps}', 'mode': 'continuous', 'lat': 42.430910366666666, 'lon': -71.40302851666667, 'dop': 1.3, 'time': 1671909004}
Found 0 bounding boxes (168 ms.)

It then times out (it looks like 50 seconds) and goes inactive again. (It also looks like a small red LED blinks next to the larger green LED). Excerpt below:

{'status': 'GPS search (49 sec, 0/0 dB SNR, 0/0 sats, HDOP 0.00) {gps-active} {gps}', 'mode': 'continuous', 'lat': 42.43107781666666, 'lon': -71.40315885, 'dop': 1.0, 'time': 1671909187}
Found 0 bounding boxes (169 ms.)
Getting frame at: 128.60 sec
{'status': 'GPS search (49 sec, 0/0 dB SNR, 0/0 sats, HDOP 0.00) {gps-active} {gps}', 'mode': 'continuous', 'lat': 42.43107781666666, 'lon': -71.40315885, 'dop': 1.0, 'time': 1671909187}
Found 0 bounding boxes (169 ms.)
Getting frame at: 129.32 sec
{'status': 'GPS search (49 sec, 0/0 dB SNR, 0/0 sats, HDOP 0.00) {gps-active} {gps}', 'mode': 'continuous', 'lat': 42.43107781666666, 'lon': -71.40315885, 'dop': 1.0, 'time': 1671909187}
Found 0 bounding boxes (168 ms.)
Getting frame at: 130.03 sec
{'status': 'GPS inactive {gps-inactive} {gps}', 'mode': 'continuous', 'lat': 42.43107781666666, 'lon': -71.40315885, 'dop': 1.0, 'time': 1671909187}
Found 0 bounding boxes (205 ms.)
Getting frame at: 130.73 sec
{'status': 'GPS inactive {gps-inactive} {gps}', 'mode': 'continuous', 'lat': 42.43107781666666, 'lon': -71.40315885, 'dop': 1.0, 'time': 1671909187}

Note: if I run my program again and don’t power down, it gets a fix immediately.

Interesting. So just to be clear, when it’s in your house it will get a fix in about a minute, then go inactive, and not be able to get another fix after that? And are you moving the Notecard (a little shake will do) to activate the accelerometer? Though in this case you’re in continuous mode, so that shouldn’t matter.

The trace log should help diagnose the issue. You should be able to PM me to send the trace log output here I think(?), if not just send it via email rob at blues dot com.

Effectively we are battling the low-power nature of the Notecard - which is usually a good thing! The nuclear option may be to repurpose this code from Arduino to Python to get an immediate GPS reading.

OK, trace log sent to your email. Given that I was in continuous mode, I didn’t move the Notecard at all.

I’ll check out the link! Thanks again!

And that’s correct about the chain of events: gets fix, goes inactive, tries to get another fix (looks like cold start), times out, goes inactive, rinse and repeat.

This was the same order of events in my car as well.

Responding here as well so others have the visibility. The issue was I had a “sync” request in my sensor note that I was sending to the notecard. Once I removed that sync, I had no issues getting a GPS fix.

Apologies @RobLauer but I don’t think I’m out of the woods yet. I set my outbound parameter to 1 (I believe that’s for 1 minute)

req = {"req": "hub.set"}
req["product"] = productUID
req["mode"] = "periodic"
req["outbound"] = 1
req["inbound"] = 60

and GPS to continuous to get the highest granular GPS data I could get. I went for a 23 minute drive after I got a satellite fix and only got 3 _track.qo notes in that time span. So when I look at the data on Datacake I only see 3 points.

I’m wondering if adding my sensor.qo note every 2 minutes conflicts with the track.qo note? I’m also still not getting velocity and heading data in the JSON data, which is interesting because I’m in a moving car.

This may be for a Datacake person, but can I use the lat/lon data from the sensor.qo note for my GPS points instead of relying on the _track.qo note? That data is getting updated for each sensor.qo note that I send.

thanks,
Justin

You’re syncing too frequently! If you’re asking the Notecard to perform an outbound sync every minute, it’s going to be almost impossible for it to disable the cellular modem, enable the GPS module, get a fix, establish a location, only to have to try to make another outbound cellular sync. I would recommend outbound is set higher (like 30 or 60 minutes). Remember that Notes are still saved to flash on the Notecard, and they will all be synced with Notehub on that outbound cadence.

Rob

Thanks @RobLauer . I saw a video of you and Paige where she described her “lofi Lojack” but she must have been talking about setting the GPS periodic to 60s.

Yes, that’s exactly it. If you want fine-grained location tracking history, setting the card.location.mode/seconds argument low is the way to go :+1:.

1 Like