How to get data sent from a device using gRPC


I was able to get the device information with the following program (v4).

There seems to be no way to get the uplink data of the device in the API documentation.
The data I want to get is fport and payload.

Is it impossible with grpc?

import grpc
from chirpstack_api import api

def main():
server = “”
api_key = ‘eyJ0xxxxxxxxxxxxxxxxxxxxxxxxx’

channel = grpc.insecure_channel(server)
stub = api.DeviceServiceStub(channel)

dev_eui = ‘70b3d57ed1234567’
request = api.GetDeviceRequest(dev_eui=dev_eui)
metadata = [(‘authorization’, f’Bearer {api_key}')]

response = stub.Get(request, metadata=metadata) # Use the correct method here
print(f"Device info: {response.device}“)
except grpc.RpcError as e:
print(f"Error occurred: {e}”)

if name == ‘main’:

You will want to use an Integration to get uplink data:

There are many to choose from, but MQTT and HTTP are popular.

Thanks for the response.

I use integration with the apps I work with, but I wanted to get uplink data without using integration.
The reason is that I want to monitor from a local PC easily without affecting the apps that are already integrated and linked.

Adding additional integrations (or using one that is already enabled with an additional client) should not affect preexisting apps.

As an example, if you use the MQTT integration, adding another client to pull data for your use will not affect existing uses of that integration.

I did not explain it well enough.

As for why I want to use the API to get uplink data, it is for debugging the device.

I have a device that someone else is creating, and I am sending the data to chirpStack, which sends it to the visualization application via the HTTP integration function.

From time to time, that device sends data with null fProt or payload.

The uplink data is not sent via integration because the data is anomalous.

I want to monitor that anomalous data.

It sounds like you could grab it via MQTT on the gateway topic(s).

Thank you.

I’ll give it a try.

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