Not receiving MQTT message for Gateway status topic

I’m new to MQTT and I try to subscribe to gateway status topic from my local running typescript program but it doesn’t receive any message for gateway status topic at all. This program also subscribe to another topic and messages for that topic is properly received. I login to TTN console to check gateway information and found that gateway status is published every 30 seconds. I thought it maybe because of permission problem, so I added Grant all current and future rights to API Key of Application but still no message for gateway status topic have received.
This is the topic I use to subscribe to gateway status v3/<gateway-id>@ttn/status. I get gateway-id from TTN console.

gateway-id

gateway_status_log

Additional Info:
I found that there is no View gateway status right in API Key for Application but Gateway and Organization’s API Key. So I generated Organization’s API Key with Grant all current and future rights and tried to connect with <Organization ID>@ttn as an username and Organization’s API Key as a password but rejected. So I Tried to connect with <Application ID>@ttn as an username and Organization’s API Key as a password then it was successfully connected but still having same result. Receiving only messages for another topic but message for gateway status is still not received :frowning:

There is no such thing as a “gateway status” topic on our MQTT API. The documentation lists the different topics you can subscribe to.

The “Live data” for gateways that you see in the Console is retrieved using the Events API, which is a gRPC API (with an HTTP SSE API trough our gRPC gateway). These kind of events are not and will not be available over MQTT.

In here it talks about “gateway status” topic. I cannot subscribe to it? Or to subscribe to it, I need to let my gateway publish v3/<gateway-id>@ttn/status topic first? then I can subscribe to it?

That is for gateways that use MQTT to send messages to the Gateway Server rather than using Packet Forwarder or Basic Station software. It’s between the gateway & the TTI stack only.

1 Like

I wrote a Java program to connect to the gateway event API, receive events and log them to a CSV file. This is not MQTT though. Basically it receives the same kind of events that you see in the gateway live view in the console. Perhaps that can help/inspire you to create what you need. Code is at:

To read the event stream, you need the id of the gateway and an API key with permission ‘Read gateway traffic’.

2 Likes

There are two other API but they are more basic information around gateways.

~https://mapper.packetbroker.net/api/v2/gateways?distanceWithin[latitude]=-**latitude**&distanceWithin[longitude]=**longitude**&"distance"Within[distance]=**distance**&netID=000013&tenantID=ttn

This is to find all gateways from latitude & longitude with in a distance (distance units is meters)

https://mapper.packetbroker.net/api/v2/gateways?distanceWithin[latitude]=53.57500181643252&distanceWithin[longitude]=-2.4573224889439444&distanceWithin[distance]=15000&netID=000013&tenantID=ttn

,{"netID":"000013","tenantID":"ttn","id":"swinton-iot-balticbroadband","eui":"313532352F006100","clusterID":"eu1.cloud.thethings.network","updatedAt":"2022-05-28T13:24:01.692752Z","location":{"latitude":53.50798297588821,"longitude":-2.338129878044129,"altitude":12,"accuracy":0},"antennaPlacement":"OUTDOOR","antennaCount":1,"online":true}
,{"netID":"000013","tenantID":"ttn","id":"swinton-iotltd","eui":"313532352F006100","clusterID":"eu1.cloud.thethings.network","updatedAt":"2022-01-29T12:17:08.171899Z","location":{"latitude":53.50784682420188,"longitude":-2.336736668898618,"altitude":8,"accuracy":0},"antennaCount":1,"online":false}
,{"netID":"000013","tenantID":"ttn","id":"living-lab-gateway-2","clusterID":"eu1.cloud.thethings.network","updatedAt":"2022-01-26T18:17:31.57097Z","location":{"latitude":53.53912914816647,"longitude":-2.619622349739075,"altitude":0,"accuracy":0},"antennaCount":1,"online":false}
]

~https://mapper.packetbroker.net/api/v2/gateways/netID=000013,tenantID=ttn,id=**id**

This is to get a bit of details of a gateway.

https://mapper.packetbroker.net/api/v2/gateways/netID=000013,tenantID=ttn,id=g-s3-testgw042-ttig-bl3-hp10

{"netID":"000013","tenantID":"ttn","id":"g-s3-testgw042-ttig-bl3-hp10","eui":"58A0CBFFFE803658","clusterID":"eu1.cloud.thethings.network","updatedAt":"2022-02-14T20:11:45.523223Z","location":{"latitude":53.56933,"longitude":-2.461042,"altitude":130,"accuracy":0},"antennaPlacement":"INDOOR","antennaCount":1,"online":false,"frequencyPlan":{"region":"EU_863_870","loraMultiSFChannels":[868100000,868300000,868500000,867100000,867300000,867500000,867700000,867900000]},"rxRate":659.8765,"txRate":13.466868}

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.