Getting location for Curl to Asset tracking

When ever time I make a request

curl " "
-d args=G
-d access_token=6789
and return this


How can i do to make a return to get location info like the one on the events?

Particle.function() calls will only ever return one integer value.
If you want the function to give you the coordinates you need to Particle.publish() the data from within that function or you could use a Particle.variable() to request the last read location.

AFAIK, the Asset Tracker Sample does already publish.

Have a look at to see your events.

1 Like

I changed
void setup() {
Particle.variable(“tmode”, transmitMode);
Particle.variable(“batt”, batteryStatus);
Particle.variable(“gps”, gpsPublish);

but the return still not what I’m looking for


please advice, thank you

This is not how Particle.variable() works.
These are functions, but Particle.variable() expects variables

Go back to the original code and check the console as I said before.

Additionally you can add a global char gpsLocation[64], register this as Particle.variable() in setup() and set its value in your code (e.g. inside gpsPublish() and/or regularly in loop()).


I got it to work now, just like you posted. Thanks a lot.