Accessing Device Events from gRPC API

Hi, I’m currently trying to use the gRPC API in Chirpstack to get the data found in the events tab on a device.

I’m using javascript with the npm package found in the documentation, and I’m able to create a client using DeviceServiceClient from device_grpc_pb.d.ts, pass a request, e.g. CreateDeviceRequest from device_pb.d.ts, and get some data back.

Looking through some of the files from the npm package it seems like I’ve found what I need in the UplinkEvent in integrations_pb.d.ts, but the integrations_grpc_pb.d.ts where I expected to find service client definitions is empty.

I’ve tried looking through some of the ChirpStack documentation and “reverse engineering” the npm package, but I’m having a hard time figuring out if it’s infact possible to get this data, and if so, how to do it.

Does anyone know if this is possible, got any experience with this, or some tips and tricks?

Thanks in advance.

The integrations_pb.d.ts contains the definitions of the event payloads as published to the MQTT, HTTP, etc… integrations. These definitions are not for the streaming events like you find in the UI.

The events that you see in the UI are using an internal API which is not considered stable (e.g. it might change with every release) as the sole purpose is to facilitate the ChirpStack UI.

If you are interested in how this stream works, please see:

Is there a way directly through the API to get the payload sent to a device? I’ve looked around a bit through the different classes available within the API part of the npm package but so far I’ve found nothing that relates to that information.

I might have overlooked something, or simply just don’t understand it fully yet as gRPC is relatively new still, could you confirm or deny if this is possible or if it’s only possible to get this by sending the payload through Integrations?

There is, but only for internal usage:

In contrast to the device events, this shows the raw LoRaWAN frames. But again, this is not a stable API that should be used for building integrations.

For monitoring, you could use the Redis streams. This is a simple example:

There are Redis streams for all gateways, all devices, per gateway ID, per device EUI.

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