# Determine which gateway is used by a given node

**URL:** <https://www.thethingsnetwork.org/forum/t/determine-which-gateway-is-used-by-a-given-node/11531>\
**Category:** End Devices (Nodes)\
**Created:** [January 4, 2018, 8:50am UTC](https://www.thethingsnetwork.org/forum/t/determine-which-gateway-is-used-by-a-given-node/11531 "2018-01-04T08:50:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kalon33](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kalon33/32/48029_2.png) [@kalon33](https://www.thethingsnetwork.org/forum/u/kalon33)\
**Post date:** [January 4, 2018, 8:50am UTC](https://www.thethingsnetwork.org/forum/t/determine-which-gateway-is-used-by-a-given-node/11531/1 "2018-01-04T08:50:54Z")

</div>

Dear all,

As my gateway crashed, I just saw that my application was still receiving packets from my node in the application data page from ttn console.

Is there any way to determine which gateway it is currently using to send the data?

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [January 4, 2018, 4:35pm UTC](https://www.thethingsnetwork.org/forum/t/determine-which-gateway-is-used-by-a-given-node/11531/12 "2018-01-04T16:35:22Z")

</div>

⚠ ⚠ ⚠

**This post contains references to outdated APIs.**

**Please read the following for the new APIs: [https://www.thethingsnetwork.org/forum/t/new-api-for-gateway-mapping-status-and-info/49778](https://www.thethingsnetwork.org/forum/t/new-api-for-gateway-mapping-status-and-info/49778)**

* * *

Get the gateway id(s) from the meta data, like from the MQTT JSON message or by expanding an item in the device’s Data page in TTN Console.

> **TTN Console example**
>
> ![](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/5/5ed1a605005221738b0301d81004cb94dae1cef9.png)

> **MQTT example**
>
> ```json
> {
> "app_id":"arjanvanb-app-1",
> "dev_id":"arjanvanb-bb-1",
> "hardware_serial":"70B3D5B020035CD1",
> "port":2,
> "counter":7165,
> "payload_raw":"CWUMqw0LDNM=",
> "metadata":{
> "time":"2017-04-27T10:07:27.207187339Z",
> "frequency":868.1,
> "modulation":"LORA",
> "data_rate":"SF7BW125",
> "coding_rate":"4/5",
> "gateways":[
> {
> "gtw_id":"eui-b827ebffff5fe05c",
> "timestamp":532315708,
> "time":"",
> "channel":0,
> "rssi":-57,
> "snr":9,
> "latitude":52.37447,
> "longitude":4.63576
> },
> {
> "gtw_id":"eui-5ccf7ff42f1970ec",
> "timestamp":1284851361,
> "time":"2017-04-27T10:07:26.494026Z",
> "channel":0,
> "rssi":-49,
> "snr":9,
> "rf_chain":1,
> "latitude":52.374523,
> "longitude":4.635771,
> "altitude":4
> }
> ]
> }
> }
> 
> ```

Next:

- Simply find the matching id in the popups of nearby gateways on [your local community](https://www.thethingsnetwork.org/community/)’s map. This also gives you a link to the owner, if the gateway’s privacy settings allow for that:

- Or, use that id in a TTN Mapper URL. If it starts with `eui-` such as `eui-0000024b080606d8` then remove that prefix and uppercase the rest:

- Or, get the specific gateway from, e.g.:

- Similarly, one could use the id in a NOC URL, yielding slightly different details (beware, this is an HTTP URL; right-clicking and some “open in new incognito window” might help if your browser tries HTTPS instead):

- Likewise, use [the Account Server API](https://www.thethingsnetwork.org/docs/network/account/api.html#get-gatewaysgw_id), showing different details but still including the owner:

- Likewise, use [the `ttnctl` command line interface](https://www.thethingsnetwork.org/docs/network/cli/):

- To get all gateways around some location:

- To get all gateways in some country:

- To get all gateways of a specific user:

- You can paste the coordinates into Google Maps:

Beware:

- ⚠ The `http://noc.thethingsnetwork.org:8085` endpoint [is known to be unreliable](https://status.thethings.network/incidents/3zddstxw97k9).

- ⚠ The endpoints starting with [https://www.thethingsnetwork.org/gateway-data/](https://www.thethingsnetwork.org/gateway-data/) might not be officially supported APIs. As for validity/caching of that specific endpoint, @htdvisser wrote on Slack:

- ⚠ The coordinates in an uplink’s metadata may be different from what is reported using the methods above. Presumably that is caused by a gateway including GPS/GNSS coordinates, or _fake_ GPS/GNSS coordinates (which it [should not do](https://www.thethingsnetwork.org/forum/t/gateway-gps-configuration-in-local-conf-json/6176/4)) in its messages. It seems `ttnctl gateways status` uses the coordinates from the last uplink’s metadata, while `ttnctl gateways info` reports whatever is configured in TTN Console.

---

<div class="post-metadata">

**Author:** ![kalon33](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kalon33/32/48029_2.png) [@kalon33](https://www.thethingsnetwork.org/forum/u/kalon33)\
**Post date:** [January 4, 2018, 4:56pm UTC](https://www.thethingsnetwork.org/forum/t/determine-which-gateway-is-used-by-a-given-node/11531/13 "2018-01-04T16:56:54Z")

</div>

Hi @arjanvanb, unfortunately my gateway doesn’t show up on TTN Mapper. Do you know how can I get it added? Should I necessarily map its coverage for the gateway to show up?

Thanks for your help.

@BoRRoZ thanks for your help too.

---

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [January 4, 2018, 5:03pm UTC](https://www.thethingsnetwork.org/forum/t/determine-which-gateway-is-used-by-a-given-node/11531/14 "2018-01-04T17:03:55Z")

</div>

To get your gateway in TTN Mapper, go mapping already! 🙂

[https://ttnmapper.org/faq/](https://ttnmapper.org/faq/)

---

<div class="post-metadata">

**Author:** ![kalon33](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kalon33/32/48029_2.png) [@kalon33](https://www.thethingsnetwork.org/forum/u/kalon33)\
**Post date:** [January 5, 2018, 10:28am UTC](https://www.thethingsnetwork.org/forum/t/determine-which-gateway-is-used-by-a-given-node/11531/15 "2018-01-05T10:28:41Z")

</div>

Thanks a lot for your detailed answer. I discovered plenty of useful tools thanks to you 🙂

I’m also trying to get in touch with @jpmeijers to try adding my gateway using a node with GPS.

---

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [January 5, 2018, 4:11pm UTC](https://www.thethingsnetwork.org/forum/t/determine-which-gateway-is-used-by-a-given-node/11531/17 "2018-01-05T16:11:20Z")

</div>

2 posts were merged into an existing topic: [Limitations: data rate, packet size, 30 seconds uplink and 10 messages downlink per day Fair Access Policy](https://www.thethingsnetwork.org/forum/t/limitations-data-rate-packet-size-30-seconds-uplink-and-10-messages-downlink-per-day-fair-access-policy/1300)

---

<div class="post-metadata">

**Author:** ![pebneter](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/pebneter/32/35697_2.png) [@pebneter](https://www.thethingsnetwork.org/forum/u/pebneter)\
**Post date:** [June 18, 2021, 8:45am UTC](https://www.thethingsnetwork.org/forum/t/determine-which-gateway-is-used-by-a-given-node/11531/18 "2021-06-18T08:45:03Z")

</div>

When I check the details of a message, I see just “packetbroker” as the gateway\_id.  
I have read that this has something to do with a migration of protocols.

Can someone help my finding the “real” gateway id that one of my LoRa devices uses?

---

<div class="post-metadata">

**Author:** ![kersing](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kersing/32/44777_2.png) [@kersing](https://www.thethingsnetwork.org/forum/u/kersing)\
**Post date:** [June 18, 2021, 10:07am UTC](https://www.thethingsnetwork.org/forum/t/determine-which-gateway-is-used-by-a-given-node/11531/19 "2021-06-18T10:07:27Z")

</div>

Not possible at this point in time. The information you are looking for is hidden by the packetbroker.
