How to get GPS Data from Notecard

Hello, I’m new to using the Blues Notecard and am struggling to get any functionality from the GPS. At this moment, I’m not interested in syncing to the cloud and am purely focused on retrieving a GPS signal. I’ve successfully build a java application that allows me to send json transactions and retrieve the Note card’s response over I2C.

Currently, these are the messages i’ve provided and the responses i’ve received:

Sending Message: {"req":"card.restore","delete":true}
RESPONSE: No Data in Que

Sending Message: {"req":"card.transport"}
RESPONSE: {"method":"cell"}

Sending Message: {"req":"card.time","time":1750447665}}
RESPONSE: {"zone":"UTC,Etc/UTC","time":1750447664}

Sending Message: {"req":"card.motion.mode","start":true}
RESPONSE: {"start":true,"seconds":5}

Sending Message: {"req":"card.location.mode","mode":"continuous"}
RESPONSE: {"mode":"continuous"}

Sending Message: {"req":"card.location"}
RESPONSE: {"status":"GPS waiting to start {gps-starting} {gps-active}","mode":"continuous"}

After waiting a few minutes, I attempted to get the location again and received this message:

Sending Message: {"req":"card.location"}
RESPONSE: {"status":"GPS inactive {gps-inactive}","mode":"continuous"}

Questions

  1. Do I have to sync to the cloud (hub.set) in order to get any GPS data?
  2. How can I make the GPS active?

Hi @bBrown,

Are you perhaps trying to use the Notecard in continuous cellular mode ({"req":"hub.set", "mode":"continuous"}) or in mode: periodic with a high outbound/inbound frequency?

This will conflict with using the GPS in continuous mode {"req":"card.location.mode","mode":"continuous"}. If you wish to use both the GPS and the cellular radio in continuous mode, you will need to use an external GPS module. You can read about our application about this here.

Thanks,
Alex

Hey, Alex. Previously, I had not used "req":"hub.set" at all. I was hoping to simply get the sensor’s data without creating a NoteHub account. However, since I first posted the message, i have created a NoteHub account.

After creating my account, I have received a single GPS reading but have been unable to effectively get the GPS to ever update. Here are the current commands I’ve provided:

Sending Message: {"req":"hub.set","product":"<myidfromnotehub>","mode":"periodic","outbound":5,"inbound":5,"sync":true}
RESPONSE: {}

Sending Message: {"req":"card.location.mode","mode":"continuous"}
RESPONSE: {"seconds":5,"mode":"continuous"}

Sending Message: {"req":"card.location"}
RESPONSE: {"status":"GPS inactive {gps-inactive}","mode":"continuous","lat":34.5200125,"lon":-86.172472656249981,"dop":20,"time":1750690180}

You’ll note that I do in fact get a gps location now when using "req":"card.location", however, This is from a reading that was taken over an hour ago. How can I get a current reading from the sensor’s GPS?

Hi @bBrown,

The issue here is your outbound and inbound arguments are set to sync accumulated data every 5 minutes (and "sync":true tells the Notecard to maintain a connection with Notehub in order to immediately sync any inbound Notefiles). If you’re more concerned about gathering up-to-date GPS coordinates, try this instead (where you’ll only try to make a cellular connection every hour):

{"req":"hub.set","product":"<myidfromnotehub>","mode":"periodic","outbound":60,"inbound":60}

I’d recommend reading up on the docs re: diagnosing GPS issues too.

Thanks,
Rob