# Getting Device Location GPS to appear in the data and dashboard

**URL:** <https://discuss.blues.com/t/getting-device-location-gps-to-appear-in-the-data-and-dashboard/421>\
**Category:** Notecarrier F\
**Created:** [September 14, 2021, 11:38am UTC](https://discuss.blues.com/t/getting-device-location-gps-to-appear-in-the-data-and-dashboard/421 "2021-09-14T11:38:39Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![patmolloy](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@patmolloy](https://discuss.blues.com/u/patmolloy)\
**Post date:** [September 14, 2021, 11:38am UTC](https://discuss.blues.com/t/getting-device-location-gps-to-appear-in-the-data-and-dashboard/421/1 "2021-09-14T11:38:39Z")

</div>

How do I see actual device location with the AF board? I see tower location but that’s it. I am just running the stock demo at the moment for testing and experimentation.

Good GPS coverage.

Thanks

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [September 14, 2021, 12:35pm UTC](https://discuss.blues.com/t/getting-device-location-gps-to-appear-in-the-data-and-dashboard/421/2 "2021-09-14T12:35:05Z")

</div>

Hi @patmolloy,

The GPS module is not enabled by default (to conserve power), so I’d recommend taking a look at our GPS docs for the full details: [Time & Location Requests - Blues Wireless Developers](https://dev.blues.io/notecard/notecard-walkthrough/time-and-location-requests/#working-with-gps-on-the-notecard)

Cheers,  
Rob

---

<div class="post-metadata">

**Author:** ![patmolloy](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@patmolloy](https://discuss.blues.com/u/patmolloy)\
**Post date:** [September 14, 2021, 12:54pm UTC](https://discuss.blues.com/t/getting-device-location-gps-to-appear-in-the-data-and-dashboard/421/3 "2021-09-14T12:54:17Z")

</div>

Thanks! I don’t know how I failed to see that in the first place - apologies.

Pat

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [September 14, 2021, 12:58pm UTC](https://discuss.blues.com/t/getting-device-location-gps-to-appear-in-the-data-and-dashboard/421/4 "2021-09-14T12:58:13Z")

</div>

No worries, it’s what we are here for! (And tells me we need to make our GPS docs a little more visible 🙂)

---

<div class="post-metadata">

**Author:** ![patmolloy](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@patmolloy](https://discuss.blues.com/u/patmolloy)\
**Post date:** [September 16, 2021, 8:00pm UTC](https://discuss.blues.com/t/getting-device-location-gps-to-appear-in-the-data-and-dashboard/421/5 "2021-09-16T20:00:11Z")

</div>

I’m struggling … I still cannot get card location to play nice … this is the code … clearly I have something wrong …

```auto
#include <Notecard.h>
#include <SparkFunBME280.h>

#define serialDebug Serial

#define productUID "uk.org.digicatapult.pat.molloy:sparkfunqwiic"

Notecard notecard;
BME280 bmeSensor;

void setup() {
  // put your setup code here, to run once:

  delay(2500);
  serialDebug.begin(115200);

  notecard.begin();
  notecard.setDebugOutputStream(serialDebug);

  J *req = notecard.newRequest("hub.set");
  JAddStringToObject(req, "product", productUID);
  JAddStringToObject(req, "mode", "periodic");
  JAddNumberToObject(req, "seconds", 900);
    
  notecard.sendRequest(req);

  J *req1 = notecard.newRequest("card.location.mode");
  JAddStringToObject(req1, "mode", "continuous");
  notecard.sendRequest(req1);
  

  
if (bmeSensor.beginI2C() == false) {
   serialDebug.println("Could not find a valid BME280 sensor...");
} else {
   serialDebug.println("BME280 Connected...");
}

}

void loop() {
  // put your main code here, to run repeatedly:

serialDebug.print("Temperature = ");
serialDebug.print(bmeSensor.readTempC());
serialDebug.println(" *C");
serialDebug.print("Humidity = ");
serialDebug.print(bmeSensor.readFloatHumidity());
serialDebug.println(" %");

J *req = notecard.newRequest("note.add");
if (req != NULL) {
    JAddStringToObject(req, "file", "sensors.qo");
    JAddBoolToObject(req, "sync", true);
    J *body = JCreateObject();
    if (body != NULL) {
        JAddNumberToObject(body, "temp", bmeSensor.readTempC());
        JAddNumberToObject(body, "humidity", bmeSensor.readFloatHumidity());

        JAddItemToObject(req, "body", body);
    }
    notecard.sendRequest(req);

    notecard.newRequest("card.location");
    notecard.sendRequest(req);
    

}

delay(60000*15); // 15 minutes
}

```

This is what appears on the SerialDebug output … it looks promising to start with but then gps-inactive for ever more …

I admit I am confused about the periodic/continuous interplay and how that related to the delay(60000) statement!

There _is_ a strong GPS signal, I have verified.

```auto
20:53:54.083 -> ets Jul 29 2019 12:21:46
20:53:54.083 -> 
20:53:54.083 -> rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
20:53:54.083 -> configsip: 0, SPIWP:0xee
20:53:54.083 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
20:53:54.083 -> mode:DIO, clock div:1
20:53:54.083 -> load:0x3fff0018,len:4
20:53:54.083 -> load:0x3fff001c,len:1044
20:53:54.083 -> load:0x40078000,len:8896
20:53:54.083 -> load:0x40080400,len:5816
20:53:54.083 -> entry 0x400806ac
20:53:57.020 -> {"req":"hub.set","product":"uk.org.digicatapult.pat.molloy:sparkfunqwiic","mode":"periodic","seconds":900,"body":{"agent":"note-arduino","compiler":"gcc 5.2.0","req_interface":"i2c","cpu_name":"esp32"}}
20:53:57.254 -> {}
20:53:57.254 -> {"req":"card.location.mode","mode":"continuous","body":{"agent":"note-arduino","compiler":"gcc 5.2.0","req_interface":"i2c","cpu_name":"esp32"}}
20:53:57.441 -> {"seconds":60,"mode":"continuous"}
20:53:57.441 -> BME280 Connected...
20:53:57.441 -> Temperature = 26.14 *C
20:53:57.441 -> Humidity = 45.13 %
20:53:57.441 -> {"req":"note.add","file":"sensors.qo","sync":true,"body":{"temp":26.14,"humidity":45.126}}
20:53:57.581 -> {"total":2}
20:53:57.581 -> {"req":"card.location","body":{"agent":"note-arduino","compiler":"gcc 5.2.0","req_interface":"i2c","cpu_name":"esp32"}}
20:53:57.721 -> {"status":"GPS inactive {gps-inactive}","mode":"continuous"}
20:54:57.735 -> Temperature = 26.16 *C
20:54:57.735 -> Humidity = 45.89 %
20:54:57.735 -> {"req":"note.add","file":"sensors.qo","sync":true,"body":{"temp":26.16,"humidity":45.8906}}
20:54:57.876 -> {"total":1}
20:54:57.876 -> {"req":"card.location","body":{"agent":"note-arduino","compiler":"gcc 5.2.0","req_interface":"i2c","cpu_name":"esp32"}}
20:54:58.015 -> {"status":"GPS search (2 sec, 0/0 dB SNR, 0/0 sats) {gps-active}","mode":"continuous"}
20:55:58.007 -> Temperature = 26.41 *C
20:55:58.007 -> Humidity = 44.90 %
20:55:58.007 -> {"req":"note.add","file":"sensors.qo","sync":true,"body":{"temp":26.41,"humidity":44.9014}}
20:55:58.146 -> {"total":1}
20:55:58.146 -> {"req":"card.location","body":{"agent":"note-arduino","compiler":"gcc 5.2.0","req_interface":"i2c","cpu_name":"esp32"}}
20:55:58.285 -> {"status":"GPS inactive {gps-inactive}","mode":"continuous"}
20:56:58.301 -> Temperature = 26.60 *C
20:56:58.301 -> Humidity = 44.20 %
20:56:58.301 -> {"req":"note.add","file":"sensors.qo","sync":true,"body":{"temp":26.6,"humidity":44.2041}}
20:56:58.440 -> {"total":1}
20:56:58.440 -> {"req":"card.location","body":{"agent":"note-arduino","compiler":"gcc 5.2.0","req_interface":"i2c","cpu_name":"esp32"}}
20:56:58.580 -> {"status":"GPS inactive {gps-inactive}","mode":"continuous"}

```

---

<div class="post-metadata">

**Author:** ![patmolloy](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@patmolloy](https://discuss.blues.com/u/patmolloy)\
**Post date:** [September 16, 2021, 8:04pm UTC](https://discuss.blues.com/t/getting-device-location-gps-to-appear-in-the-data-and-dashboard/421/6 "2021-09-16T20:04:11Z")

</div>

I lied … a little later I saw this … (see \*\*) but still no card location in the backend.

```auto
20:59:59.256 -> {"req":"card.location","body":{"agent":"note-arduino","compiler":"gcc 5.2.0","req_interface":"i2c","cpu_name":"esp32"}}
**20:59:59.411 -> {"status":"GPS started {gps-active} {gps-active}","mode":"continuous"}**
21:00:59.400 -> Temperature = 26.77 *C
21:00:59.400 -> Humidity = 44.11 %
21:00:59.400 -> {"req":"note.add","file":"sensors.qo","sync":true,"body":{"temp":26.77,"humidity":44.1143}}
21:00:59.540 -> {"total":1}
21:00:59.540 -> {"req":"card.location","body":{"agent":"note-arduino","compiler":"gcc 5.2.0","req_interface":"i2c","cpu_name":"esp32"}}
21:00:59.680 -> {"status":"GPS inactive {gps-inactive}","mode":"continuous"}
21:01:59.692 -> Temperature = 26.84 *C
21:01:59.692 -> Humidity = 44.48 %
21:01:59.692 -> {"req":"note.add","file":"sensors.qo","sync":true,"body":{"temp":26.84,"humidity":44.4785}}
21:01:59.789 -> {"total":1}
21:01:59.789 -> {"req":"card.location","body":{"agent":"note-arduino","compiler":"gcc 5.2.0","req_interface":"i2c","cpu_name":"esp32"}}
21:01:59.943 -> {"status":"GPS inactive {gps-inactive}","mode":"continuous"}

```

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [September 18, 2021, 8:51pm UTC](https://discuss.blues.com/t/getting-device-location-gps-to-appear-in-the-data-and-dashboard/421/7 "2021-09-18T20:51:02Z")

</div>

Hi @patmolloy,

Sorry for the delay in my response. The only issue I noticed in your code is the usage of the `seconds` parameter with your `hub.set` request. You can remove that entirely.

On the GPS side of things, there a couple of things to note. If you are using the onboard antennas of the Notecarrier-AF, it can take a minute or so to acquire a good signal from the GPS satellites. So even though it’s in `continuous` mode, that doesn’t mean you’ll see a signal immediately. Also, you almost need to be outside with a clear view of the sky (indoor GPS generally requires an external antenna). I also find it easier to test in the browser at [https://dev.blues.io](https://dev.blues.io) (issuing the `card.location.mode` and `card.location` requests) vs jumping right into the Arduino IDE.

One last thing: make sure you’re on the [latest firmware](https://discuss.blues.com/t/announcing-the-q2-2021-developer-firmware-release/276) in case you haven’t upgraded recently!

---

<div class="post-metadata">

**Author:** ![patmolloy](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@patmolloy](https://discuss.blues.com/u/patmolloy)\
**Post date:** [September 19, 2021, 9:32am UTC](https://discuss.blues.com/t/getting-device-location-gps-to-appear-in-the-data-and-dashboard/421/8 "2021-09-19T09:32:48Z")

</div>

Thanks, It has come to life eventually (\>30 mins). I am using the sparkfun carrier attached to a GPS antenna that is outside with a clear view of the sky.

I can see two seconds coming back from the notecard – the first from the hub.set (900 seconds) and the second presumably from the card.location.mode (60 seconds). I actually don’t know where that 60 seconds came from unless is it implicit when you set mode to continuous?

Is it the first of there that can go? And the second one will just be generated even though not explicitly set?

I’ll upgrade the firmware!

Thanks a million.

Pat

---

<div class="post-metadata">

**Author:** ![patmolloy](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@patmolloy](https://discuss.blues.com/u/patmolloy)\
**Post date:** [September 19, 2021, 6:33pm UTC](https://discuss.blues.com/t/getting-device-location-gps-to-appear-in-the-data-and-dashboard/421/9 "2021-09-19T18:33:59Z")

</div>

Also bridging the VACT\_GPS jumper on the carrier helped!

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [September 20, 2021, 2:12pm UTC](https://discuss.blues.com/t/getting-device-location-gps-to-appear-in-the-data-and-dashboard/421/10 "2021-09-20T14:12:00Z")

</div>

Hi @patmolloy,

You can remove the `seconds` parameter from the `hub.set` request. There are [outbound and inbound](https://dev.blues.io/reference/notecard-api/hub-requests/#hub-set) params for hub.set that let you set (in minutes) how frequently you sync with Notehub.

For card.location.mode, the seconds param is explained in the [docs](https://dev.blues.io/reference/notecard-api/card-requests/#card-location-mode): “When in periodic mode, location will be sampled at this interval, if the Notecard detects motion.”

Back to your GPS issue, my next question was going to be what type of GPS antenna you are using (active vs passive). However, if you read about bridging that jumper it must mean you are using an active antenna!

Rob

---

<div class="post-metadata">

**Author:** ![paulohm](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@paulohm](https://discuss.blues.com/u/paulohm)\
**Post date:** [June 30, 2023, 8:57pm UTC](https://discuss.blues.com/t/getting-device-location-gps-to-appear-in-the-data-and-dashboard/421/11 "2023-06-30T20:57:32Z")

</div>

Looks like I am having the exact same problem 😀 your post saved me from a long weekend of debugging and agony !!!
